From b5d5b7676c92eee961ca34259848bfcb97115c7b Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期二, 21 四月 2026 15:56:00 +0800
Subject: [PATCH] 奖惩记录迁移到绩效模块

---
 cnas-personnel/src/main/resources/mapper/PersonRewardPunishmentRecordMapper.xml |   38 ++++++++++++++++----------------------
 1 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/cnas-personnel/src/main/resources/mapper/PersonRewardPunishmentRecordMapper.xml b/cnas-personnel/src/main/resources/mapper/PersonRewardPunishmentRecordMapper.xml
index d92a163..c62d196 100644
--- a/cnas-personnel/src/main/resources/mapper/PersonRewardPunishmentRecordMapper.xml
+++ b/cnas-personnel/src/main/resources/mapper/PersonRewardPunishmentRecordMapper.xml
@@ -3,23 +3,23 @@
 <mapper namespace="com.ruoyi.personnel.mapper.PersonRewardPunishmentRecordMapper">
 
 
-    <select id="rewardPunishmentPage" resultType="com.ruoyi.personnel.dto.PersonRewardPunishmentRecordDto">
-        select cprpr.*, us.name create_user_name, u.account account, u.name user_name
+    <select id="rewardPunishmentPage" resultType="com.ruoyi.personnel.vo.PersonRewardPunishmentRecordVO">
+        select
+            cprpr.*,
+            us.name create_user_name,
+            u.account account,
+            u.name user_name,
+            us2.name AS update_user_name
         from cnas_person_reward_punishment_record cprpr
         left join user u on cprpr.user_id = u.id
         left join user us on cprpr.create_user = us.id
+        left join user us2 on cprpr.update_user = us2.id
         <where>
-            <if test="userId != null and userId != ''">
-                and cprpr.user_id = #{userId}
+            <if test="dto.userName != null and dto.userName != ''">
+                and u.name like concat('%', #{dto.userName}, '%')
             </if>
-            <if test="userName != null and userName != ''">
-                and u.name like concat('%', #{userName}, '%')
-            </if>
-            <if test="startTime != null and endTime != null">
-                AND DATE(cprpr.reward_punish_time) BETWEEN #{startTime} AND #{endTime}
-            </if>
-            <if test="departmentId != null and departmentId != ''">
-                and FIND_IN_SET(#{departmentId}, u.depart_lims_id)
+            <if test="dto.startTime != null and dto.startTime != null">
+                AND cprpr.reward_punish_time BETWEEN #{dto.startTime} AND #{dto.endTime}
             </if>
         </where>
     </select>
@@ -30,17 +30,11 @@
         left join user u on cprpr.user_id = u.id
         left join user us on cprpr.create_user = us.id
         <where>
-            <if test="userId != null and userId != ''">
-                and cprpr.user_id = #{userId}
+            <if test="dto.userName != null and dto.userName != ''">
+                and u.name like concat('%', #{dto.userName}, '%')
             </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>
-            <if test="startTime != null and endTime != null">
-                AND DATE(cprpr.reward_punish_time) BETWEEN #{startTime} AND #{endTime}
+            <if test="dto.startTime != null and dto.endTime != null">
+                AND cprpr.reward_punish_time BETWEEN #{dto.startTime} AND #{dto.endTime}
             </if>
         </where>
     </select>

--
Gitblit v1.9.3