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

    <resultMap type="cn.cecep.talroad.domain.SMainDynamicControlFactory" id="SMainDynamicControlFactoryResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="outletId"    column="outlet_id"    />
        <result property="controlTypeCode"    column="control_type_code"    />
        <result property="measuredValue"    column="measured_value"    />
        <result property="standardValue"    column="standard_value"    />
    </resultMap>


    <sql id="selectSMainDynamicControlFactoryVo">
        select id, factory_id, outlet_id, control_type_code, measured_value, standard_value from s_main_dynamic_control_factory
    </sql>

    <select id="selectSMainDynamicControlFactoryList" parameterType="cn.cecep.talroad.domain.SMainDynamicControlFactory" resultMap="SMainDynamicControlFactoryResult">
        <include refid="selectSMainDynamicControlFactoryVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="outletId != null  and outletId != ''"> and outlet_id = #{outletId}</if>
            <if test="controlTypeCode != null  and controlTypeCode != ''"> and control_type_code = #{controlTypeCode}</if>
            <if test="measuredValue != null  and measuredValue != ''"> and measured_value = #{measuredValue}</if>
            <if test="standardValue != null  and standardValue != ''"> and standard_value = #{standardValue}</if>
        </where>
    </select>

</mapper>
