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

    <resultMap type="cn.cecep.talroad.domain.BMainActionReports" id="BMainActionReportsResult">
        <result property="id"    column="id"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="reportsType"    column="reports_type"    />
        <result property="reportsTime"    column="reports_time"    />
        <result property="reportsFile"    column="reports_file"    />
    </resultMap>


    <sql id="selectBMainActionReportsVo">
        select id, factory_id, reports_type, reports_time, reports_file from b_main_action_reports
    </sql>

    <select id="selectBMainActionReportsList" parameterType="cn.cecep.talroad.domain.BMainActionReports" resultMap="BMainActionReportsResult">
        <include refid="selectBMainActionReportsVo"/>
        <where>
            <if test="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="reportsType != null  and reportsType != ''"> and reports_type = #{reportsType}</if>
            <if test="reportsTime != null  and reportsTime != ''"> and reports_time = #{reportsTime}</if>
            <if test="reportsFile != null  and reportsFile != ''"> and reports_file = #{reportsFile}</if>
        </where>
    </select>

</mapper>
