From d74c28c6f826c9d9e61612b4bc589b0774feb82a Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期五, 10 五月 2024 13:30:09 +0800
Subject: [PATCH] 2024-5-9 绩效管理-班次后端开发调整年份完成

---
 performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml b/performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml
index 29c9d73..0b702be 100644
--- a/performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml
+++ b/performance-server/src/main/resources/mapper/PerformanceShiftMapper.xml
@@ -43,4 +43,46 @@
         <if test="laboratory != null and laboratory != ''">
         </if>
     </select>
+
+    <select id="performanceShiftYear" resultType="java.util.Map">
+        SELECT if(u.department is not null and u.department != '', CONCAT(u.name, '锛�', u.department, '锛�'), u.name) name,
+        s.user_id, u.account,
+        DATE_FORMAT(s.work_time, '%c') work_time,
+        GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), '锛�', s.shift order by s.work_time SEPARATOR ';') month_str
+        FROM performance_shift s
+        LEFT JOIN user u on u.id = s.user_id
+        where s.shift is not NULL
+        and s.shift != ''
+        <if test="time != null and time != ''">
+            and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' )
+        </if>
+        <if test="userName != null and userName != ''">
+            and u.name like concat('%', #{userName}, '%')
+        </if>
+        <if test="laboratory != null and laboratory != ''">
+        </if>
+        GROUP BY u.id
+        order by s.work_time
+    </select>
+
+    <select id="performanceShiftYearList" resultType="map">
+        SELECT if(u.department is not null and u.department != '', CONCAT(u.name, '锛�', u.department, '锛�'), u.name) name,
+        s.user_id, u.account,
+        DATE_FORMAT(s.work_time, '%c') work_time,
+        GROUP_CONCAT(DATE_FORMAT(s.work_time, '%c'), '锛�', s.shift order by s.work_time SEPARATOR ';') month_str
+        FROM performance_shift s
+        LEFT JOIN user u on u.id = s.user_id
+        where s.shift is not NULL
+        and s.shift != ''
+        <if test="time != null and time != ''">
+            and DATE_FORMAT(s.work_time, '%Y') = DATE_FORMAT(#{time}, '%Y' )
+        </if>
+        <if test="userName != null and userName != ''">
+            and u.name like concat('%', #{userName}, '%')
+        </if>
+        <if test="laboratory != null and laboratory != ''">
+        </if>
+        GROUP BY u.id
+        order by s.work_time
+    </select>
 </mapper>

--
Gitblit v1.9.3