| | |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.RiskValue; |
| | | import com.flightfeather.monitor.pojo.Result; |
| | | import com.flightfeather.monitor.pojo.RiskValuePojo; |
| | | import com.flightfeather.monitor.service.RiskValueService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @RequestParam String month, |
| | | @RequestParam String type |
| | | ) { |
| | | List<RiskValue> list = riskValueService.queryRiskDataByMonth(mnCode, month, type); |
| | | List<RiskValuePojo> list = riskValueService.queryRiskDataByMonth(mnCode, month, type); |
| | | return Result.success(list); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.RiskValue |
| | | import com.flightfeather.monitor.domain.util.MyMapper |
| | | import com.flightfeather.monitor.pojo.RiskValuePojo |
| | | import org.apache.ibatis.annotations.Mapper |
| | | import sun.util.resources.LocaleData |
| | | import java.time.LocalDate |
| | | import java.util.* |
| | | |
| | | @Mapper |
| | | interface RiskValueMapper : MyMapper<RiskValue?> |
| | | interface RiskValueMapper : MyMapper<RiskValue?> { |
| | | |
| | | fun queryRiskDataByMonth(mnCode: String?, month: LocalDate?, type: String?): List<RiskValuePojo?> |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.flightfeather.monitor.pojo |
| | | |
| | | import java.util.* |
| | | |
| | | class RiskValuePojo { |
| | | var id: Int? = null |
| | | |
| | | /** |
| | | * çæµç¹ç¼å· |
| | | */ |
| | | var mnCode: String? = null |
| | | |
| | | /** |
| | | * çæµç¹åç§° |
| | | */ |
| | | 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 |
| | | } |
| | |
| | | package com.flightfeather.monitor.service; |
| | | |
| | | import com.flightfeather.monitor.domain.ds1.entity.RiskValue; |
| | | import com.flightfeather.monitor.pojo.RiskValuePojo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param type |
| | | * @return |
| | | */ |
| | | List<RiskValue> queryRiskDataByMonth(String mnCode, String month, String type); |
| | | List<RiskValuePojo> queryRiskDataByMonth(String mnCode, String month, String type); |
| | | } |
| | |
| | | import com.flightfeather.monitor.domain.ds1.mapper.RiskValueMapper; |
| | | import com.flightfeather.monitor.domain.ds1.repository.RiskValueRep; |
| | | import com.flightfeather.monitor.mapper.RiskAnalysisMapper; |
| | | import com.flightfeather.monitor.pojo.RiskValuePojo; |
| | | import com.flightfeather.monitor.service.RiskValueService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | private RiskValueRep riskValueRep; |
| | | |
| | | @Override |
| | | public List<RiskValue> queryRiskDataByMonth(String mnCode, String month, String type) { |
| | | public List<RiskValuePojo> queryRiskDataByMonth(String mnCode, String month, String type) { |
| | | LocalDate date = LocalDate.parse(month); |
| | | if (date != null) { |
| | | return riskValueRep.select(mnCode, date, type); |
| | | date = date.withDayOfMonth(1); |
| | | return riskValueMapper.queryRiskDataByMonth(mnCode, date, type); |
| | | // return riskValueRep.select(mnCode, date, type); |
| | | } else { |
| | | return new ArrayList<>(); |
| | | } |
| | |
| | | id, mn_code, lst, online_risk, valid_risk, exceed_risk, exception_type_aggregation, |
| | | typical_exception_repetition_rate, type |
| | | </sql> |
| | | |
| | | <select id="queryRiskDataByMonth" resultType="com.flightfeather.monitor.pojo.RiskValuePojo"> |
| | | select b.name,a.* |
| | | 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} |
| | | </if> |
| | | |
| | | <if test="month != null"> |
| | | and a.lst = #{month} |
| | | </if> |
| | | |
| | | <if test="type != null and type != '' "> |
| | | and a.type = #{type} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |