|
|
|
<?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.daqing.financial.hrms.dao.PermissionDao">
|
|
|
|
|
|
|
|
<!-- 可根据自己的需求,是否要使用 -->
|
|
|
|
<resultMap type="com.daqing.framework.domain.hrms.PermissionEntity" id="permissionMap">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="code" column="code"/>
|
|
|
|
<result property="name" column="name"/>
|
|
|
|
<result property="url" column="url"/>
|
|
|
|
<result property="menuUrl" column="menu_url"/>
|
|
|
|
<result property="parentId" column="parent_id"/>
|
|
|
|
<result property="level" column="level"/>
|
|
|
|
<result property="menuOrNot" column="menu_or_not"/>
|
|
|
|
<result property="status" column="status"/>
|
|
|
|
<result property="sort" column="sort"/>
|
|
|
|
<result property="icon" column="icon"/>
|
|
|
|
<result property="createTime" column="create_time"/>
|
|
|
|
<result property="motifyTime" column="motify_time"/>
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<select id="listPermissionByRoleIds" parameterType="long" resultType="com.daqing.framework.domain.hrms.response.RolePermissionResponse">
|
|
|
|
SELECT rp.permission_id, hp.name permissionName, hp.parent_id, hp.sort
|
|
|
|
FROM hrms_role_permission rp
|
|
|
|
LEFT JOIN hrms_permission hp
|
|
|
|
ON hp.id=rp.permission_id
|
|
|
|
WHERE rp.role_id IN
|
|
|
|
<foreach collection="ids" open="(" separator="," close=")" item="id">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
<select id="queryPermissionsByIds" resultType="com.daqing.framework.domain.hrms.PermissionEntity">
|
|
|
|
select * from hrms_permission
|
|
|
|
where id in
|
|
|
|
<foreach collection="ids" open="(" separator="," close=")" item="id">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
</mapper>
|