| | |
| | | List<WarningDetail> selectByTimeForYj(@Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | List<WarningDetail> selectByTimeForBj(@Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | Double getLastYearVal(@Param("id") long id); |
| | | } |
| | |
| | | private double val; |
| | | |
| | | @ApiModelProperty(value = "去年数值") |
| | | private double lastVal; |
| | | private Double lastVal; |
| | | |
| | | @ApiModelProperty(value = "时间") |
| | | private String time; |
| | |
| | | public Report() { |
| | | } |
| | | |
| | | public Report(String name, double lon, double lat, double val, double lastVal, String time, double speed, String dir, double maxVal, double dis, String maxDir, int isSame) { |
| | | public Report(String name, double lon, double lat, double val, String time, double speed, String dir, double maxVal, double dis, String maxDir, int isSame) { |
| | | this.name = name; |
| | | this.lon = lon; |
| | | this.lat = lat; |
| | | this.val = val; |
| | | this.lastVal = lastVal; |
| | | this.time = time; |
| | | this.speed = speed; |
| | | this.dir = dir; |
| | |
| | | double speed2 = CalculateUtils.getWindSpeed(suMax.getV(), suMax.getU()); |
| | | double direction2 = CalculateUtils.getWindDirection(suMax.getV(), suMax.getU()); |
| | | String maxDir = CalculateUtils.getDir(angle); |
| | | int isSame = (Math.abs(direction1 - direction2) < 30 && Math.abs(speed1 - speed2) < 0.5) ? 1 : 0; |
| | | int isSame = (Math.abs(direction1 - direction2) <= 45 && Math.abs(speed1 - speed2) <= 0.5) ? 1 : 0; |
| | | |
| | | return new Report(wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), lastVal, time, |
| | | return new Report(wd.getLocationName(), c1.getX(), c1.getY(), wd.getValue(), time, |
| | | speed1, dir, maxVal, dis1, maxDir, isSame); |
| | | } |
| | | |
| | |
| | | this.val = val; |
| | | } |
| | | |
| | | public double getLastVal() { |
| | | public Double getLastVal() { |
| | | return lastVal; |
| | | } |
| | | |
| | | public void setLastVal(double lastVal) { |
| | | public void setLastVal(Double lastVal) { |
| | | this.lastVal = lastVal; |
| | | } |
| | | |
| | |
| | | //list.add(new WarningVo(wd.getLocationName(), wd.getSuYuanId(), 0.0, 0.0, wd.getValue(), time)); |
| | | |
| | | DistanceSuYuan suYuan = suYuanMapper.getSuYuanById(wd.getTableName(), wd.getSuYuanId()); |
| | | Double lastVal = warningDetailMapper.getLastYearVal(wd.getId()); |
| | | |
| | | int rows = suYuanMapper.isTableExists(wd.getTableName()); |
| | | DistanceSuYuan suMax = null; |
| | |
| | | } |
| | | |
| | | Report report = Report.calcReport(wd, suYuan, suMax); |
| | | report.setLastVal(lastVal); |
| | | |
| | | list.add(report); |
| | | } |
| | | |
| | |
| | | and value >= (select jcbj from rs) |
| | | order by value; |
| | | </select> |
| | | |
| | | <select id="getLastYearVal" resultType="java.lang.Double"> |
| | | with rs as ( |
| | | select su_yuan_id "id", date_sub(create_time, interval 1 year) "time" |
| | | from warning_detail where id = ${id}) |
| | | select format(value, 2) "val" |
| | | from warning_detail |
| | | where su_yuan_id = (select id from rs) and create_time = (select time from rs); |
| | | </select> |
| | | |
| | | <insert id="batchInsert"> |
| | | INSERT INTO warning_detail (table_name, su_yuan_id, location_name, type, create_time, value)VALUES |