<?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.hzya.frame.grpU8.nxproof.oerdjml.dao.impl.OerDjmlDaoImpl">
    <resultMap id="get-OerDjmlEntity-result" type="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        <result property="mlId" column="mlId" />
        <result property="djlxId" column="djlxId" />
        <result property="gsdm" column="gsdm" />
        <result property="kjnd" column="kjnd" />
        <result property="zt" column="zt" />
        <result property="crerdm" column="crerdm"/>
        <result property="crermc" column="crermc" />
        <result property="crerdate" column="crerdate" />
        <result property="curshjd" column="curshjd" />
        <result property="nextshjd" column="nextshjd" />
        <result property="shrs" column="shr" />
        <result property="shrId" column="shrId" />
        <result property="je" column="je" />
        <result property="shrq" column="shrq" />
        <result property="jsfs" column="jsfs" />
        <result property="djbh" column="djbh" />
        <result property="djdate" column="djdate" />
        <result property="fjs" column="fjs" />
        <result property="bmdm" column="bmdm" />
        <result property="bmmc" column="bmmc" />
        <result property="grdm" column="grdm" />
        <result property="grmc" column="grmc" />
        <result property="tel" column="tel" />
        <result property="yjje" column="yjje" />
        <result property="thje" column="thje" />
        <result property="blje" column="blje" />
        <result property="whje" column="whje" />
        <result property="jedx" column="jedx" />
        <result column="Rpt_Rt_content" property="RptRtContent" jdbcType="BLOB"  typeHandler="org.apache.ibatis.type.BlobTypeHandler" />

    </resultMap>

   <sql id="OerDjmlEntity_Base_Column_List">
GSDM,KJND,mlId
   </sql>

    <select id="OerDjmlEntity_list_base_Rpt_Rt_content" resultMap="get-OerDjmlEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
    select Rpt_Rt_content as Rpt_Rt_content from Rpt_Report where kjnd='2024'  and  rpt_rt_id='1883339185'
    <!--select ATFile as Rpt_Rt_content from AT_AttachmentFile where ATGuid='A1:00367df4-d5d6-4abb-82f6-e3bd1ca9e070'-->
</select>

