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

    <resultMap type="cn.cecep.talroad.domain.FactoryReportingTask" id="FactoryReportingTaskResult">
        <result property="frId"    column="fr_id"    />
        <result property="taskName"    column="task_name"    />
        <result property="taskSource"    column="task_source"    />
        <result property="regionName"    column="region_name"    />
        <result property="taskDescription"    column="task_description"    />
        <result property="taskTime"    column="task_time"    />
    </resultMap>


    <sql id="selectFactoryReportingTaskVo">
        select fr_id, task_name, task_source, region_name, task_description, task_time from factory_reporting_task
    </sql>

    <select id="selectFactoryReportingTaskList" parameterType="cn.cecep.talroad.domain.FactoryReportingTask" resultMap="FactoryReportingTaskResult">
        <include refid="selectFactoryReportingTaskVo"/>
        <where>
            <if test="taskName != null  and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
            <if test="taskSource != null  and taskSource != ''"> and task_source = #{taskSource}</if>
            <if test="regionName != null  and regionName != ''"> and region_name like concat('%', #{regionName}, '%')</if>
            <if test="taskDescription != null  and taskDescription != ''"> and task_description = #{taskDescription}</if>
            <if test="taskTime != null  and taskTime != ''"> and task_time = #{taskTime}</if>
        </where>
    </select>

</mapper>
