2025-02-18 14:09:35 +08:00
|
|
|
<?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.electromagnetic.industry.software.manage.mapper.RolePermissionMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap id="RolePermissionMap" type="com.electromagnetic.industry.software.manage.pojo.models.RolePermission">
|
|
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/>
|
|
|
|
|
<result column="file_id" jdbcType="VARCHAR" property="fileId"/>
|
|
|
|
|
<result column="permission_code" jdbcType="VARCHAR" property="permissionCode"/>
|
|
|
|
|
<result column="role_id" jdbcType="VARCHAR" property="roleId"/>
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
2025-03-07 10:41:15 +08:00
|
|
|
<select id="getCurrentPermission"
|
|
|
|
|
parameterType="com.electromagnetic.industry.software.manage.pojo.req.PublishedFileDTO"
|
|
|
|
|
resultMap="RolePermissionMap">
|
|
|
|
|
SELECT f.parent_id as file_id, rp.permission_code, rp.role_id
|
2025-02-18 14:09:35 +08:00
|
|
|
FROM ed_role_permission rp
|
2025-03-07 10:41:15 +08:00
|
|
|
JOIN ed_file_info f ON rp.file_id = f.id
|
2025-02-18 14:09:35 +08:00
|
|
|
WHERE f.parent_id = #{fileId}
|
2025-03-07 10:41:15 +08:00
|
|
|
AND f.prj_dir = #{prjDir}
|
|
|
|
|
AND f.data_status = #{dataStatus}
|
|
|
|
|
AND f.effect_flag = #{effectFlag}
|
2025-02-18 14:09:35 +08:00
|
|
|
GROUP BY rp.role_id, rp.permission_code
|
2025-03-07 10:41:15 +08:00
|
|
|
HAVING COUNT(f.id) = (SELECT COUNT(f2.id)
|
|
|
|
|
FROM ed_file_info f2
|
|
|
|
|
WHERE f2.parent_id = #{fileId}
|
|
|
|
|
AND f2.prj_dir = #{prjDir}
|
|
|
|
|
AND f2.data_status = #{dataStatus}
|
|
|
|
|
AND f2.effect_flag = #{effectFlag})
|
2025-02-18 14:09:35 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|