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

    <resultMap type="cn.cecep.talroad.domain.BasParam" id="BasParamResult">
        <result property="paramId"    column="param_id"    />
        <result property="paramIdNew"    column="param_id_new"    />
        <result property="paramCodeSvc"    column="param_code_svc"    />
        <result property="name"    column="name"    />
        <result property="paramType"    column="param_type"    />
        <result property="dataTypeJava"    column="data_type_java"    />
        <result property="industry"    column="industry"    />
        <result property="deviceType"    column="device_type"    />
        <result property="facilityType"    column="facility_type"    />
        <result property="facilityName"    column="facility_name"    />
        <result property="unitReal"    column="unit_real"    />
        <result property="unitStat"    column="unit_stat"    />
        <result property="scale"    column="scale"    />
        <result property="statMinValue"    column="stat_min_value"    />
        <result property="statMaxValue"    column="stat_max_value"    />
        <result property="overMaxVal"    column="over_max_val"    />
        <result property="stopValue"    column="stop_value"    />
        <result property="stopValueMemo"    column="stop_value_memo"    />
        <result property="isChkSame"    column="is_chk_same"    />
        <result property="isChkAbnormal"    column="is_chk_abnormal"    />
        <result property="showOrder"    column="show_order"    />
        <result property="createTime"    column="create_time"    />
        <result property="status"    column="status"    />
        <result property="minWidth"    column="min_width"    />
    </resultMap>


    <sql id="selectBasParamVo">
        select param_id, param_id_new, param_code_svc, name, param_type, data_type_java, industry, device_type, facility_type, facility_name, unit_real, unit_stat, scale, stat_min_value, stat_max_value, over_max_val, stop_value, stop_value_memo, is_chk_same, is_chk_abnormal, show_order, create_time, status, min_width from bas_param
    </sql>

    <select id="selectBasParamList" parameterType="cn.cecep.talroad.domain.BasParam" resultMap="BasParamResult">
        <include refid="selectBasParamVo"/>
        <where>
            <if test="paramIdNew != null  and paramIdNew != ''"> and param_id_new = #{paramIdNew}</if>
            <if test="paramCodeSvc != null  and paramCodeSvc != ''"> and param_code_svc = #{paramCodeSvc}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="paramType != null  and paramType != ''"> and param_type = #{paramType}</if>
            <if test="dataTypeJava != null  and dataTypeJava != ''"> and data_type_java = #{dataTypeJava}</if>
            <if test="facilityName != null  and facilityName != ''"> and facility_name like concat('%', #{facilityName}, '%')</if>
            <if test="unitReal != null  and unitReal != ''"> and unit_real = #{unitReal}</if>
            <if test="unitStat != null  and unitStat != ''"> and unit_stat = #{unitStat}</if>
            <if test="scale != null "> and scale = #{scale}</if>
            <if test="statMinValue != null  and statMinValue != ''"> and stat_min_value = #{statMinValue}</if>
            <if test="statMaxValue != null  and statMaxValue != ''"> and stat_max_value = #{statMaxValue}</if>
            <if test="overMaxVal != null  and overMaxVal != ''"> and over_max_val = #{overMaxVal}</if>
            <if test="stopValue != null  and stopValue != ''"> and stop_value = #{stopValue}</if>
            <if test="stopValueMemo != null  and stopValueMemo != ''"> and stop_value_memo = #{stopValueMemo}</if>
            <if test="isChkSame != null "> and is_chk_same = #{isChkSame}</if>
            <if test="isChkAbnormal != null "> and is_chk_abnormal = #{isChkAbnormal}</if>
            <if test="showOrder != null "> and show_order = #{showOrder}</if>
            <if test="status != null "> and status = #{status}</if>
            <if test="minWidth != null "> and min_width = #{minWidth}</if>
        </where>
    </select>

</mapper>
