<?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.xzzn.ems.mapper.EmsCoolingAlarmDataMapper">

    <resultMap type="EmsCoolingAlarmData" id="EmsCoolingAlarmDataResult">
        <result property="id"    column="id"    />
        <result property="dataTimestamp"    column="data_timestamp"    />
        <result property="siteId"    column="site_id"    />
        <result property="deviceId"    column="device_id"    />
        <result property="lsjyx"    column="lsjyx"    />
        <result property="pqdcfyx"    column="pqdcfyx"    />
        <result property="djrq2yx"    column="djrq2yx"    />
        <result property="djrq1yx"    column="djrq1yx"    />
        <result property="bqbyx"    column="bqbyx"    />
        <result property="bsbyx"    column="bsbyx"    />
        <result property="zxhbyx"    column="zxhbyx"    />
        <result property="sltzgz"    column="sltzgz"    />
        <result property="slzhyj"    column="slzhyj"    />
        <result property="slxtyctzxh"    column="slxtyctzxh"    />
        <result property="slxtycqdxh"    column="slxtycqdxh"    />
        <result property="slxtyckz"    column="slxtyckz"    />
        <result property="slxtbdkz"    column="slxtbdkz"    />
        <result property="slxtzdms"    column="slxtzdms"    />
        <result property="slxtsdms"    column="slxtsdms"    />
        <result property="hsylcdyj"    column="hsylcdyj"    />
        <result property="hsyldyj"    column="hsyldyj"    />
        <result property="gsylcgyj"    column="gsylcgyj"    />
        <result property="gsylgyj"    column="gsylgyj"    />
        <result property="gsylcdyj"    column="gsylcdyj"    />
        <result property="gsyldyj"    column="gsyldyj"    />
        <result property="hcgywg"    column="hcgywg"    />
        <result property="hcgywcdtz"    column="hcgywcdtz"    />
        <result property="hcgywd"    column="hcgywd"    />
        <result property="hcgylg"    column="hcgylg"    />
        <result property="hcgyld"    column="hcgyld"    />
        <result property="lysylgyj"    column="lysylgyj"    />
        <result property="lysyldyj"    column="lysyldyj"    />
        <result property="hswdcgyj"    column="hswdcgyj"    />
        <result property="hswdgyj"    column="hswdgyj"    />
        <result property="gswdcgtz"    column="gswdcgtz"    />
        <result property="gswdgyj"    column="gswdgyj"    />
        <result property="gswddyj"    column="gswddyj"    />
        <result property="ddf2gz"    column="ddf2gz"    />
        <result property="ddf1gz"    column="ddf1gz"    />
        <result property="lyswdbsqyJ"    column="lyswdbsqyJ"    />
        <result property="hsylbsqyJ"    column="hsylbsqyJ"    />
        <result property="gsylbsqyJ"    column="gsylbsqyJ"    />
        <result property="hswdbsqyJ"    column="hswdbsqyJ"    />
        <result property="gswdbsqgztz"    column="gswdbsqgztz"    />
        <result property="lsjgz"    column="lsjgz"    />
        <result property="djrq2gz"    column="djrq2gz"    />
        <result property="djrq1gz"    column="djrq1gz"    />
        <result property="bqbgz"    column="bqbgz"    />
        <result property="bsbgz"    column="bsbgz"    />
        <result property="xhbgz"    column="xhbgz"    />
        <result property="zdygz"    column="zdygz"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="remark"    column="remark"    />
    </resultMap>

    <sql id="selectEmsCoolingAlarmDataVo">
        select id, data_timestamp, site_id, device_id, lsjyx, pqdcfyx, djrq2yx, djrq1yx, bqbyx, bsbyx, zxhbyx, sltzgz, slzhyj, slxtyctzxh, slxtycqdxh, slxtyckz, slxtbdkz, slxtzdms, slxtsdms, hsylcdyj, hsyldyj, gsylcgyj, gsylgyj, gsylcdyj, gsyldyj, hcgywg, hcgywcdtz, hcgywd, hcgylg, hcgyld, lysylgyj, lysyldyj, hswdcgyj, hswdgyj, gswdcgtz, gswdgyj, gswddyj, ddf2gz, ddf1gz, lyswdbsqyJ, hsylbsqyJ, gsylbsqyJ, hswdbsqyJ, gswdbsqgztz, lsjgz, djrq2gz, djrq1gz, bqbgz, bsbgz, xhbgz, zdygz, create_by, create_time, update_by, update_time, remark from ems_cooling_alarm_data
    </sql>

    <select id="selectEmsCoolingAlarmDataList" parameterType="EmsCoolingAlarmData" resultMap="EmsCoolingAlarmDataResult">
        <include refid="selectEmsCoolingAlarmDataVo"/>
        <where>
            <if test="dataTimestamp != null "> and data_timestamp = #{dataTimestamp}</if>
            <if test="siteId != null  and siteId != ''"> and site_id = #{siteId}</if>
            <if test="deviceId != null  and deviceId != ''"> and device_id = #{deviceId}</if>
            <if test="lsjyx != null "> and lsjyx = #{lsjyx}</if>
            <if test="pqdcfyx != null "> and pqdcfyx = #{pqdcfyx}</if>
            <if test="djrq2yx != null "> and djrq2yx = #{djrq2yx}</if>
            <if test="djrq1yx != null "> and djrq1yx = #{djrq1yx}</if>
            <if test="bqbyx != null "> and bqbyx = #{bqbyx}</if>
            <if test="bsbyx != null "> and bsbyx = #{bsbyx}</if>
            <if test="zxhbyx != null "> and zxhbyx = #{zxhbyx}</if>
            <if test="sltzgz != null "> and sltzgz = #{sltzgz}</if>
            <if test="slzhyj != null "> and slzhyj = #{slzhyj}</if>
            <if test="slxtyctzxh != null "> and slxtyctzxh = #{slxtyctzxh}</if>
            <if test="slxtycqdxh != null "> and slxtycqdxh = #{slxtycqdxh}</if>
            <if test="slxtyckz != null "> and slxtyckz = #{slxtyckz}</if>
            <if test="slxtbdkz != null "> and slxtbdkz = #{slxtbdkz}</if>
            <if test="slxtzdms != null "> and slxtzdms = #{slxtzdms}</if>
            <if test="slxtsdms != null "> and slxtsdms = #{slxtsdms}</if>
            <if test="hsylcdyj != null "> and hsylcdyj = #{hsylcdyj}</if>
            <if test="hsyldyj != null "> and hsyldyj = #{hsyldyj}</if>
            <if test="gsylcgyj != null "> and gsylcgyj = #{gsylcgyj}</if>
            <if test="gsylgyj != null "> and gsylgyj = #{gsylgyj}</if>
            <if test="gsylcdyj != null "> and gsylcdyj = #{gsylcdyj}</if>
            <if test="gsyldyj != null "> and gsyldyj = #{gsyldyj}</if>
            <if test="hcgywg != null "> and hcgywg = #{hcgywg}</if>
            <if test="hcgywcdtz != null "> and hcgywcdtz = #{hcgywcdtz}</if>
            <if test="hcgywd != null "> and hcgywd = #{hcgywd}</if>
            <if test="hcgylg != null "> and hcgylg = #{hcgylg}</if>
            <if test="hcgyld != null "> and hcgyld = #{hcgyld}</if>
            <if test="lysylgyj != null "> and lysylgyj = #{lysylgyj}</if>
            <if test="lysyldyj != null "> and lysyldyj = #{lysyldyj}</if>
            <if test="hswdcgyj != null "> and hswdcgyj = #{hswdcgyj}</if>
            <if test="hswdgyj != null "> and hswdgyj = #{hswdgyj}</if>
            <if test="gswdcgtz != null "> and gswdcgtz = #{gswdcgtz}</if>
            <if test="gswdgyj != null "> and gswdgyj = #{gswdgyj}</if>
            <if test="gswddyj != null "> and gswddyj = #{gswddyj}</if>
            <if test="ddf2gz != null "> and ddf2gz = #{ddf2gz}</if>
            <if test="ddf1gz != null "> and ddf1gz = #{ddf1gz}</if>
            <if test="lyswdbsqyJ != null "> and lyswdbsqyJ = #{lyswdbsqyJ}</if>
            <if test="hsylbsqyJ != null "> and hsylbsqyJ = #{hsylbsqyJ}</if>
            <if test="gsylbsqyJ != null "> and gsylbsqyJ = #{gsylbsqyJ}</if>
            <if test="hswdbsqyJ != null "> and hswdbsqyJ = #{hswdbsqyJ}</if>
            <if test="gswdbsqgztz != null "> and gswdbsqgztz = #{gswdbsqgztz}</if>
            <if test="lsjgz != null "> and lsjgz = #{lsjgz}</if>
            <if test="djrq2gz != null "> and djrq2gz = #{djrq2gz}</if>
            <if test="djrq1gz != null "> and djrq1gz = #{djrq1gz}</if>
            <if test="bqbgz != null "> and bqbgz = #{bqbgz}</if>
            <if test="bsbgz != null "> and bsbgz = #{bsbgz}</if>
            <if test="xhbgz != null "> and xhbgz = #{xhbgz}</if>
            <if test="zdygz != null "> and zdygz = #{zdygz}</if>
        </where>
    </select>

    <select id="selectEmsCoolingAlarmDataById" parameterType="Long" resultMap="EmsCoolingAlarmDataResult">
        <include refid="selectEmsCoolingAlarmDataVo"/>
        where id = #{id}
    </select>

    <insert id="insertEmsCoolingAlarmData" parameterType="EmsCoolingAlarmData" useGeneratedKeys="true" keyProperty="id">
        insert into ems_cooling_alarm_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="dataTimestamp != null">data_timestamp,</if>
            <if test="siteId != null and siteId != ''">site_id,</if>
            <if test="deviceId != null and deviceId != ''">device_id,</if>
            <if test="lsjyx != null">lsjyx,</if>
            <if test="pqdcfyx != null">pqdcfyx,</if>
            <if test="djrq2yx != null">djrq2yx,</if>
            <if test="djrq1yx != null">djrq1yx,</if>
            <if test="bqbyx != null">bqbyx,</if>
            <if test="bsbyx != null">bsbyx,</if>
            <if test="zxhbyx != null">zxhbyx,</if>
            <if test="sltzgz != null">sltzgz,</if>
            <if test="slzhyj != null">slzhyj,</if>
            <if test="slxtyctzxh != null">slxtyctzxh,</if>
            <if test="slxtycqdxh != null">slxtycqdxh,</if>
            <if test="slxtyckz != null">slxtyckz,</if>
            <if test="slxtbdkz != null">slxtbdkz,</if>
            <if test="slxtzdms != null">slxtzdms,</if>
            <if test="slxtsdms != null">slxtsdms,</if>
            <if test="hsylcdyj != null">hsylcdyj,</if>
            <if test="hsyldyj != null">hsyldyj,</if>
            <if test="gsylcgyj != null">gsylcgyj,</if>
            <if test="gsylgyj != null">gsylgyj,</if>
            <if test="gsylcdyj != null">gsylcdyj,</if>
            <if test="gsyldyj != null">gsyldyj,</if>
            <if test="hcgywg != null">hcgywg,</if>
            <if test="hcgywcdtz != null">hcgywcdtz,</if>
            <if test="hcgywd != null">hcgywd,</if>
            <if test="hcgylg != null">hcgylg,</if>
            <if test="hcgyld != null">hcgyld,</if>
            <if test="lysylgyj != null">lysylgyj,</if>
            <if test="lysyldyj != null">lysyldyj,</if>
            <if test="hswdcgyj != null">hswdcgyj,</if>
            <if test="hswdgyj != null">hswdgyj,</if>
            <if test="gswdcgtz != null">gswdcgtz,</if>
            <if test="gswdgyj != null">gswdgyj,</if>
            <if test="gswddyj != null">gswddyj,</if>
            <if test="ddf2gz != null">ddf2gz,</if>
            <if test="ddf1gz != null">ddf1gz,</if>
            <if test="lyswdbsqyJ != null">lyswdbsqyJ,</if>
            <if test="hsylbsqyJ != null">hsylbsqyJ,</if>
            <if test="gsylbsqyJ != null">gsylbsqyJ,</if>
            <if test="hswdbsqyJ != null">hswdbsqyJ,</if>
            <if test="gswdbsqgztz != null">gswdbsqgztz,</if>
            <if test="lsjgz != null">lsjgz,</if>
            <if test="djrq2gz != null">djrq2gz,</if>
            <if test="djrq1gz != null">djrq1gz,</if>
            <if test="bqbgz != null">bqbgz,</if>
            <if test="bsbgz != null">bsbgz,</if>
            <if test="xhbgz != null">xhbgz,</if>
            <if test="zdygz != null">zdygz,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="dataTimestamp != null">#{dataTimestamp},</if>
            <if test="siteId != null and siteId != ''">#{siteId},</if>
            <if test="deviceId != null and deviceId != ''">#{deviceId},</if>
            <if test="lsjyx != null">#{lsjyx},</if>
            <if test="pqdcfyx != null">#{pqdcfyx},</if>
            <if test="djrq2yx != null">#{djrq2yx},</if>
            <if test="djrq1yx != null">#{djrq1yx},</if>
            <if test="bqbyx != null">#{bqbyx},</if>
            <if test="bsbyx != null">#{bsbyx},</if>
            <if test="zxhbyx != null">#{zxhbyx},</if>
            <if test="sltzgz != null">#{sltzgz},</if>
            <if test="slzhyj != null">#{slzhyj},</if>
            <if test="slxtyctzxh != null">#{slxtyctzxh},</if>
            <if test="slxtycqdxh != null">#{slxtycqdxh},</if>
            <if test="slxtyckz != null">#{slxtyckz},</if>
            <if test="slxtbdkz != null">#{slxtbdkz},</if>
            <if test="slxtzdms != null">#{slxtzdms},</if>
            <if test="slxtsdms != null">#{slxtsdms},</if>
            <if test="hsylcdyj != null">#{hsylcdyj},</if>
            <if test="hsyldyj != null">#{hsyldyj},</if>
            <if test="gsylcgyj != null">#{gsylcgyj},</if>
            <if test="gsylgyj != null">#{gsylgyj},</if>
            <if test="gsylcdyj != null">#{gsylcdyj},</if>
            <if test="gsyldyj != null">#{gsyldyj},</if>
            <if test="hcgywg != null">#{hcgywg},</if>
            <if test="hcgywcdtz != null">#{hcgywcdtz},</if>
            <if test="hcgywd != null">#{hcgywd},</if>
            <if test="hcgylg != null">#{hcgylg},</if>
            <if test="hcgyld != null">#{hcgyld},</if>
            <if test="lysylgyj != null">#{lysylgyj},</if>
            <if test="lysyldyj != null">#{lysyldyj},</if>
            <if test="hswdcgyj != null">#{hswdcgyj},</if>
            <if test="hswdgyj != null">#{hswdgyj},</if>
            <if test="gswdcgtz != null">#{gswdcgtz},</if>
            <if test="gswdgyj != null">#{gswdgyj},</if>
            <if test="gswddyj != null">#{gswddyj},</if>
            <if test="ddf2gz != null">#{ddf2gz},</if>
            <if test="ddf1gz != null">#{ddf1gz},</if>
            <if test="lyswdbsqyJ != null">#{lyswdbsqyJ},</if>
            <if test="hsylbsqyJ != null">#{hsylbsqyJ},</if>
            <if test="gsylbsqyJ != null">#{gsylbsqyJ},</if>
            <if test="hswdbsqyJ != null">#{hswdbsqyJ},</if>
            <if test="gswdbsqgztz != null">#{gswdbsqgztz},</if>
            <if test="lsjgz != null">#{lsjgz},</if>
            <if test="djrq2gz != null">#{djrq2gz},</if>
            <if test="djrq1gz != null">#{djrq1gz},</if>
            <if test="bqbgz != null">#{bqbgz},</if>
            <if test="bsbgz != null">#{bsbgz},</if>
            <if test="xhbgz != null">#{xhbgz},</if>
            <if test="zdygz != null">#{zdygz},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
        </trim>
    </insert>

    <update id="updateEmsCoolingAlarmData" parameterType="EmsCoolingAlarmData">
        update ems_cooling_alarm_data
        <trim prefix="SET" suffixOverrides=",">
            <if test="dataTimestamp != null">data_timestamp = #{dataTimestamp},</if>
            <if test="siteId != null and siteId != ''">site_id = #{siteId},</if>
            <if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
            <if test="lsjyx != null">lsjyx = #{lsjyx},</if>
            <if test="pqdcfyx != null">pqdcfyx = #{pqdcfyx},</if>
            <if test="djrq2yx != null">djrq2yx = #{djrq2yx},</if>
            <if test="djrq1yx != null">djrq1yx = #{djrq1yx},</if>
            <if test="bqbyx != null">bqbyx = #{bqbyx},</if>
            <if test="bsbyx != null">bsbyx = #{bsbyx},</if>
            <if test="zxhbyx != null">zxhbyx = #{zxhbyx},</if>
            <if test="sltzgz != null">sltzgz = #{sltzgz},</if>
            <if test="slzhyj != null">slzhyj = #{slzhyj},</if>
            <if test="slxtyctzxh != null">slxtyctzxh = #{slxtyctzxh},</if>
            <if test="slxtycqdxh != null">slxtycqdxh = #{slxtycqdxh},</if>
            <if test="slxtyckz != null">slxtyckz = #{slxtyckz},</if>
            <if test="slxtbdkz != null">slxtbdkz = #{slxtbdkz},</if>
            <if test="slxtzdms != null">slxtzdms = #{slxtzdms},</if>
            <if test="slxtsdms != null">slxtsdms = #{slxtsdms},</if>
            <if test="hsylcdyj != null">hsylcdyj = #{hsylcdyj},</if>
            <if test="hsyldyj != null">hsyldyj = #{hsyldyj},</if>
            <if test="gsylcgyj != null">gsylcgyj = #{gsylcgyj},</if>
            <if test="gsylgyj != null">gsylgyj = #{gsylgyj},</if>
            <if test="gsylcdyj != null">gsylcdyj = #{gsylcdyj},</if>
            <if test="gsyldyj != null">gsyldyj = #{gsyldyj},</if>
            <if test="hcgywg != null">hcgywg = #{hcgywg},</if>
            <if test="hcgywcdtz != null">hcgywcdtz = #{hcgywcdtz},</if>
            <if test="hcgywd != null">hcgywd = #{hcgywd},</if>
            <if test="hcgylg != null">hcgylg = #{hcgylg},</if>
            <if test="hcgyld != null">hcgyld = #{hcgyld},</if>
            <if test="lysylgyj != null">lysylgyj = #{lysylgyj},</if>
            <if test="lysyldyj != null">lysyldyj = #{lysyldyj},</if>
            <if test="hswdcgyj != null">hswdcgyj = #{hswdcgyj},</if>
            <if test="hswdgyj != null">hswdgyj = #{hswdgyj},</if>
            <if test="gswdcgtz != null">gswdcgtz = #{gswdcgtz},</if>
            <if test="gswdgyj != null">gswdgyj = #{gswdgyj},</if>
            <if test="gswddyj != null">gswddyj = #{gswddyj},</if>
            <if test="ddf2gz != null">ddf2gz = #{ddf2gz},</if>
            <if test="ddf1gz != null">ddf1gz = #{ddf1gz},</if>
            <if test="lyswdbsqyJ != null">lyswdbsqyJ = #{lyswdbsqyJ},</if>
            <if test="hsylbsqyJ != null">hsylbsqyJ = #{hsylbsqyJ},</if>
            <if test="gsylbsqyJ != null">gsylbsqyJ = #{gsylbsqyJ},</if>
            <if test="hswdbsqyJ != null">hswdbsqyJ = #{hswdbsqyJ},</if>
            <if test="gswdbsqgztz != null">gswdbsqgztz = #{gswdbsqgztz},</if>
            <if test="lsjgz != null">lsjgz = #{lsjgz},</if>
            <if test="djrq2gz != null">djrq2gz = #{djrq2gz},</if>
            <if test="djrq1gz != null">djrq1gz = #{djrq1gz},</if>
            <if test="bqbgz != null">bqbgz = #{bqbgz},</if>
            <if test="bsbgz != null">bsbgz = #{bsbgz},</if>
            <if test="xhbgz != null">xhbgz = #{xhbgz},</if>
            <if test="zdygz != null">zdygz = #{zdygz},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteEmsCoolingAlarmDataById" parameterType="Long">
        delete from ems_cooling_alarm_data where id = #{id}
    </delete>

    <delete id="deleteEmsCoolingAlarmDataByIds" parameterType="String">
        delete from ems_cooling_alarm_data where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>