From 96e520a9c5407310d03792b6012195f516f0233b Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 23 八月 2024 15:15:57 +0800
Subject: [PATCH] 定时任务工单生成bug修改

---
 ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
index 4692c3d..9df4474 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
@@ -108,4 +108,17 @@
                  INNER JOIN t_unit_people tup ON tup.unit_id = tyw.id and tyw.deleted = 0
                  INNER JOIN t_yw_people typ ON tup.yw_people_id = typ.id AND typ.user_id = #{userId} AND typ.deleted = 0
     </select>
+
+    <select id="ywUnitCount" resultType="java.util.Map">
+        SELECT
+            u.unit_name AS name,
+            COUNT(tcs.id) AS num,
+            100 - SUM(score) AS score
+        FROM
+            t_contract_score tcs
+                LEFT JOIN t_yw_unit u ON tcs.unit_id = u.id
+        WHERE tcs.deleted = 0
+        GROUP BY tcs.unit_id
+        ORDER BY score DESC
+    </select>
 </mapper>

--
Gitblit v1.8.0