From d346846239a8a39246c464dc634f5fd72add99ab Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期二, 26 八月 2025 15:22:15 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/pim-jlmy' into pim-jlmy

---
 main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml b/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml
new file mode 100644
index 0000000..6a266ad
--- /dev/null
+++ b/main-business/src/main/resources/mapper/StaffJoinLeaveRecordMapper.xml
@@ -0,0 +1,39 @@
+<?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.business.mapper.StaffJoinLeaveRecordMapper">
+    <select id="staffJoinLeaveRecordListPage" resultType="com.ruoyi.business.entity.StaffJoinLeaveRecord">
+        SELECT
+        *
+        FROM staff_join_leave_record
+        where
+        staff_state = #{staffJoinLeaveRecord.staffState}
+        <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.business.entity.StaffJoinLeaveRecord">
+        SELECT
+        *
+        FROM staff_join_leave_record
+        where
+        staff_state = #{staffJoinLeaveRecord.staffState}
+        <if test="staffJoinLeaveRecord.staffName != null and staffJoinLeaveRecord.staffName != '' ">
+            AND staff_name LIKE CONCAT('%',#{staffJoinLeaveRecord.staffName},'%')
+        </if>
+    </select>
+    <select id="staffOnJobList" resultType="com.ruoyi.business.entity.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>

--
Gitblit v1.9.3