Newer
Older
smartwell_demos / src / main / resources / mapper / DataPressureMapper.xml
chaizhuang on 24 Sep 2022 985 bytes 硫化氢新增
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.casic.dao.DataPressureMapper">

    <select id="getRuleValue" resultType="Float">
        SELECT  HIGH_VALUE
        FROM    ALARM_LEVEL
        WHERE   DEVICE_TYPE=#{deviceType}
        AND    level=1
    </select>

    <select id="getWellCode" resultType="String">
        SELECT  well_code
        FROM bus_device bd
        JOIN bus_device_well bdw ON bdw.device_id=bd.id
        JOIN bus_well_info bwi ON bwi.id=bdw.well_id
       WHERE  bd.DEVCODE=#{devcode}
    </select>


    <insert id="saveRecords">
         INSERT INTO ALARM_RECORDS(DEVICE_ID, DEVCODE, WELL_CODE, ALARM_TYPE,ALARM_CONTENT,ALARM_VALUE,ALARM_TIME,ALARM_MSG,STATUS )
         VALUES ( '1', '89860423192180035458', 'test003', '1', '压力超标',#{reValue},#{alarmTime},'压力超标','1')
    </insert>

</mapper>