更新火点的街道编号数据

//省的账号要查市的火点
This commit is contained in:
liuchengqian 2022-05-11 15:12:31 +08:00
parent b4a5f74a06
commit 9f3563121c

View File

@ -25,13 +25,24 @@ public class Query {
* 动态多条件查询项目信息()
*/
public List<FirePointEntity> selectFirePointByPro(String proName, String cityCode, String satelliteType, String landType, String startTime, String endTime) {
try {
if (cityCode.substring(4).equals("00") && !cityCode.substring(2).equals("0000")) {//省的账号要查市的火点
if (cityCode.length() > 4) {
cityCode = cityCode.substring(0, 4);
}
}
}catch (Exception e) {
e.printStackTrace();
cityCode = null;
}
String finalCityCode = cityCode;
Specification<FirePointEntity> specification = (root, criteriaQuery, criteriaBuilder) -> {
List<Predicate> list = new ArrayList<>();
if (proName != null && !"".equals(proName)) {
list.add(criteriaBuilder.like(root.get("firePointAddress").as(String.class), "%" + proName + "%"));
}
if (cityCode != null && !"".equals(cityCode)) {
list.add(criteriaBuilder.like(root.get("countyCode").as(String.class), "%" + cityCode + "%"));
if (finalCityCode != null && !"".equals(finalCityCode)) {
list.add(criteriaBuilder.like(root.get("countyCode").as(String.class), "%" + finalCityCode + "%"));
}
if (satelliteType != null && !"".equals(satelliteType)) {
list.add(criteriaBuilder.equal(root.get("satelliteType").as(String.class), satelliteType));