forked from zhangyuan/epmet-cloud-lingshan
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.3 KiB
53 lines
2.3 KiB
<?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.epmet.dao.RoleOperationDefaultDao">
|
|
|
|
<resultMap type="com.epmet.entity.RoleOperationDefaultEntity" id="roleOperationDefaultMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="roleKey" column="ROLE_KEY"/>
|
|
<result property="operationKey" column="OPERATION_KEY"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="revision" column="REVISION"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<!--根据角色key和操作key删除-->
|
|
<delete id="deleteByRoleKeyAndOpeKey">
|
|
DELETE FROM role_operation_default WHERE ROLE_KEY = #{roleKey} AND OPERATION_KEY = #{operationKey}
|
|
</delete>
|
|
|
|
<select id="listAllValid" resultType="com.epmet.dto.result.RoleOperationDefaultResultDTO">
|
|
SELECT o.ID, d.ROLE_KEY, o.OPERATION_KEY
|
|
FROM role_operation_default d
|
|
INNER JOIN operation o ON (d.OPERATION_KEY = o.OPERATION_KEY OR d.OPERATION_KEY = '*')
|
|
WHERE
|
|
d.DEL_FLAG = 0
|
|
AND o.DEL_FLAG = 0
|
|
</select>
|
|
|
|
<select id="listByRoleKey" resultType="com.epmet.dto.result.RoleOperationDefaultResultDTO">
|
|
SELECT o.ID, d.ROLE_KEY, o.OPERATION_KEY
|
|
FROM role_operation_default d
|
|
INNER JOIN operation o ON (d.OPERATION_KEY = o.OPERATION_KEY OR d.OPERATION_KEY = '*')
|
|
WHERE d.ROLE_KEY = #{roleKey}
|
|
AND d.DEL_FLAG = 0
|
|
AND o.DEL_FLAG = 0
|
|
</select>
|
|
|
|
<select id="listRoleDefaultOpsByRoleKey" resultType="com.epmet.dto.result.RoleOperationDefaultResultDTO">
|
|
SELECT o.OPERATION_KEY,
|
|
o.OPERATION_NAME,
|
|
CASE
|
|
WHEN d.ROLE_KEY IS NOT NULL THEN TRUE
|
|
ELSE FALSE END AS assigned
|
|
FROM operation o
|
|
LEFT JOIN role_operation_default d ON (o.OPERATION_KEY = d.OPERATION_KEY AND d.DEL_FLAG = '0'
|
|
AND d.ROLE_KEY = #{roleKey})
|
|
WHERE o.DEL_FLAG = '0'
|
|
ORDER BY o.OPERATION_NAME ASC
|
|
</select>
|
|
</mapper>
|