From a2cf66488e354cf9b52f7697909e196d3944d2b3 Mon Sep 17 00:00:00 2001 From: "DESKTOP-G8BCEP0\\HP" <2037158277@qq.com> Date: Wed, 11 Aug 2021 11:21:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E8=BF=91=E4=B8=80=E4=B8=AA=E6=9C=88=E5=92=8C=E4=BB=8A=E5=A4=A9?= =?UTF-8?q?=E7=81=AB=E7=82=B9=E4=BF=A1=E6=81=AF=E7=9A=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/xkrs/dao/CountyDao.java | 7 +++++++ .../java/com/xkrs/service/impl/FirePointServiceImpl.java | 4 ++-- src/main/resources/application.properties | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/xkrs/dao/CountyDao.java b/src/main/java/com/xkrs/dao/CountyDao.java index 6914b6e..5e4720a 100644 --- a/src/main/java/com/xkrs/dao/CountyDao.java +++ b/src/main/java/com/xkrs/dao/CountyDao.java @@ -20,4 +20,11 @@ public interface CountyDao extends JpaRepository { */ @Query(value = "select county_name cityname,county_code citycode from county where city_code = :code",nativeQuery = true) List> selectCountyName(String code); + + /** + * 根据市编码查询信息 + * @param cityCode + * @return + */ + List findByCityCode(String cityCode); } diff --git a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java index 0b6e53e..887e7cf 100644 --- a/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java +++ b/src/main/java/com/xkrs/service/impl/FirePointServiceImpl.java @@ -120,7 +120,7 @@ public class FirePointServiceImpl implements FirePointService { String proName = byProCode.get(0).getProName(); return firePointDao.selectTodayFirePoint(addTime,proName); }else if("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))){ - List byCityCode = cityDao.findByCityCode(countyCode); + List byCityCode = countyDao.findByCityCode(countyCode); String cityName = byCityCode.get(0).getCityName(); return firePointDao.selectTodayFirePoint(addTime,cityName); }else { @@ -322,7 +322,7 @@ public class FirePointServiceImpl implements FirePointService { String proName = byProCode.get(0).getProName(); return query.selectFirePointByMonth(proName,startTime,endTime); }else if("00".equals(countyCode.substring(4)) && !"0000".equals(countyCode.substring(2))){ - List byCityCode = cityDao.findByCityCode(countyCode); + List byCityCode = countyDao.findByCityCode(countyCode); String cityName = byCityCode.get(0).getCityName(); return query.selectFirePointByMonthCity(cityName,startTime,endTime); }else { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index f581f5c..67f3fd5 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -38,7 +38,7 @@ spring.cache.type = redis spring.redis.database = 8 spring.redis.host = localhost spring.redis.port = 6379 -#spring.redis.password=sdust2020 +spring.redis.password=sdust2020 spring.redis.timeout = 10000 spring.redis.lettuce.pool.max-active = 100 spring.redis.lettuce.pool.max-wait = 10000