shudonghui преди 1 година
родител
ревизия
8a2a1b3667

+ 1 - 1
sop-api/src/main/java/com/qmth/sop/server/api/CrmAnalyseController.java

@@ -91,7 +91,7 @@ public class CrmAnalyseController {
     @ApiResponses({@ApiResponse(code = 200, message = "供应商派单分布下钻", response = TBCrmResult.class)})
     public Result supplierDetail(@ApiParam(value = "开始时间", required = true) @RequestParam Long startTime,
                                  @ApiParam(value = "结束时间", required = true) @RequestParam Long endTime,
-                                 @ApiParam(value = "供应商", required = true) @RequestParam Long supplierId,
+                                 @ApiParam(value = "供应商", required = false) @RequestParam(required = false) Long supplierId,
                                  @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                  @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
         return ResultUtil.ok(crmAnalyseService.supplierDetail(new Page<>(pageNumber, pageSize), startTime, endTime, supplierId));

+ 5 - 2
sop-business/src/main/resources/mapper/CrmAnalyseMapper.xml

@@ -110,7 +110,6 @@
         LEFT JOIN t_b_user_archives_supplier us ON us.user_archives_id = ua.id
         LEFT JOIN sys_supplier su ON su.id = us.supplier_id
         <where>
-            and r.lead_id IS NOT NULL
             <!--            <if test="year != null and year != ''">-->
             <!--                and YEAR ( FROM_UNIXTIME( s.start_time / 1000 ))=  #{year}-->
             <!--            </if>-->
@@ -233,7 +232,7 @@
         LEFT JOIN t_b_user_archives_supplier us ON us.user_archives_id = ua.id
         LEFT JOIN sys_supplier su ON su.id = us.supplier_id
         <where>
-            and tbs.`status`='PUBLISH' and a.service_id is not null and r.id is not null
+
             <if test="serviceId != null and serviceId != ''">
                 and a.service_id = #{serviceId}
             </if>
@@ -241,6 +240,7 @@
 <!--                and r.id = #{regionId}-->
 <!--            </if>-->
             <if test="province != null and province != ''">
+                and tbs.`status`='PUBLISH' and a.service_id is not null and r.id is not null
                 and rd.province = #{province}
             </if>
             <if test="type != null and type != ''">
@@ -249,6 +249,9 @@
             <if test="supplierId != null and supplierId != ''">
                 and su.id = #{supplierId}
             </if>
+            <if test="supplierId == null or supplierId = ''">
+                and su.id is null
+            </if>
             <!--            <if test="year != null and year != ''">-->
             <!--                and YEAR ( FROM_UNIXTIME( tbs.start_time / 1000 ))=  #{year}-->
             <!--            </if>-->