소스 검색

修复:郑多燕订单查询功能在附加部门筛选条件时无法返回结果的问题。

cgp 1 일 전
부모
커밋
fc6fd9fcf5
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

+ 7 - 3
fs-service/src/main/resources/mapper/hisStore/FsStoreOrderScrmMapper.xml

@@ -1848,7 +1848,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND date_format(o.delivery_import_time,'%y%m%d') <= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d')
             </if>
             <if test="maps.deptId != null     ">
-                AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+                AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (
+                SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
+                ))
             </if>
             <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
                 and o.erp_phone like concat(#{maps.erpPhoneNumber},'%')
@@ -1901,7 +1903,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="(maps.nickname != null and  maps.nickname !='') or (maps.phone != null and  maps.phone !='')">
             left join fs_user u on o.user_id=u.user_id
         </if>
-        <if test="maps.companyUserNickName != null and  maps.companyUserNickName !=  ''">
+        <if test="(maps.companyUserNickName != null and  maps.companyUserNickName !=  '') or (maps.deptId != null)">
             left join company_user cu on cu.user_id=o.company_user_id
         </if>
         <if test="maps.erpAccount != null and maps.erpAccount != ''">
@@ -2035,7 +2037,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 AND date_format(o.delivery_import_time,'%y%m%d') &lt;= date_format(#{maps.deliveryImportTimeList[1]},'%y%m%d')
             </if>
             <if test="maps.deptId != null     ">
-                AND (o.dept_id = #{maps.deptId} OR o.dept_id IN ( SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors) ))
+                AND (cu.dept_id = #{maps.deptId} OR cu.dept_id IN (
+                SELECT t.dept_id FROM company_dept t WHERE find_in_set(#{maps.deptId}, ancestors)
+                ))
             </if>
             <if test="maps.erpPhoneNumber != null and maps.erpPhoneNumber != ''">
                 and so.erp_phone like concat(#{maps.erpPhoneNumber},'%')