<?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.MonDevBlHourMapper">

    <resultMap type="cn.cecep.talroad.domain.MonDevBlHour" id="MonDevBlHourResult">
        <result property="dataId"    column="data_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="deviceId"    column="device_id"    />
        <result property="timeType"    column="time_type"    />
        <result property="dataTime"    column="data_time"    />
        <result property="bs100"    column="bs100"    />
        <result property="bs101"    column="bs101"    />
        <result property="bs102"    column="bs102"    />
        <result property="bs103"    column="bs103"    />
        <result property="bs104"    column="bs104"    />
        <result property="bs105"    column="bs105"    />
        <result property="bs106"    column="bs106"    />
        <result property="bs107"    column="bs107"    />
        <result property="bz100"    column="bz100"    />
        <result property="bz101"    column="bz101"    />
        <result property="bz102"    column="bz102"    />
        <result property="bz103"    column="bz103"    />
        <result property="bz104"    column="bz104"    />
        <result property="bz105"    column="bz105"    />
        <result property="bz106"    column="bz106"    />
        <result property="bz107"    column="bz107"    />
        <result property="bz108"    column="bz108"    />
        <result property="bz109"    column="bz109"    />
        <result property="bz110"    column="bz110"    />
        <result property="bz111"    column="bz111"    />
        <result property="bz112"    column="bz112"    />
        <result property="g140"    column="g140"    />
        <result property="g141"    column="g141"    />
        <result property="g313"    column="g313"    />
        <result property="g314"    column="g314"    />
        <result property="g329"    column="g329"    />
        <result property="g501"    column="g501"    />
        <result property="g502"    column="g502"    />
        <result property="g604"    column="g604"    />
        <result property="g605"    column="g605"    />
        <result property="g983"    column="g983"    />
        <result property="g984"    column="g984"    />
        <result property="g985"    column="g985"    />
        <result property="g986"    column="g986"    />
        <result property="gb08"    column="gb08"    />
        <result property="gb09"    column="gb09"    />
        <result property="addiParam"    column="addi_param"    />
        <result property="updateTime"    column="update_time"    />
        <result property="createTime"    column="create_time"    />
    </resultMap>


    <sql id="selectMonDevBlHourVo">
        select data_id, factory_id, device_id, time_type, data_time, bs100, bs101, bs102, bs103, bs104, bs105, bs106, bs107, bz100, bz101, bz102, bz103, bz104, bz105, bz106, bz107, bz108, bz109, bz110, bz111, bz112, g140, g141, g313, g314, g329, g501, g502, g604, g605, g983, g984, g985, g986, gb08, gb09, addi_param, update_time, create_time from mon_dev_bl_hour
    </sql>

    <select id="selectMonDevBlHourList" parameterType="cn.cecep.talroad.domain.MonDevBlHour" resultMap="MonDevBlHourResult">
        <include refid="selectMonDevBlHourVo"/>
        <where>
            <if test="factoryId != null "> and factory_id = #{factoryId}</if>
            <if test="deviceId != null  and deviceId != ''"> and device_id = #{deviceId}</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="bs100 != null  and bs100 != ''"> and bs100 = #{bs100}</if>
            <if test="bs101 != null  and bs101 != ''"> and bs101 = #{bs101}</if>
            <if test="bs102 != null  and bs102 != ''"> and bs102 = #{bs102}</if>
            <if test="bs103 != null  and bs103 != ''"> and bs103 = #{bs103}</if>
            <if test="bs104 != null  and bs104 != ''"> and bs104 = #{bs104}</if>
            <if test="bs105 != null  and bs105 != ''"> and bs105 = #{bs105}</if>
            <if test="bs106 != null  and bs106 != ''"> and bs106 = #{bs106}</if>
            <if test="bs107 != null  and bs107 != ''"> and bs107 = #{bs107}</if>
            <if test="bz100 != null  and bz100 != ''"> and bz100 = #{bz100}</if>
            <if test="bz101 != null  and bz101 != ''"> and bz101 = #{bz101}</if>
            <if test="bz102 != null  and bz102 != ''"> and bz102 = #{bz102}</if>
            <if test="bz103 != null  and bz103 != ''"> and bz103 = #{bz103}</if>
            <if test="bz104 != null  and bz104 != ''"> and bz104 = #{bz104}</if>
            <if test="bz105 != null  and bz105 != ''"> and bz105 = #{bz105}</if>
            <if test="bz106 != null  and bz106 != ''"> and bz106 = #{bz106}</if>
            <if test="bz107 != null  and bz107 != ''"> and bz107 = #{bz107}</if>
            <if test="bz108 != null  and bz108 != ''"> and bz108 = #{bz108}</if>
            <if test="bz109 != null  and bz109 != ''"> and bz109 = #{bz109}</if>
            <if test="bz110 != null  and bz110 != ''"> and bz110 = #{bz110}</if>
            <if test="bz111 != null  and bz111 != ''"> and bz111 = #{bz111}</if>
            <if test="bz112 != null  and bz112 != ''"> and bz112 = #{bz112}</if>
            <if test="g140 != null  and g140 != ''"> and g140 = #{g140}</if>
            <if test="g141 != null  and g141 != ''"> and g141 = #{g141}</if>
            <if test="g313 != null  and g313 != ''"> and g313 = #{g313}</if>
            <if test="g314 != null  and g314 != ''"> and g314 = #{g314}</if>
            <if test="g329 != null  and g329 != ''"> and g329 = #{g329}</if>
            <if test="g501 != null  and g501 != ''"> and g501 = #{g501}</if>
            <if test="g502 != null  and g502 != ''"> and g502 = #{g502}</if>
            <if test="g604 != null  and g604 != ''"> and g604 = #{g604}</if>
            <if test="g605 != null  and g605 != ''"> and g605 = #{g605}</if>
            <if test="g983 != null  and g983 != ''"> and g983 = #{g983}</if>
            <if test="g984 != null  and g984 != ''"> and g984 = #{g984}</if>
            <if test="g985 != null  and g985 != ''"> and g985 = #{g985}</if>
            <if test="g986 != null  and g986 != ''"> and g986 = #{g986}</if>
            <if test="gb08 != null  and gb08 != ''"> and gb08 = #{gb08}</if>
            <if test="gb09 != null  and gb09 != ''"> and gb09 = #{gb09}</if>
            <if test="addiParam != null  and addiParam != ''"> and addi_param = #{addiParam}</if>
        </where>
    </select>
    <select id="getDataPage" resultType="cn.cecep.talroad.vo.MonDevBlVO">
        SELECT r.*, d.name
        from mon_dev_bl_hour r
                 LEFT JOIN bas_device d on r.device_id = d.device_id
            ${ew.customSqlSegment}
    </select>

</mapper>
