Browse Source

更新区划筛选条件

master
牧羊人 4 years ago
parent
commit
6f4d615519
2 changed files with 31 additions and 24 deletions
  1. +9
    -7
      src/main/java/com/taauav/admin/mapper/TauvInspectDriverMapper.xml
  2. +22
    -17
      src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java

+ 9
- 7
src/main/java/com/taauav/admin/mapper/TauvInspectDriverMapper.xml View File

@@ -56,14 +56,16 @@
<if test="param.driverName != null and param.driverName!=''">
and driver_name like CONCAT('%',#{param.driverName},'%')
</if>
<!-- <if test="param.driverArea != null and param.driverArea != ''">-->
<!-- and driver_area in-->
<!-- <foreach collection="param.driverArea" item="area" open="(" close=")" separator=",">-->
<!-- #{area}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="param.driverArea != null and param.driverArea != ''">
and driver_area = #{param.driverArea}
<if test="param.driverAreaType != null and param.driverAreaType > 0">
and driver_area in
<foreach collection="param.driverArea" item="area" open="(" close=")" separator=",">
#{area}
</foreach>
</if>
<if test="param.driverAreaType == null || param.driverAreaType == ''">
and driver_area = #{param.driverArea}
</if>
</if>

<if test="param.status != null and param.status != '' ">

+ 22
- 17
src/main/java/com/taauav/admin/service/impl/TauvInspectFileServiceImpl.java View File

@@ -112,24 +112,29 @@ public class TauvInspectFileServiceImpl extends BaseServiceImpl<TauvInspectFileM
// 区域
// map = FunctionUtils.dealArea(map);
// 区划查询范围
if (map.containsKey("driverAreaType") && !StringUtils.isEmpty(map.get("driverAreaType")) && map.containsKey("driverArea") && !StringUtils.isEmpty(map.get("driverArea"))) {
Integer driverAreaType = Integer.valueOf(map.get("driverAreaType").toString());
if (map.containsKey("driverArea") && !StringUtils.isEmpty(map.get("driverArea"))) {
// 区划ID
BigInteger driverArea = BigInteger.valueOf(Long.valueOf(map.get("driverArea").toString()));
// List<BigInteger> cityIds = new ArrayList<>();
// if (driverArea != null) {
// if (driverAreaType == 1) {
// // 区划所有(取本级及子级区划ID)
// cityIds = lsCityService.getChildCityIds(driverArea);
// // 加入当前选中的区划
// cityIds.add(driverArea);
// } else {
// // 本级河湖区划
// cityIds.add(driverArea);
// }
// }
// String cityIdsStr = org.apache.commons.lang3.StringUtils.join(cityIds.toArray(), ",");
// String[] cityIdsList = cityIdsStr.split(",");
map.put("driverArea", driverArea);
if (map.containsKey("driverAreaType") && !StringUtils.isEmpty(map.get("driverAreaType"))) {
Integer driverAreaType = Integer.valueOf(map.get("driverAreaType").toString());
List<BigInteger> cityIds = new ArrayList<>();
if (driverArea != null) {
if (driverAreaType == 1) {
// 区划所有(取本级及子级区划ID)
cityIds = lsCityService.getChildCityIds(driverArea);
// 加入当前选中的区划
cityIds.add(driverArea);
} else {
// 本级河湖区划
cityIds.add(driverArea);
}
}
String cityIdsStr = org.apache.commons.lang3.StringUtils.join(cityIds.toArray(), ",");
String[] cityIdsList = cityIdsStr.split(",");
map.put("driverArea", cityIdsList);
} else {
map.put("driverArea", driverArea);
}
} else {
map.remove("driverArea");
}

Loading…
Cancel
Save