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

    <resultMap type="cn.cecep.talroad.domain.BMainPollDisFile" id="BMainPollDisFileResult">
        <result property="fileId"    column="file_id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="pollDisId"    column="poll_dis_id"    />
        <result property="fileType"    column="file_type"    />
        <result property="fileName"    column="file_name"    />
    </resultMap>


    <sql id="selectBMainPollDisFileVo">
        select file_id, factory_id, poll_dis_id, file_type, file_name from b_main_poll_dis_file
    </sql>

    <select id="selectBMainPollDisFileList" parameterType="cn.cecep.talroad.domain.BMainPollDisFile" resultMap="BMainPollDisFileResult">
        <include refid="selectBMainPollDisFileVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="pollDisId != null  and pollDisId != ''"> and poll_dis_id = #{pollDisId}</if>
            <if test="fileType != null  and fileType != ''"> and file_type = #{fileType}</if>
            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
        </where>
    </select>

</mapper>
