更新火点的街道编号数据
//省的账号要查市的火点
This commit is contained in:
parent
b4a5f74a06
commit
9f3563121c
@ -25,13 +25,24 @@ public class Query {
|
|||||||
* 动态多条件查询项目信息(省)
|
* 动态多条件查询项目信息(省)
|
||||||
*/
|
*/
|
||||||
public List<FirePointEntity> selectFirePointByPro(String proName, String cityCode, String satelliteType, String landType, String startTime, String endTime) {
|
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) -> {
|
Specification<FirePointEntity> specification = (root, criteriaQuery, criteriaBuilder) -> {
|
||||||
List<Predicate> list = new ArrayList<>();
|
List<Predicate> list = new ArrayList<>();
|
||||||
if (proName != null && !"".equals(proName)) {
|
if (proName != null && !"".equals(proName)) {
|
||||||
list.add(criteriaBuilder.like(root.get("firePointAddress").as(String.class), "%" + proName + "%"));
|
list.add(criteriaBuilder.like(root.get("firePointAddress").as(String.class), "%" + proName + "%"));
|
||||||
}
|
}
|
||||||
if (cityCode != null && !"".equals(cityCode)) {
|
if (finalCityCode != null && !"".equals(finalCityCode)) {
|
||||||
list.add(criteriaBuilder.like(root.get("countyCode").as(String.class), "%" + cityCode + "%"));
|
list.add(criteriaBuilder.like(root.get("countyCode").as(String.class), "%" + finalCityCode + "%"));
|
||||||
}
|
}
|
||||||
if (satelliteType != null && !"".equals(satelliteType)) {
|
if (satelliteType != null && !"".equals(satelliteType)) {
|
||||||
list.add(criteriaBuilder.equal(root.get("satelliteType").as(String.class), satelliteType));
|
list.add(criteriaBuilder.equal(root.get("satelliteType").as(String.class), satelliteType));
|
||||||
|
Loading…
Reference in New Issue
Block a user