| | |
| | | /** |
| | | * æ ¹æ®æ¶é´æ¥è¯¢ |
| | | * |
| | | * @param time æ¶é´ï¼ç¤ºä¾ï¼2023060514ï¼ |
| | | * @param startVal èµ·å§å¼ï¼å¯ä¸ºç©º) |
| | | * @param time æ¶é´ï¼ç¤ºä¾ï¼2023060514ï¼ |
| | | * @return |
| | | */ |
| | | public List<VocVals> selectByTime(@Param("time") String time, @Param("startVal") Double startVal); |
| | | public List<VocVals> selectByTime(@Param("time") String time); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¶é´ç»è®¡ |
| | |
| | | package com.yssh.entity; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.github.biyanwen.annotation.CsvProperty; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | public class VocVals implements Serializable { |
| | | private static final long serialVersionUID = -20230605145412000L; |
| | | |
| | | @JsonIgnore |
| | | @ApiModelProperty(value = "主é®") |
| | | private BigInteger id; |
| | | |
| | |
| | | @ApiModelProperty(value = "å¼") |
| | | private Double val; |
| | | |
| | | @JsonIgnore |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | |
| | | protected final Log logger = LogFactory.getLog(this.getClass()); |
| | | |
| | | @Override |
| | | public List<VocVals> selectByTime(String time, Double startVal) { |
| | | return vocValsMapper.selectByTime(time, startVal); |
| | | public List<VocVals> selectByTime(String time) { |
| | | return vocValsMapper.selectByTime(time); |
| | | } |
| | | |
| | | @Override |
| | |
| | | </resultMap> |
| | | |
| | | <select id="selectByTime" resultMap="selectMap"> |
| | | select * |
| | | select x, y, cast(val as decimal(12, 3)) "val" |
| | | from voc_vals |
| | | <where> |
| | | date_format(create_time, '%Y%m%d%H') = ${time} |
| | | <if test="startVal != null"> |
| | | and val > ${startVal} |
| | | </if> |
| | | </where> |
| | | where date_format(create_time, '%Y%m%d%H') = ${time} |
| | | and val > (select jcyj from alert_config); |
| | | </select> |
| | | |
| | | <select id="countByTime" resultType="java.lang.Integer"> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | ---------------------------------------------------------------------- |
| | | use yssh; |
| | | show tables; |
| | | |
| | | SHOW BINARY LOGS; |
| | | RESET MASTER; |
| | | ---------------------------------------------------------------------- |
| | | create table voc_vals ( |
| | | id bigint not null primary key comment '主é®', |
| | | x int comment 'X', |
| | | y int comment 'Y', |
| | | val double(25, 10) comment 'å¼', |
| | | create_time datetime comment 'å¼' |
| | | ); |
| | | -- drop table voc_vals; |
| | | create index voc_vals_val on voc_vals (val); |
| | | create index voc_vals_time on voc_vals (create_time); |
| | | ---------------------------------------------------------------------- |
| | | /* select a.*, date_format(create_time, '%Y%m%d%H') "time" from voc_vals a where date_format(create_time, '%Y%m%d%H') = '2023060514'; |
| | | select * from voc_vals where create_time < date_sub(now(), interval 1 year); |
| | | select date_sub(now(), interval 1 year) "time" from dual; |
| | | select count(*) from voc_vals; */ |
| | | |
| | | select * from voc_vals; |