Browse Source

1.大中型统计报表修改

GouGengquan 5 months ago
parent
commit
2e438e0fb6
1 changed files with 14 additions and 0 deletions
  1. 14 0
      dao/src/main/resources/mapper/MajorStatisticalStatementMapper.xml

+ 14 - 0
dao/src/main/resources/mapper/MajorStatisticalStatementMapper.xml

@@ -1125,6 +1125,7 @@
         LEFT JOIN order_fund ON order_fund.business_id = major.id AND business_type = 'MAJOR_BUSINESS' AND order_fund.deleted = 0
         WHERE major.deleted = 0
         <if test="dto != null and dto.efficiencyType == 'order'">
+            # 看了现场才算接单,评估对象大于0
             AND (SELECT COUNT(major_target.major_id) FROM major_target WHERE major_target.deleted = 0 AND major_target.major_id = major.id) > 0
         </if>
         <if test="dto != null and dto.customerId != null">
@@ -1156,6 +1157,10 @@
             AND major.client_manager_id = #{dto.clientManagerId}
         </if>
         <if test="dto != null and dto.efficiencyType == 'order'">
+            AND (SELECT major_target.created FROM major_target WHERE major_target.major_id = major.id AND deleted = 0 LIMIT 1) BETWEEN #{dto.startTime} AND #{dto.endTime}
+        </if>
+        <if test="dto != null and dto.efficiencyType == 'marketOrder'">
+            # 市场筛选条件不一样
             AND major.created BETWEEN #{dto.startTime} AND #{dto.endTime}
         </if>
         <if test="dto != null and dto.efficiencyType == 'statement'">
@@ -1174,6 +1179,7 @@
         </if>
         <if test="dto != null and dto.efficiencyType == 'unSite'">
             AND major.created BETWEEN #{dto.startTime} AND #{dto.endTime}
+            # unSite是未看现场数,评估对象为0则没看现场
             AND (SELECT COUNT(major_target.major_id) FROM major_target WHERE major_target.deleted = 0 AND major_target.major_id = major.id) = 0
         </if>
         ORDER BY major.created DESC
@@ -1328,6 +1334,14 @@
                   AND post.department_id = department.id
                 GROUP BY user.id
             ) AS user
+        <where>
+            <if test="dto != null and dto.departmentId != null">
+                AND user.departmentId = #{dto.departmentId}
+            </if>
+            <if test="dto != null and dto.userName != null">
+                AND user.userName LIKE CONCAT('%',#{dto.userName},'%')
+            </if>
+        </where>
         GROUP BY user.id
         order by currentPeriodOrderVolume DESC
     </select>