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

    <resultMap type="cn.cecep.talroad.domain.OdsOnlineOlPsWhitelistA" id="OdsOnlineOlPsWhitelistAResult">
        <result property="id"    column="id"    />
        <result property="regionId"    column="region_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="portNum"    column="port_num"    />
        <result property="portName"    column="port_name"    />
        <result property="pollutantCode"    column="pollutant_code"    />
        <result property="startTime"    column="start_time"    />
        <result property="endTime"    column="end_time"    />
        <result property="operator"    column="operator"    />
        <result property="userId"    column="user_id"    />
        <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="remarks"    column="remarks"    />
        <result property="verifyStatusId"    column="verify_status_id"    />
        <result property="verifyRemarks"    column="verify_remarks"    />
        <result property="verifierId"    column="verifier_id"    />
        <result property="verifierName"    column="verifier_name"    />
        <result property="verifyTime"    column="verify_time"    />
        <result property="verifierMobile"    column="verifier_mobile"    />
        <result property="startTime2"    column="start_time2"    />
        <result property="endTime2"    column="end_time2"    />
        <result property="createTime2"    column="create_time2"    />
        <result property="receiveTime"    column="receive_time"    />
        <result property="infoType"    column="info_type"    />
    </resultMap>


    <sql id="selectOdsOnlineOlPsWhitelistAVo">
        select id, region_id, factory_id, port_num, port_name, pollutant_code, start_time, end_time, operator, user_id, reason, create_time, update_time, delete_time, enable, remarks, verify_status_id, verify_remarks, verifier_id, verifier_name, verify_time, verifier_mobile, start_time2, end_time2, create_time2, receive_time, info_type from ods_online_ol_ps_whitelist_a
    </sql>

    <select id="selectOdsOnlineOlPsWhitelistAList" parameterType="cn.cecep.talroad.domain.OdsOnlineOlPsWhitelistA" resultMap="OdsOnlineOlPsWhitelistAResult">
        <include refid="selectOdsOnlineOlPsWhitelistAVo"/>
        <where>
            <if test="regionId != null  and regionId != ''"> and region_id = #{regionId}</if>
            <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="pollutantCode != null  and pollutantCode != ''"> and pollutant_code = #{pollutantCode}</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="operator != null  and operator != ''"> and operator = #{operator}</if>
            <if test="userId != null  and userId != ''"> and user_id = #{userId}</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="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="verifyStatusId != null  and verifyStatusId != ''"> and verify_status_id = #{verifyStatusId}</if>
            <if test="verifyRemarks != null  and verifyRemarks != ''"> and verify_remarks = #{verifyRemarks}</if>
            <if test="verifierId != null  and verifierId != ''"> and verifier_id = #{verifierId}</if>
            <if test="verifierName != null  and verifierName != ''"> and verifier_name like concat('%', #{verifierName}, '%')</if>
            <if test="verifyTime != null  and verifyTime != ''"> and verify_time = #{verifyTime}</if>
            <if test="verifierMobile != null  and verifierMobile != ''"> and verifier_mobile = #{verifierMobile}</if>
            <if test="startTime2 != null  and startTime2 != ''"> and start_time2 = #{startTime2}</if>
            <if test="endTime2 != null  and endTime2 != ''"> and end_time2 = #{endTime2}</if>
            <if test="createTime2 != null  and createTime2 != ''"> and create_time2 = #{createTime2}</if>
            <if test="receiveTime != null  and receiveTime != ''"> and receive_time = #{receiveTime}</if>
            <if test="infoType != null  and infoType != ''"> and info_type = #{infoType}</if>
        </where>
    </select>

</mapper>
