<?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.compensationperformance.mapper.CompensationPerformanceMapper">
|
|
<select id="listPage" resultType="com.ruoyi.compensationperformance.pojo.CompensationPerformance">
|
SELECT
|
cp.*,
|
soj.staff_name AS staffName,
|
sp.post_name AS postName,
|
sd.dept_name AS deptName
|
FROM compensation_performance cp
|
LEFT JOIN staff_on_job soj ON soj.id = cp.staff_id
|
LEFT JOIN sys_post sp ON sp.post_id = soj.sys_post_id
|
LEFT JOIN sys_dept sd ON sd.dept_id = soj.sys_dept_id
|
<where>
|
<if test="staffName != null and staffName != ''">
|
AND soj.staff_name LIKE CONCAT('%', #{staffName}, '%')
|
</if>
|
<if test="payDateStr != null and payDateStr != ''">
|
AND DATE_FORMAT(cp.pay_date, '%Y-%m') = #{payDateStr}
|
</if>
|
</where>
|
ORDER BY cp.pay_date DESC, cp.id DESC
|
</select>
|
</mapper>
|