<?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="cn.cecep.talroad.mapper.MonElecEventMapper">

    <resultMap type="cn.cecep.talroad.domain.MonElecEvent" id="MonElecEventResult">
        <result property="dataId"    column="data_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="siteId"    column="site_id"    />
        <result property="timeType"    column="time_type"    />
        <result property="dataTime"    column="data_time"    />
        <result property="tn50"    column="tn50"    />
        <result property="tn62"    column="tn62"    />
        <result property="tn63"    column="tn63"    />
        <result property="tn64"    column="tn64"    />
        <result property="tn65"    column="tn65"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>


    <sql id="selectMonElecEventVo">
        select data_id, factory_id, site_id, time_type, data_time, tn50, tn62, tn63, tn64, tn65, create_time from mon_elec_event
    </sql>

    <select id="selectMonElecEventList" parameterType="cn.cecep.talroad.domain.MonElecEvent" resultMap="MonElecEventResult">
        <include refid="selectMonElecEventVo"/>
        <where>
            <if test="dataId != null "> and data_id = #{dataId}</if>
            <if test="factoryId != null "> and factory_id = #{factoryId}</if>
            <if test="siteId != null  and siteId != ''"> and site_id = #{siteId}</if>
            <if test="timeType != null  and timeType != ''"> and time_type = #{timeType}</if>
            <if test="dataTime != null  and dataTime != ''"> and data_time = #{dataTime}</if>
            <if test="tn50 != null "> and tn50 = #{tn50}</if>
            <if test="tn62 != null "> and tn62 = #{tn62}</if>
            <if test="tn63 != null  and tn63 != ''"> and tn63 = #{tn63}</if>
            <if test="tn64 != null  and tn64 != ''"> and tn64 = #{tn64}</if>
            <if test="tn65 != null "> and tn65 = #{tn65}</if>
        </where>
    </select>

</mapper>
