zhangyuewww 2 anos atrás
pai
commit
219dfec3b4

+ 32 - 2
winsea-haixin-plugin-wangluohuoyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/HyReleaseGoodsInfoServiceImpl.java

@@ -51,8 +51,38 @@ public class HyReleaseGoodsInfoServiceImpl extends ServiceImpl<HyReleaseGoodsInf
         pageView.put("currentPage", hyReleaseGoodsInfo.getCurrentPage());
         pageView.put("loadingPlaceCity", hyReleaseGoodsInfo.getLoadingPlaceCity());
         pageView.put("unLoadingPlaceCity", hyReleaseGoodsInfo.getUnLoadingPlaceCity());
-        // 查询总数
-        Integer dataCount = baseMapper.getCountByCondition(pageView);
+        if (hyReleaseGoodsInfo.getLoadingPlace().contains(",")){
+            StringBuffer sb = new StringBuffer();
+            String[] temp = hyReleaseGoodsInfo.getLoadingPlace().split(",");
+            for (int i = 0; i < temp.length; i++) {
+                if (!"".equals(temp[i]) && temp[i] != null)
+                    sb.append("'" + temp[i] + "',");
+            }
+            String result = sb.toString();
+            String tp = result.substring(result.length() - 1, result.length());
+            if (",".equals(tp)){
+                hyReleaseGoodsInfo.setLoadingPlace(result.substring(0, result.length() - 1));
+            } else{
+                hyReleaseGoodsInfo.setLoadingPlace(result);
+            }
+        }
+        if (hyReleaseGoodsInfo.getUnLoadingPlace().contains(",")){
+            StringBuffer sb = new StringBuffer();
+            String[] temp = hyReleaseGoodsInfo.getUnLoadingPlace().split(",");
+            for (int i = 0; i < temp.length; i++) {
+                if (!"".equals(temp[i]) && temp[i] != null)
+                    sb.append("'" + temp[i] + "',");
+            }
+            String result = sb.toString();
+            String tp = result.substring(result.length() - 1, result.length());
+            if (",".equals(tp)){
+                hyReleaseGoodsInfo.setUnLoadingPlace(result.substring(0, result.length() - 1));
+            } else{
+                hyReleaseGoodsInfo.setUnLoadingPlace(result);
+            }
+        }
+        pageView.put("loadingPlace", hyReleaseGoodsInfo.getLoadingPlace());
+        pageView.put("unLoadingPlace", hyReleaseGoodsInfo.getUnLoadingPlace());
         //货源列表
         List<HyReleaseGoodsInfo> hyReleaseGoodsInfoList = new ArrayList<>();
         //按时间排序货源列表

+ 15 - 6
winsea-haixin-plugin-wangluohuoyun/src/main/resources/mapper/HyReleaseGoodsInfoMapper.xml

@@ -17,10 +17,10 @@
             AND (lower(unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND send_area in (${loadingPlace})
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND unload_area in (${unLoadingPlace})
         </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -84,10 +84,10 @@
             AND (lower(unload_city) like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
         </if>
         <if test="loadingPlace != null and loadingPlace != ''">
-            AND (lower(send_area) like lower(CONCAT('%',#{loadingPlace},'%')))
+            AND send_area in (${loadingPlace})
         </if>
         <if test="unLoadingPlace != null and unLoadingPlace != ''">
-            AND (lower(unload_area) like lower(CONCAT('%',#{unLoadingPlace},'%')))
+            AND unload_area in (${unLoadingPlace})
         </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">
@@ -148,8 +148,17 @@
         <if test="commonId != null and commonId != ''">
             AND common_id = #{commonId}
         </if>
-        <if test="loadingPlaceCity != null and loadingPlaceCity != ''">
-            AND (lower(send_city)  not like lower(CONCAT('%',#{loadingPlaceCity},'%')))
+        <if test="loadingPlaceCity != null and loadingPlaceCity != '' and loadingPlace == null and loadingPlace == ''">
+            AND (lower(send_city) not like lower(CONCAT('%',#{loadingPlaceCity},'%')))
+        </if>
+        <if test="unLoadingPlaceCity != null and unLoadingPlaceCity != '' and unLoadingPlace == null and unLoadingPlace == ''">
+            AND (lower(unload_city) not like lower(CONCAT('%',#{unLoadingPlaceCity},'%')))
+        </if>
+        <if test="loadingPlace != null and loadingPlace != ''">
+            AND send_area not in (${loadingPlace})
+        </if>
+        <if test="unLoadingPlace != null and unLoadingPlace != ''">
+            AND unload_area not in (${unLoadingPlace})
         </if>
         <if test="searchType != null and searchType != ''">
             <if test="searchType == 1">