<!--    查询最大单据编号+1-->
    <select id="OerDjmlEntity_list_base_djbhMax" resultMap="get-OerDjmlEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
            select
                case  when
                          len(isnull(max(right(DJBH,'4')), '0')+1)=2 then
                          concat(#{fph}+'BXD'+#{djdate}+'00',isnull(max(right(DJBH,'4')), '0')+1)
                      when len(isnull(max(right(DJBH,'4')), '0')+1)=1 then
                          concat(#{fph}+'BXD'+#{djdate}+'000',isnull(max(right(DJBH,'4')), '0')+1)
                      when len(isnull(max(right(DJBH,'4')), '0')+1)=3 then
                          concat(#{fph}+'BXD'+#{djdate}+'0',isnull(max(right(DJBH,'4')), '0')+1)
                      else concat(#{fph}+'BXD'+#{djdate}+'',isnull(max(right(DJBH,'4')), '0')+1) end
                    as djbh from OER_DJML where GSDM=#{gsdm} and DJBH like '%BXD'+#{djdate}+'%';
    </select>

    <!--    查询最大单据编号+1 指标占用时候使用-->
    <select id="OerDjmlEntity_list_base_djbhMax_zy" resultMap="get-OerDjmlEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        select
            case  when
                      len(isnull(max(right(DJBH,'4')), '0')+1)=2 then
                      concat('ZYBXD'+#{djdate}+'00',isnull(max(right(DJBH,'4')), '0')+1)
                  when len(isnull(max(right(DJBH,'4')), '0')+1)=1 then
                      concat('ZYBXD'+#{djdate}+'000',isnull(max(right(DJBH,'4')), '0')+1)
                  when len(isnull(max(right(DJBH,'4')), '0')+1)=3 then
                      concat('ZYBXD'+#{djdate}+'0',isnull(max(right(DJBH,'4')), '0')+1)
                  else concat('ZYBXD'+#{djdate}+'',isnull(max(right(DJBH,'4')), '0')+1) end
                as djbh from OER_DJML where GSDM=#{gsdm} and DJBH like '%ZYBXD'+#{djdate}+'%';
    </select>

    <!--    查询最大mlid+1-->
    <!--<select id="OerDjmlEntity_list_base_mlidMax" resultMap="get-OerDjmlEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        select
               case  when
                         length(ifnull(max(right(mlid,'4')), '0')+1)=2 then
                         concat(concat(substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,6),'00'),ifnull(max(right(mlid,'4')), '0')+1)
                     when length(ifnull(max(right(mlid,'4')), '0')+1)=1 then
                         concat(concat(substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,6),'000'),ifnull(max(right(mlid,'4')), '0')+1)
                     when length(ifnull(max(right(mlid,'4')), '0')+1)=3 then
                         concat(concat(substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,6),'0'),ifnull(max(right(mlid,'4')), '0')+1)
                     else concat(substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,6),ifnull(max(right(mlid,'4')), '0')+1) end
                   as mlId from OER_DJML where GSDM=#{gsdm} and mlid like concat(substring(replace(DATE_FORMAT(now(),'%Y-%m-%d'),'-',''),1,6),'%')
    </select>-->
    <select id="OerDjmlEntity_list_base_mlidMax" resultMap="get-OerDjmlEntity-result" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        select (isnull(max(MLID),concat(substring(#{djdate},0,7),0000)) + 1) as mlId
        from OER_DJML where 1=1 and GSDM=#{gsdm} and MLID like concat(substring(#{djdate},0,7),'%')
    </select>


    <insert id="OerDjmlEntity_insert" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        insert into OER_DJML(
        <trim prefixOverrides="," suffixOverrides=",">

            <if test="gsdm != null and gsdm !='' "> GSDM, </if>
            <if test="kjnd != null and kjnd !='' "> KJND, </if>
            <if test="djlxId != null and djlxId !='' "> DJLXID, </if>
            <if test="mlId != null and mlId !='' "> MLID, </if>
            <if test="zt != null and zt !='' "> ZT, </if>
            <if test="crerdm != null and crerdm !=''"> CRerDM, </if>
            <if test="crermc != null and crermc !='' "> CRerMC, </if>
            <if test="crerdate != null and crerdate !='' "> CRerDate, </if>
            <if test="flowcode != null and flowcode !='' "> FlowCode,</if>
            <if test="curshjd != null and curshjd !='' "> CurSHJD, </if>
            <if test="nextshjd != null and nextshjd !='' "> NextSHJD,</if>
            <if test="shrs != null and shrs !='' "> SHR,</if>
            <if test="shrId != null and shrId !=''"> SHRID, </if>
            <if test="shrq != null and shrq !='' "> SHRQ, </if>
            <if test="jsfs != null and jsfs !='' "> JSFS, </if>
            <if test="djbh != null and djbh !='' "> DJBH, </if>
            <if test="djdate != null and djdate !='' "> DJDate, </if>
            <if test="fjs != null and fjs !='' "> FJS,</if>
            <if test="bmdm != null and bmdm !='' "> BMDM, </if>
            <if test="bmmc != null and bmmc !='' "> BMMC,</if>
            <if test="grdm != null and grdm !='' ">GRDM, </if>
            <if test="grmc != null and grmc !='' ">GRMC,</if>
            <if test="tel != null and tel !='' "> TEL, </if>
            <if test="yjje != null and yjje !='' "> YJJE, </if>
            <if test="thje != null and thje !='' "> THJE,</if>
            <if test="blje != null and blje !='' "> BLJE, </if>
            <if test="je != null and je !='' "> JE, </if>
            <if test="whje != null and whje !='' "> WHJE,</if>
            <if test="jedx != null and jedx !='' "> JEDX, </if>
            <if test="zy != null and zy !='' "> ZY, </if>
            <if test="clf_ccr != null and clf_ccr !='' "> clf_ccr, </if>
            <if test="clf_cclb != null and clf_cclb !='' "> clf_cclb, </if>
            <if test="jjdm != null and jjdm !='' "> jjdm, </if>
            <if test="jjmc != null and jjmc !='' "> jjmc, </if>
            <if test="khyh != null and khyh !='' "> khyh, </if>
            <if test="yhzh != null and yhzh !='' "> yhzh, </if>
            <if test="ssr != null and ssr !='' "> ssr, </if>
            <if test="ssrid != null and ssrid !='' "> ssrid, </if>
            <if test="ssrq != null and ssrq !='' "> ssrq, </if>
            <if test="jflxdm != null and jflxdm !='' "> jflxdm, </if>
            <if test="jflxmc != null and jflxmc !='' "> jflxmc, </if>
            <if test="xmdm != null and xmdm !='' "> xmdm, </if>
            <if test="xmmc != null and xmmc !='' "> xmmc, </if>
        </trim>
        )
        values (
        <trim prefixOverrides="," suffixOverrides=",">
            <if test="gsdm != null and gsdm !='' "> #{gsdm}, </if>
            <if test="kjnd != null and kjnd !='' "> #{kjnd}, </if>
            <if test="djlxId != null and djlxId !='' "> ${djlxId}, </if>
            <if test="mlId != null and mlId !='' "> ${mlId}, </if>
            <if test="zt != null and zt !='' "> #{zt}, </if>
            <if test="crerdm != null and crerdm !=''"> #{crerdm}, </if>
            <if test="crermc != null and crermc !='' "> #{crermc}, </if>
            <if test="crerdate != null and crerdate !='' "> #{crerdate}, </if>
            <if test="flowcode != null and flowcode !='' "> #{flowcode},</if>
            <if test="curshjd != null and curshjd !='' "> ${curshjd}, </if>
            <if test="nextshjd != null and nextshjd !='' "> ${nextshjd},</if>
            <if test="shrs != null and shrs !='' "> #{shrs}, </if>
            <if test="shrId != null and shrId !='' "> #{shrId}, </if>
            <if test="shrq != null and shrq !='' "> #{shrq}, </if>
            <if test="jsfs != null and jsfs !='' "> #{jsfs}, </if>
            <if test="djbh != null and djbh !='' "> #{djbh}, </if>
            <if test="djdate != null and djdate !='' "> #{djdate}, </if>
            <if test="fjs != null and fjs !='' "> ${fjs},</if>
            <if test="bmdm != null and bmdm !='' "> #{bmdm}, </if>
            <if test="bmmc != null and bmmc !='' "> #{bmmc},</if>
            <if test="grdm != null and grdm !='' "> #{grdm}, </if>
            <if test="grmc != null and grmc !='' "> #{grmc},</if>
            <if test="tel != null and tel !='' "> #{tel}, </if>
            <if test="yjje != null and yjje !='' "> #{yjje}, </if>
            <if test="thje != null and thje !='' "> #{thje},</if>
            <if test="blje != null and blje !='' "> #{blje}, </if>
            <if test="je != null and je !='' "> #{je}, </if>
            <if test="whje != null and whje !='' "> #{whje},</if>
            <if test="jedx != null and jedx !='' "> #{jedx}, </if>
            <if test="zy != null and zy !='' "> #{zy}, </if>
            <if test="clf_ccr != null and clf_ccr !='' "> #{clf_ccr}, </if>
            <if test="clf_cclb != null and clf_cclb !='' "> #{clf_cclb}, </if>
            <if test="jjdm != null and jjdm !='' "> #{jjdm}, </if>
            <if test="jjmc != null and jjmc !='' "> #{jjmc}, </if>
            <if test="khyh != null and khyh !='' "> #{khyh}, </if>
            <if test="yhzh != null and yhzh !='' "> #{yhzh}, </if>
            <if test="ssr != null and ssr !='' "> #{ssr}, </if>
            <if test="ssrid != null and ssrid !='' "> #{ssrid}, </if>
            <if test="ssrq != null and ssrq !='' "> #{ssrq}, </if>
            <if test="jflxdm != null and jflxdm !='' "> #{jflxdm}, </if>
            <if test="jflxmc != null and jflxmc !='' "> #{jflxmc}, </if>
            <if test="xmdm != null and xmdm !='' "> #{xmdm}, </if>
            <if test="xmmc != null and xmmc !='' "> #{xmmc}, </if>
        </trim>
        )
    </insert>

    <update id="OerDjmlEntity_update" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        update oer_djml set zy= #{zy}
        where GSDM = #{gsdm} and KJND=#{kjnd} and DJLXID=${djlxId} and MLID=${mlId}
    </update>


    <update id="OerDjmlEntity_update_data" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        update oer_djml set
        <trim prefixOverrides="," suffixOverrides=",">
            <if test="gsdm != null and gsdm !='' "> GSDM = #{gsdm}, </if>
            <if test="kjnd != null and kjnd !='' "> KJND = #{kjnd}, </if>
            <if test="djlxId != null and djlxId !='' "> DJLXID = #{djlxId}, </if>
            <if test="mlId != null and mlId !='' "> MLID = #{mlId}, </if>
            <if test="zt != null and zt !='' "> ZT = #{zt}, </if>
            <if test="crerdm != null and crerdm !=''"> CRerDM = #{crerdm}, </if>
            <if test="crermc != null and crermc !='' "> CRerMC = #{crermc}, </if>
            <if test="crerdate != null and crerdate !='' "> CRerDate = #{crerdate}, </if>
            <if test="flowcode != null and flowcode !='' "> FlowCode = #{flowcode},</if>
            <if test="curshjd != null and curshjd !='' "> CurSHJD = #{curshjd}, </if>
            <if test="nextshjd != null and nextshjd !='' "> NextSHJD = #{nextshjd},</if>
            <if test="shrs != null and shrs !='' "> SHR = #{shrs},</if>
            <if test="shrId != null and shrId !=''"> SHRID = #{shrId}, </if>
            <if test="shrq != null and shrq !='' "> SHRQ = #{shrq}, </if>
            <if test="jsfs != null and jsfs !='' "> JSFS = #{jsfs}, </if>
            <if test="djbh != null and djbh !='' "> DJBH = #{djbh}, </if>
            <if test="djdate != null and djdate !='' "> DJDate = #{djdate}, </if>
            <if test="fjs != null and fjs !='' "> FJS = #{fjs},</if>
            <if test="bmdm != null and bmdm !='' "> BMDM = #{bmdm}, </if>
            <if test="bmmc != null and bmmc !='' "> BMMC = #{bmmc},</if>
            <if test="grdm != null and grdm !='' ">GRDM = #{grdm}, </if>
            <if test="grmc != null and grmc !='' ">GRMC = #{grmc},</if>
            <if test="tel != null and tel !='' "> TEL = #{tel}, </if>
            <if test="yjje != null and yjje !='' "> YJJE = #{yjje}, </if>
            <if test="thje != null and thje !='' "> THJE = #{thje},</if>
            <if test="blje != null and blje !='' "> BLJE = #{blje}, </if>
            <if test="je != null and je !='' "> JE = #{je}, </if>
            <if test="whje != null and whje !='' "> WHJE = #{whje},</if>
            <if test="jedx != null and jedx !='' "> JEDX = #{jedx}, </if>
            <if test="zy != null and zy !='' "> ZY = #{zy}, </if>
            <if test="clf_ccr != null and clf_ccr !='' "> clf_ccr = #{clf_ccr}, </if>
            <if test="clf_cclb != null and clf_cclb !='' "> clf_cclb = #{clf_cclb}, </if>
            <if test="jjdm != null and jjdm !='' "> jjdm = #{jjdm}, </if>
            <if test="jjmc != null and jjmc !='' "> jjmc = #{jjmc}, </if>
            <if test="khyh != null and khyh !='' "> khyh = #{khyh}, </if>
            <if test="yhzh != null and yhzh !='' "> yhzh = #{yhzh}, </if>
            <if test="ssr != null and ssr !='' "> ssr = #{ssr}, </if>
            <if test="ssrid != null and ssrid !='' "> ssrid = #{ssrid}, </if>
            <if test="xmdm != null and xmdm !='' "> xmdm = #{xmdm}, </if>
            <if test="xmmc != null and xmmc !='' "> xmmc = #{xmmc}, </if>
        </trim>
        where DJBH = #{djbh}  and MLID=${mlId}
    </update>


    <!--删除，用于单据删除时使用-->
    <delete id="OerDjmlEntity_delete" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        DELETE
        FROM
            oer_djml
        WHERE
            GSDM = #{gsdm}
          AND KJND = #{kjnd}
          AND DJLXID = #{djlxId}
          AND MLID = #{mlId}
    </delete>

    <!--修改 用于单据送审和审批时使用-->
    <update id="OerDjmlEntity_update_songs" parameterType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        UPDATE OER_DJML
        SET ZT = #{zt},
            FlowCode = #{flowcode},
            CurSHJD =#{curshjd},
            NextSHJD = #{nextshjd},
            SHRID =#{shrId},
            SHR = #{shrs},
            SHRQ = #{shrq}
        WHERE
            gsdm = #{gsdm}
          AND kjnd = #{kjnd}
          AND djlxid = #{djlxId}
          AND mlid = #{mlId}
    </update>



    <select id="queryOerDjml" resultType="com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity">
        select
        mlId,
        kjnd,
        gsdm,
        DJBH,
        djlxid
        from OER_DJML
        <trim prefix="where" prefixOverrides="and">
            <if test="djbh != null and djbh != ''"> and DJBH = #{djbh} </if>
        </trim>
    </select>


    <update id="updateOerDjmlZt" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity" >
        update OER_DJML  set
        <trim suffix="" suffixOverrides=",">
            <if test="gsdm != null and gsdm != ''">  GSDM = #{gsdm}, </if>
            <if test="kjnd != null and kjnd != ''">  KJND = #{kjnd}, </if>
            <if test="djlxId != null"> DJLXID = #{djlxId},</if>
            <if test="dqrq != null and dqrq != ''"> DQRQ = #{dqrq},</if>
            <if test="zt != null and zt != ''"> ZT = #{zt},</if>
            <if test="crerdm != null and crerdm != ''"> CRERDM = #{crerdm},</if>
            <if test="crermc != null and crermc != ''"> CRERMC = #{crermc},</if>
            <if test="crerdate != null and crerdate != ''"> CRERDATE = #{crerdate},</if>
            <if test="fkdh != null and fkdh != ''"> FKDH = #{fkdh},</if>
            <if test="fkrid != null"> FKRID = #{fkrid},</if>
            <if test="fkr != null and fkr != ''"> FKR = #{fkr},</if>
            <if test="fkrq != null and fkrq != ''"> FKRQ = #{fkrq},</if>
            <if test="idpzh != null and idpzh != ''"> IDPZH = #{idpzh},</if>
            <if test="pzrid != null"> PZRID = #{pzrid},</if>
            <if test="pzr != null and pzr != ''"> PZR = #{pzr},</if>
            <if test="pzrq != null and pzrq != ''"> PZRQ = #{pzrq},</if>
            <if test="djbh != null and djbh != ''"> DJBH = #{djbh},</if>
            <if test="djdate != null and djdate != ''"> DJDATE = #{djdate},</if>
            <if test="je != null"> JE = #{je},</if>
            <if test="jedx != null and jedx != ''"> JEDX = #{jedx},</if>
            <if test="whje != null"> WHJE = #{whje},</if>
            <if test="fjs != null"> FJS = #{fjs},</if>
            <if test="zy != null and zy != ''"> ZY = #{zy},</if>
            <if test="yjje != null"> YJJE = #{yjje},</if>
            <if test="thje != null"> THJE = #{thje},</if>
            <if test="blje != null"> BLJE = #{blje},</if>
            <if test="bmdm != null and bmdm != ''"> BMDM = #{bmdm},</if>
            <if test="bmmc != null and bmmc != ''"> BMMC = #{bmmc},</if>
            <if test="xmdm != null and xmdm != ''"> XMDM = #{xmdm},</if>
            <if test="xmmc != null and xmmc != ''"> XMMC = #{xmmc},</if>
            <if test="grdm != null and grdm != ''"> GRDM = #{grdm},</if>
            <if test="grmc != null and grmc != ''"> GRMC = #{grmc},</if>
            <if test="dwdm != null and dwdm != ''"> DWDM = #{dwdm},</if>
            <if test="dwmc != null and dwmc != ''"> DWMC = #{dwmc},</if>
            <if test="gndm != null and gndm != ''"> GNDM = #{gndm},</if>
            <if test="gnmc != null and gnmc != ''"> GNMC = #{gnmc},</if>
            <if test="jjdm != null and jjdm != ''"> JJDM = #{jjdm},</if>
            <if test="jjmc != null and jjmc != ''"> JJMC = #{jjmc},</if>
            <if test="fzx6dm != null and fzx6dm != ''"> FZX6DM = #{fzx6dm},</if>
            <if test="fzx6mc != null and fzx6mc != ''"> FZX6MC = #{fzx6mc},</if>
            <if test="fzx7dm != null and fzx7dm != ''"> FZX7DM = #{fzx7dm},</if>
            <if test="fzx7mc != null and fzx7mc != ''"> FZX7MC = #{fzx7mc},</if>
            <if test="fzx8dm != null and fzx8dm != ''"> FZX8DM = #{fzx8dm},</if>
            <if test="fzx8mc != null and fzx8mc != ''"> FZX8MC = #{fzx8mc},</if>
            <if test="fzx9dm != null and fzx9dm != ''"> FZX9DM = #{fzx9dm},</if>
            <if test="fzx9mc != null and fzx9mc != ''"> FZX9MC = #{fzx9mc},</if>
            <if test="fzxadm != null and fzxadm != ''"> FZXADM = #{fzxadm},</if>
            <if test="fzxamc != null and fzxamc != ''"> FZXAMC = #{fzxamc},</if>
            <if test="kmdm != null and kmdm != ''"> KMDM = #{kmdm},</if>
            <if test="kmmc != null and kmmc != ''"> KMMC = #{kmmc},</if>
            <if test="htbh != null and htbh != ''"> HTBH = #{htbh},</if>
            <if test="htjh != null and htjh != ''"> HTJH = #{htjh},</if>
            <if test="skr != null and skr != ''"> SKR = #{skr},</if>
            <if test="yhzh != null and yhzh != ''"> YHZH = #{yhzh},</if>
            <if test="khyh != null and khyh != ''"> KHYH = #{khyh},</if>
            <if test="curshjd != null"> CURSHJD = #{curshjd},</if>
            <if test="nextshjd != null"> NEXTSHJD = #{nextshjd},</if>
            <if test="flowcode != null and flowcode != ''"> FLOWCODE = #{flowcode},</if>
            <if test="shrid != null and shrid != ''"> SHRID = #{shrid},</if>
            <if test="shr != null and shr != ''"> SHR = #{shr},</if>
            <if test="shrq != null and shrq != ''"> SHRQ = #{shrq},</if>
            <if test="sfth != null and sfth != ''"> SFTH = #{sfth},</if>
            <if test="thxx != null and thxx != ''"> THXX = #{thxx},</if>
            <if test="jsfs != null and jsfs != ''"> JSFS = #{jsfs},</if>
            <if test="fqrid != null"> FQRID = #{fqrid},</if>
            <if test="fqr != null and fqr != ''"> FQR = #{fqr},</if>
            <if test="fqrq != null and fqrq != ''"> FQRQ = #{fqrq},</if>
            <if test="wx00000051 != null and wx00000051 != ''"> WX00000051 = #{wx00000051},</if>
            <if test="wx00000052 != null and wx00000052 != ''"> WX00000052 = #{wx00000052},</if>
            <if test="wx00000053 != null and wx00000053 != ''"> WX00000053 = #{wx00000053},</if>
            <if test="wx00000054 != null and wx00000054 != ''"> WX00000054 = #{wx00000054},</if>
            <if test="wx00000055 != null and wx00000055 != ''"> WX00000055 = #{wx00000055},</if>
            <if test="wx00000056 != null"> WX00000056 = #{wx00000056},</if>
            <if test="wx00000057 != null and wx00000057 != ''"> WX00000057 = #{wx00000057},</if>
            <if test="wx00000058 != null and wx00000058 != ''"> WX00000058 = #{wx00000058},</if>
            <if test="wx00000059 != null"> WX00000059 = #{wx00000059},</if>
            <if test="xq != null and xq != ''"> XQ = #{xq},</if>
            <if test="wx00000060 != null and wx00000060 != ''"> WX00000060 = #{wx00000060},</if>
            <if test="skzh != null and skzh != ''"> SKZH = #{skzh},</if>
            <if test="fkzh != null and fkzh != ''"> FKZH = #{fkzh},</if>
            <if test="jsdh != null and jsdh != ''"> JSDH = #{jsdh},</if>
            <if test="jsrid != null"> JSRID = #{jsrid},</if>
            <if test="jsr != null and jsr != ''"> JSR = #{jsr},</if>
            <if test="jsrq != null and jsrq != ''"> JSRQ = #{jsrq},</if>
            <if test="wx00000061 != null and wx00000061 != ''"> WX00000061 = #{wx00000061},</if>
            <if test="wx00000062 != null and wx00000062 != ''"> WX00000062 = #{wx00000062},</if>
            <if test="lybxsx != null and lybxsx != ''"> LYBXSX = #{lybxsx},</if>
            <if test="wx00000065 != null"> WX00000065 = #{wx00000065},</if>
            <if test="wx00000066 != null"> WX00000066 = #{wx00000066},</if>
            <if test="wx00000063 != null"> WX00000063 = #{wx00000063},</if>
            <if test="wx00000064 != null"> WX00000064 = #{wx00000064},</if>
            <if test="wx00000067 != null and wx00000067 != ''"> WX00000067 = #{wx00000067},</if>
            <if test="wx00000068 != null"> WX00000068 = #{wx00000068},</if>
            <if test="wx00000069 != null and wx00000069 != ''"> WX00000069 = #{wx00000069},</if>
            <if test="jflxdm != null and jflxdm != ''"> JFLXDM = #{jflxdm},</if>
            <if test="jflxmc != null and jflxmc != ''"> JFLXMC = #{jflxmc},</if>
            <if test="gzdm != null"> GZDM = #{gzdm},</if>
            <if test="gzmc != null and gzmc != ''"> GZMC = #{gzmc},</if>
            <if test="mxxmdm != null and mxxmdm != ''"> MXXMDM = #{mxxmdm},</if>
            <if test="mxxmmc != null and mxxmmc != ''"> MXXMMC = #{mxxmmc},</if>
            <if test="jxse != null"> JXSE = #{jxse},</if>
            <if test="posrq != null and posrq != ''"> POSRQ = #{posrq},</if>
            <if test="posdh != null and posdh != ''"> POSDH = #{posdh},</if>
            <if test="sfzh != null and sfzh != ''"> SFZH = #{sfzh},</if>
            <if test="province != null and province != ''"> PROVINCE = #{province},</if>
            <if test="city != null and city != ''"> CITY = #{city},</if>
            <if test="yh != null and yh != ''"> YH = #{yh},</if>
            <if test="yhhh != null and yhhh != ''"> YHHH = #{yhhh},</if>
            <if test="khdq != null and khdq != ''"> KHDQ = #{khdq},</if>
            <if test="wyzfguid != null and wyzfguid != ''"> WYZFGUID = #{wyzfguid},</if>
            <if test="fkrname != null and fkrname != ''"> FKRNAME = #{fkrname},</if>
            <if test="fkrkhyh != null and fkrkhyh != ''"> FKRKHYH = #{fkrkhyh},</if>
            <if test="fkryhzh != null and fkryhzh != ''"> FKRYHZH = #{fkryhzh},</if>
            <if test="tel != null and tel != ''"> TEL = #{tel},</if>
            <if test="clfCcr != null and clfCcr != ''"> CLF_CCR = #{clfCcr},</if>
            <if test="wlywguid != null and wlywguid != ''"> WLYWGUID = #{wlywguid},</if>
            <if test="yybh != null and yybh != ''"> YYBH = #{yybh},</if>
            <if test="zjxzdm != null and zjxzdm != ''"> ZJXZDM = #{zjxzdm},</if>
            <if test="zjxzmc != null and zjxzmc != ''"> ZJXZMC = #{zjxzmc},</if>
            <if test="zjlydm != null and zjlydm != ''"> ZJLYDM = #{zjlydm},</if>
            <if test="zjlymc != null and zjlymc != ''"> ZJLYMC = #{zjlymc},</if>
            <if test="ysdwdm != null and ysdwdm != ''"> YSDWDM = #{ysdwdm},</if>
            <if test="ysdwmc != null and ysdwmc != ''"> YSDWMC = #{ysdwmc},</if>
            <if test="sfkgsdm != null and sfkgsdm != ''"> SFKGSDM = #{sfkgsdm},</if>
            <if test="wlh != null and wlh != ''"> wlh = #{wlh},</if>
            <if test="wlhdisplay != null and wlhdisplay != ''"> wlhDisplay = #{wlhdisplay},</if>
            <if test="clfCclb != null and clfCclb != ''"> CLF_CCLB = #{clfCclb},</if>
            <if test="kzzl1dm != null and kzzl1dm != ''"> KZZL1DM = #{kzzl1dm},</if>
            <if test="kzzl1mc != null and kzzl1mc != ''"> KZZL1MC = #{kzzl1mc},</if>
            <if test="kzzl2dm != null and kzzl2dm != ''"> KZZL2DM = #{kzzl2dm},</if>
            <if test="kzzl2mc != null and kzzl2mc != ''"> KZZL2MC = #{kzzl2mc},</if>
            <if test="kzzl3dm != null and kzzl3dm != ''"> KZZL3DM = #{kzzl3dm},</if>
            <if test="kzzl3mc != null and kzzl3mc != ''"> KZZL3MC = #{kzzl3mc},</if>
            <if test="kzzl4dm != null and kzzl4dm != ''"> KZZL4DM = #{kzzl4dm},</if>
            <if test="kzzl4mc != null and kzzl4mc != ''"> KZZL4MC = #{kzzl4mc},</if>
            <if test="kzzl5dm != null and kzzl5dm != ''"> KZZL5DM = #{kzzl5dm},</if>
            <if test="kzzl5mc != null and kzzl5mc != ''"> KZZL5MC = #{kzzl5mc},</if>
            <if test="kzzl6dm != null and kzzl6dm != ''"> KZZL6DM = #{kzzl6dm},</if>
            <if test="kzzl6mc != null and kzzl6mc != ''"> KZZL6MC = #{kzzl6mc},</if>
            <if test="kzzl7dm != null and kzzl7dm != ''"> KZZL7DM = #{kzzl7dm},</if>
            <if test="kzzl7mc != null and kzzl7mc != ''"> KZZL7MC = #{kzzl7mc},</if>
            <if test="zcsxdm != null and zcsxdm != ''"> ZCSXDM = #{zcsxdm},</if>
            <if test="zcsxmc != null and zcsxmc != ''"> ZCSXMC = #{zcsxmc},</if>
            <if test="fybz != null and fybz != ''"> FYBZ = #{fybz},</if>
            <if test="ts != null"> TS = #{ts},</if>
            <if test="hdksrq != null and hdksrq != ''"> HDKSRQ = #{hdksrq},</if>
            <if test="hdjsrq != null and hdjsrq != ''"> HDJSRQ = #{hdjsrq},</if>
            <if test="startdate != null and startdate != ''"> StartDate = #{startdate},</if>
            <if test="enddate != null and enddate != ''"> EndDate = #{enddate},</if>
            <if test="sfdd != null and sfdd != ''"> SFDD = #{sfdd},</if>
            <if test="fddsm != null and fddsm != ''"> FDDSM = #{fddsm},</if>
            <if test="zwjb != null and zwjb != ''"> ZWJB = #{zwjb},</if>
            <if test="jddxdw != null and jddxdw != ''"> JDDXDW = #{jddxdw},</if>
            <if test="zbxm != null and zbxm != ''"> ZBXM = #{zbxm},</if>
            <if test="hylb != null and hylb != ''"> HYLB = #{hylb},</if>
            <if test="pxmc != null and pxmc != ''"> PXMC = #{pxmc},</if>
            <if test="pxlb != null and pxlb != ''"> PXLB = #{pxlb},</if>
            <if test="zyrs != null"> ZYRS = #{zyrs},</if>
            <if test="fzrs != null"> FZRS = #{fzrs},</if>
            <if test="dd != null and dd != ''"> DD = #{dd},</if>
            <if test="hymc != null and hymc != ''"> HYMC = #{hymc},</if>
            <if test="smssendflag != null"> SmsSendFlag = #{smssendflag},</if>
            <if test="billmods != null and billmods != ''"> BillMODS = #{billmods},</if>
            <if test="dxLwfdh != null and dxLwfdh != ''"> DX_LWFDH = #{dxLwfdh},</if>
            <if test="dxClspdh != null and dxClspdh != ''"> DX_CLSPDH = #{dxClspdh},</if>
            <if test="dxHyjh != null and dxHyjh != ''"> DX_HYJH = #{dxHyjh},</if>
            <if test="dxZclx != null and dxZclx != ''"> DX_ZCLX = #{dxZclx},</if>
            <if test="zffsxx != null and zffsxx != ''"> ZFFSXX = #{zffsxx},</if>
            <if test="clfQzf != null"> CLF_QZF = #{clfQzf},</if>
            <if test="clfBxf != null"> CLF_BXF = #{clfBxf},</if>
            <if test="clfQtf != null"> CLF_QTF = #{clfQtf},</if>
            <if test="clfJtf != null"> CLF_JTF = #{clfJtf},</if>
            <if test="clfCcts != null"> CLF_CCTS = #{clfCcts},</if>
            <if test="dyrid != null and dyrid != ''"> DYRID = #{dyrid},</if>
            <if test="dyr != null and dyr != ''"> DYR = #{dyr},</if>
            <if test="dyrq != null and dyrq != ''"> DYRQ = #{dyrq},</if>
            <if test="dycs != null"> DYCS = #{dycs},</if>
            <if test="idsfpd != null and idsfpd != ''"> IDSFPD = #{idsfpd},</if>
            <if test="yskjkmdm != null and yskjkmdm != ''"> YSKJKMDM = #{yskjkmdm},</if>
            <if test="yskjkmmc != null and yskjkmmc != ''"> YSKJKMMC = #{yskjkmmc},</if>
            <if test="djguid != null and djguid != ''"> DJGUID = #{djguid},</if>
            <if test="ssrq != null and ssrq != ''"> SSRQ = #{ssrq},</if>
            <if test="ssrid != null and ssrid != ''"> SSRID = #{ssrid},</if>
            <if test="ssr != null and ssr != ''"> SSR = #{ssr},</if>
            <if test="xmfldm != null and xmfldm != ''"> XMFLDM = #{xmfldm},</if>
            <if test="xmflmc != null and xmflmc != ''"> XMFLMC = #{xmflmc},</if>
            <if test="zcbh != null and zcbh != ''"> ZCBH = #{zcbh},</if>
            <if test="gwzjbxdbh != null and gwzjbxdbh != ''"> GWZJBXDBH = #{gwzjbxdbh},</if>
            <if test="wbdjbh != null and wbdjbh != ''"> WBDJBH = #{wbdjbh},</if>
            <if test="fzx11dm != null and fzx11dm != ''"> FZX11DM = #{fzx11dm},</if>
            <if test="fzx11mc != null and fzx11mc != ''"> FZX11MC = #{fzx11mc},</if>
            <if test="fzx12dm != null and fzx12dm != ''"> FZX12DM = #{fzx12dm},</if>
            <if test="fzx12mc != null and fzx12mc != ''"> FZX12MC = #{fzx12mc},</if>
            <if test="fzx13dm != null and fzx13dm != ''"> FZX13DM = #{fzx13dm},</if>
            <if test="fzx13mc != null and fzx13mc != ''"> FZX13MC = #{fzx13mc},</if>
            <if test="fzx14dm != null and fzx14dm != ''"> FZX14DM = #{fzx14dm},</if>
            <if test="fzx14mc != null and fzx14mc != ''"> FZX14MC = #{fzx14mc},</if>
            <if test="fzx15dm != null and fzx15dm != ''"> FZX15DM = #{fzx15dm},</if>
            <if test="fzx15mc != null and fzx15mc != ''"> FZX15MC = #{fzx15mc},</if>
            <if test="fzx16dm != null and fzx16dm != ''"> FZX16DM = #{fzx16dm},</if>
            <if test="fzx16mc != null and fzx16mc != ''"> FZX16MC = #{fzx16mc},</if>
            <if test="fzx17dm != null and fzx17dm != ''"> FZX17DM = #{fzx17dm},</if>
            <if test="fzx17mc != null and fzx17mc != ''"> FZX17MC = #{fzx17mc},</if>
            <if test="fzx18dm != null and fzx18dm != ''"> FZX18DM = #{fzx18dm},</if>
            <if test="fzx18mc != null and fzx18mc != ''"> FZX18MC = #{fzx18mc},</if>
            <if test="fzx19dm != null and fzx19dm != ''"> FZX19DM = #{fzx19dm},</if>
            <if test="fzx19mc != null and fzx19mc != ''"> FZX19MC = #{fzx19mc},</if>
            <if test="fzx20dm != null and fzx20dm != ''"> FZX20DM = #{fzx20dm},</if>
            <if test="fzx20mc != null and fzx20mc != ''"> FZX20MC = #{fzx20mc},</if>
            <if test="fzx21dm != null and fzx21dm != ''"> FZX21DM = #{fzx21dm},</if>
            <if test="fzx21mc != null and fzx21mc != ''"> FZX21MC = #{fzx21mc},</if>
            <if test="fzx22dm != null and fzx22dm != ''"> FZX22DM = #{fzx22dm},</if>
            <if test="fzx22mc != null and fzx22mc != ''"> FZX22MC = #{fzx22mc},</if>
            <if test="fzx23dm != null and fzx23dm != ''"> FZX23DM = #{fzx23dm},</if>
            <if test="fzx23mc != null and fzx23mc != ''"> FZX23MC = #{fzx23mc},</if>
            <if test="fzx24dm != null and fzx24dm != ''"> FZX24DM = #{fzx24dm},</if>
            <if test="fzx24mc != null and fzx24mc != ''"> FZX24MC = #{fzx24mc},</if>
            <if test="fzx25dm != null and fzx25dm != ''"> FZX25DM = #{fzx25dm},</if>
            <if test="fzx25mc != null and fzx25mc != ''"> FZX25MC = #{fzx25mc},</if>
            <if test="fzx26dm != null and fzx26dm != ''"> FZX26DM = #{fzx26dm},</if>
            <if test="fzx26mc != null and fzx26mc != ''"> FZX26MC = #{fzx26mc},</if>
            <if test="fzx27dm != null and fzx27dm != ''"> FZX27DM = #{fzx27dm},</if>
            <if test="fzx27mc != null and fzx27mc != ''"> FZX27MC = #{fzx27mc},</if>
            <if test="fzx28dm != null and fzx28dm != ''"> FZX28DM = #{fzx28dm},</if>
            <if test="fzx28mc != null and fzx28mc != ''"> FZX28MC = #{fzx28mc},</if>
            <if test="fzx29dm != null and fzx29dm != ''"> FZX29DM = #{fzx29dm},</if>
            <if test="fzx29mc != null and fzx29mc != ''"> FZX29MC = #{fzx29mc},</if>
            <if test="fzx30dm != null and fzx30dm != ''"> FZX30DM = #{fzx30dm},</if>
            <if test="fzx30mc != null and fzx30mc != ''"> FZX30MC = #{fzx30mc},</if>
            <if test="tduser != null and tduser != ''"> TDUSER = #{tduser},</if>
            <if test="tddate != null and tddate != ''"> TDDATE = #{tddate},</if>
        </trim>
        where MLID = #{mlid}
    </update>
    <update id="updateOerDjml" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.OerDjmlEntity" >
        update OER_DJML  set
        <trim suffix="" suffixOverrides=",">
            <if test="zt != null and zt != ''"> ZT = #{zt},</if>
            <if test="curshjd != null and curshjd != ''"> curshjd = #{curshjd},</if>
            <if test="nextshjd != null and nextshjd != ''"> nextshjd = #{nextshjd},</if>
             ssrid = #{ssrid},
             ssr = #{ssr},
             ssrq = #{ssrq},
             shrid = #{ssrid},
             shrq = #{shrq}
        </trim>
        where MLID = #{mlId} and DJBH = #{djbh}
    </update>
    <update id="updateGbiZbsyrecByDjid" parameterType = "com.hzya.frame.grpU8.nxproof.oerdjml.entity.GbiZbsyrecAllEntity" >
        update GBI_ZBSYREC  set
        <trim suffix="" suffixOverrides=",">
            <if test="djzt != null and djzt != ''"> DJZT = #{djzt},</if>
        </trim>
        where djid = #{djid} and djlx = #{djlx}
    </update>

</mapper>
