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

    <resultMap type="cn.cecep.talroad.domain.OdsOnlineOlStopinfoA" id="OdsOnlineOlStopinfoAResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="portNum"    column="port_num"    />
        <result property="portName"    column="port_name"    />
        <result property="startTime"    column="start_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="dcsType"    column="dcs_type"    />
        <result property="operator"    column="operator"    />
        <result property="reason"    column="reason"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="deleteTime"    column="delete_time"    />
        <result property="enable"    column="enable"    />
        <result property="infoSources"    column="info_sources"    />
        <result property="userId"    column="user_id"    />
        <result property="remarks"    column="remarks"    />
        <result property="startTimeFormat"    column="start_time_format"    />
        <result property="endTimeFormat"    column="end_time_format"    />
        <result property="createTimeFormat"    column="create_time_format"    />
        <result property="checkTime"    column="check_time"    />
        <result property="checkUserId"    column="check_user_id"    />
        <result property="checkUserName"    column="check_user_name"    />
        <result property="checkStatus"    column="check_status"    />
        <result property="checkRemarks"    column="check_remarks"    />
        <result property="startTimeUnix"    column="start_time_unix"    />
        <result property="endTimeUnix"    column="end_time_unix"    />
    </resultMap>


    <sql id="selectOdsOnlineOlStopinfoAVo">
        select id, factory_id, port_num, port_name, start_time, end_time, dcs_type, operator, reason, create_time, update_time, delete_time, enable, info_sources, user_id, remarks, start_time_format, end_time_format, create_time_format, check_time, check_user_id, check_user_name, check_status, check_remarks, start_time_unix, end_time_unix from ods_online_ol_stopinfo_a
    </sql>

    <select id="selectOdsOnlineOlStopinfoAList" parameterType="cn.cecep.talroad.domain.OdsOnlineOlStopinfoA" resultMap="OdsOnlineOlStopinfoAResult">
        <include refid="selectOdsOnlineOlStopinfoAVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="portNum != null  and portNum != ''"> and port_num = #{portNum}</if>
            <if test="portName != null  and portName != ''"> and port_name like concat('%', #{portName}, '%')</if>
            <if test="startTime != null  and startTime != ''"> and start_time = #{startTime}</if>
            <if test="endTime != null  and endTime != ''"> and end_time = #{endTime}</if>
            <if test="dcsType != null  and dcsType != ''"> and dcs_type = #{dcsType}</if>
            <if test="operator != null  and operator != ''"> and operator = #{operator}</if>
            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
            <if test="deleteTime != null  and deleteTime != ''"> and delete_time = #{deleteTime}</if>
            <if test="enable != null  and enable != ''"> and enable = #{enable}</if>
            <if test="infoSources != null  and infoSources != ''"> and info_sources = #{infoSources}</if>
            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="startTimeFormat != null  and startTimeFormat != ''"> and start_time_format = #{startTimeFormat}</if>
            <if test="endTimeFormat != null  and endTimeFormat != ''"> and end_time_format = #{endTimeFormat}</if>
            <if test="createTimeFormat != null  and createTimeFormat != ''"> and create_time_format = #{createTimeFormat}</if>
            <if test="checkTime != null  and checkTime != ''"> and check_time = #{checkTime}</if>
            <if test="checkUserId != null  and checkUserId != ''"> and check_user_id = #{checkUserId}</if>
            <if test="checkUserName != null  and checkUserName != ''"> and check_user_name like concat('%', #{checkUserName}, '%')</if>
            <if test="checkStatus != null "> and check_status = #{checkStatus}</if>
            <if test="checkRemarks != null  and checkRemarks != ''"> and check_remarks = #{checkRemarks}</if>
            <if test="startTimeUnix != null "> and start_time_unix = #{startTimeUnix}</if>
            <if test="endTimeUnix != null "> and end_time_unix = #{endTimeUnix}</if>
        </where>
    </select>

</mapper>
