<?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.ruoyi.personnel.mapper.PersonJobResponsibilitiesMapper">
|
|
|
<select id="personJobResponsibilitiesSelect" resultType="com.ruoyi.personnel.dto.PersonJobResponsibilitiesDto">
|
select cpt.*, u.name incumbent_name, su.name supervisor_name, dl.name depart_lims_name, u.account
|
from cnas_person_job_responsibilities cpt
|
left join user u on cpt.incumbent_id = u.id
|
left join user su on cpt.supervisor_id = su.id
|
left join department_lims dl on dl.id = SUBSTRING_INDEX(SUBSTRING_INDEX(u.depart_lims_id, ',', -2), ',', 1)
|
<where>
|
<if test="userId != null and userId != ''">
|
and cpt.incumbent_id = #{userId}
|
</if>
|
<if test="departmentId != null and departmentId != ''">
|
and FIND_IN_SET(#{departmentId}, u.depart_lims_id)
|
</if>
|
<if test="userName != null and userName != ''">
|
and u.name like concat('%', #{userName}, '%')
|
</if>
|
</where>
|
</select>
|
</mapper>
|