<?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.glPzml.dao.impl.SenderGlPzmlDaoImpl">

    <resultMap id="get-SenderGlPzmlEntity-result" type="com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" >
       <result property="gsdm" column="gsdm" jdbcType="VARCHAR"/>
           <result property="zth" column="ZTH" jdbcType="VARCHAR"/>
           <result property="kjqj" column="kjqj" jdbcType="VARCHAR"/>
           <result property="pzly" column="pzly" jdbcType="VARCHAR"/>
           <result property="pzh" column="pzh" jdbcType="VARCHAR"/>
           <result property="pzrq" column="pzrq" jdbcType="VARCHAR"/>
           <result property="fjzs" column="fjzs" jdbcType="INTEGER"/>
           <result property="srid" column="srID" jdbcType="INTEGER"/>
           <result property="sr" column="sr" jdbcType="VARCHAR"/>
           <result property="shid" column="shID" jdbcType="INTEGER"/>
           <result property="sh" column="sh" jdbcType="VARCHAR"/>
           <result property="jsr" column="jsr" jdbcType="VARCHAR"/>
           <result property="jzrid" column="jzrID" jdbcType="INTEGER"/>
           <result property="jzr" column="jzr" jdbcType="VARCHAR"/>
           <result property="srrq" column="srrq" jdbcType="VARCHAR"/>
           <result property="shrq" column="shrq" jdbcType="VARCHAR"/>
           <result property="jzrq" column="jzrq" jdbcType="VARCHAR"/>
           <result property="pzhzkmdy" column="pzhzkmdy" jdbcType="VARCHAR"/>
           <result property="pzhzbz" column="pzhzbz" jdbcType="VARCHAR"/>
           <result property="zt" column="zt" jdbcType="INTEGER"/>
           <result property="pzzy" column="pzzy" jdbcType="VARCHAR"/>
           <result property="pzje" column="pzje" jdbcType="VARCHAR"/>
           <result property="cn" column="CN" jdbcType="VARCHAR"/>
           <result property="bz" column="BZ" jdbcType="VARCHAR"/>
           <result property="kjzg" column="kjzg" jdbcType="VARCHAR"/>
           <result property="idpzh" column="idpzh" jdbcType="VARCHAR"/>
           <result property="dyzt" column="dyzt" jdbcType="VARCHAR"/>
           <result property="qzrq" column="QZRQ" jdbcType="VARCHAR"/>
           <result property="gdid" column="GDID" jdbcType="INTEGER"/>
           <result property="gdname" column="GDName" jdbcType="VARCHAR"/>
           <result property="gdrqsj" column="GDRQSJ" jdbcType="VARCHAR"/>
           <result property="gdcs" column="GDCS" jdbcType="INTEGER"/>
           <result property="gdbz" column="GDBZ" jdbcType="VARCHAR"/>
           <result property="yspzzs" column="yspzzs" jdbcType="INTEGER"/>
           <result property="kjtxdm" column="kjtxdm" jdbcType="VARCHAR"/>
           <result property="pzlxdm" column="pzlxdm" jdbcType="VARCHAR"/>
           <result property="pzsbm" column="pzsbm" jdbcType="VARCHAR"/>
           <result property="stamp" column="stamp" jdbcType="VARCHAR"/>
           <result property="yspzje" column="yspzje" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "SenderGlPzmlEntity_Base_Column_List">
        gsdm
        , ZTH
        , kjqj
        , pzly
        ,pzlxdm
        ,kjtxdm
        , pzh
        , pzrq
        , fjzs
        , srID
        , sr
        , shID
        , sh
        , jsr
        , jzrID
        , jzr
        , srrq
        , shrq
        , jzrq
        , pzhzkmdy
        , pzhzbz
        , zt
        , pzzy
        , pzje
        , CN
        , BZ
        , kjzg
        , idpzh
        , dyzt
        , QZRQ
        , GDID
        , GDName
        , GDRQSJ
        , GDCS
        , GDBZ
        , yspzzs
        , pzsbm
        , stamp
        , yspzje
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
    select
    <include refid="SenderGlPzmlEntity_Base_Column_List" />
    from gl_pzml
    <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="kjqj != null and kjqj != ''"> and kjqj = #{kjqj} </if>
            <if test="pzly != null and pzly != ''"> and pzly = #{pzly} </if>
            <if test="pzh != null and pzh != ''"> and pzh = #{pzh} </if>
            <if test="pzrq != null and pzrq != ''"> and pzrq >= #{pzrq} </if>
            <if test="fjzs != null"> and fjzs = #{fjzs} </if>
            <if test="srid != null"> and srID = #{srid} </if>
            <if test="sr != null and sr != ''"> and sr = #{sr} </if>
            <if test="shid != null"> and shID = #{shid} </if>
            <if test="sh != null and sh != ''"> and sh = #{sh} </if>
            <if test="jsr != null and jsr != ''"> and jsr = #{jsr} </if>
            <if test="jzrid != null"> and jzrID = #{jzrid} </if>
            <if test="jzr != null and jzr != ''"> and jzr = #{jzr} </if>
            <if test="srrq != null and srrq != ''"> and srrq = #{srrq} </if>
            <if test="shrq != null and shrq != ''"> and shrq = #{shrq} </if>
            <if test="jzrq != null and jzrq != ''"> and jzrq = #{jzrq} </if>
            <if test="pzhzkmdy != null and pzhzkmdy != ''"> and pzhzkmdy = #{pzhzkmdy} </if>
            <if test="pzhzbz != null and pzhzbz != ''"> and pzhzbz = #{pzhzbz} </if>
            <if test="zt != null"> and zt = #{zt} </if>
            <if test="pzzy != null and pzzy != ''"> and pzzy = #{pzzy} </if>
            <if test="pzje != null"> and pzje = #{pzje} </if>
            <if test="cn != null and cn != ''"> and CN = #{cn} </if>
            <if test="bz != null and bz != ''"> and BZ = #{bz} </if>
            <if test="kjzg != null and kjzg != ''"> and kjzg = #{kjzg} </if>
            <if test="idpzh != null and idpzh != ''"> and idpzh = #{idpzh} </if>
            <if test="dyzt != null and dyzt != ''"> and dyzt = #{dyzt} </if>
            <if test="qzrq != null and qzrq != ''"> and QZRQ = #{qzrq} </if>
            <if test="gdid != null"> and GDID = #{gdid} </if>
            <if test="gdname != null and gdname != ''"> and GDName = #{gdname} </if>
            <if test="gdrqsj != null and gdrqsj != ''"> and GDRQSJ = #{gdrqsj} </if>
            <if test="gdcs != null"> and GDCS = #{gdcs} </if>
            <if test="gdbz != null and gdbz != ''"> and GDBZ = #{gdbz} </if>
            <if test="yspzzs != null"> and yspzzs = #{yspzzs} </if>
            <if test="pzsbm != null and pzsbm!=''"> and pzsbm = #{pzsbm} </if>
            <if test="stamp != null and stamp!=''"> and stamp = #{stamp} </if>
            <if test="yspzje != null and yspzje!=''"> and yspzje = #{yspzje} </if>
       -- and zth in('004','005','009','010','011','012','014')
    </trim>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
        select  count(1)   from gl_pzml
    <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="kjqj != null and kjqj != ''"> and kjqj = #{kjqj} </if>
            <if test="pzly != null and pzly != ''"> and pzly = #{pzly} </if>
            <if test="pzh != null and pzh != ''"> and pzh = #{pzh} </if>
            <if test="pzrq != null and pzrq != ''"> and pzrq = #{pzrq} </if>
            <if test="fjzs != null"> and fjzs = #{fjzs} </if>
            <if test="srid != null"> and srID = #{srid} </if>
            <if test="sr != null and sr != ''"> and sr = #{sr} </if>
            <if test="shid != null"> and shID = #{shid} </if>
            <if test="sh != null and sh != ''"> and sh = #{sh} </if>
            <if test="jsr != null and jsr != ''"> and jsr = #{jsr} </if>
            <if test="jzrid != null"> and jzrID = #{jzrid} </if>
            <if test="jzr != null and jzr != ''"> and jzr = #{jzr} </if>
            <if test="srrq != null and srrq != ''"> and srrq = #{srrq} </if>
            <if test="shrq != null and shrq != ''"> and shrq = #{shrq} </if>
            <if test="jzrq != null and jzrq != ''"> and jzrq = #{jzrq} </if>
            <if test="pzhzkmdy != null and pzhzkmdy != ''"> and pzhzkmdy = #{pzhzkmdy} </if>
            <if test="pzhzbz != null and pzhzbz != ''"> and pzhzbz = #{pzhzbz} </if>
            <if test="zt != null"> and zt = #{zt} </if>
            <if test="pzzy != null and pzzy != ''"> and pzzy = #{pzzy} </if>
            <if test="pzje != null"> and pzje = #{pzje} </if>
            <if test="cn != null and cn != ''"> and CN = #{cn} </if>
            <if test="bz != null and bz != ''"> and BZ = #{bz} </if>
            <if test="kjzg != null and kjzg != ''"> and kjzg = #{kjzg} </if>
            <if test="idpzh != null and idpzh != ''"> and idpzh = #{idpzh} </if>
            <if test="dyzt != null and dyzt != ''"> and dyzt = #{dyzt} </if>
            <if test="qzrq != null and qzrq != ''"> and QZRQ = #{qzrq} </if>
            <if test="gdid != null"> and GDID = #{gdid} </if>
            <if test="gdname != null and gdname != ''"> and GDName = #{gdname} </if>
            <if test="gdrqsj != null and gdrqsj != ''"> and GDRQSJ = #{gdrqsj} </if>
            <if test="gdcs != null"> and GDCS = #{gdcs} </if>
            <if test="gdbz != null and gdbz != ''"> and GDBZ = #{gdbz} </if>
            <if test="yspzzs != null"> and yspzzs = #{yspzzs} </if>
    </trim>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
    select
    <include refid="SenderGlPzmlEntity_Base_Column_List" />
    from gl_pzml
    <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="kjqj != null and kjqj != ''"> and kjqj like concat('%',#{kjqj},'%') </if>
            <if test="pzly != null and pzly != ''"> and pzly like concat('%',#{pzly},'%') </if>
            <if test="pzh != null and pzh != ''"> and pzh like concat('%',#{pzh},'%') </if>
            <if test="pzrq != null and pzrq != ''"> and pzrq like concat('%',#{pzrq},'%') </if>
            <if test="fjzs != null"> and fjzs like concat('%',#{fjzs},'%') </if>
            <if test="srid != null"> and srID like concat('%',#{srid},'%') </if>
            <if test="sr != null and sr != ''"> and sr like concat('%',#{sr},'%') </if>
            <if test="shid != null"> and shID like concat('%',#{shid},'%') </if>
            <if test="sh != null and sh != ''"> and sh like concat('%',#{sh},'%') </if>
            <if test="jsr != null and jsr != ''"> and jsr like concat('%',#{jsr},'%') </if>
            <if test="jzrid != null"> and jzrID like concat('%',#{jzrid},'%') </if>
            <if test="jzr != null and jzr != ''"> and jzr like concat('%',#{jzr},'%') </if>
            <if test="srrq != null and srrq != ''"> and srrq like concat('%',#{srrq},'%') </if>
            <if test="shrq != null and shrq != ''"> and shrq like concat('%',#{shrq},'%') </if>
            <if test="jzrq != null and jzrq != ''"> and jzrq like concat('%',#{jzrq},'%') </if>
            <if test="pzhzkmdy != null and pzhzkmdy != ''"> and pzhzkmdy like concat('%',#{pzhzkmdy},'%') </if>
            <if test="pzhzbz != null and pzhzbz != ''"> and pzhzbz like concat('%',#{pzhzbz},'%') </if>
            <if test="zt != null"> and zt like concat('%',#{zt},'%') </if>
            <if test="pzzy != null and pzzy != ''"> and pzzy like concat('%',#{pzzy},'%') </if>
            <if test="pzje != null"> and pzje like concat('%',#{pzje},'%') </if>
            <if test="cn != null and cn != ''"> and CN like concat('%',#{cn},'%') </if>
            <if test="bz != null and bz != ''"> and BZ like concat('%',#{bz},'%') </if>
            <if test="kjzg != null and kjzg != ''"> and kjzg like concat('%',#{kjzg},'%') </if>
            <if test="idpzh != null and idpzh != ''"> and idpzh like concat('%',#{idpzh},'%') </if>
            <if test="dyzt != null and dyzt != ''"> and dyzt like concat('%',#{dyzt},'%') </if>
            <if test="qzrq != null and qzrq != ''"> and QZRQ like concat('%',#{qzrq},'%') </if>
            <if test="gdid != null"> and GDID like concat('%',#{gdid},'%') </if>
            <if test="gdname != null and gdname != ''"> and GDName like concat('%',#{gdname},'%') </if>
            <if test="gdrqsj != null and gdrqsj != ''"> and GDRQSJ like concat('%',#{gdrqsj},'%') </if>
            <if test="gdcs != null"> and GDCS like concat('%',#{gdcs},'%') </if>
            <if test="gdbz != null and gdbz != ''"> and GDBZ like concat('%',#{gdbz},'%') </if>
            <if test="yspzzs != null"> and yspzzs like concat('%',#{yspzzs},'%') </if>
    </trim>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="SenderGlPzmlEntity_list_or" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
    select
    <include refid="SenderGlPzmlEntity_Base_Column_List" />
    from gl_pzml
    <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="kjqj != null and kjqj != ''"> or kjqj = #{kjqj} </if>
             <if test="pzly != null and pzly != ''"> or pzly = #{pzly} </if>
             <if test="pzh != null and pzh != ''"> or pzh = #{pzh} </if>
             <if test="pzrq != null and pzrq != ''"> or pzrq = #{pzrq} </if>
             <if test="fjzs != null"> or fjzs = #{fjzs} </if>
             <if test="srid != null"> or srID = #{srid} </if>
             <if test="sr != null and sr != ''"> or sr = #{sr} </if>
             <if test="shid != null"> or shID = #{shid} </if>
             <if test="sh != null and sh != ''"> or sh = #{sh} </if>
             <if test="jsr != null and jsr != ''"> or jsr = #{jsr} </if>
             <if test="jzrid != null"> or jzrID = #{jzrid} </if>
             <if test="jzr != null and jzr != ''"> or jzr = #{jzr} </if>
             <if test="srrq != null and srrq != ''"> or srrq = #{srrq} </if>
             <if test="shrq != null and shrq != ''"> or shrq = #{shrq} </if>
             <if test="jzrq != null and jzrq != ''"> or jzrq = #{jzrq} </if>
             <if test="pzhzkmdy != null and pzhzkmdy != ''"> or pzhzkmdy = #{pzhzkmdy} </if>
             <if test="pzhzbz != null and pzhzbz != ''"> or pzhzbz = #{pzhzbz} </if>
             <if test="zt != null"> or zt = #{zt} </if>
             <if test="pzzy != null and pzzy != ''"> or pzzy = #{pzzy} </if>
             <if test="pzje != null"> or pzje = #{pzje} </if>
             <if test="cn != null and cn != ''"> or CN = #{cn} </if>
             <if test="bz != null and bz != ''"> or BZ = #{bz} </if>
             <if test="kjzg != null and kjzg != ''"> or kjzg = #{kjzg} </if>
             <if test="idpzh != null and idpzh != ''"> or idpzh = #{idpzh} </if>
             <if test="dyzt != null and dyzt != ''"> or dyzt = #{dyzt} </if>
             <if test="qzrq != null and qzrq != ''"> or QZRQ = #{qzrq} </if>
             <if test="gdid != null"> or GDID = #{gdid} </if>
             <if test="gdname != null and gdname != ''"> or GDName = #{gdname} </if>
             <if test="gdrqsj != null and gdrqsj != ''"> or GDRQSJ = #{gdrqsj} </if>
             <if test="gdcs != null"> or GDCS = #{gdcs} </if>
             <if test="gdbz != null and gdbz != ''"> or GDBZ = #{gdbz} </if>
             <if test="yspzzs != null"> or yspzzs = #{yspzzs} </if>
    </trim>
</select>

    <!-- 查询列表 商学院所需要的凭证数据-->
    <select id="queryGlPzmlSxy" resultMap="get-SenderGlPzmlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity">
        select
            pzml.idpzh as idpzh,
            pzml.kjqj as kjqj,
            pzml.srrq as srrq,
            pzml.srID as srID,
            pznr.bmdm as bmdm,
            pzml.pzzy as pzzy,
            sum(pznr.je) as pzje,
            pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh
        from GL_Pzml pzml
            left join gl_pznr pznr on pznr.idpzh=pzml.idpzh and pzml.kjqj=pznr.kjqj
        <trim prefix="where" prefixOverrides="and">
            <if test="idpzh !=null and  idpzh!='' "> and pzml.idpzh = #{idpzh} </if>
            and pzml.kjqj =#{kjqj}  and pznr.kjqj =#{kjqj} and pznr.zbid!=0
        </trim>
        group by pzml.idpzh,
        pzml.kjqj,
        pzml.srrq,
        pzml.pzzy,
        pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh,pzml.srID,pznr.bmdm

    </select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" keyProperty="" useGeneratedKeys="true">
    insert into gl_pzml(
    <trim suffix="" suffixOverrides=",">
        <if test="gsdm != null and gsdm != ''"> gsdm , </if>
        <if test="kjqj != null and kjqj != ''"> kjqj , </if>
        <if test="pzly != null and pzly != ''"> pzly , </if>
        <if test="pzh != null and pzh != ''"> pzh , </if>
        <if test="kjtxdm != null "> kjtxdm , </if>
        <if test="pzlxdm != null and pzlxdm != ''"> pzlxdm , </if>
        <if test="pzrq != null and pzrq != ''"> pzrq , </if>
        <if test="fjzs != null"> fjzs , </if>
        <if test="srid != null"> srID , </if>
        <if test="sr != null and sr != ''"> sr , </if>
        <if test="shid != null"> shID , </if>
        <if test="sh != null and sh != ''"> sh , </if>
        <if test="jsr != null and jsr != ''"> jsr , </if>
        <if test="jzrid != null"> jzrID , </if>
        <if test="jzr != null and jzr != ''"> jzr , </if>
        <if test="srrq != null and srrq != ''"> srrq , </if>
        <if test="shrq != null "> shrq , </if>
        <if test="jzrq != null "> jzrq , </if>
        <if test="pzhzkmdy != null and pzhzkmdy != ''"> pzhzkmdy , </if>
        <if test="pzhzbz != null and pzhzbz != ''"> pzhzbz , </if>
        <if test="zt != null"> zt , </if>
        <if test="pzzy != null and pzzy != ''"> pzzy , </if>
        <if test="pzje != null"> pzje , </if>
        <if test="cn != null and cn != ''"> CN , </if>
        <if test="bz != null and bz != ''"> BZ , </if>
        <if test="kjzg != null and kjzg != ''"> kjzg , </if>
        <if test="idpzh != null and idpzh != ''"> idpzh , </if>
        <if test="dyzt != null and dyzt != ''"> dyzt , </if>
        <if test="qzrq != null and qzrq != ''"> QZRQ , </if>
        <if test="gdid != null"> GDID , </if>
        <if test="gdname != null and gdname != ''"> GDName , </if>
        <if test="gdrqsj != null and gdrqsj != ''"> GDRQSJ , </if>
        <if test="gdcs != null"> GDCS , </if>
        <if test="gdbz != null and gdbz != ''"> GDBZ , </if>
        <if test="yspzzs != null"> yspzzs , </if>
        <if test="pzsbm != null and pzsbm != ''"> pzsbm, </if>
        <if test="stamp != null and stamp != ''"> stamp, </if>
        <if test="yspzje != null and yspzje != ''"> yspzje, </if>
        <if test="zth != null and zth != ''"> ZTH </if>
    </trim>
    )values(
    <trim suffix="" suffixOverrides=",">
        <if test="gsdm != null and gsdm != ''"> #{gsdm} ,</if>
        <if test="kjqj != null and kjqj != ''"> #{kjqj} ,</if>
        <if test="pzly != null and pzly != ''"> #{pzly} ,</if>
        <if test="pzh != null and pzh != ''"> #{pzh} ,</if>
        <if test="kjtxdm != null "> #{kjtxdm} , </if>
        <if test="pzlxdm != null and pzlxdm != ''"> #{pzlxdm} , </if>
        <if test="pzrq != null and pzrq != ''"> #{pzrq} ,</if>
        <if test="fjzs != null"> #{fjzs} ,</if>
        <if test="srid != null"> #{srid} ,</if>
        <if test="sr != null and sr != ''"> #{sr} ,</if>
        <if test="shid != null"> #{shid} ,</if>
        <if test="sh != null and sh != ''"> #{sh} ,</if>
        <if test="jsr != null and jsr != ''"> #{jsr} ,</if>
        <if test="jzrid != null"> #{jzrid} ,</if>
        <if test="jzr != null and jzr != ''"> #{jzr} ,</if>
        <if test="srrq != null and srrq != ''"> #{srrq} ,</if>
        <if test="shrq != null "> #{shrq} ,</if>
        <if test="jzrq != null "> #{jzrq} ,</if>
        <if test="pzhzkmdy != null and pzhzkmdy != ''"> #{pzhzkmdy} ,</if>
        <if test="pzhzbz != null and pzhzbz != ''"> #{pzhzbz} ,</if>
        <if test="zt != null"> #{zt} ,</if>
        <if test="pzzy != null and pzzy != ''"> #{pzzy} ,</if>
        <if test="pzje != null"> #{pzje} ,</if>
        <if test="cn != null and cn != ''"> #{cn} ,</if>
        <if test="bz != null and bz != ''"> #{bz} ,</if>
        <if test="kjzg != null and kjzg != ''"> #{kjzg} ,</if>
        <if test="idpzh != null and idpzh != ''"> #{idpzh} ,</if>
        <if test="dyzt != null and dyzt != ''"> #{dyzt} ,</if>
        <if test="qzrq != null and qzrq != ''"> #{qzrq} ,</if>
        <if test="gdid != null"> #{gdid} ,</if>
        <if test="gdname != null and gdname != ''"> #{gdname} ,</if>
        <if test="gdrqsj != null and gdrqsj != ''"> #{gdrqsj} ,</if>
        <if test="gdcs != null"> #{gdcs} ,</if>
        <if test="gdbz != null and gdbz != ''"> #{gdbz} ,</if>
        <if test="yspzzs != null"> #{yspzzs} ,</if>
        <if test="pzsbm != null and pzsbm != ''"> #{pzsbm}, </if>
        <if test="stamp != null and stamp != ''"> #{stamp}, </if>
        <if test="yspzje != null and yspzje != ''"> #{yspzje}, </if>
        <if test="zth != null and zth != ''"> #{zth} </if>
    </trim>
    )
</insert>



    <!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="" useGeneratedKeys="true">
  insert into gl_pzml(gsdm, ZTH, kjqj, pzly, pzh, pzrq, fjzs, srID, sr, shID, sh, jsr, jzrID, jzr, srrq, shrq, jzrq, pzhzkmdy, pzhzbz, zt, pzzy, pzje, CN, BZ, kjzg, idpzh, dyzt, QZRQ, GDID, GDName, GDRQSJ, GDCS, GDBZ, yspzzs)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.gsdm},#{entity.zth},#{entity.kjqj},#{entity.pzly},#{entity.pzh},#{entity.pzrq},#{entity.fjzs},#{entity.srid},#{entity.sr},#{entity.shid},#{entity.sh},#{entity.jsr},#{entity.jzrid},#{entity.jzr},#{entity.srrq},#{entity.shrq},#{entity.jzrq},#{entity.pzhzkmdy},#{entity.pzhzbz},#{entity.zt},#{entity.pzzy},#{entity.pzje},#{entity.cn},#{entity.bz},#{entity.kjzg},#{entity.idpzh},#{entity.dyzt},#{entity.qzrq},#{entity.gdid},#{entity.gdname},#{entity.gdrqsj},#{entity.gdcs},#{entity.gdbz},#{entity.yspzzs})
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="" useGeneratedKeys="true">
    insert into gl_pzml(gsdm, ZTH, kjqj, pzly, pzh, pzrq, fjzs, srID, sr, shID, sh, jsr, jzrID, jzr, srrq, shrq, jzrq, pzhzkmdy, pzhzbz, zt, pzzy, pzje, CN, BZ, kjzg, idpzh, dyzt, QZRQ, GDID, GDName, GDRQSJ, GDCS, GDBZ, yspzzs)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.gsdm},#{entity.zth},#{entity.kjqj},#{entity.pzly},#{entity.pzh},#{entity.pzrq},#{entity.fjzs},#{entity.srid},#{entity.sr},#{entity.shid},#{entity.sh},#{entity.jsr},#{entity.jzrid},#{entity.jzr},#{entity.srrq},#{entity.shrq},#{entity.jzrq},#{entity.pzhzkmdy},#{entity.pzhzbz},#{entity.zt},#{entity.pzzy},#{entity.pzje},#{entity.cn},#{entity.bz},#{entity.kjzg},#{entity.idpzh},#{entity.dyzt},#{entity.qzrq},#{entity.gdid},#{entity.gdname},#{entity.gdrqsj},#{entity.gdcs},#{entity.gdbz},#{entity.yspzzs})
    </foreach>
    on duplicate key update
    gsdm = values(gsdm),
    ZTH = values(ZTH),
    kjqj = values(kjqj),
    pzly = values(pzly),
    pzh = values(pzh),
    pzrq = values(pzrq),
    fjzs = values(fjzs),
    srID = values(srID),
    sr = values(sr),
    shID = values(shID),
    sh = values(sh),
    jsr = values(jsr),
    jzrID = values(jzrID),
    jzr = values(jzr),
    srrq = values(srrq),
    shrq = values(shrq),
    jzrq = values(jzrq),
    pzhzkmdy = values(pzhzkmdy),
    pzhzbz = values(pzhzbz),
    zt = values(zt),
    pzzy = values(pzzy),
    pzje = values(pzje),
    CN = values(CN),
    BZ = values(BZ),
    kjzg = values(kjzg),
    idpzh = values(idpzh),
    dyzt = values(dyzt),
    QZRQ = values(QZRQ),
    GDID = values(GDID),
    GDName = values(GDName),
    GDRQSJ = values(GDRQSJ),
    GDCS = values(GDCS),
    GDBZ = values(GDBZ),
    yspzzs = values(yspzzs)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" >
    update gl_pzml  set
    <trim suffix="" suffixOverrides=",">
        <if test="gsdm != null and gsdm != ''"> gsdm = #{gsdm},</if>
        <if test="zth != null and zth != ''"> ZTH = #{zth},</if>
        <if test="kjqj != null and kjqj != ''"> kjqj = #{kjqj},</if>
        <if test="pzly != null and pzly != ''"> pzly = #{pzly},</if>
        <if test="pzh != null and pzh != ''"> pzh = #{pzh},</if>
        <if test="kjtxdm != null "> kjtxdm = #{kjtxdm},</if>
        <if test="pzlxdm != null and pzlxdm != ''"> pzlxdm = #{pzlxdm},</if>
        <if test="pzrq != null and pzrq != ''"> pzrq = #{pzrq},</if>
        <if test="fjzs != null"> fjzs = #{fjzs},</if>
        <if test="srid != null"> srID = #{srid},</if>
        <if test="sr != null and sr != ''"> sr = #{sr},</if>
        <if test="shid != null"> shID = #{shid},</if>
        <if test="sh != null and sh != ''"> sh = #{sh},</if>
        <if test="jsr != null and jsr != ''"> jsr = #{jsr},</if>
        <if test="jzrid != null"> jzrID = #{jzrid},</if>
        <if test="jzr != null and jzr != ''"> jzr = #{jzr},</if>
        <if test="srrq != null and srrq != ''"> srrq = #{srrq},</if>
        <if test="shrq != null and shrq != ''"> shrq = #{shrq},</if>
        <if test="jzrq != null and jzrq != ''"> jzrq = #{jzrq},</if>
        <if test="pzhzkmdy != null and pzhzkmdy != ''"> pzhzkmdy = #{pzhzkmdy},</if>
        <if test="pzhzbz != null and pzhzbz != ''"> pzhzbz = #{pzhzbz},</if>
        <if test="zt != null"> zt = #{zt},</if>
        <if test="pzzy != null and pzzy != ''"> pzzy = #{pzzy},</if>
        <if test="pzje != null"> pzje = #{pzje},</if>
        <if test="cn != null and cn != ''"> CN = #{cn},</if>
        <if test="bz != null and bz != ''"> BZ = #{bz},</if>
        <if test="kjzg != null and kjzg != ''"> kjzg = #{kjzg},</if>
        <if test="dyzt != null and dyzt != ''"> dyzt = #{dyzt},</if>
        <if test="qzrq != null and qzrq != ''"> QZRQ = #{qzrq},</if>
        <if test="gdid != null"> GDID = #{gdid},</if>
        <if test="gdname != null and gdname != ''"> GDName = #{gdname},</if>
        <if test="gdrqsj != null and gdrqsj != ''"> GDRQSJ = #{gdrqsj},</if>
        <if test="gdcs != null"> GDCS = #{gdcs},</if>
        <if test="gdbz != null and gdbz != ''"> GDBZ = #{gdbz},</if>
        <if test="yspzzs != null"> yspzzs = #{yspzzs},</if>
        <if test="pzsbm != null and pzsbm!=''"> pzsbm = #{pzsbm},</if>
        <if test="stamp != null and stamp!=''"> stamp = #{stamp},</if>
        <if test="yspzje != null and yspzje !='' "> yspzje = #{yspzje}</if>
    </trim>
    where  idpzh= #{idpzh}
</update>


<!-- 逻辑删除 -->
<update id="SenderGlPzmlEntity_logicDelete" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" >
update gl_pzml  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where  idpzh= #{idpzh}
</update>
<!-- 多条件逻辑删除 -->
<update id="SenderGlPzmlEntity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity" >
update gl_pzml  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="kjqj != null and kjqj != ''"> and kjqj = #{kjqj} </if>
            <if test="pzly != null and pzly != ''"> and pzly = #{pzly} </if>
            <if test="pzh != null and pzh != ''"> and pzh = #{pzh} </if>
     <if test="kjtxdm != null and kjtxdm != ''"> and kjtxdm = #{kjtxdm}</if>
     <if test="pzlxdm != null and pzlxdm != ''"> and pzh = #{pzlxdm}</if>
            <if test="pzrq != null and pzrq != ''"> and pzrq = #{pzrq} </if>
            <if test="fjzs != null"> and fjzs = #{fjzs} </if>
            <if test="srid != null"> and srID = #{srid} </if>
            <if test="sr != null and sr != ''"> and sr = #{sr} </if>
            <if test="shid != null"> and shID = #{shid} </if>
            <if test="sh != null and sh != ''"> and sh = #{sh} </if>
            <if test="jsr != null and jsr != ''"> and jsr = #{jsr} </if>
            <if test="jzrid != null"> and jzrID = #{jzrid} </if>
            <if test="jzr != null and jzr != ''"> and jzr = #{jzr} </if>
            <if test="srrq != null and srrq != ''"> and srrq = #{srrq} </if>
            <if test="shrq != null and shrq != ''"> and shrq = #{shrq} </if>
            <if test="jzrq != null and jzrq != ''"> and jzrq = #{jzrq} </if>
            <if test="pzhzkmdy != null and pzhzkmdy != ''"> and pzhzkmdy = #{pzhzkmdy} </if>
            <if test="pzhzbz != null and pzhzbz != ''"> and pzhzbz = #{pzhzbz} </if>
            <if test="zt != null"> and zt = #{zt} </if>
            <if test="pzzy != null and pzzy != ''"> and pzzy = #{pzzy} </if>
            <if test="pzje != null"> and pzje = #{pzje} </if>
            <if test="cn != null and cn != ''"> and CN = #{cn} </if>
            <if test="bz != null and bz != ''"> and BZ = #{bz} </if>
            <if test="kjzg != null and kjzg != ''"> and kjzg = #{kjzg} </if>
            <if test="dyzt != null and dyzt != ''"> and dyzt = #{dyzt} </if>
            <if test="qzrq != null and qzrq != ''"> and QZRQ = #{qzrq} </if>
            <if test="gdid != null"> and GDID = #{gdid} </if>
            <if test="gdname != null and gdname != ''"> and GDName = #{gdname} </if>
            <if test="gdrqsj != null and gdrqsj != ''"> and GDRQSJ = #{gdrqsj} </if>
            <if test="gdcs != null"> and GDCS = #{gdcs} </if>
            <if test="gdbz != null and gdbz != ''"> and GDBZ = #{gdbz} </if>
            <if test="yspzzs != null"> and yspzzs = #{yspzzs} </if>
            and sts='Y'
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from gl_pzml where  idpzh= #{idpzh}
</delete>

    <!--通过主键删除-->
    <delete id="SenderGlPzmlEntity_delete_pzml">
        delete from gl_pzml where  gsdm= #{gsdm} and zth=#{zth}
        <if test="kjqj != null and kjqj!=''"> and kjqj=#{kjqj}</if>
        <if test="pzh != null and pzh!=''"> and pzh = #{pzh} </if>
        <if test="idpzh != null and idpzh!=''"> and idpzh = #{idpzh} </if>
    </delete>

</mapper>

