From 4da3b0321291a1ad8a1341f8f843a41d4b516903 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 24 四月 2024 18:09:11 +0800
Subject: [PATCH] 合同规则分三层、合同积分新增

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

diff --git a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
index 6af2bf0..7908573 100644
--- a/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
+++ b/ycl-server/src/main/resources/mapper/zgyw/YwUnitMapper.xml
@@ -4,7 +4,7 @@
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.ycl.platform.mapper.YwUnitMapper">
 
-    <resultMap type="YwUnit" id="YwUnitResult">
+    <resultMap type="YwUnitVo" id="YwUnitResult">
         <result property="id"    column="id"    />
         <result property="unitCode"    column="unit_code"    />
         <result property="unitName"    column="unit_name"    />
@@ -13,8 +13,6 @@
         <result property="unitAdminAccount"    column="unit_admin_account"    />
         <result property="remark"    column="remark"    />
         <result property="createTime"    column="create_time"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="deleted"    column="deleted"    />
     </resultMap>
 
     <sql id="selectYwUnitVo">
@@ -35,6 +33,20 @@
         where id = #{id}
     </select>
 
+    <select id="workList" resultType="com.ycl.platform.domain.vo.YwUnitVO">
+        SELECT
+            a.*,
+            COUNT(b.id) AS work_order_count
+        FROM
+            t_yw_unit a
+                LEFT JOIN
+            t_work_order b ON a.id = b.unit_id AND b.deleted = 0 AND b.status = 'WAIT_DISTRIBUTE'
+        WHERE
+            a.deleted = 0
+        GROUP BY
+            a.id;
+    </select>
+
     <insert id="insertYwUnit" parameterType="YwUnit" useGeneratedKeys="true" keyProperty="id">
         insert into t_yw_unit
         <trim prefix="(" suffix=")" suffixOverrides=",">

--
Gitblit v1.8.0