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