From 555fb0758022cec5c88e98ee989d0287bdc0052d Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 23 十一月 2023 08:50:05 +0800 Subject: [PATCH] 修改历史数据查询的sql语句 --- src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java | 17 ++++++++++------- src/main/resources/mapper/FugitiveDustMapper.xml | 5 +++-- src/main/resources/application.yml | 12 ++++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java b/src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java index 4517ad7..5a63bf0 100644 --- a/src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java +++ b/src/main/java/com/flightfeather/monitor/controller/FugitiveDustController.java @@ -100,21 +100,24 @@ PageBean pageBean = fugitiveDustService.getExceptionData2(page,pageSize,siteName,exceptionType,beginTime,endTime,street,dutyCompany); return Result.success(pageBean); } -//鏍规嵁鏌愭鏃堕棿鍐呮煇涓紓甯哥被鍨嬫煡璇㈠搴旂殑搴楅摵鍚嶇О鍜岃澶囩紪鍙� -@GetMapping("/sitenamecode") -public Result getExceptionSitenameAndCode(String exceptionType,String beginTime, String endTime,String [] street,String [] dutyCompany,String siteName){ - List<DustExceptionData> list = fugitiveDustService.getExceptionSitenameAndCode(exceptionType,beginTime,endTime,street,dutyCompany,siteName); - return Result.success(list); -} + + //鏍规嵁鏌愭鏃堕棿鍐呮煇涓紓甯哥被鍨�,鍦板潃锛岃繍缁村晢锛岀偣浣嶅悕绉� 锛屾煡璇㈠搴旂殑搴楅摵鍚嶇О鍜岃澶囩紪鍙� + @GetMapping("/sitenamecode") + public Result getExceptionSitenameAndCode(String exceptionType,String beginTime, String endTime,String [] street,String [] dutyCompany,String siteName){ + List<DustExceptionData> list = fugitiveDustService.getExceptionSitenameAndCode(exceptionType,beginTime,endTime,street,dutyCompany,siteName); + return Result.success(list); + } - // 鏍规嵁鏃堕棿杩斿洖璇ュ紓甯哥被鍨嬬殑涓暟 + + // 鏍规嵁鏃堕棿,鍦板潃锛岃繍缁村晢锛岀偣浣嶅悕绉帮紝杩斿洖璇ュ紓甯哥被鍨嬬殑涓暟 @GetMapping("/exceptionnum") public Result exceptionNum(String exceptionType,String beginTime,String endTime,String [] street,String [] dutyCompany,String siteName){ Integer list = fugitiveDustService.exceptionNum( exceptionType, beginTime, endTime,street,dutyCompany,siteName); return Result.success(list); } + // 鏌ヨ鍘嗗彶鏁版嵁 涓嶅垎椤� @GetMapping("/history") public Result conditonQueryHistoryData(String siteName,String beginTime, String endTime ){ diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 358ae74..4ffadab 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -3,9 +3,9 @@ ds1: driver-class-name: com.mysql.cj.jdbc.Driver # 鐢熶骇鐜 - url: jdbc:mysql://localhost:3306/fume?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false - username: fume - password: fume_feiyu2023 +# url: jdbc:mysql://localhost:3306/fume?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false +# username: fume +# password: fume_feiyu2023 # url: jdbc:mysql://localhost:3306/qianduan_sql?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false # username: root @@ -15,9 +15,9 @@ # username: root # password: 123456 -# url: jdbc:mysql://114.215.109.124:3306/fume?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false -# username: fumeRemote -# password: feiyu2023 + url: jdbc:mysql://114.215.109.124:3306/fume?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false + username: fumeRemote + password: feiyu2023 mybatis: configuration: diff --git a/src/main/resources/mapper/FugitiveDustMapper.xml b/src/main/resources/mapper/FugitiveDustMapper.xml index ddbd502..6b8ed8c 100644 --- a/src/main/resources/mapper/FugitiveDustMapper.xml +++ b/src/main/resources/mapper/FugitiveDustMapper.xml @@ -35,7 +35,8 @@ from ja_t_dust_site_data_info as a join ja_t_dust_site_info as b on a.mn_code = b.mn_code <where> <if test="siteName !=null and siteName != ''"> - b.name like concat('%',#{siteName},'%') +<!-- b.name like concat('%',#{siteName},'%')--> + b.name = #{siteName} </if> <if test="mnCode !=null and mnCode != ''"> and a.mn_code = #{mnCode} @@ -107,7 +108,7 @@ d.lst between #{beginTime} and #{endTime} and d.type = 'day' </if> </where> - order by c.name asc + order by d.day_avg desc </select> -- Gitblit v1.9.3