Browse Source

区划查询条件更新

master
牧羊人 4 years ago
parent
commit
6ee27c116c
2 changed files with 25 additions and 2 deletions
  1. +15
    -1
      src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java
  2. +10
    -1
      src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java

+ 15
- 1
src/main/java/com/taauav/admin/service/impl/TauvDriverServiceImpl.java View File

@@ -8,6 +8,7 @@ import com.taauav.admin.entity.LsAdmin;
import com.taauav.admin.entity.TauvEquipment;
import com.taauav.admin.mapper.LsAdminMapper;
import com.taauav.admin.query.TauvDriverQuery;
import com.taauav.admin.service.ILsCityService;
import com.taauav.admin.service.ISysCityService;
import com.taauav.admin.vo.TauvDriverListVo;
import com.taauav.common.bean.Response;
@@ -55,6 +56,9 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
@Autowired
private LsAdminMapper lsAdminMapper;

@Autowired
private ILsCityService lsCityService;

/**
* 获取河道列表
*
@@ -268,7 +272,17 @@ public class TauvDriverServiceImpl extends BaseServiceImpl<TauvDriverMapper, Tau
QueryWrapper queryWrapper = new QueryWrapper();
// 区划ID
if (map.containsKey("driverArea") && !StringUtils.isEmpty(map.get("driverArea"))) {
queryWrapper.eq("driver_area", BigInteger.valueOf(Long.valueOf(map.get("driverArea").toString())));
BigInteger driverArea = BigInteger.valueOf(Long.valueOf(map.get("driverArea").toString()));
// 获取所有自己区划ID
List<BigInteger> driverAreaList = new ArrayList<>();
driverAreaList.add(driverArea);
List<BigInteger> cityIdsList = lsCityService.getChildCityIds(driverArea);
if (!cityIdsList.isEmpty()) {
cityIdsList.forEach(item -> {
driverAreaList.add(item);
});
}
queryWrapper.in("driver_area", driverAreaList);
}
// 河流名称
if (map.containsKey("name") && !StringUtils.isEmpty(map.get("name"))) {

+ 10
- 1
src/main/java/com/taauav/front/service/impl/LSReportServiceImpl.java View File

@@ -107,7 +107,16 @@ public class LSReportServiceImpl extends BaseServiceImpl<LSReportMapper, TauvRep
}
// 区划ID
if (query.getDriverArea() != null) {
queryWrapper.eq("driver_area", query.getDriverArea());
// 获取所有自己区划ID
List<BigInteger> driverAreaList = new ArrayList<>();
driverAreaList.add(query.getDriverArea());
List<BigInteger> cityIdsList = lsCityService.getChildCityIds(query.getDriverArea());
if (!cityIdsList.isEmpty()) {
cityIdsList.forEach(item -> {
driverAreaList.add(item);
});
}
queryWrapper.in("driver_area", driverAreaList);
}
queryWrapper.eq("mark", 1);


Loading…
Cancel
Save