燕山石化溯源三维电子沙盘-【后端】-服务
13693261870
2023-06-06 4a4179b19501059168bd2d725bf6294708c99ec3
src/main/resources/mapping/VocValsMapper.xml
@@ -7,13 +7,15 @@
        <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">
@@ -22,6 +24,20 @@
        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});