weaver-hrm-salary/src/com/engine/salary/mapper/auth/AuthMapper.xml

58 lines
2.6 KiB
XML
Raw Normal View History

2024-08-01 10:56:29 +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.engine.salary.mapper.auth.AuthMapper">
<resultMap id="BaseResultMap" type="com.engine.salary.entity.auth.dto.AuthDTO">
2024-08-01 16:19:23 +08:00
<id column="tax_agent_id" property="taxAgentId"/>
<collection property="emps" ofType="com.engine.salary.entity.auth.dto.EmpOpt">
<id column="employee_id" property="employeeId"/>
2024-08-28 17:55:42 +08:00
<collection property="opts" ofType="string">
<constructor>
<arg column="opt"/>
</constructor>
2024-08-01 16:19:23 +08:00
</collection>
2024-08-01 10:56:29 +08:00
</collection>
</resultMap>
<select id="getAuth" resultMap="BaseResultMap">
2024-08-01 16:19:23 +08:00
select role.tax_agent_id, d.employee_id, o.id as optId,o.page,o.opt
2024-08-28 10:02:39 +08:00
from hrsa_auth_role_emp emp
left join hrsa_auth_role role on emp.role_id = role.id
left join hrsa_auth_role_data d on emp.role_id = d.role_id
left join hrsa_auth_opt o on d.role_id = o.role_id
where emp.delete_type = 0 and role.delete_type = 0 and d.delete_type = 0 and o.delete_type = 0
and emp.employee_id = #{uid} and o.page = #{page}
</select>
2024-08-28 17:55:42 +08:00
<resultMap id="getLimitSobMap" type="com.engine.salary.entity.auth.dto.AuthLimitDTO">
2024-08-28 10:02:39 +08:00
<id column="tax_agent_id" property="taxAgentId"/>
2024-08-28 17:55:42 +08:00
<collection property="roleLimits" ofType="com.engine.salary.entity.auth.dto.RoleLimit">
<id column="roleId" property="roleId"/>
<collection property="sobIds" ofType="long" javaType="arraylist">
<constructor>
<arg column="sob_id"/>
</constructor>
</collection>
</collection>
2024-08-28 10:02:39 +08:00
</resultMap>
<select id="getLimitSobs" resultMap="getLimitSobMap">
2024-08-28 17:55:42 +08:00
select role.tax_agent_id ,role.id as roleId,lim.sob_id
from hrsa_auth_role role
left join hrsa_auth_limit lim on role.id = lim.role_id and lim.delete_type = 0 and role.delete_type = 0
left join hrsa_auth_role_emp emp on role.id = emp.role_id and emp.delete_type = 0
and emp.employee_id = #{uid}
2024-08-01 10:56:29 +08:00
</select>
2024-08-30 10:49:46 +08:00
<select id="getOptsByPage" resultType="string">
select o.opt
from hrsa_auth_role_emp emp
left join hrsa_auth_role role on emp.role_id = role.id
left join hrsa_auth_opt o on role.id = o.role_id
where emp.delete_type = 0 and role.delete_type = 0 and o.delete_type = 0
and emp.employee_id = #{uid} and o.page = #{page}
</select>
2024-08-01 10:56:29 +08:00
</mapper>