80 lines
2.6 KiB
XML
80 lines
2.6 KiB
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.mhd.user.domain.roleAggregate.repository.mapper.RoleMenuMapper">
|
|
|
|
<sql id="selectRoleMenuVo">
|
|
SELECT
|
|
a.role_menu_id,
|
|
a.role_id,
|
|
a.menu_id
|
|
FROM
|
|
role_menu a
|
|
WHERE
|
|
a.del_flag = 1
|
|
</sql>
|
|
|
|
<select id="queryList" parameterType="com.mhd.user.domain.roleAggregate.repository.todo.RoleMenuDo"
|
|
resultType="com.mhd.user.domain.roleAggregate.entity.RoleMenuEntity">
|
|
<include refid="selectRoleMenuVo"/>
|
|
|
|
</select>
|
|
<select id="selectRoleMenuList" parameterType="com.mhd.user.domain.roleAggregate.repository.todo.RoleMenuDo"
|
|
resultType="com.mhd.common.core.domain.po.UserRoleMenuPO">
|
|
SELECT DISTINCT
|
|
a.menu_id,
|
|
a.role_id
|
|
FROM
|
|
role_menu a
|
|
WHERE
|
|
a.del_flag = 1
|
|
<include refid="common_where"></include>
|
|
</select>
|
|
<select id="selectByRoleMenuId" parameterType="com.mhd.user.domain.roleAggregate.repository.todo.RoleMenuDo"
|
|
resultType="com.mhd.user.domain.roleAggregate.entity.RoleMenuEntity">
|
|
<include refid="selectRoleMenuVo"/>
|
|
<include refid="common_where"></include>
|
|
</select>
|
|
|
|
<sql id="common_where">
|
|
<if test="roleMenuId !=null and roleMenuId !='' ">
|
|
and a.role_menu_id = #{roleMenuId}
|
|
</if>
|
|
<if test="roleId !=null and roleId !='' ">
|
|
and a.role_id = #{roleId}
|
|
</if>
|
|
<if test="roleIds!=null and roleIds.size() > 0">
|
|
and a.role_id in <foreach item="roleId" index="index" collection="roleIds" open="(" separator=" , " close=")">#{roleId}</foreach>
|
|
</if>
|
|
<choose>
|
|
<when test="roleMenuClient !=null">
|
|
and a.role_menu_client = #{roleMenuClient}
|
|
</when>
|
|
<otherwise>
|
|
and a.role_menu_client = 1
|
|
</otherwise>
|
|
</choose>
|
|
</sql>
|
|
|
|
<select id="removeByRoleId" parameterType="java.lang.Long">
|
|
DELETE
|
|
FROM
|
|
role_menu a
|
|
WHERE
|
|
a.del_flag = 1
|
|
and a.role_id = #{roleId}
|
|
<include refid="common_where_two"></include>
|
|
</select>
|
|
|
|
<sql id="common_where_two">
|
|
<if test="organizationId !=null">
|
|
and a.organization_id = #{organizationId}
|
|
</if>
|
|
<if test="roleMenuClient !=null">
|
|
and a.role_menu_client = #{roleMenuClient}
|
|
</if>
|
|
</sql>
|
|
|
|
</mapper>
|