<?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.analysis.SRaControlSchemeMapper">

    <resultMap type="cn.cecep.talroad.domain.analysis.SRaControlScheme" id="SRaControlSchemeResult">
        <result property="schemeId"    column="scheme_id"    />
        <result property="schemeName"    column="scheme_name"    />
        <result property="warningLevel"    column="warning_level"    />
        <result property="controlMeasures"    column="control_measures"    />
        <result property="controlStartTime"    column="control_start_time"    />
        <result property="controlEndTime"    column="control_end_time"    />
        <result property="stopCar"    column="stop_car"    />
        <result property="noControlStartTime"    column="no_control_start_time"    />
        <result property="noControlEndTime"    column="no_control_end_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>


    <sql id="selectSRaControlSchemeVo">
        select scheme_id, scheme_name, warning_level, control_measures, control_start_time, control_end_time, stop_car, no_control_start_time, no_control_end_time, create_by, create_time, update_by, update_time from s_ra_control_scheme
    </sql>

    <select id="selectSRaControlSchemeList" parameterType="cn.cecep.talroad.domain.analysis.SRaControlScheme" resultMap="SRaControlSchemeResult">
        <include refid="selectSRaControlSchemeVo"/>
        <where>
            <if test="schemeId != null  and schemeId != ''"> and scheme_id = #{schemeId}</if>
            <if test="schemeName != null  and schemeName != ''"> and scheme_name like concat('%', #{schemeName}, '%')</if>
            <if test="warningLevel != null  and warningLevel != ''"> and warning_level = #{warningLevel}</if>
            <if test="controlMeasures != null  and controlMeasures != ''"> and control_measures = #{controlMeasures}</if>
            <if test="controlStartTime != null  and controlStartTime != ''"> and control_start_time = #{controlStartTime}</if>
            <if test="controlEndTime != null  and controlEndTime != ''"> and control_end_time = #{controlEndTime}</if>
            <if test="stopCar != null  and stopCar != ''"> and stop_car = #{stopCar}</if>
            <if test="noControlStartTime != null  and noControlStartTime != ''"> and no_control_start_time = #{noControlStartTime}</if>
            <if test="noControlEndTime != null  and noControlEndTime != ''"> and no_control_end_time = #{noControlEndTime}</if>
        </where>
    </select>

</mapper>
