From a9e60d55e3e8d0c5c84c6678911ee8131491fc45 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期四, 01 八月 2024 10:54:38 +0800
Subject: [PATCH] feat:考核结果

---
 ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
index 2bc0f1f..ae68b76 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/CheckScoreMapper.xml
@@ -123,21 +123,17 @@
 
     <select id="selectCheckScoreMap" resultType="com.ycl.platform.domain.entity.CheckScore">
         SELECT
+            id,
             tcs.dept_id,
             examine_category,
-            ROUND(AVG(score), 2) AS score,
-            #{startDate} AS startDate,
-            #{endDate} AS endDate,
-            ANY_VALUE(tcs.create_time) AS createTime
+            ROUND(AVG(score) OVER(PARTITION BY tcs.dept_id, examine_category), 2) AS score,
+            tcs.create_time AS createTime
         FROM
             t_check_score tcs
                 LEFT JOIN sys_dept d ON tcs.dept_id = d.dept_id
         WHERE
             examine_tag = #{examineTag}
-          AND tcs.create_time BETWEEN #{startDate} AND #{endDate}
-        GROUP BY
-            tcs.dept_id,
-            examine_category
+          AND DATE_FORMAT(tcs.create_time, '%Y-%m') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m') AND DATE_FORMAT(#{endDate}, '%Y-%m')
     </select>
 
 </mapper>
\ No newline at end of file

--
Gitblit v1.8.0