24 lines
833 B
XML
24 lines
833 B
XML
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||
|
<!DOCTYPE mapper
|
||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||
|
<mapper namespace="com.qiaoba.module.system.mapper.SysMenuMapper">
|
||
|
|
||
|
<select id="checkMenuNameUnique" parameterType="com.qiaoba.api.system.entity.SysMenu" resultType="int">
|
||
|
select count(1) from sys_menu
|
||
|
where menu_name= #{menuName} and parent_id = #{parentId}
|
||
|
<if test="menuId != null">
|
||
|
and menu_id != #{menuId}
|
||
|
</if>
|
||
|
limit 1
|
||
|
</select>
|
||
|
|
||
|
<select id="selectMenuIdsByRoleId" resultType="string">
|
||
|
select m.menu_id
|
||
|
from sys_menu m
|
||
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||
|
where rm.role_id = #{roleId}
|
||
|
order by m.parent_id, m.order_num
|
||
|
</select>
|
||
|
</mapper>
|