From 1f4e7d0f73a73e7350cf5a1df279d5f30904c5d5 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 06 十二月 2023 08:41:32 +0800
Subject: [PATCH] bug

---
 server/src/main/resources/mappers/WorkorderRecordExtMapper.xml |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/server/src/main/resources/mappers/WorkorderRecordExtMapper.xml b/server/src/main/resources/mappers/WorkorderRecordExtMapper.xml
index ba1ad1b..86cb369 100644
--- a/server/src/main/resources/mappers/WorkorderRecordExtMapper.xml
+++ b/server/src/main/resources/mappers/WorkorderRecordExtMapper.xml
@@ -490,11 +490,11 @@
   </select>
   <select id="getUserProduceTopData" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO"
           resultType="doumeemes.dao.business.dto.statistics.UserProduceTopModel">
-    SELECT sum(a.num) as doneNum,b.user_id as userId,b.`NAME` as userName,b.PHONE
+    SELECT sum(a.QUALIFIED_NUM) as doneNum,b.user_id as userId,b.`NAME` as userName,b.PHONE
     from workorder_record a
-    left join company_user b on b.DELETED=0 and b.user_id=a.CREATE_USER
+    left join company_user b on b.DELETED=0 and b.user_id=a.CREATE_USER  and b.root_depart_id=a.root_depart_id
     left join workorder c on a.WORKORDER_ID=c.id
-    where a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} and c.status=4
+    where  to_days(a.create_time)=to_days(now()) and a.deleted=0 and a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId} and c.status=4
     <if test="procedureId != null">
       AND  a.`PROCEDURE_ID` = #{procedureId}
     </if>
@@ -526,20 +526,21 @@
     <if test="procedureId != null">
       AND  a.`PROCEDURE_ID` = #{procedureId}
     </if>
-    GROUP BY TO_DAYS(d.ID )
+    GROUP BY  b.CATEGORY_ID
     order by unqualifiedNum desc
     limit 6
   </select>
   <select id="getRecordLog" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO"
           resultType="doumeemes.dao.business.dto.statistics.RecordLogModel">
     select a.CREATE_TIME as createTime,a.UNQUALIFIED_NUM as unqualifiedNum,a.QUALIFIED_NUM as qualifiedNum,
-    d.name as userName,c.name as materialName,c.code as materialCode
+    d.name as userName,c.name as materialName,c.code as materialCode,p.name as procedureName
     from workorder_record a
     left join material_distribute b on a.MATERIAL_ID=b.ID
     left join material c on b.MATERIAL_ID=c.ID
-    left join company_user d on d.DELETED=0 and d.user_id=a.CREATE_USER
+    left join company_user d on d.DELETED=0 and d.user_id=a.CREATE_USER and d.root_depart_id=a.root_depart_id
+    left join procedures p on a.PROCEDURE_ID=p.ID
     left JOIN workorder  e on e.id=a.WORKORDER_ID
-    where a.DELETED = 0 AND a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId}  AND e.`STATUS` = 4
+    where a.DELETED = 0 AND a.ROOT_DEPART_ID=#{rootDepartId} and a.DEPART_ID=#{departId}  AND e.`STATUS` = 4 and a.type=1
     <if test="procedureId != null">
       AND  a.`PROCEDURE_ID` = #{procedureId}
     </if>
@@ -548,8 +549,8 @@
   </select>
   <select id="selectListNew" parameterType="doumeemes.dao.ext.dto.QueryWorkorderRecordExtDTO" resultMap="WorkorderRecordExtListVO">
     SELECT
-      `a`.*,
-      `dmodel`.`ID` AS DMODEL_ID,
+      `a`.*, ROUND(a.SALARY / 100 ,2) as salaryYuan,
+       `dmodel`.`ID` AS DMODEL_ID,
       `dmodel`.`DELETED` AS DMODEL_DELETED,
       `dmodel`.`CREATE_USER` AS DMODEL_CREATE_USER,
       `dmodel`.`CREATE_TIME` AS DMODEL_CREATE_TIME,

--
Gitblit v1.9.3