Jelajahi Sumber

1.控制台业务数据代理人 渠道 电销 部门树查询

wuhp 1 tahun lalu
induk
melakukan
6c4f4bd566

+ 22 - 10
src/main/resources/mapper/modules/admin/TaskStatisticsMapper.xml

@@ -34,16 +34,6 @@
                 AND DATE_FORMAT( #{vo.createtimeEnd}, '%Y-%m-%d')
             </if>
 
-            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
-                AND io.deptid in
-                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-
-            <if test="vo.deptId !=null  and vo.deptId!=''">
-                and io.deptid like concat('%',#{vo.deptId},'%')
-            </if>
         </where>
         group by io.userid
         ) a  on  a.userId  =su.id
@@ -65,6 +55,17 @@
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
             </if>
+
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.deptId !=null  and vo.deptId!=''">
+                and sd.id like concat('%',#{vo.deptId},'%')
+            </if>
         </where>
         order by  a.sumpremium  desc
     </select>
@@ -92,6 +93,17 @@
             <if test="vo.managementSource !=null  and vo.managementSource!=''">
                 and sd.management_source=#{vo.managementSource}
             </if>
+
+            <if test="vo.deptIds != null and vo.deptIds != '' and vo.deptIds.size() > 0">
+                AND sd.id in
+                <foreach collection="vo.deptIds" item="item" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+
+            <if test="vo.deptId !=null  and vo.deptId!=''">
+                and sd.id like concat('%',#{vo.deptId},'%')
+            </if>
         </where>
     </select>