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

    <resultMap type="cn.cecep.talroad.domain.BMainThreeSupervisionEnforcRecord" id="BMainThreeSupervisionEnforcRecordResult">
        <result property="recordId"    column="record_id"    />
        <result property="taskId"    column="task_id"    />
        <result property="handleDeptId"    column="handle_dept_id"    />
        <result property="handleDeptName"    column="handle_dept_name"    />
        <result property="handlePerson"    column="handle_person"    />
        <result property="handleTime"    column="handle_time"    />
        <result property="isEnforcement"    column="is_enforcement"    />
        <result property="conclusion"    column="conclusion"    />
        <result property="specificConclusion"    column="specific_conclusion"    />
        <result property="questionAttachment"    column="question_attachment"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>


    <sql id="selectBMainThreeSupervisionEnforcRecordVo">
        select record_id, task_id, handle_dept_id, handle_dept_name, handle_person, handle_time, is_enforcement, conclusion, specific_conclusion, question_attachment, create_by, create_time, update_by, update_time from b_main_three_supervision_enforc_record
    </sql>

    <select id="selectBMainThreeSupervisionEnforcRecordList" parameterType="cn.cecep.talroad.domain.BMainThreeSupervisionEnforcRecord" resultMap="BMainThreeSupervisionEnforcRecordResult">
        <include refid="selectBMainThreeSupervisionEnforcRecordVo"/>
        <where>
            <if test="taskId != null  and taskId != ''"> and task_id = #{taskId}</if>
            <if test="handleDeptId != null  and handleDeptId != ''"> and handle_dept_id = #{handleDeptId}</if>
            <if test="handleDeptName != null  and handleDeptName != ''"> and handle_dept_name like concat('%', #{handleDeptName}, '%')</if>
            <if test="handlePerson != null  and handlePerson != ''"> and handle_person = #{handlePerson}</if>
            <if test="handleTime != null  and handleTime != ''"> and handle_time = #{handleTime}</if>
            <if test="conclusion != null  and conclusion != ''"> and conclusion = #{conclusion}</if>
            <if test="specificConclusion != null  and specificConclusion != ''"> and specific_conclusion = #{specificConclusion}</if>
            <if test="questionAttachment != null  and questionAttachment != ''"> and question_attachment = #{questionAttachment}</if>
        </where>
    </select>

</mapper>
