| | |
| | | <result property="y" column="y" /> |
| | | <result property="val" column="val" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="addr" column="addr" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectByTime" resultMap="selectMap"> |
| | | select x, y, format(val, 2) "val" |
| | | from voc_vals |
| | | where date_format(create_time, '%Y%m%d%H') = ${time} |
| | | and val > (select jcyj from alert_config); |
| | | select a.x, a.y, format(a.val, 2) "val", b.addr |
| | | from voc_vals a inner join voc_addr b |
| | | on a.x = b.x and a.y = b.y |
| | | where date_format(a.create_time, '%Y%m%d%H') = ${time} |
| | | and a.val > (select jcyj from alert_config); |
| | | </select> |
| | | |
| | | <select id="countByTime" resultType="java.lang.Integer"> |
| | |
| | | where date_format(create_time, '%Y%m%d%H') = ${time}; |
| | | </select> |
| | | |
| | | <select id="selectCoords" resultType="com.yssh.entity.VocCoords"> |
| | | select x, y, addr |
| | | from voc_addr |
| | | <where> |
| | | 1 = 1 |
| | | <if test="x != null"> |
| | | and x = ${x} |
| | | </if> |
| | | <if test="y != null"> |
| | | and y = ${y} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <insert id="insert" parameterType="com.yssh.entity.VocVals" useGeneratedKeys="false" keyProperty="id"> |
| | | insert into voc_vals (id, x, y, val, create_time) values |
| | | (${id}, ${x}, ${y}, ${val}, ${createTime}); |