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

    <resultMap type="cn.cecep.talroad.domain.BMainFactoryVerification" id="BMainFactoryVerificationResult">
        <result property="id"    column="id"    />
        <result property="taskName"    column="task_name"    />
        <result property="taskSource"    column="task_source"    />
        <result property="factoryId"    column="factory_id"    />
        <result property="factoryName"    column="factory_name"    />
        <result property="factoryAddress"    column="factory_address"    />
        <result property="area"    column="area"    />
        <result property="creditCode"    column="credit_code"    />
        <result property="handlePerson"    column="handle_person"    />
        <result property="completeTime"    column="complete_time"    />
        <result property="verificationContent"    column="verification_content"    />
        <result property="verificationTime"    column="verification_time"    />
        <result property="taskStatus"    column="task_status"    />
        <result property="factoryType"    column="factory_type"    />
        <result property="isLawEnforcement"    column="is_law_enforcement"    />
        <result property="isHiddenDangerReminder"    column="is_hidden_danger_reminder"    />
        <result property="isProblem"    column="is_problem"    />
        <result property="lawEnforcementPerson"    column="law_enforcement_person"    />
        <result property="enforcementSummary"    column="enforcement_summary"    />
        <result property="remark"    column="remark"    />
        <result property="evidenceList"    column="evidence_list"    />
        <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="selectBMainFactoryVerificationVo">
        select id, task_name, task_source, factory_id, factory_name, factory_address, area, credit_code, handle_person, complete_time, verification_content, verification_time, task_status, factory_type, is_law_enforcement, is_hidden_danger_reminder, is_problem, law_enforcement_person, enforcement_summary, remark, evidence_list, create_by, create_time, update_by, update_time from b_main_factory_verification
    </sql>

    <select id="selectBMainFactoryVerificationList" parameterType="cn.cecep.talroad.domain.BMainFactoryVerification" resultMap="BMainFactoryVerificationResult">
        <include refid="selectBMainFactoryVerificationVo"/>
        <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="factoryId != null  and factoryId != ''"> and factory_id = #{factoryId}</if>
            <if test="factoryName != null  and factoryName != ''"> and factory_name like concat('%', #{factoryName}, '%')</if>
            <if test="factoryAddress != null  and factoryAddress != ''"> and factory_address = #{factoryAddress}</if>
            <if test="area != null  and area != ''"> and area = #{area}</if>
            <if test="creditCode != null  and creditCode != ''"> and credit_code = #{creditCode}</if>
            <if test="handlePerson != null  and handlePerson != ''"> and handle_person = #{handlePerson}</if>
            <if test="completeTime != null  and completeTime != ''"> and complete_time = #{completeTime}</if>
            <if test="verificationContent != null  and verificationContent != ''"> and verification_content = #{verificationContent}</if>
            <if test="verificationTime != null  and verificationTime != ''"> and verification_time = #{verificationTime}</if>
            <if test="taskStatus != null  and taskStatus != ''"> and task_status = #{taskStatus}</if>
            <if test="factoryType != null  and factoryType != ''"> and factory_type = #{factoryType}</if>
            <if test="isLawEnforcement != null  and isLawEnforcement != ''"> and is_law_enforcement = #{isLawEnforcement}</if>
            <if test="isHiddenDangerReminder != null  and isHiddenDangerReminder != ''"> and is_hidden_danger_reminder = #{isHiddenDangerReminder}</if>
            <if test="isProblem != null  and isProblem != ''"> and is_problem = #{isProblem}</if>
            <if test="lawEnforcementPerson != null  and lawEnforcementPerson != ''"> and law_enforcement_person = #{lawEnforcementPerson}</if>
            <if test="enforcementSummary != null  and enforcementSummary != ''"> and enforcement_summary = #{enforcementSummary}</if>
            <if test="evidenceList != null  and evidenceList != ''"> and evidence_list = #{evidenceList}</if>
        </where>
    </select>

</mapper>
