From 26103c72e1ebd8ec39d4f70808f524a9e3c6689e Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期一, 14 七月 2025 10:27:52 +0800
Subject: [PATCH] 新增离职的人员选项使用下拉框(查询改员工最新的入职信息)

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

diff --git a/src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml b/src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml
index be3c392..82b7609 100644
--- a/src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml
+++ b/src/main/resources/mapper/staff/StaffJoinLeaveRecordMapper.xml
@@ -22,4 +22,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>

--
Gitblit v1.9.3