| | |
| | | |
| | | import java.util.List; |
| | | |
| | | // FIXME: 2023/11/15 类名不合适, 各函数的分类不合适, 需要根据业务拆分成多个service |
| | | @Slf4j |
| | | @RequestMapping("/fume") |
| | | @CrossOrigin |
| | |
| | | */ |
| | | @GetMapping("/month") |
| | | public Result queryRiskDataByMonth( |
| | | @RequestParam String mnCode, |
| | | @RequestParam(required = false) String mnCode, |
| | | @RequestParam String month, |
| | | @RequestParam String type |
| | | ) { |
| | |
| | | package com.flightfeather.monitor.domain.ds1.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.util.Date; |
| | | import javax.persistence.*; |
| | | |
| | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "YYYY-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date lst; |
| | | |
| | | /** |
| | |
| | | * 继承自己的MyMapper |
| | | */ |
| | | public interface MyMapper<T> extends Mapper<T>, MySqlMapper<T> { |
| | | //TODO |
| | | //FIXME 特别注意,该接口不能被扫描到,否则会出错 |
| | | } |
| | |
| | | package com.flightfeather.monitor.pojo |
| | | |
| | | import java.util.* |
| | | import com.flightfeather.monitor.domain.ds1.entity.RiskValue |
| | | |
| | | class RiskValuePojo { |
| | | var id: Int? = null |
| | | |
| | | /** |
| | | * 监测点编号 |
| | | */ |
| | | var mnCode: String? = null |
| | | |
| | | class RiskValuePojo : RiskValue() { |
| | | /** |
| | | * 监测点名称 |
| | | */ |
| | | var name: String? = null |
| | | |
| | | /** |
| | | * 时间 |
| | | */ |
| | | var lst: Date? = null |
| | | |
| | | /** |
| | | * 在线率风险值 |
| | | */ |
| | | var onlineRisk: Double? = null |
| | | |
| | | /** |
| | | * 有效率风险值 |
| | | */ |
| | | var validRisk: Double? = null |
| | | |
| | | /** |
| | | * 超标风险值 |
| | | */ |
| | | var exceedRisk: Double? = null |
| | | |
| | | /** |
| | | * 异常类型聚集度 |
| | | */ |
| | | var exceptionTypeAggregation: Double? = null |
| | | |
| | | /** |
| | | * 典型异常复现率 |
| | | */ |
| | | var typicalExceptionRepetitionRate: Double? = null |
| | | |
| | | /** |
| | | * 统计类型(日统计或月统计),day month |
| | | */ |
| | | var type: String? = null |
| | | } |
| | |
| | | LocalDate date = LocalDate.parse(month); |
| | | if (date != null) { |
| | | date = date.withDayOfMonth(1); |
| | | return riskValueMapper.queryRiskDataByMonth(mnCode, date, type); |
| | | List<RiskValuePojo> res = riskValueMapper.queryRiskDataByMonth(mnCode, date, type); |
| | | return res; |
| | | // return riskValueRep.select(mnCode, date, type); |
| | | } else { |
| | | return new ArrayList<>(); |
| | |
| | | ds1: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | # 生产环境 |
| | | # url: jdbc:mysql://localhost:3306/fume |
| | | # 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 |
| | | # url: jdbc:mysql://localhost:3306/qianduan_sql?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: 1234 |
| | | |
| | | # url: jdbc:mysql://localhost:3306/fume |
| | | # url: jdbc:mysql://localhost:3306/fume?serverTimezone=Asia/Shanghai&prepStmtCacheSize=517&cachePrepStmts=true&autoReconnect=true&allowMultiQueries=true&useSSL=false |
| | | # username: root |
| | | # password: 123456 |
| | | |
| | | url: jdbc:mysql://114.215.109.124:3306/fume |
| | | 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: |
| | |
| | | from du_js_t_risk_value as a left join ja_t_dust_site_info as b on a.mn_code = b.mn_code |
| | | <where> |
| | | <if test="mnCode != null and mnCode != '' "> |
| | | b.name = #{mnCode} |
| | | a.mn_code = #{mnCode} |
| | | </if> |
| | | |
| | | <if test="month != null"> |