<?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="com.ruoyi.postCheck.mapper.PostCheckedReportMapper">

    <resultMap type="PostCheckedReport" id="PostCheckedReportResult">
        <result property="id"    column="id"    />
        <result property="reportNo"    column="report_no"    />
        <result property="reportName"    column="report_name"    />
        <result property="reportPreface"    column="report_preface"    />
        <!--
        <result property="consummationProblem"    column="consummation_problem"    />
        <result property="suitabilityProblem"    column="suitability_problem"    />
        <result property="effectivenessProblem"    column="effectiveness_problem"    />
        <result property="liXingLiGaiQuestionNumber"    column="li_xing_li_gai_question_number"    />
        <result property="liXingLiGaiQuestionHasRectifiedNumber"    column="li_xing_li_gai_question_has_rectified_number"    />
        <result property="richText"    column="rich_text"    />
        -->
        <result property="generateTime"    column="generate_time"    />
        <result property="remark"    column="remark"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createTime"    column="create_time"    />
        <result property="createBy"    column="create_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="createUserId"    column="create_user_id"    />
        <result property="htmlOne"    column="html_one"    />
        <result property="htmlTwo"    column="html_two"    />
        <result property="htmlThree"    column="html_three"    />
        <result property="htmlFour"    column="html_four"    />
        <result property="htmlFive"    column="html_five"    />
        <result property="htmlSix"    column="html_six"    />
        <result property="htmlSeven"    column="html_seven"    />
        <result property="htmlEight"    column="html_eight"    />
        <result property="htmlNine"    column="html_nine"    />
        <result property="status"    column="status"    />
        <result property="statusByUserId"    column="status_by_user_id"    />
        <result property="statusByUserName"    column="status_by_user_name"    />
        <result property="statusReason"    column="status_reason"    />
        <result property="statusApproveTime"    column="status_approve_time"    />
    </resultMap>

    <sql id="selectPostCheckedReportVo">
        select
            id, report_no, report_name, report_preface, consummation_problem, suitability_problem, effectiveness_problem, li_xing_li_gai_question_number, li_xing_li_gai_question_has_rectified_number, rich_text, generate_time, remark, del_flag, create_time, create_by, update_time, update_by, create_user_id, html_one, html_two, html_three, html_four, html_five, html_six, html_seven, html_eight, html_nine, status, status_by_user_id, status_by_user_name,
            status_reason, status_approve_time
        from post_checked_report
    </sql>

    <select id="selectPostCheckedReportList" parameterType="PostCheckedReport" resultMap="PostCheckedReportResult">
        <include refid="selectPostCheckedReportVo"/>
        <where>
            <if test="reportNo != null  and reportNo != ''"> and report_no = #{reportNo}</if>
            <if test="reportName != null  and reportName != ''"> and report_name like concat('%', #{reportName}, '%')</if>
            <if test="reportPreface != null  and reportPreface != ''"> and report_preface = #{reportPreface}</if>
            <!--
            <if test="consummationProblem != null "> and consummation_problem = #{consummationProblem}</if>
            <if test="suitabilityProblem != null "> and suitability_problem = #{suitabilityProblem}</if>
            <if test="effectivenessProblem != null "> and effectiveness_problem = #{effectivenessProblem}</if>
            <if test="liXingLiGaiQuestionNumber != null "> and li_xing_li_gai_question_number = #{liXingLiGaiQuestionNumber}</if>
            <if test="liXingLiGaiQuestionHasRectifiedNumber != null "> and li_xing_li_gai_question_has_rectified_number = #{liXingLiGaiQuestionHasRectifiedNumber}</if>
            <if test="richText != null  and richText != ''"> and rich_text = #{richText}</if>
            -->
            <if test="generateTime != null "> and generate_time = #{generateTime}</if>
            <if test="createUserId != null "> and create_user_id = #{createUserId}</if>
            <if test="htmlOne != null  and htmlOne != ''"> and html_one = #{htmlOne}</if>
            <if test="htmlTwo != null  and htmlTwo != ''"> and html_two = #{htmlTwo}</if>
            <if test="htmlThree != null  and htmlThree != ''"> and html_three = #{htmlThree}</if>
            <if test="htmlFour != null  and htmlFour != ''"> and html_four = #{htmlFour}</if>
            <if test="htmlFive != null  and htmlFive != ''"> and html_five = #{htmlFive}</if>
            <if test="htmlSix != null  and htmlSix != ''"> and html_six = #{htmlSix}</if>
            <if test="htmlSeven != null  and htmlSeven != ''"> and html_seven = #{htmlSeven}</if>
            <if test="htmlEight != null  and htmlEight != ''"> and html_eight = #{htmlEight}</if>
            <if test="htmlNine != null  and htmlNine != ''"> and html_nine = #{htmlNine}</if>
            <if test="status != null "> and status = #{status}</if>
            <if test="statusByUserId != null "> and status_by_user_id = #{statusByUserId}</if>
            <if test="statusByUserName != null  and statusByUserName != ''"> and status_by_user_name like concat('%', #{statusByUserName}, '%')</if>
            <if test="statusReason != null  and statusReason != ''"> and status_reason like concat('%', #{statusReason}, '%')</if>
        </where>
    </select>

    <select id="selectPostCheckedReportById" parameterType="Long" resultMap="PostCheckedReportResult">
        <include refid="selectPostCheckedReportVo"/>
        where id = #{id}
    </select>

    <insert id="insertPostCheckedReport" parameterType="PostCheckedReport">
        insert into post_checked_report
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="reportNo != null and reportNo != ''">report_no,</if>
            <if test="reportName != null and reportName != ''">report_name,</if>
            <if test="reportPreface != null and reportPreface != ''">report_preface,</if>
            <!--
            <if test="consummationProblem != null">consummation_problem,</if>
            <if test="suitabilityProblem != null">suitability_problem,</if>
            <if test="effectivenessProblem != null">effectiveness_problem,</if>
            <if test="liXingLiGaiQuestionNumber != null">li_xing_li_gai_question_number,</if>
            <if test="liXingLiGaiQuestionHasRectifiedNumber != null">li_xing_li_gai_question_has_rectified_number,</if>
            <if test="richText != null">rich_text,</if>
            -->
            <if test="generateTime != null">generate_time,</if>
            <if test="remark != null">remark,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createBy != null and createBy != ''">create_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateBy != null and updateBy != ''">update_by,</if>
            <if test="createUserId != null">create_user_id,</if>
            <if test="htmlOne != null">html_one,</if>
            <if test="htmlTwo != null">html_two,</if>
            <if test="htmlThree != null">html_three,</if>
            <if test="htmlFour != null">html_four,</if>
            <if test="htmlFive != null">html_five,</if>
            <if test="htmlSix != null">html_six,</if>
            <if test="htmlSeven != null">html_seven,</if>
            <if test="htmlEight != null">html_eight,</if>
            <if test="htmlNine != null">html_nine,</if>
            <if test="status != null">status,</if>
            <if test="statusByUserId != null">status_by_user_id,</if>
            <if test="statusByUserName != null">status_by_user_name,</if>
            <if test="statusReason != null">status_reason,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="reportNo != null and reportNo != ''">#{reportNo},</if>
            <if test="reportName != null and reportName != ''">#{reportName},</if>
            <if test="reportPreface != null and reportPreface != ''">#{reportPreface},</if>
            <!--<if test="consummationProblem != null">#{consummationProblem},</if>
            <if test="suitabilityProblem != null">#{suitabilityProblem},</if>
            <if test="effectivenessProblem != null">#{effectivenessProblem},</if>
            <if test="liXingLiGaiQuestionNumber != null">#{liXingLiGaiQuestionNumber},</if>
            <if test="liXingLiGaiQuestionHasRectifiedNumber != null">#{liXingLiGaiQuestionHasRectifiedNumber},</if>
            <if test="richText != null">#{richText},</if>
            -->
            <if test="generateTime != null">#{generateTime},</if>
            <if test="remark != null">#{remark},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createBy != null and createBy != ''">#{createBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
            <if test="createUserId != null">#{createUserId},</if>
            <if test="htmlOne != null">#{htmlOne},</if>
            <if test="htmlTwo != null">#{htmlTwo},</if>
            <if test="htmlThree != null">#{htmlThree},</if>
            <if test="htmlFour != null">#{htmlFour},</if>
            <if test="htmlFive != null">#{htmlFive},</if>
            <if test="htmlSix != null">#{htmlSix},</if>
            <if test="htmlSeven != null">#{htmlSeven},</if>
            <if test="htmlEight != null">#{htmlEight},</if>
            <if test="htmlNine != null">#{htmlNine},</if>
            <if test="status != null">#{status},</if>
            <if test="statusByUserId != null">#{statusByUserId},</if>
            <if test="statusByUserName != null">#{statusByUserName},</if>
            <if test="statusReason != null">#{statusReason},</if>
         </trim>
    </insert>

    <update id="updatePostCheckedReport" parameterType="PostCheckedReport">
        update post_checked_report
        <trim prefix="SET" suffixOverrides=",">
            <if test="reportNo != null and reportNo != ''">report_no = #{reportNo},</if>
            <if test="reportName != null and reportName != ''">report_name = #{reportName},</if>
            <if test="reportPreface != null and reportPreface != ''">report_preface = #{reportPreface},</if>
            <!--
            <if test="consummationProblem != null">consummation_problem = #{consummationProblem},</if>
            <if test="suitabilityProblem != null">suitability_problem = #{suitabilityProblem},</if>
            <if test="effectivenessProblem != null">effectiveness_problem = #{effectivenessProblem},</if>
            <if test="liXingLiGaiQuestionNumber != null">li_xing_li_gai_question_number = #{liXingLiGaiQuestionNumber},</if>
            <if test="liXingLiGaiQuestionHasRectifiedNumber != null">li_xing_li_gai_question_has_rectified_number = #{liXingLiGaiQuestionHasRectifiedNumber},</if>
            <if test="richText != null">rich_text = #{richText},</if>
            -->
            <if test="generateTime != null">generate_time = #{generateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
            <if test="createUserId != null">create_user_id = #{createUserId},</if>
            <if test="htmlOne != null">html_one = #{htmlOne},</if>
            <if test="htmlTwo != null">html_two = #{htmlTwo},</if>
            <if test="htmlThree != null">html_three = #{htmlThree},</if>
            <if test="htmlFour != null">html_four = #{htmlFour},</if>
            <if test="htmlFive != null">html_five = #{htmlFive},</if>
            <if test="htmlSix != null">html_six = #{htmlSix},</if>
            <if test="htmlSeven != null">html_seven = #{htmlSeven},</if>
            <if test="htmlEight != null">html_eight = #{htmlEight},</if>
            <if test="htmlNine != null">html_nine = #{htmlNine},</if>
            <if test="status != null">status = #{status},</if>
            <if test="statusByUserId != null">status_by_user_id = #{statusByUserId},</if>
            <if test="statusByUserName != null">status_by_user_name = #{statusByUserName},</if>
            <if test="statusReason != null and statusReason != ''">status_reason = #{statusReason},</if>
            <if test="statusApproveTime != null">status_approve_time = #{statusApproveTime},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deletePostCheckedReportById" parameterType="Long">
        delete from post_checked_report where id = #{id}
    </delete>

    <delete id="deletePostCheckedReportByIds" parameterType="String">
        delete from post_checked_report where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>
