yaozhixue hai 1 ano
pai
achega
8b990d49a9

+ 6 - 2
src/main/java/com/zfire/jiasm/syncdata/service/impl/PublicServiceImpl.java

@@ -192,12 +192,14 @@ public class PublicServiceImpl implements PublicService {
         // 先从售后网点查
         WebsitOrderSign wos = websitOrderSignService.lambdaQuery()
                 .eq(WebsitOrderSign::getBrandWebsitNumber, websitNo)
+                .eq(WebsitOrderSign::getBrandId, brandId)
                 .one();
         if (wos != null){
             resultData.setWdId(wos.getWebsitId());
         } else {
             CustomerInformationWebsit ciwx = customerInformationWebsitService.lambdaQuery()
                     .eq(CustomerInformationWebsit::getRefWebsitId, websitNo)
+                    .eq(CustomerInformationWebsit::getBrandId, brandId)
                     .one();
             if (ciwx !=null){
                 resultData.setWdId(ciwx.getWebsitId());
@@ -214,7 +216,7 @@ public class PublicServiceImpl implements PublicService {
                 if (StringUtils.isNotEmpty(websit.getHotline())){
                     resultData.setWdlxdh(websit.getHotline());
                 } else if (StringUtils.isNotEmpty(websit.getOfficePhone()))
-                resultData.setWdlxdh(websit.getOfficePhone());
+                    resultData.setWdlxdh(websit.getOfficePhone());
             }
         }
 
@@ -233,6 +235,7 @@ public class PublicServiceImpl implements PublicService {
         // 先从售后网点查
         WebsitOrderSign wos = websitOrderSignService.lambdaQuery()
                 .eq(WebsitOrderSign::getWebsitId, websitId)
+                .eq(WebsitOrderSign::getBrandId, brandId)
                 .one();
         if (wos != null){
             resultData.setWdno(wos.getBrandWebsitNumber());
@@ -241,6 +244,7 @@ public class PublicServiceImpl implements PublicService {
             // 查看销售网点
             CustomerInformationWebsit ciwx = customerInformationWebsitService.lambdaQuery()
                     .eq(CustomerInformationWebsit::getWebsitId, websitId)
+                    .eq(CustomerInformationWebsit::getBrandId, brandId)
                     .one();
             if (ciwx !=null){
                 resultData.setWdno(ciwx.getRefWebsitId());
@@ -266,7 +270,7 @@ public class PublicServiceImpl implements PublicService {
 
     @Override
     public OutJiasmToGreeUploadTaskList getUploadTaskListLog(String orderNo, String id, Date updateTime,
-                                                          String itemTableName, String itemOrderType, int taskType) {
+                                                             String itemTableName, String itemOrderType, int taskType) {
         // 提取目志的类型
         OrderRepairOperatingLog rlog = orderRepairOperatingLogService.lambdaQuery()
                 .eq(OrderRepairOperatingLog::getId,id).one();

+ 1 - 1
src/main/resources/mapper/AZGDFYQDDownloadMapper.xml

@@ -14,7 +14,7 @@
                  left join itf_tbl_az_assign_lc_ls_download b on b.syn_req_id = #{request.mainSynReqId}
                  left join websit c on c.websit_id in
                                        (select websit_id from customer_information_websit
-                                        where ref_websit_id in
+                                        where brand_id = #{request.brandId} and ref_websit_id in
                                                (select cjwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.mainSynReqId}))
 
         where a.syn_req_id = #{request.synReqId}

+ 1 - 1
src/main/resources/mapper/AZGDFkMxDownloadMapper.xml

@@ -9,7 +9,7 @@
         from itf_tbl_az_assign_fkmx_download a
                  left join websit b on b.websit_id in
                                        (select websit_id from websit_order_sign
-                                        where brand_websit_id in
+                                        where brand_id = #{request.brandId} and brand_websit_id in
                                                (select wdno from itf_tbl_az_assign_fkmx_download where syn_req_id = #{request.synReqId}))
         where syn_req_id = #{request.synReqId}
     </select>

+ 18 - 18
src/main/resources/mapper/AZGDLcLsDownloadMapper.xml

@@ -39,29 +39,29 @@
                  left join sys_dict_ref f on a.spid= f.ref_dict_code and f.brand_id=1 and f.dict_type='MAIN_TYPE'
                  left join sys_dict g on g.dict_type='SERVICE_CATEGORY' and g.dict_value='家电售后'
                  left join websit h on h.websit_id in
-                                       (select websit_id from websit_order_sign
-                                        where brand_websit_id in
-                                              (select azwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                      (select websit_id from websit_order_sign
+                                        where brand_id = #{request.brandId} and brand_websit_id in
+                                                        (select azwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
                  left join websit i on i.websit_id in
-                                       (select websit_id from websit_order_sign
-                                        where  brand_websit_id in
-                                              (select jspgwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                      (select websit_id from websit_order_sign
+                                        where brand_id = #{request.brandId} and brand_websit_id in
+                                                         (select jspgwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
                  left join websit j on j.websit_id in
-                                       (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                             (select cjwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                     (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                              (select cjwdno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
                  left join websit l on l.websit_id in
-                                       (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                                             (select zjczwd from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                     (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                              (select zjczwd from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
                  left join websit n on n.websit_id in
-                                       (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                                             (select xsdwno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                      (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                              (select xsdwno from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
                  left join websit o on o.websit_id in
-                                       (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                                             (select xsdwxtbh from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
+                     (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                              (select xsdwxtbh from itf_tbl_az_assign_lc_ls_download where syn_req_id = #{request.synReqId}))
         where a.syn_req_id = #{request.synReqId}
     </select>
 

+ 11 - 11
src/main/resources/mapper/DetailOrderInstallMapper.xml

@@ -30,8 +30,8 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select operator_websit_id from order_install_detail where id = #{request.id}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
@@ -65,8 +65,8 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                          (select brand_websit_number from websit_order_sign where websit_id in
-                                  (select operator_websit_id from order_install_detail where id = #{request.id}))
+                           (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                   (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
@@ -101,8 +101,8 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                          (select brand_websit_number from websit_order_sign where websit_id in
-                                  (select operator_websit_id from order_install_detail where id = #{request.id}))
+                      (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                              (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
@@ -136,8 +136,8 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select operator_websit_id from order_install_detail where id = #{request.id}))
+                      (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                              (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
@@ -171,8 +171,8 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select operator_websit_id from order_install_detail where id = #{request.id}))
+                      (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                              (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0
         where a.order_base_id = #{request.orderNo} and a.status in( '1' , '2') and a.id = #{request.id}
@@ -206,7 +206,7 @@
                  left join sys_dict_ref d on d.dict_code=a.small_id and d.brand_id = #{request.brandId} and d.dict_type='SMALL_TYPE'
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
+                           (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
                                    (select operator_websit_id from order_install_detail where id = #{request.id}))
                  left join order_install_detail_fee g on g.order_base_id = a.order_base_id and g.order_detail_id=a.id
                  left join worker_brand_account h on h.worker_id = a.worker_id and h.websit_id = a.operator_websit_id and h.del=0

+ 17 - 17
src/main/resources/mapper/DetailOrderRepairMapper.xml

@@ -24,23 +24,23 @@
                if(j.zbby = '1' and c.ref_dict_code = 101 , 8, 1 ) as wxlx,a.over_time as bwgsj
         from order_repair_detail a
                  left join brand_websit b on b.brand_id = #{request.brandId} and b.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign
-                                   where websit_id =a.settle_websit_id)
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
-                 left join order_base d on d.id=a.order_base_id
-                 left join order_repair_operating_log e on e.order_base_id=a.order_base_id
-                 left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign
-                                   where websit_id in
-                                         (select install_websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign
-                                   where websit_id in
-                                         (select websit_id from order_base where id = #{request.orderNo}))
-                 left join sys_dict_ref h on h.dict_code=a.main_id and h.brand_id = #{request.brandId} and h.dict_type='MAIN_TYPE'
-            left join order_product i on i.order_base_id = a.order_base_id and i.id = a.repair_product_id
-                 left join order_repair j on j.order_base_id = a.order_base_id
-                 left join worker_brand_account k on k.worker_id = a.worker_id and k.websit_id = a.websit_id and k.del=0
+        (select brand_websit_number from websit_order_sign
+        where brand_id = #{request.brandId} and websit_id =a.settle_websit_id)
+        left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+        left join order_base d on d.id=a.order_base_id
+        left join order_repair_operating_log e on e.order_base_id=a.order_base_id
+        left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
+        (select brand_websit_number from websit_order_sign
+        where brand_id = #{request.brandId} and websit_id in
+        (select install_websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
+        (select brand_websit_number from websit_order_sign
+        where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join sys_dict_ref h on h.dict_code=a.main_id and h.brand_id = #{request.brandId} and h.dict_type='MAIN_TYPE'
+        left join order_product i on i.order_base_id = a.order_base_id and i.id = a.repair_product_id
+        left join order_repair j on j.order_base_id = a.order_base_id
+        left join worker_brand_account k on k.worker_id = a.worker_id and k.websit_id = a.websit_id and k.del=0
         where a.order_base_id = #{request.orderNo} and a.id =  #{request.id}
     </select>
 

+ 73 - 73
src/main/resources/mapper/GDOrderBaseMapper.xml

@@ -41,29 +41,29 @@
                a.area as xian,a.area_id as xianid,a.street as xzhen,a.street_id as xzhenid
         from order_base a
             left join brand_websit b on b.brand_websit_number=a.rece_websit_id and b.brand_id = #{request.brandId}
-            left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
-            left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
-            left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                 (select brand_websit_number from websit_order_sign where websit_id in
-                                 (select websit_id from order_base where id = #{request.orderNo}))
-            left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                 (select brand_websit_number from websit_order_sign where websit_id in
-                                 (select rece_websit_id from order_base where id = #{request.orderNo}))
-            left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
-                 (select brand_websit_number from websit_order_sign where websit_id in
-                                 (select rece_websit_id from order_base where id = #{request.orderNo}))
-           left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
-                 (select brand_websit_number from websit_order_sign where websit_id in
-                                 (select websit_id from order_base where id = #{request.orderNo}))
-           left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
-                 (select brand_websit_number from websit_order_sign where websit_id in
-                                 (select websit_id from order_base where id = #{request.orderNo}))
-           left join order_install j on j.order_base_id=a.id and a.id = #{request.orderNo}
-           left join brand_websit k on k.brand_id = #{request.brandId} and k.brand_websit_number in
-                 (select ref_websit_id from customer_information_websit where websit_id in
-                                 (select sale_websit_id from order_base where id = #{request.orderNo}))
-           left join order_state_contrast_upload l on l.order_state=a.last_order_status and l.state_type=10 and l.brand_id = #{request.brandId}
-           left join order_state_contrast_upload m on m.order_state=a.order_status and m.state_type=10 and m.brand_id = #{request.brandId}
+        left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+        left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
+        left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select rece_websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select rece_websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join order_install j on j.order_base_id=a.id and a.id = #{request.orderNo}
+        left join brand_websit k on k.brand_id = #{request.brandId} and k.brand_websit_number in
+        (select ref_websit_id from customer_information_websit where brand_id = #{request.brandId} and websit_id in
+        (select sale_websit_id from order_base where id = #{request.orderNo}))
+        left join order_state_contrast l on l.order_state=a.last_order_status and l.state_type=10 and l.brand_id = #{request.brandId}
+        left join order_state_contrast m on m.order_state=a.order_status and m.state_type=10 and m.brand_id = #{request.brandId}
         where a.id = #{request.orderNo}
     </select>
 
@@ -95,27 +95,27 @@
           IFNULL(a.info_source_id, 102) as xxlyid,IFNULL(a.user_attr_id, 1) as yhsxid,IFNULL(a.out_wxcount,1) as wxcount,
           '1' as extjson5,IFNULL(a.vip,'')  as vip
         from order_base a
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = 1 and c.dict_type='MAIN_TYPE'
-                 left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
-                 left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select rece_websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
-                 left join order_state_contrast_upload m on m.order_state=a.order_status and m.state_type=60 and m.brand_id = #{request.brandId}
-                 left join brand_websit n on n.brand_id = #{request.brandId} and n.brand_websit_number in
-                           (select ref_websit_id from customer_information_websit where websit_id in
-                                   (select sale_websit_id from order_base where id  = #{request.orderNo}))
-                 left join order_state_contrast_upload o on o.order_state=a.last_order_status and o.state_type=60 and o.brand_id = #{request.brandId}
-                 left join order_state_contrast_upload p on p.order_state=a.order_status and p.state_type=60 and p.brand_id = #{request.brandId}
-                 left join order_repair q on q.order_base_id=a.id
+            left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = 1 and c.dict_type='MAIN_TYPE'
+            left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
+            left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
+            (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+            (select websit_id from order_base where id = #{request.orderNo}))
+            left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
+            (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+            (select rece_websit_id from order_base where id = #{request.orderNo}))
+            left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
+            (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+            (select websit_id from order_base where id = #{request.orderNo}))
+            left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
+            (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+            (select websit_id from order_base where id = #{request.orderNo}))
+            left join order_state_contrast m on m.order_state=a.order_status and m.state_type=60 and m.brand_id = #{request.brandId}
+            left join brand_websit n on n.brand_id = #{request.brandId} and n.brand_websit_number in
+            (select ref_websit_id from customer_information_websit where brand_id = #{request.brandId} and websit_id in
+            (select sale_websit_id from order_base where id  = #{request.orderNo}))
+            left join order_state_contrast o on o.order_state=a.last_order_status and o.state_type=60 and o.brand_id = #{request.brandId}
+            left join order_state_contrast p on p.order_state=a.order_status and p.state_type=60 and p.brand_id = #{request.brandId}
+            left join order_repair q on q.order_base_id=a.id
         where a.id = #{request.orderNo}
     </select>
 
@@ -125,8 +125,8 @@
                e.brand_websit_number as fjwd
         from order_base a
                  left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select websit_id from order_base where id = #{request.orderNo}))
         where a.id = #{request.orderNo}
     </select>
 
@@ -134,8 +134,8 @@
         select a.id as worker_order_no, 2 as azorwx,now() as crdt,a.pgid as fjid,e.brand_websit_number as fjwd
         from order_base a
                  left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                    (select websit_id from order_base where id = #{request.orderNo}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select websit_id from order_base where id = #{request.orderNo}))
         where a.id = #{request.orderNo}
     </select>
 
@@ -145,8 +145,8 @@
                e.brand_websit_number as fjwd
         from order_base a
                  left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select websit_id from order_base where id = #{request.orderNo}))
         where a.id = #{request.orderNo}
     </select>
 
@@ -188,29 +188,29 @@
                a.area as xian,a.area_id as xianid,a.street as xzhen,a.street_id as xzhenid
         from order_base a
                  left join brand_websit b on b.brand_websit_number=a.rece_websit_id and b.brand_id = #{request.brandId}
-                 left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
-                 left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
-                 left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select rece_websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select rece_websit_id from order_base where id = #{request.orderNo}))
-                 left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select create_sys from order_base where id = #{request.orderNo}))
-                 left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select websit_id from order_base where id = #{request.orderNo}))
-                 left join order_install j on j.order_base_id=a.id and a.id = #{request.orderNo}
-                 left join brand_websit k on k.brand_id = #{request.brandId} and k.brand_websit_number in
-                           (select ref_websit_id from customer_information_websit where websit_id in
-                                   (select sale_websit_id from order_base where id = #{request.orderNo}))
-                 left join order_state_contrast_upload l on l.order_state=a.last_order_status and l.state_type=10 and l.brand_id = #{request.brandId}
-                 left join order_state_contrast_upload m on m.order_state=a.order_status and m.state_type=10 and m.brand_id = #{request.brandId}
+        left join sys_dict_ref c on c.dict_code=a.main_id and c.brand_id = #{request.brandId} and c.dict_type='MAIN_TYPE'
+        left join worker_brand_account d on d.worker_id = a.worker_id and d.websit_id = a.rece_websit_id and d.del=0
+        left join brand_websit e on e.brand_id = #{request.brandId} and e.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit f on f.brand_id = #{request.brandId} and f.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select rece_websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select rece_websit_id from order_base where id = #{request.orderNo}))
+        left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select create_sys from order_base where id = #{request.orderNo}))
+        left join brand_websit i on i.brand_id = #{request.brandId} and i.brand_websit_number in
+        (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+        (select websit_id from order_base where id = #{request.orderNo}))
+        left join order_install j on j.order_base_id=a.id and a.id = #{request.orderNo}
+        left join brand_websit k on k.brand_id = #{request.brandId} and k.brand_websit_number in
+        (select ref_websit_id from customer_information_websit where brand_id = #{request.brandId} and websit_id in
+        (select sale_websit_id from order_base where id = #{request.orderNo}))
+        left join order_state_contrast l on l.order_state=a.last_order_status and l.state_type=10 and l.brand_id = #{request.brandId}
+        left join order_state_contrast m on m.order_state=a.order_status and m.state_type=10 and m.brand_id = #{request.brandId}
         where a.id = #{request.orderNo}
     </select>
 

+ 6 - 6
src/main/resources/mapper/GetOrderProductMapper.xml

@@ -19,11 +19,11 @@
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join product f on f.jxid = a.product_id
                  left join brand_websit g on g.brand_id = #{request.brandId} and g.brand_websit_number in
-                           (select ref_websit_id from customer_information_websit where websit_id in
-                                   (select sale_websit from order_product where id = #{request.id}))
+                                                                                 (select ref_websit_id from customer_information_websit where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                                (select sale_websit from order_product where id = #{request.id}))
                  left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
-                           (select brand_websit_number from websit_order_sign where websit_id in
-                                   (select rece_websit_id from order_base where id = #{request.orderNo}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select rece_websit_id from order_base where id = #{request.orderNo}))
                  left join repair_bug i on i.bug_id=a.fault_reason
         where a.id = #{request.id}
     </select>
@@ -41,8 +41,8 @@
                  left join sys_dict_ref e on e.dict_code=a.series_id and e.brand_id = #{request.brandId} and e.dict_type='SERIES'
                  left join product f on f.jxid = a.product_id
                  left join brand_websit h on h.brand_id = #{request.brandId} and h.brand_websit_number in
-                       (select brand_websit_number from websit_order_sign where websit_id in
-                                (select rece_websit_id from order_base where id = #{request.orderNo}))
+                                                                                 (select brand_websit_number from websit_order_sign where brand_id = #{request.brandId} and websit_id in
+                                                                                                                                                                            (select rece_websit_id from order_base where id = #{request.orderNo}))
         where a.id = #{request.id}
     </select>
 

+ 13 - 13
src/main/resources/mapper/RepairDownloadMapper.xml

@@ -33,20 +33,20 @@
                  left join sys_dict f on f.dict_type='SERVICE_CATEGORY' and f.dict_value='家电售后'
                  left join websit g on g.websit_id in
                                        (select websit_id from websit_order_sign
-                                        where brand_websit_id in
-                                                         (select if((wxwdno='' or wxwdno is null),IFNULL(xjwdno,''),wxwdno) from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
+                                        where brand_id = #{request.brandId} and brand_websit_id in
+                                                                                (select if((wxwdno='' or wxwdno is null),IFNULL(xjwdno,''),wxwdno) from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
                  left join websit h on h.websit_id in
                                        (select websit_id from websit_order_sign
-                                        where brand_websit_id in
-                                                         (select xjwdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
+                                        where brand_id = #{request.brandId} and brand_websit_id in
+                                                                                (select xjwdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
                  left join websit j on j.websit_id in
                                        (select websit_id from websit_order_sign
-                                        where brand_websit_id in
-                                                         (select cjwdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
+                                        where brand_id = #{request.brandId} and brand_websit_id in
+                                                                                (select cjwdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
                  left join websit k on k.websit_id in
                                        (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                                         (select xswdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                                                                (select xswdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
         where a.syn_req_id = #{request.synReqId}
     </select>
 
@@ -66,22 +66,22 @@
                a.wcsj as over_time,IFNULL(a.zjczsj,a.last_modified_date) as last_operator_time,
                IFNULL(a.last_modified_date,a.zjczsj) as update_time,a.yhsx as user_attr,a.yhsxid as user_attr_id,
                a.fjhm,a.gdhao as file_no,a.zxhao as seat_no,a.xjwdsj as rece_time,a.yhqwsmsj as appointment_time,
-               a.yhqwsmsj as expect_start_time,a.qwsmjssj as expect_end_time,a.fjhm,a.wxcount as out_wxcount
+               a.yhqwsmsj as expect_start_time,a.qwsmjssj as expect_end_time,a.fjhm,a.wxcount as out_wxcount,
         from itf_tbl_assign_download a
                  left join itf_tbl_wangdian_wxg_download b on b.wxgid=a.wxrenid and b.wdno=a.wxwdno
                  left join websit k on k.websit_id in
                                        (select websit_id from customer_information_websit
-                                        where ref_websit_id in
-                                                         (select xswdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                                                                (select xswdno from itf_tbl_assign_download where syn_req_id = #{request.synReqId}))
         where a.syn_req_id = #{request.synReqId}
     </select>
 
     <select id="getOrderBaseStatus" parameterType="com.zfire.jiasm.syncdata.parameter.OrderPar" resultType="com.zfire.jiasm.syncdata.plus.entity.OrderBase">
-        select c.order_state as order_status,d.order_state as last_order_status
+        select c.order_state as order_status,d.order_state as last_order_status,
         from itf_tbl_assign_download a
                  left join order_state_contrast c on c.brand_order_state=a.stat and c.state_type=60 and c.brand_id = #{request.brandId}
                  left join order_state_contrast d on d.brand_order_state=a.qystat and d.state_type=60 and d.brand_id = #{request.brandId}
-             where a.syn_req_id = #{request.synReqId};
+        where a.syn_req_id = #{request.synReqId};
     </select>
 
 

+ 3 - 3
src/main/resources/mapper/RepairLogMapper.xml

@@ -29,9 +29,9 @@
                a.brand_file_name as scwj,a.req_source_num as qqlyxh,a.fkmxguid,a.wjid
         from order_repair_operating_log a
                  left join brand_websit b on b.brand_id = 1 and b.brand_websit_number in
-                      (select brand_websit_number from websit_order_sign
-                              where websit_id in
-                                    (select websit_id from order_repair_operating_log where id = #{request.id}))
+                                                                (select brand_websit_number from websit_order_sign
+                                                                 where brand_id = 1 and websit_id in
+                                                                                        (select websit_id from order_repair_operating_log where id = #{request.id}))
         where a.order_base_id = #{request.orderNo} and a.id = #{request.id}
     </select>
 

+ 8 - 8
src/main/resources/mapper/RepairMxDownloadMapper.xml

@@ -9,14 +9,14 @@
                b.websit_id as sale_websit,a.xsdwdh as sale_websit_mobile,
                c.websit_id as service_websit,a.fwdwdh as service_websit_mobile, a.gmsj as buy_time,a.beiz as remark
         from itf_tbl_assign_mx_download a
-                left join websit b on b.websit_id in
-                          (select websit_id from customer_information_websit
-                                  where ref_websit_id in
-                                        (select xsdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
-                left join websit c on c.websit_id in
-                          (select websit_id from customer_information_websit
-                                  where ref_websit_id in
-                                        (select fwdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
+                 left join websit b on b.websit_id in
+                                       (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                                                                (select xsdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
+                 left join websit c on c.websit_id in
+                                       (select websit_id from customer_information_websit
+                                        where brand_id = #{request.brandId} and ref_websit_id in
+                                                                                (select fwdw from itf_tbl_assign_mx_download where syn_req_id = #{request.synReqId}))
         where syn_req_id = #{request.synReqId}
     </select>