maven
6 天以前 81f7d381c300f6b0a22c00f98517b2619d0094f4
src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml
@@ -10,7 +10,12 @@
        <if test="staffJoinLeaveRecord.staffName != null and staffJoinLeaveRecord.staffName != '' ">
            AND staff_name LIKE CONCAT('%',#{staffJoinLeaveRecord.staffName},'%')
        </if>
        <if test="staffJoinLeaveRecord.entryDateStart != null and staffJoinLeaveRecord.entryDateStart != '' ">
            and contract_start_time like concat('%',#{staffJoinLeaveRecord.entryDateStart},'%')
        </if>
        <if test="staffJoinLeaveRecord.entryDateEnd != null and staffJoinLeaveRecord.entryDateEnd != '' ">
            and contract_end_time like concat('%',#{staffJoinLeaveRecord.entryDateEnd},'%')
        </if>
    </select>
    <select id="staffJoinLeaveRecordList" resultType="com.ruoyi.staff.pojo.StaffJoinLeaveRecord">
        SELECT
@@ -22,4 +27,13 @@
            AND staff_name LIKE CONCAT('%',#{staffJoinLeaveRecord.staffName},'%')
        </if>
    </select>
    <select id="staffOnJobList" resultType="com.ruoyi.staff.pojo.StaffJoinLeaveRecord">
        select *
        from (select *,
                     ROW_NUMBER() over (PARTITION BY staff_no ORDER BY create_time DESC ) as rn
              from staff_join_leave_record
              where staff_state = 1) t
        where rn = 1
    </select>
</mapper>