Quellcode durchsuchen

Merge remote-tracking branch 'origin/test' into test

Qchen vor 1 Jahr
Ursprung
Commit
a6596a41dd
1 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. 9 6
      src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

+ 9 - 6
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -39,6 +39,7 @@
         COUNT( CASE WHEN iac.product = '单三'  THEN 1 END ) AS "riskCodeDsan"
         from ins_area_company iac
         left join ins_orders io on io.orderno =iac.orderno
+        left join  sys_user  su  on su.id =io.userid
         <where>
             iac.orderstatus = '3'
             <if test="vo.createtimeStart  != null  and  vo.createtimeStart!=''  and vo.createtimeEnd  != null  and  vo.createtimeEnd!=''">
@@ -46,6 +47,13 @@
                 AND DATE_FORMAT( #{vo.createtimeEnd}, '%Y-%m-%d')
             </if>
 
+            <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
+                and su.leader_id in
+                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
         </where>
         group by io.userid
         ) a  on  a.userId  =su.id
@@ -54,12 +62,7 @@
             <if test="vo.userId !=null  and vo.userId!=''">
                 and su.id=#{vo.userId}
             </if>
-            <if test="vo.userIds  !=null  and vo.userIds!=''  and vo.userIds.size()>0">
-                and su.leader_id in
-                <foreach collection="vo.userIds" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
+
             <if test="vo.userName !=null  and vo.userName!=''">
                 and su.name=#{vo.userName}
             </if>