<?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.goldenwater.slaj.sins.mapper.ObjCaseMapper">
    <resultMap type="com.goldenwater.slaj.sins.domain.ObjCase" id="ObjCaseResult">
        <result property="guid" column="guid"/>
        <result property="caseNum" column="case_num"/>
        <result property="caseName" column="case_name"/>
        <result property="caseSour" column="case_sour"/>
        <result property="caseTime" column="case_time"/>
        <result property="caseProg" column="case_prog"/>
        <result property="caseProc" column="case_proc"/>
        <result property="litiType" column="liti_type"/>
        <result property="suneOrgGuid" column="sune_org_guid"/>
        <result property="punForm" column="pun_form"/>
        <result property="punTime" column="pun_time"/>
        <result property="punFund" column="pun_fund"/>
        <result property="contra1" column="contra1"/>
        <result property="contraNum1" column="contra_num1"/>
        <result property="filiTime" column="fili_time"/>
        <result property="closTime" column="clos_time"/>
        <result property="archTime" column="arch_time"/>
        <result property="archNum" column="arch_num"/>
        <result property="ifReconHear" column="if_recon_hear"/>
        <result property="ifEnfor" column="if_enfor"/>
        <result property="ifReview" column="if_review"/>
        <result property="ifArch" column="if_arch"/>
        <result property="caseLitiName" column="case_liti_name"/>
        <result property="caseLitiMobi" column="case_liti_mobi"/>
        <result property="caseLeg" column="case_leg"/>
        <result property="caseLitiAddr" column="case_liti_addr"/>
        <result property="postCode" column="post_code"/>
        <result property="caseCous" column="case_cous"/>
        <result property="caseFiliBasi" column="case_fili_basi"/>
        <result property="caseSitu" column="case_situ"/>
        <result property="punBais" column="pun_bais"/>
        <result property="punDesc" column="pun_desc"/>
        <result property="note" column="note"/>
        <result property="collTime" column="coll_time"/>
        <result property="updTime" column="upd_time"/>
        <result property="recPers" column="rec_pers"/>
        <result property="orgGuid" column="org_guid"/>
        <result property="unitType" column="unit_type"/>
        <result property="adArea" column="ad_area"/>
        <result property="scePunTime" column="sce_pun_time"/>
        <result property="sceFouPro" column="sce_fou_pro"/>
        <result property="sceDeci" column="sce_deci"/>
        <result property="socCreCode" column="soc_cre_code"/>
        <result property="domainClass" column="domain_class"/>
        <result property="isBreakPro" column="is_break_pro"/>
    </resultMap>

    <sql id="selectObjCaseVo">
        select guid, case_num, case_name, case_sour, case_time, case_prog, case_proc, liti_type, sune_org_guid, pun_form, pun_time, pun_fund, contra1, contra_num1, fili_time, clos_time, arch_time, arch_num, if_recon_hear, if_enfor, if_review, if_arch, case_liti_name, case_liti_mobi, case_leg, case_liti_addr, post_code, case_cous, case_fili_basi, case_situ, pun_bais, pun_desc, note, coll_time, upd_time, rec_pers, org_guid, unit_type, ad_area, sce_pun_time, sce_fou_pro, sce_deci, soc_cre_code, domain_class, is_break_pro from obj_case
    </sql>

    <select id="selectObjCaseByGuid" parameterType="String" resultMap="ObjCaseResult">
        <include refid="selectObjCaseVo"/> where guid = #{guid}
    </select>

    <select id="selectObjCaseList" parameterType="com.goldenwater.slaj.sins.domain.ObjCase" resultMap="ObjCaseResult">
        <include refid="selectObjCaseVo"/>
        <where>
            <if test="caseName != null and caseName != ''">
                and case_name like '%' || #{caseName} || '%'
            </if>
            <if test="caseNum != null and caseNum != ''">
                and case_num = #{caseNum}
            </if>
            <if test="caseProg != null and caseProg != ''">
                and case_prog = #{caseProg}
            </if>
            <if test="caseProc != null and caseProc != ''">
                and case_proc = #{caseProc}
            </if>
        </where>
    </select>

    <insert id="insertObjCase" parameterType="com.goldenwater.slaj.sins.domain.ObjCase">
        insert into obj_case (guid, case_num, case_name, case_sour, case_time, case_prog, case_proc, liti_type, sune_org_guid, pun_form, pun_time, pun_fund, contra1, contra_num1, fili_time, clos_time, arch_time, arch_num, if_recon_hear, if_enfor, if_review, if_arch, case_liti_name, case_liti_mobi, case_leg, case_liti_addr, post_code, case_cous, case_fili_basi, case_situ, pun_bais, pun_desc, note, coll_time, upd_time, rec_pers, org_guid, unit_type, ad_area, sce_pun_time, sce_fou_pro, sce_deci, soc_cre_code, domain_class, is_break_pro)
        values (#{guid}, #{caseNum}, #{caseName}, #{caseSour}, #{caseTime}, #{caseProg}, #{caseProc}, #{litiType}, #{suneOrgGuid}, #{punForm}, #{punTime}, #{punFund}, #{contra1}, #{contraNum1}, #{filiTime}, #{closTime}, #{archTime}, #{archNum}, #{ifReconHear}, #{ifEnfor}, #{ifReview}, #{ifArch}, #{caseLitiName}, #{caseLitiMobi}, #{caseLeg}, #{caseLitiAddr}, #{postCode}, #{caseCous}, #{caseFiliBasi}, #{caseSitu}, #{punBais}, #{punDesc}, #{note}, #{collTime}, #{updTime}, #{recPers}, #{orgGuid}, #{unitType}, #{adArea}, #{scePunTime}, #{sceFouPro}, #{sceDeci}, #{socCreCode}, #{domainClass}, #{isBreakPro})
    </insert>

    <update id="updateObjCase" parameterType="com.goldenwater.slaj.sins.domain.ObjCase">
        update obj_case
        <set>
            <if test="caseNum != null and caseNum != ''">case_num = #{caseNum},</if>
            <if test="caseName != null and caseName != ''">case_name = #{caseName},</if>
            <if test="caseSour != null and caseSour != ''">case_sour = #{caseSour},</if>
            <if test="caseTime != null">case_time = #{caseTime},</if>
            <if test="caseProg != null and caseProg != ''">case_prog = #{caseProg},</if>
            <if test="caseProc != null and caseProc != ''">case_proc = #{caseProc},</if>
            <if test="litiType != null and litiType != ''">liti_type = #{litiType},</if>
            <if test="suneOrgGuid != null and suneOrgGuid != ''">sune_org_guid = #{suneOrgGuid},</if>
            <if test="punForm != null and punForm != ''">pun_form = #{punForm},</if>
            <if test="punTime != null">pun_time = #{punTime},</if>
            <if test="punFund != null and punFund != ''">pun_fund = #{punFund},</if>
            <if test="contra1 != null and contra1 != ''">contra1 = #{contra1},</if>
            <if test="contraNum1 != null and contraNum1 != ''">contra_num1 = #{contraNum1},</if>
            <if test="filiTime != null">fili_time = #{filiTime},</if>
            <if test="closTime != null">clos_time = #{closTime},</if>
            <if test="archTime != null">arch_time = #{archTime},</if>
            <if test="archNum != null and archNum != ''">arch_num = #{archNum},</if>
            <if test="ifReconHear != null and ifReconHear != ''">if_recon_hear = #{ifReconHear},</if>
            <if test="ifEnfor != null and ifEnfor != ''">if_enfor = #{ifEnfor},</if>
            <if test="ifReview != null and ifReview != ''">if_review = #{ifReview},</if>
            <if test="ifArch != null and ifArch != ''">if_arch = #{ifArch},</if>
            <if test="caseLitiName != null and caseLitiName != ''">case_liti_name = #{caseLitiName},</if>
            <if test="caseLitiMobi != null and caseLitiMobi != ''">case_liti_mobi = #{caseLitiMobi},</if>
            <if test="caseLeg != null and caseLeg != ''">case_leg = #{caseLeg},</if>
            <if test="caseLitiAddr != null and caseLitiAddr != ''">case_liti_addr = #{caseLitiAddr},</if>
            <if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
            <if test="caseCous != null and caseCous != ''">case_cous = #{caseCous},</if>
            <if test="caseFiliBasi != null and caseFiliBasi != ''">case_fili_basi = #{caseFiliBasi},</if>
            <if test="caseSitu != null and caseSitu != ''">case_situ = #{caseSitu},</if>
            <if test="punBais != null and punBais != ''">pun_bais = #{punBais},</if>
            <if test="punDesc != null and punDesc != ''">pun_desc = #{punDesc},</if>
            <if test="note != null and note != ''">note = #{note},</if>
            <if test="collTime != null">coll_time = #{collTime},</if>
            <if test="updTime != null">upd_time = #{updTime},</if>
            <if test="recPers != null and recPers != ''">rec_pers = #{recPers},</if>
            <if test="orgGuid != null and orgGuid != ''">org_guid = #{orgGuid},</if>
            <if test="unitType != null and unitType != ''">unit_type = #{unitType},</if>
            <if test="adArea != null and adArea != ''">ad_area = #{adArea},</if>
            <if test="scePunTime != null">sce_pun_time = #{scePunTime},</if>
            <if test="sceFouPro != null and sceFouPro != ''">sce_fou_pro = #{sceFouPro},</if>
            <if test="sceDeci != null and sceDeci != ''">sce_deci = #{sceDeci},</if>
            <if test="socCreCode != null and socCreCode != ''">soc_cre_code = #{socCreCode},</if>
            <if test="domainClass != null and domainClass != ''">domain_class = #{domainClass},</if>
            <if test="isBreakPro != null and isBreakPro != ''">is_break_pro = #{isBreakPro},</if>
        </set>
        where guid = #{guid}
    </update>

    <delete id="deleteObjCaseByGuid" parameterType="String">
        delete from obj_case where guid = #{guid}
    </delete>

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