<?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.glkmxx.dao.impl.SenderGlKmxxDaoImpl">

    <resultMap id="get-SenderGlKmxxEntity-result" type="com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity" >
       <result property="gsdm" column="gsdm" jdbcType="VARCHAR"/>
           <result property="zth" column="ZTH" jdbcType="VARCHAR"/>
           <result property="kjnd" column="kjnd" jdbcType="VARCHAR"/>
           <result property="kmdm" column="kmdm" jdbcType="VARCHAR"/>
           <result property="zjm" column="zjm" jdbcType="VARCHAR"/>
           <result property="kmmc" column="kmmc" jdbcType="VARCHAR"/>
           <result property="syzt" column="syzt" jdbcType="VARCHAR"/>
           <result property="kmxz" column="kmxz" jdbcType="VARCHAR"/>
           <result property="kmmxlb" column="kmmxlb" jdbcType="VARCHAR"/>
           <result property="kmmx" column="kmmx" jdbcType="VARCHAR"/>
           <result property="kmgs" column="kmgs" jdbcType="VARCHAR"/>
           <result property="kmbz" column="kmbz" jdbcType="VARCHAR"/>
           <result property="kmdw" column="kmdw" jdbcType="VARCHAR"/>
           <result property="kmslxsws" column="kmslxsws" jdbcType="INTEGER"/>
           <result property="kmlb" column="kmlb" jdbcType="VARCHAR"/>
           <result property="kmhdfx" column="kmhdfx" jdbcType="VARCHAR"/>
           <result property="kmsyfx" column="kmsyfx" jdbcType="VARCHAR"/>
           <result property="syzcfs" column="syzcfs" jdbcType="VARCHAR"/>
           <result property="kmpz" column="kmpz" jdbcType="VARCHAR"/>
           <result property="yefx" column="yefx" jdbcType="VARCHAR"/>
           <result property="fzsm" column="fzsm" jdbcType="VARCHAR"/>
           <result property="fzhs" column="fzhs" jdbcType="VARCHAR"/>
           <result property="jfmax" column="jfmax" jdbcType="VARCHAR"/>
           <result property="dfmax" column="dfmax" jdbcType="VARCHAR"/>
           <result property="yemax" column="yemax" jdbcType="VARCHAR"/>
           <result property="accNa" column="acc_na" jdbcType="VARCHAR"/>
           <result property="kmjx" column="kmjx" jdbcType="VARCHAR"/>
           <result property="kmqx" column="kmqx" jdbcType="VARCHAR"/>
           <result property="jlrId" column="JLR_ID" jdbcType="INTEGER"/>
           <result property="jlRq" column="JL_RQ" jdbcType="VARCHAR"/>
           <result property="xgrId" column="XGR_ID" jdbcType="INTEGER"/>
           <result property="xgRq" column="XG_RQ" jdbcType="VARCHAR"/>
           <result property="sjly" column="Sjly" jdbcType="VARCHAR"/>
           <result property="zdyfzhs" column="zdyfzhs" jdbcType="VARCHAR"/>
           <result property="kjtxdm" column="kjtxdm" jdbcType="VARCHAR"/>
           <result property="dwlxdm" column="dwlxdm" jdbcType="VARCHAR"/>
           <result property="kmsm" column="kmsm" jdbcType="VARCHAR"/>
           <result property="bcdj" column="bcdj" jdbcType="VARCHAR"/>
           <result property="czyjkz" column="czyjkz" jdbcType="VARCHAR"/>
           <result property="qycyx" column="qycyx" jdbcType="VARCHAR"/>
           <result property="qyrjz" column="qyrjz" jdbcType="VARCHAR"/>
           <result property="djdqrq" column="djdqrq" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "SenderGlKmxxEntity_Base_Column_List">
        gsdm
        , ZTH
        , kjnd
        , kmdm
        , zjm
        , kmmc
        , syzt
        , kmxz
        , kmmxlb
        , kmmx
        , kmgs
        , kmbz
        , kmdw
        , kmslxsws
        , kmlb
        , kmhdfx
        , kmsyfx
        , syzcfs
        , kmpz
        , yefx
        , fzsm
        , fzhs
        , jfmax
        , dfmax
        , yemax
        , acc_na
        , kmjx
        , kmqx
        , JLR_ID
        , JL_RQ
        , XGR_ID
        , XG_RQ
        , Sjly
        , zdyfzhs
        , kjtxdm
        , dwlxdm
        , kmsm
        , bcdj
        , czyjkz
        , qycyx
        , qyrjz
        , djdqrq
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-SenderGlKmxxEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity">
    select
    <include refid="SenderGlKmxxEntity_Base_Column_List" />
    from gl_kmxx
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm = #{gsdm} </if>
            <if test="zth != null and zth != ''"> and ZTH = #{zth} </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="kmdm != null and kmdm != ''"> and kmdm = #{kmdm} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="kmmc != null and kmmc != ''"> and kmmc = #{kmmc} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="kmxz != null and kmxz != ''"> and kmxz = #{kmxz} </if>
            <if test="kmmxlb != null and kmmxlb != ''"> and kmmxlb = #{kmmxlb} </if>
            <if test="kmmx != null and kmmx != ''"> and kmmx = #{kmmx} </if>
            <if test="kmgs != null and kmgs != ''"> and kmgs = #{kmgs} </if>
            <if test="kmbz != null and kmbz != ''"> and kmbz = #{kmbz} </if>
            <if test="kmdw != null and kmdw != ''"> and kmdw = #{kmdw} </if>
            <if test="kmslxsws != null"> and kmslxsws = #{kmslxsws} </if>
            <if test="kmlb != null and kmlb != ''"> and kmlb = #{kmlb} </if>
            <if test="kmhdfx != null and kmhdfx != ''"> and kmhdfx = #{kmhdfx} </if>
            <if test="kmsyfx != null and kmsyfx != ''"> and kmsyfx = #{kmsyfx} </if>
            <if test="syzcfs != null and syzcfs != ''"> and syzcfs = #{syzcfs} </if>
            <if test="kmpz != null and kmpz != ''"> and kmpz = #{kmpz} </if>
            <if test="yefx != null and yefx != ''"> and yefx = #{yefx} </if>
            <if test="fzsm != null and fzsm != ''"> and fzsm = #{fzsm} </if>
            <if test="fzhs != null and fzhs != ''"> and fzhs = #{fzhs} </if>
            <if test="jfmax != null"> and jfmax = #{jfmax} </if>
            <if test="dfmax != null"> and dfmax = #{dfmax} </if>
            <if test="yemax != null"> and yemax = #{yemax} </if>
            <if test="accNa != null and accNa != ''"> and acc_na = #{accNa} </if>
            <if test="kmjx != null and kmjx != ''"> and kmjx = #{kmjx} </if>
            <if test="kmqx != null and kmqx != ''"> and kmqx = #{kmqx} </if>
            <if test="jlrId != null"> and JLR_ID = #{jlrId} </if>
            <if test="jlRq != null and jlRq != ''"> and JL_RQ = #{jlRq} </if>
            <if test="xgrId != null"> and XGR_ID = #{xgrId} </if>
            <if test="xgRq != null and xgRq != ''">  and XG_RQ >= #{xgRq} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </if>
            <if test="zdyfzhs != null and zdyfzhs != ''"> and zdyfzhs = #{zdyfzhs} </if>
            <if test="kjtxdm != null and kjtxdm != ''"> and kjtxdm = #{kjtxdm} </if>
            <if test="dwlxdm != null and dwlxdm != ''"> and dwlxdm = #{dwlxdm} </if>
            <if test="kmsm != null and kmsm != ''"> and kmsm = #{kmsm} </if>
            <if test="bcdj != null and bcdj != ''"> and bcdj = #{bcdj} </if>
            <if test="czyjkz != null and czyjkz != ''"> and czyjkz = #{czyjkz} </if>
            <if test="qycyx != null and qycyx != ''"> and qycyx = #{qycyx} </if>
            <if test="qyrjz != null and qyrjz != ''"> and qyrjz = #{qyrjz} </if>
            <if test="djdqrq != null and djdqrq != ''"> and zdyfzhs = #{djdqrq} </if>
        -- and gsdm in ('0101010201','0101010202')
    </trim>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity">
        select  count(1)   from gl_kmxx
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm = #{gsdm} </if>
            <if test="zth != null and zth != ''"> and ZTH = #{zth} </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="kmdm != null and kmdm != ''"> and kmdm = #{kmdm} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="kmmc != null and kmmc != ''"> and kmmc = #{kmmc} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="kmxz != null and kmxz != ''"> and kmxz = #{kmxz} </if>
            <if test="kmmxlb != null and kmmxlb != ''"> and kmmxlb = #{kmmxlb} </if>
            <if test="kmmx != null and kmmx != ''"> and kmmx = #{kmmx} </if>
            <if test="kmgs != null and kmgs != ''"> and kmgs = #{kmgs} </if>
            <if test="kmbz != null and kmbz != ''"> and kmbz = #{kmbz} </if>
            <if test="kmdw != null and kmdw != ''"> and kmdw = #{kmdw} </if>
            <if test="kmslxsws != null"> and kmslxsws = #{kmslxsws} </if>
            <if test="kmlb != null and kmlb != ''"> and kmlb = #{kmlb} </if>
            <if test="kmhdfx != null and kmhdfx != ''"> and kmhdfx = #{kmhdfx} </if>
            <if test="kmsyfx != null and kmsyfx != ''"> and kmsyfx = #{kmsyfx} </if>
            <if test="syzcfs != null and syzcfs != ''"> and syzcfs = #{syzcfs} </if>
            <if test="kmpz != null and kmpz != ''"> and kmpz = #{kmpz} </if>
            <if test="yefx != null and yefx != ''"> and yefx = #{yefx} </if>
            <if test="fzsm != null and fzsm != ''"> and fzsm = #{fzsm} </if>
            <if test="fzhs != null and fzhs != ''"> and fzhs = #{fzhs} </if>
            <if test="jfmax != null"> and jfmax = #{jfmax} </if>
            <if test="dfmax != null"> and dfmax = #{dfmax} </if>
            <if test="yemax != null"> and yemax = #{yemax} </if>
            <if test="accNa != null and accNa != ''"> and acc_na = #{accNa} </if>
            <if test="kmjx != null and kmjx != ''"> and kmjx = #{kmjx} </if>
            <if test="kmqx != null and kmqx != ''"> and kmqx = #{kmqx} </if>
            <if test="jlrId != null"> and JLR_ID = #{jlrId} </if>
            <if test="jlRq != null and jlRq != ''"> and JL_RQ = #{jlRq} </if>
            <if test="xgrId != null"> and XGR_ID = #{xgrId} </if>
            <if test="xgRq != null and xgRq != ''"> and XG_RQ = #{xgRq} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </if>
            <if test="zdyfzhs != null and zdyfzhs != ''"> and zdyfzhs = #{zdyfzhs} </if>
    </trim>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SenderGlKmxxEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity">
    select
    <include refid="SenderGlKmxxEntity_Base_Column_List" />
    from gl_kmxx
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm like concat('%',#{gsdm},'%') </if>
            <if test="zth != null and zth != ''"> and ZTH like concat('%',#{zth},'%') </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd like concat('%',#{kjnd},'%') </if>
            <if test="kmdm != null and kmdm != ''"> and kmdm like concat('%',#{kmdm},'%') </if>
            <if test="zjm != null and zjm != ''"> and zjm like concat('%',#{zjm},'%') </if>
            <if test="kmmc != null and kmmc != ''"> and kmmc like concat('%',#{kmmc},'%') </if>
            <if test="syzt != null and syzt != ''"> and syzt like concat('%',#{syzt},'%') </if>
            <if test="kmxz != null and kmxz != ''"> and kmxz like concat('%',#{kmxz},'%') </if>
            <if test="kmmxlb != null and kmmxlb != ''"> and kmmxlb like concat('%',#{kmmxlb},'%') </if>
            <if test="kmmx != null and kmmx != ''"> and kmmx like concat('%',#{kmmx},'%') </if>
            <if test="kmgs != null and kmgs != ''"> and kmgs like concat('%',#{kmgs},'%') </if>
            <if test="kmbz != null and kmbz != ''"> and kmbz like concat('%',#{kmbz},'%') </if>
            <if test="kmdw != null and kmdw != ''"> and kmdw like concat('%',#{kmdw},'%') </if>
            <if test="kmslxsws != null"> and kmslxsws like concat('%',#{kmslxsws},'%') </if>
            <if test="kmlb != null and kmlb != ''"> and kmlb like concat('%',#{kmlb},'%') </if>
            <if test="kmhdfx != null and kmhdfx != ''"> and kmhdfx like concat('%',#{kmhdfx},'%') </if>
            <if test="kmsyfx != null and kmsyfx != ''"> and kmsyfx like concat('%',#{kmsyfx},'%') </if>
            <if test="syzcfs != null and syzcfs != ''"> and syzcfs like concat('%',#{syzcfs},'%') </if>
            <if test="kmpz != null and kmpz != ''"> and kmpz like concat('%',#{kmpz},'%') </if>
            <if test="yefx != null and yefx != ''"> and yefx like concat('%',#{yefx},'%') </if>
            <if test="fzsm != null and fzsm != ''"> and fzsm like concat('%',#{fzsm},'%') </if>
            <if test="fzhs != null and fzhs != ''"> and fzhs like concat('%',#{fzhs},'%') </if>
            <if test="jfmax != null"> and jfmax like concat('%',#{jfmax},'%') </if>
            <if test="dfmax != null"> and dfmax like concat('%',#{dfmax},'%') </if>
            <if test="yemax != null"> and yemax like concat('%',#{yemax},'%') </if>
            <if test="accNa != null and accNa != ''"> and acc_na like concat('%',#{accNa},'%') </if>
            <if test="kmjx != null and kmjx != ''"> and kmjx like concat('%',#{kmjx},'%') </if>
            <if test="kmqx != null and kmqx != ''"> and kmqx like concat('%',#{kmqx},'%') </if>
            <if test="jlrId != null"> and JLR_ID like concat('%',#{jlrId},'%') </if>
            <if test="jlRq != null and jlRq != ''"> and JL_RQ like concat('%',#{jlRq},'%') </if>
            <if test="xgrId != null"> and XGR_ID like concat('%',#{xgrId},'%') </if>
            <if test="xgRq != null and xgRq != ''"> and XG_RQ like concat('%',#{xgRq},'%') </if>
            <if test="sjly != null and sjly != ''"> and Sjly like concat('%',#{sjly},'%') </if>
            <if test="zdyfzhs != null and zdyfzhs != ''"> and zdyfzhs like concat('%',#{zdyfzhs},'%') </if>
    </trim>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="SenderGlKmxxEntity_list_or" resultMap="get-SenderGlKmxxEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity">
    select
    <include refid="SenderGlKmxxEntity_Base_Column_List" />
    from gl_kmxx
    <trim prefix="where" prefixOverrides="and"> 
         <if test="gsdm != null and gsdm != ''"> or gsdm = #{gsdm} </if>
             <if test="zth != null and zth != ''"> or ZTH = #{zth} </if>
             <if test="kjnd != null and kjnd != ''"> or kjnd = #{kjnd} </if>
             <if test="kmdm != null and kmdm != ''"> or kmdm = #{kmdm} </if>
             <if test="zjm != null and zjm != ''"> or zjm = #{zjm} </if>
             <if test="kmmc != null and kmmc != ''"> or kmmc = #{kmmc} </if>
             <if test="syzt != null and syzt != ''"> or syzt = #{syzt} </if>
             <if test="kmxz != null and kmxz != ''"> or kmxz = #{kmxz} </if>
             <if test="kmmxlb != null and kmmxlb != ''"> or kmmxlb = #{kmmxlb} </if>
             <if test="kmmx != null and kmmx != ''"> or kmmx = #{kmmx} </if>
             <if test="kmgs != null and kmgs != ''"> or kmgs = #{kmgs} </if>
             <if test="kmbz != null and kmbz != ''"> or kmbz = #{kmbz} </if>
             <if test="kmdw != null and kmdw != ''"> or kmdw = #{kmdw} </if>
             <if test="kmslxsws != null"> or kmslxsws = #{kmslxsws} </if>
             <if test="kmlb != null and kmlb != ''"> or kmlb = #{kmlb} </if>
             <if test="kmhdfx != null and kmhdfx != ''"> or kmhdfx = #{kmhdfx} </if>
             <if test="kmsyfx != null and kmsyfx != ''"> or kmsyfx = #{kmsyfx} </if>
             <if test="syzcfs != null and syzcfs != ''"> or syzcfs = #{syzcfs} </if>
             <if test="kmpz != null and kmpz != ''"> or kmpz = #{kmpz} </if>
             <if test="yefx != null and yefx != ''"> or yefx = #{yefx} </if>
             <if test="fzsm != null and fzsm != ''"> or fzsm = #{fzsm} </if>
             <if test="fzhs != null and fzhs != ''"> or fzhs = #{fzhs} </if>
             <if test="jfmax != null"> or jfmax = #{jfmax} </if>
             <if test="dfmax != null"> or dfmax = #{dfmax} </if>
             <if test="yemax != null"> or yemax = #{yemax} </if>
             <if test="accNa != null and accNa != ''"> or acc_na = #{accNa} </if>
             <if test="kmjx != null and kmjx != ''"> or kmjx = #{kmjx} </if>
             <if test="kmqx != null and kmqx != ''"> or kmqx = #{kmqx} </if>
             <if test="jlrId != null"> or JLR_ID = #{jlrId} </if>
             <if test="jlRq != null and jlRq != ''"> or JL_RQ = #{jlRq} </if>
             <if test="xgrId != null"> or XGR_ID = #{xgrId} </if>
             <if test="xgRq != null and xgRq != ''"> or XG_RQ = #{xgRq} </if>
             <if test="sjly != null and sjly != ''"> or Sjly = #{sjly} </if>
             <if test="zdyfzhs != null and zdyfzhs != ''"> or zdyfzhs = #{zdyfzhs} </if>
    </trim>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity" keyProperty="" useGeneratedKeys="true">
    insert into gl_kmxx(
    <trim suffix="" suffixOverrides=",">
        <if test="zth != null and zth != ''"> ZTH , </if>
        <if test="kjnd != null and kjnd != ''"> kjnd , </if>
        <if test="kmdm != null and kmdm != ''"> kmdm , </if>
        <if test="zjm != null and zjm != ''"> zjm , </if>
        <if test="kmmc != null and kmmc != ''"> kmmc , </if>
        <if test="syzt != null and syzt != ''"> syzt , </if>
        <if test="kmxz != null and kmxz != ''"> kmxz , </if>
        <if test="kmmxlb != null and kmmxlb != ''"> kmmxlb , </if>
        <if test="kmmx != null and kmmx != ''"> kmmx , </if>
        <if test="kmgs != null and kmgs != ''"> kmgs , </if>
        <if test="kmbz != null and kmbz != ''"> kmbz , </if>
        <if test="kmdw != null and kmdw != ''"> kmdw , </if>
        <if test="kmslxsws != null"> kmslxsws , </if>
        <if test="kmlb != null and kmlb != ''"> kmlb , </if>
        <if test="kmhdfx != null and kmhdfx != ''"> kmhdfx , </if>
        <if test="kmsyfx != null and kmsyfx != ''"> kmsyfx , </if>
        <if test="syzcfs != null and syzcfs != ''"> syzcfs , </if>
        <if test="kmpz != null and kmpz != ''"> kmpz , </if>
        <if test="yefx != null and yefx != ''"> yefx , </if>
        <if test="fzsm != null and fzsm != ''"> fzsm , </if>
        <if test="fzhs != null and fzhs != ''"> fzhs , </if>
        <if test="jfmax != null"> jfmax , </if>
        <if test="dfmax != null"> dfmax , </if>
        <if test="yemax != null"> yemax , </if>
        <if test="accNa != null and accNa != ''"> acc_na , </if>
        <if test="kmjx != null and kmjx != ''"> kmjx , </if>
        <if test="kmqx != null and kmqx != ''"> kmqx , </if>
        <if test="jlrId != null"> JLR_ID , </if>
        <if test="jlRq != null and jlRq != ''"> JL_RQ , </if>
        <if test="xgrId != null"> XGR_ID , </if>
        <if test="xgRq != null and xgRq != ''"> XG_RQ , </if>
        <if test="sjly != null and sjly != ''"> Sjly , </if>
        <if test="zdyfzhs != null and zdyfzhs != ''"> zdyfzhs , </if>
        <if test="gsdm != null and gsdm != ''"> gsdm,  </if>
        <if test="kjtxdm != null and kjtxdm != ''"> kjtxdm,  </if>
        <if test="dwlxdm != null and dwlxdm != ''"> dwlxdm,  </if>
        <if test="kmsm != null and kmsm != ''"> kmsm,  </if>
        <if test="bcdj != null and bcdj != ''"> bcdj,  </if>
        <if test="czyjkz != null and czyjkz != ''"> czyjkz,  </if>
        <if test="qycyx != null and qycyx != ''"> qycyx,  </if>
        <if test="qyrjz != null and qyrjz != ''"> qyrjz,  </if>
        <if test="djdqrq != null and djdqrq != ''"> djdqrq  </if>
    </trim>
    )values(
    <trim suffix="" suffixOverrides=",">
        <if test="zth != null and zth != ''"> #{zth} ,</if>
        <if test="kjnd != null and kjnd != ''"> #{kjnd} ,</if>
        <if test="kmdm != null and kmdm != ''"> #{kmdm} ,</if>
        <if test="zjm != null and zjm != ''"> #{zjm} ,</if>
        <if test="kmmc != null and kmmc != ''"> #{kmmc} ,</if>
        <if test="syzt != null and syzt != ''"> #{syzt} ,</if>
        <if test="kmxz != null and kmxz != ''"> #{kmxz} ,</if>
        <if test="kmmxlb != null and kmmxlb != ''"> #{kmmxlb} ,</if>
        <if test="kmmx != null and kmmx != ''"> #{kmmx} ,</if>
        <if test="kmgs != null and kmgs != ''"> #{kmgs} ,</if>
        <if test="kmbz != null and kmbz != ''"> #{kmbz} ,</if>
        <if test="kmdw != null and kmdw != ''"> #{kmdw} ,</if>
        <if test="kmslxsws != null"> #{kmslxsws} ,</if>
        <if test="kmlb != null and kmlb != ''"> #{kmlb} ,</if>
        <if test="kmhdfx != null and kmhdfx != ''"> #{kmhdfx} ,</if>
        <if test="kmsyfx != null and kmsyfx != ''"> #{kmsyfx} ,</if>
        <if test="syzcfs != null and syzcfs != ''"> #{syzcfs} ,</if>
        <if test="kmpz != null and kmpz != ''"> #{kmpz} ,</if>
        <if test="yefx != null and yefx != ''"> #{yefx} ,</if>
        <if test="fzsm != null and fzsm != ''"> #{fzsm} ,</if>
        <if test="fzhs != null and fzhs != ''"> #{fzhs} ,</if>
        <if test="jfmax != null"> #{jfmax} ,</if>
        <if test="dfmax != null"> #{dfmax} ,</if>
        <if test="yemax != null"> #{yemax} ,</if>
        <if test="accNa != null and accNa != ''"> #{accNa} ,</if>
        <if test="kmjx != null and kmjx != ''"> #{kmjx} ,</if>
        <if test="kmqx != null and kmqx != ''"> #{kmqx} ,</if>
        <if test="jlrId != null"> #{jlrId} ,</if>
        <if test="jlRq != null and jlRq != ''"> #{jlRq} ,</if>
        <if test="xgrId != null"> #{xgrId} ,</if>
        <if test="xgRq != null and xgRq != ''"> #{xgRq} ,</if>
        <if test="sjly != null and sjly != ''"> #{sjly} ,</if>
        <if test="zdyfzhs != null and zdyfzhs != ''"> #{zdyfzhs} ,</if>
        <if test="gsdm != null and gsdm != ''"> #{gsdm}, </if>
        <if test="kjtxdm != null and kjtxdm != ''"> #{kjtxdm}, </if>
        <if test="dwlxdm != null and dwlxdm != ''"> #{dwlxdm}, </if>
        <if test="kmsm != null and kmsm != ''"> #{kmsm}, </if>
        <if test="bcdj != null and bcdj != ''"> #{bcdj}, </if>
        <if test="czyjkz != null and czyjkz != ''"> #{czyjkz}, </if>
        <if test="qycyx != null and qycyx != ''"> #{qycyx}, </if>
        <if test="qyrjz != null and qyrjz != ''"> #{qyrjz}, </if>
        <if test="djdqrq != null and gsdm != ''"> #{djdqrq} </if>
    </trim>
    )
</insert>


<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
  insert into gl_kmxx(id,gsdm, ZTH, kjnd, kmdm, zjm, kmmc, syzt, kmxz, kmmxlb, kmmx, kmgs, kmbz, kmdw, kmslxsws, kmlb, kmhdfx, kmsyfx, syzcfs, kmpz, yefx, fzsm, fzhs, jfmax, dfmax, yemax, acc_na, kmjx, kmqx, JLR_ID, JL_RQ, XGR_ID, XG_RQ, Sjly, zdyfzhs)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.id},#{entity.gsdm},#{entity.zth},#{entity.kjnd},#{entity.kmdm},#{entity.zjm},#{entity.kmmc},#{entity.syzt},#{entity.kmxz},#{entity.kmmxlb},#{entity.kmmx},#{entity.kmgs},#{entity.kmbz},#{entity.kmdw},#{entity.kmslxsws},#{entity.kmlb},#{entity.kmhdfx},#{entity.kmsyfx},#{entity.syzcfs},#{entity.kmpz},#{entity.yefx},#{entity.fzsm},#{entity.fzhs},#{entity.jfmax},#{entity.dfmax},#{entity.yemax},#{entity.accNa},#{entity.kmjx},#{entity.kmqx},#{entity.jlrId},#{entity.jlRq},#{entity.xgrId},#{entity.xgRq},#{entity.sjly},#{entity.zdyfzhs})
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
    insert into gl_kmxx(id,gsdm, ZTH, kjnd, kmdm, zjm, kmmc, syzt, kmxz, kmmxlb, kmmx, kmgs, kmbz, kmdw, kmslxsws, kmlb, kmhdfx, kmsyfx, syzcfs, kmpz, yefx, fzsm, fzhs, jfmax, dfmax, yemax, acc_na, kmjx, kmqx, JLR_ID, JL_RQ, XGR_ID, XG_RQ, Sjly, zdyfzhs)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.id},#{entity.gsdm},#{entity.zth},#{entity.kjnd},#{entity.kmdm},#{entity.zjm},#{entity.kmmc},#{entity.syzt},#{entity.kmxz},#{entity.kmmxlb},#{entity.kmmx},#{entity.kmgs},#{entity.kmbz},#{entity.kmdw},#{entity.kmslxsws},#{entity.kmlb},#{entity.kmhdfx},#{entity.kmsyfx},#{entity.syzcfs},#{entity.kmpz},#{entity.yefx},#{entity.fzsm},#{entity.fzhs},#{entity.jfmax},#{entity.dfmax},#{entity.yemax},#{entity.accNa},#{entity.kmjx},#{entity.kmqx},#{entity.jlrId},#{entity.jlRq},#{entity.xgrId},#{entity.xgRq},#{entity.sjly},#{entity.zdyfzhs})
    </foreach>
    on duplicate key update
    gsdm = values(gsdm),
    ZTH = values(ZTH),
    kjnd = values(kjnd),
    kmdm = values(kmdm),
    zjm = values(zjm),
    kmmc = values(kmmc),
    syzt = values(syzt),
    kmxz = values(kmxz),
    kmmxlb = values(kmmxlb),
    kmmx = values(kmmx),
    kmgs = values(kmgs),
    kmbz = values(kmbz),
    kmdw = values(kmdw),
    kmslxsws = values(kmslxsws),
    kmlb = values(kmlb),
    kmhdfx = values(kmhdfx),
    kmsyfx = values(kmsyfx),
    syzcfs = values(syzcfs),
    kmpz = values(kmpz),
    yefx = values(yefx),
    fzsm = values(fzsm),
    fzhs = values(fzhs),
    jfmax = values(jfmax),
    dfmax = values(dfmax),
    yemax = values(yemax),
    acc_na = values(acc_na),
    kmjx = values(kmjx),
    kmqx = values(kmqx),
    JLR_ID = values(JLR_ID),
    JL_RQ = values(JL_RQ),
    XGR_ID = values(XGR_ID),
    XG_RQ = values(XG_RQ),
    Sjly = values(Sjly),
    zdyfzhs = values(zdyfzhs)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity" >
    update gl_kmxx  set
    <trim suffix="" suffixOverrides=",">
        <if test="gsdm != null and gsdm != ''"> gsdm = #{gsdm},</if>
        <if test="zth != null and zth != ''"> ZTH = #{zth},</if>
        <if test="kjnd != null and kjnd != ''"> kjnd = #{kjnd},</if>
        <if test="kmdm != null and kmdm != ''"> kmdm = #{kmdm},</if>
        <if test="zjm != null and zjm != ''"> zjm = #{zjm},</if>
        <if test="kmmc != null and kmmc != ''"> kmmc = #{kmmc},</if>
        <if test="syzt != null and syzt != ''"> syzt = #{syzt},</if>
        <if test="kmxz != null and kmxz != ''"> kmxz = #{kmxz},</if>
        <if test="kmmxlb != null and kmmxlb != ''"> kmmxlb = #{kmmxlb},</if>
        <if test="kmmx != null and kmmx != ''"> kmmx = #{kmmx},</if>
        <if test="kmgs != null and kmgs != ''"> kmgs = #{kmgs},</if>
        <if test="kmbz != null and kmbz != ''"> kmbz = #{kmbz},</if>
        <if test="kmdw != null and kmdw != ''"> kmdw = #{kmdw},</if>
        <if test="kmslxsws != null"> kmslxsws = #{kmslxsws},</if>
        <if test="kmlb != null and kmlb != ''"> kmlb = #{kmlb},</if>
        <if test="kmhdfx != null and kmhdfx != ''"> kmhdfx = #{kmhdfx},</if>
        <if test="kmsyfx != null and kmsyfx != ''"> kmsyfx = #{kmsyfx},</if>
        <if test="syzcfs != null and syzcfs != ''"> syzcfs = #{syzcfs},</if>
        <if test="kmpz != null and kmpz != ''"> kmpz = #{kmpz},</if>
        <if test="yefx != null and yefx != ''"> yefx = #{yefx},</if>
        <if test="fzsm != null and fzsm != ''"> fzsm = #{fzsm},</if>
        <if test="fzhs != null and fzhs != ''"> fzhs = #{fzhs},</if>
        <if test="jfmax != null"> jfmax = #{jfmax},</if>
        <if test="dfmax != null"> dfmax = #{dfmax},</if>
        <if test="yemax != null"> yemax = #{yemax},</if>
        <if test="accNa != null and accNa != ''"> acc_na = #{accNa},</if>
        <if test="kmjx != null and kmjx != ''"> kmjx = #{kmjx},</if>
        <if test="kmqx != null and kmqx != ''"> kmqx = #{kmqx},</if>
        <if test="jlrId != null"> JLR_ID = #{jlrId},</if>
        <if test="jlRq != null and jlRq != ''"> JL_RQ = #{jlRq},</if>
        <if test="xgrId != null"> XGR_ID = #{xgrId},</if>
        <if test="xgRq != null and xgRq != ''"> XG_RQ = #{xgRq},</if>
        <if test="sjly != null and sjly != ''"> Sjly = #{sjly},</if>
        <if test="zdyfzhs != null and zdyfzhs != ''"> zdyfzhs = #{zdyfzhs},</if>
        <if test="kjtxdm != null and kjtxdm != ''"> kjtxdm = #{kjtxdm},</if>
        <if test="dwlxdm != null and dwlxdm != ''"> dwlxdm = #{dwlxdm},</if>
        <if test="kmsm != null and kmsm != ''"> kmsm = #{kmsm},</if>
        <if test="bcdj != null and bcdj != ''"> bcdj = #{bcdj},</if>
        <if test="czyjkz != null and czyjkz != ''"> czyjkz = #{czyjkz},</if>
        <if test="qycyx != null and qycyx != ''"> qycyx = #{qycyx},</if>
        <if test="qyrjz != null and qyrjz != ''"> qyrjz = #{qyrjz},</if>
        <if test="djdqrq != null and djdqrq != ''"> djdqrq = #{djdqrq}</if>
    </trim>
    where  gsdm= #{gsdm} and kjnd=#{kjnd} and zth=#{zth} and kmdm=#{kmdm}
</update>


    <!-- 逻辑删除 -->
<update id="SenderGlKmxxEntity_logicDelete" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity" >
update gl_kmxx  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where  id= #{id}
</update>
<!-- 多条件逻辑删除 -->
<update id="SenderGlKmxxEntity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.grpU8.nxproof.glkmxx.entity.SenderGlKmxxEntity" >
update gl_kmxx  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
 <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm = #{gsdm} </if>
            <if test="zth != null and zth != ''"> and ZTH = #{zth} </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="kmdm != null and kmdm != ''"> and kmdm = #{kmdm} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="kmmc != null and kmmc != ''"> and kmmc = #{kmmc} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="kmxz != null and kmxz != ''"> and kmxz = #{kmxz} </if>
            <if test="kmmxlb != null and kmmxlb != ''"> and kmmxlb = #{kmmxlb} </if>
            <if test="kmmx != null and kmmx != ''"> and kmmx = #{kmmx} </if>
            <if test="kmgs != null and kmgs != ''"> and kmgs = #{kmgs} </if>
            <if test="kmbz != null and kmbz != ''"> and kmbz = #{kmbz} </if>
            <if test="kmdw != null and kmdw != ''"> and kmdw = #{kmdw} </if>
            <if test="kmslxsws != null"> and kmslxsws = #{kmslxsws} </if>
            <if test="kmlb != null and kmlb != ''"> and kmlb = #{kmlb} </if>
            <if test="kmhdfx != null and kmhdfx != ''"> and kmhdfx = #{kmhdfx} </if>
            <if test="kmsyfx != null and kmsyfx != ''"> and kmsyfx = #{kmsyfx} </if>
            <if test="syzcfs != null and syzcfs != ''"> and syzcfs = #{syzcfs} </if>
            <if test="kmpz != null and kmpz != ''"> and kmpz = #{kmpz} </if>
            <if test="yefx != null and yefx != ''"> and yefx = #{yefx} </if>
            <if test="fzsm != null and fzsm != ''"> and fzsm = #{fzsm} </if>
            <if test="fzhs != null and fzhs != ''"> and fzhs = #{fzhs} </if>
            <if test="jfmax != null"> and jfmax = #{jfmax} </if>
            <if test="dfmax != null"> and dfmax = #{dfmax} </if>
            <if test="yemax != null"> and yemax = #{yemax} </if>
            <if test="accNa != null and accNa != ''"> and acc_na = #{accNa} </if>
            <if test="kmjx != null and kmjx != ''"> and kmjx = #{kmjx} </if>
            <if test="kmqx != null and kmqx != ''"> and kmqx = #{kmqx} </if>
            <if test="jlrId != null"> and JLR_ID = #{jlrId} </if>
            <if test="jlRq != null and jlRq != ''"> and JL_RQ = #{jlRq} </if>
            <if test="xgrId != null"> and XGR_ID = #{xgrId} </if>
            <if test="xgRq != null and xgRq != ''"> and XG_RQ = #{xgRq} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </if>
            <if test="zdyfzhs != null and zdyfzhs != ''"> and zdyfzhs = #{zdyfzhs} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from gl_kmxx where  id= #{id}
</delete>

    <!--根据会计年度，账套号，科目代码，公司代码删除科目-->
    <delete id="SenderGlKmxxEntity_delete_kmxx">
        delete from gl_kmxx where
                                gsdm= #{gsdm} and kjnd=#{kjnd} and zth=#{zth}
        <if test="kmdm != null and kmdm != ''"> and kmdm=#{kmdm}</if>
    </delete>

</mapper>

