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.
77 lines
2.8 KiB
77 lines
2.8 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.OperationScopeDefaultDao">
|
|
|
|
<resultMap type="com.epmet.entity.OperationScopeDefaultEntity" id="operationScopeDefaultMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="roleKey" column="ROLE_KEY"/>
|
|
<result property="operationKey" column="OPERATION_KEY"/>
|
|
<result property="scopeKey" column="SCOPE_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>
|
|
|
|
<delete id="delete">
|
|
DELETE
|
|
FROM operation_scope_default
|
|
WHERE ROLE_KEY = #{roleKey}
|
|
AND OPERATION_KEY = #{operationKey}
|
|
AND SCOPE_KEY = #{scopeKey}
|
|
</delete>
|
|
|
|
<select id="listAllValid" resultType="com.epmet.entity.OperationScopeDefaultEntity">
|
|
SELECT *
|
|
FROM operation_scope_default WHERE DEL_FLAG=0
|
|
</select>
|
|
|
|
<!--根据角色key和操作key查询默认操作权限列表-->
|
|
<select id="listDefaultOpeScopes" resultType="com.epmet.dto.result.OperationScopeDefaultResultDTO">
|
|
SELECT id,
|
|
role_key,
|
|
operation_key,
|
|
scope_key,
|
|
del_flag,
|
|
revision,
|
|
created_by,
|
|
created_time,
|
|
updated_by,
|
|
updated_time
|
|
FROM operation_scope_default
|
|
WHERE ROLE_KEY = #{roleKey}
|
|
</select>
|
|
|
|
<!--查询操作的默认范围-->
|
|
<select id="listOpeDefaultScopes4Config"
|
|
resultType="com.epmet.dto.result.AccessConfigOpeDefaultScopesResultDTO">
|
|
SELECT os.SCOPE_KEY,
|
|
os.SCOPE_NAME,
|
|
os.SCOPE_INDEX,
|
|
rs.OPERATION_KEY,
|
|
rs.ROLE_KEY,
|
|
CASE
|
|
WHEN rs.ROLE_KEY IS NULL
|
|
THEN FALSE
|
|
ELSE TRUE
|
|
END AS assigned
|
|
FROM operation_scope os
|
|
LEFT JOIN operation_scope_default rs
|
|
ON (os.SCOPE_KEY = rs.SCOPE_KEY AND rs.DEL_FLAG = 0 AND rs.ROLE_KEY = #{roleKey} AND
|
|
OPERATION_KEY = #{operationKey})
|
|
WHERE os.DEL_FLAG = 0
|
|
ORDER BY os.SORT ASC
|
|
</select>
|
|
|
|
<select id="listOpeDefaultScopesByRoleAndOpeKey" resultType="com.epmet.entity.OperationScopeDefaultEntity">
|
|
SELECT *
|
|
FROM operation_scope_default
|
|
WHERE ROLE_KEY = #{roleKey}
|
|
AND OPERATION_KEY = #{operationKey}
|
|
</select>
|
|
|
|
|
|
</mapper>
|