<?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.glfzxzl.dao.impl.GlFzxzlDaoImpl">

    <resultMap id="get-GlFzxzlEntity-result" type="com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity" >
       <result property="gsdm" column="gsdm" jdbcType="VARCHAR"/>
           <result property="kjnd" column="kjnd" jdbcType="VARCHAR"/>
           <result property="lbdm" column="lbdm" jdbcType="VARCHAR"/>
           <result property="fzdm" column="fzdm" jdbcType="VARCHAR"/>
           <result property="fzmc" column="fzmc" jdbcType="VARCHAR"/>
           <result property="zjm" column="zjm" jdbcType="VARCHAR"/>
           <result property="f1" column="f1" jdbcType="VARCHAR"/>
           <result property="f2" column="f2" jdbcType="VARCHAR"/>
           <result property="syzt" column="syzt" jdbcType="VARCHAR"/>
           <result property="bz" column="bz" jdbcType="VARCHAR"/>
           <result property="sjly" column="Sjly" 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="sfmx" column="SFMX" jdbcType="VARCHAR"/>
           <result property="gnlb" column="GNLB" jdbcType="VARCHAR"/>
           <result property="gnlbmc" column="GNLBMC" jdbcType="VARCHAR"/>
        </resultMap>
    <!-- 查询的字段-->
    <sql id = "GlFzxzlEntity_Base_Column_List">
        gsdm
       ,kjnd 
        ,lbdm 
        ,fzdm 
        ,fzmc 
        ,zjm 
        ,f1 
        ,f2 
        ,syzt 
        ,bz 
        ,Sjly 
        ,Jlr_ID 
        ,Jl_RQ 
        ,Xgr_ID 
        ,Xg_RQ 
        ,SFMX 
        ,GNLB 
        ,GNLBMC 
     </sql>
 <!-- 查询 采用==查询 -->
 <select id="entity_list_base" resultMap="get-GlFzxzlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity">
    select
    <include refid="GlFzxzlEntity_Base_Column_List" />
    from GL_Fzxzl
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm = #{gsdm} </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="lbdm != null and lbdm != ''"> and lbdm = #{lbdm} </if>
            <if test="fzdm != null and fzdm != ''"> and fzdm = #{fzdm} </if>
            <if test="fzmc != null and fzmc != ''"> and fzmc = #{fzmc} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="f1 != null and f1 != ''"> and f1 = #{f1} </if>
            <if test="f2 != null and f2 != ''"> and f2 = #{f2} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="bz != null and bz != ''"> and bz = #{bz} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </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="sfmx != null and sfmx != ''"> and SFMX = #{sfmx} </if>
            <if test="gnlb != null and gnlb != ''"> and GNLB = #{gnlb} </if>
            <if test="gnlbmc != null and gnlbmc != ''"> and GNLBMC = #{gnlbmc} </if>
    </trim>
</select>
    
<!-- 查询符合条件的数量 -->
<select id="entity_count" resultType="Integer" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity">
        select  count(1)   from GL_Fzxzl
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm = #{gsdm} </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="lbdm != null and lbdm != ''"> and lbdm = #{lbdm} </if>
            <if test="fzdm != null and fzdm != ''"> and fzdm = #{fzdm} </if>
            <if test="fzmc != null and fzmc != ''"> and fzmc = #{fzmc} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="f1 != null and f1 != ''"> and f1 = #{f1} </if>
            <if test="f2 != null and f2 != ''"> and f2 = #{f2} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="bz != null and bz != ''"> and bz = #{bz} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </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="sfmx != null and sfmx != ''"> and SFMX = #{sfmx} </if>
            <if test="gnlb != null and gnlb != ''"> and GNLB = #{gnlb} </if>
            <if test="gnlbmc != null and gnlbmc != ''"> and GNLBMC = #{gnlbmc} </if>
    </trim>
    </select>

    <!-- 分页查询列表 采用like格式 -->
<select id="entity_list_like" resultMap="get-GlFzxzlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity">
    select
    <include refid="GlFzxzlEntity_Base_Column_List" />
    from GL_Fzxzl
    <trim prefix="where" prefixOverrides="and"> 
        <if test="gsdm != null and gsdm != ''"> and gsdm like concat('%',#{gsdm},'%') </if>
            <if test="kjnd != null and kjnd != ''"> and kjnd like concat('%',#{kjnd},'%') </if>
            <if test="lbdm != null and lbdm != ''"> and lbdm like concat('%',#{lbdm},'%') </if>
            <if test="fzdm != null and fzdm != ''"> and fzdm like concat('%',#{fzdm},'%') </if>
            <if test="fzmc != null and fzmc != ''"> and fzmc like concat('%',#{fzmc},'%') </if>
            <if test="zjm != null and zjm != ''"> and zjm like concat('%',#{zjm},'%') </if>
            <if test="f1 != null and f1 != ''"> and f1 like concat('%',#{f1},'%') </if>
            <if test="f2 != null and f2 != ''"> and f2 like concat('%',#{f2},'%') </if>
            <if test="syzt != null and syzt != ''"> and syzt like concat('%',#{syzt},'%') </if>
            <if test="bz != null and bz != ''"> and bz like concat('%',#{bz},'%') </if>
            <if test="sjly != null and sjly != ''"> and Sjly like concat('%',#{sjly},'%') </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="sfmx != null and sfmx != ''"> and SFMX like concat('%',#{sfmx},'%') </if>
            <if test="gnlb != null and gnlb != ''"> and GNLB like concat('%',#{gnlb},'%') </if>
            <if test="gnlbmc != null and gnlbmc != ''"> and GNLBMC like concat('%',#{gnlbmc},'%') </if>
    </trim>
</select>

<!-- 查询列表 字段采用or格式 -->
<select id="GlFzxzlentity_list_or" resultMap="get-GlFzxzlEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity">
    select
    <include refid="GlFzxzlEntity_Base_Column_List" />
    from GL_Fzxzl
    <trim prefix="where" prefixOverrides="and"> 
         <if test="gsdm != null and gsdm != ''"> or gsdm = #{gsdm} </if>
             <if test="kjnd != null and kjnd != ''"> or kjnd = #{kjnd} </if>
             <if test="lbdm != null and lbdm != ''"> or lbdm = #{lbdm} </if>
             <if test="fzdm != null and fzdm != ''"> or fzdm = #{fzdm} </if>
             <if test="fzmc != null and fzmc != ''"> or fzmc = #{fzmc} </if>
             <if test="zjm != null and zjm != ''"> or zjm = #{zjm} </if>
             <if test="f1 != null and f1 != ''"> or f1 = #{f1} </if>
             <if test="f2 != null and f2 != ''"> or f2 = #{f2} </if>
             <if test="syzt != null and syzt != ''"> or syzt = #{syzt} </if>
             <if test="bz != null and bz != ''"> or bz = #{bz} </if>
             <if test="sjly != null and sjly != ''"> or Sjly = #{sjly} </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="sfmx != null and sfmx != ''"> or SFMX = #{sfmx} </if>
             <if test="gnlb != null and gnlb != ''"> or GNLB = #{gnlb} </if>
             <if test="gnlbmc != null and gnlbmc != ''"> or GNLBMC = #{gnlbmc} </if>
    </trim>
</select>

<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity" keyProperty="gsdm" useGeneratedKeys="true">
    insert into GL_Fzxzl(
  <trim suffix="" suffixOverrides=",">
       <if test="gsdm != null and gsdm != ''"> gsdm , </if>
            <if test="kjnd != null and kjnd != ''"> kjnd , </if>
            <if test="lbdm != null and lbdm != ''"> lbdm , </if>
            <if test="fzdm != null and fzdm != ''"> fzdm , </if>
            <if test="fzmc != null and fzmc != ''"> fzmc , </if>
            <if test="zjm != null and zjm != ''"> zjm , </if>
            <if test="f1 != null and f1 != ''"> f1 , </if>
            <if test="f2 != null and f2 != ''"> f2 , </if>
            <if test="syzt != null and syzt != ''"> syzt , </if>
            <if test="bz != null and bz != ''"> bz , </if>
            <if test="sjly != null and sjly != ''"> Sjly , </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="sfmx != null and sfmx != ''"> SFMX , </if>
            <if test="gnlb != null and gnlb != ''"> GNLB , </if>
            <if test="gnlbmc != null and gnlbmc != ''"> GNLBMC , </if>
  </trim>
  )values(
 <trim suffix="" suffixOverrides=",">
       <if test="gsdm != null and gsdm != ''"> #{gsdm} ,</if>
            <if test="kjnd != null and kjnd != ''"> #{kjnd} ,</if>
            <if test="lbdm != null and lbdm != ''"> #{lbdm} ,</if>
            <if test="fzdm != null and fzdm != ''"> #{fzdm} ,</if>
            <if test="fzmc != null and fzmc != ''"> #{fzmc} ,</if>
            <if test="zjm != null and zjm != ''"> #{zjm} ,</if>
            <if test="f1 != null and f1 != ''"> #{f1} ,</if>
            <if test="f2 != null and f2 != ''"> #{f2} ,</if>
            <if test="syzt != null and syzt != ''"> #{syzt} ,</if>
            <if test="bz != null and bz != ''"> #{bz} ,</if>
            <if test="sjly != null and sjly != ''"> #{sjly} ,</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="sfmx != null and sfmx != ''"> #{sfmx} ,</if>
            <if test="gnlb != null and gnlb != ''"> #{gnlb} ,</if>
            <if test="gnlbmc != null and gnlbmc != ''"> #{gnlbmc} ,</if>
  </trim>
  )  
</insert>
<!-- 批量新增 -->
<insert id="entityInsertBatch" keyProperty="gsdm" useGeneratedKeys="true">
  insert into GL_Fzxzl(fzmc, zjm, f1, f2, syzt, bz, Sjly, Jlr_ID, Jl_RQ, Xgr_ID, Xg_RQ, SFMX, GNLB, GNLBMC,  sts) 
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.fzmc},#{entity.zjm},#{entity.f1},#{entity.f2},#{entity.syzt},#{entity.bz},#{entity.sjly},#{entity.jlrId},#{entity.jlRq},#{entity.xgrId},#{entity.xgRq},#{entity.sfmx},#{entity.gnlb},#{entity.gnlbmc}, 'Y')
    </foreach>
</insert>
<!-- 批量新增或者修改-->
<insert id="entityInsertOrUpdateBatch" keyProperty="gsdm" useGeneratedKeys="true">
    insert into GL_Fzxzl(fzmc, zjm, f1, f2, syzt, bz, Sjly, Jlr_ID, Jl_RQ, Xgr_ID, Xg_RQ, SFMX, GNLB, GNLBMC)
    values
    <foreach collection="entities" item="entity" separator=",">
    (#{entity.fzmc},#{entity.zjm},#{entity.f1},#{entity.f2},#{entity.syzt},#{entity.bz},#{entity.sjly},#{entity.jlrId},#{entity.jlRq},#{entity.xgrId},#{entity.xgRq},#{entity.sfmx},#{entity.gnlb},#{entity.gnlbmc})
    </foreach>
    on duplicate key update
    fzmc = values(fzmc),
    zjm = values(zjm),
    f1 = values(f1),
    f2 = values(f2),
    syzt = values(syzt),
    bz = values(bz),
    Sjly = values(Sjly),
    Jlr_ID = values(Jlr_ID),
    Jl_RQ = values(Jl_RQ),
    Xgr_ID = values(Xgr_ID),
    Xg_RQ = values(Xg_RQ),
    SFMX = values(SFMX),
    GNLB = values(GNLB),
    GNLBMC = values(GNLBMC)</insert>
<!--通过主键修改方法-->
<update id="entity_update" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity" >
update GL_Fzxzl  set
<trim suffix="" suffixOverrides=",">
  <if test="fzmc != null and fzmc != ''"> fzmc = #{fzmc},</if>
  <if test="zjm != null and zjm != ''"> zjm = #{zjm},</if>
  <if test="f1 != null and f1 != ''"> f1 = #{f1},</if>
  <if test="f2 != null and f2 != ''"> f2 = #{f2},</if>
  <if test="syzt != null and syzt != ''"> syzt = #{syzt},</if>
  <if test="bz != null and bz != ''"> bz = #{bz},</if>
  <if test="sjly != null and sjly != ''"> Sjly = #{sjly},</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="sfmx != null and sfmx != ''"> SFMX = #{sfmx},</if>
  <if test="gnlb != null and gnlb != ''"> GNLB = #{gnlb},</if>
  <if test="gnlbmc != null and gnlbmc != ''"> GNLBMC = #{gnlbmc},</if>
</trim>
where gsdm = #{gsdm} and kjnd=#{kjnd} and lbdm=#{lbdm} and fzdm=#{fzdm}
</update>
<!-- 逻辑删除 -->
<update id="entity_logicDelete" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity" >
update GL_Fzxzl  set sts= 'N' ,modify_time = #{modify_time},modify_user_id = #{modify_user_id}
where gsdm = #{gsdm}
</update>
<!-- 多条件逻辑删除 -->
<update id="entity_logicDelete_Multi_Condition" parameterType = "com.hzya.frame.grpU8.nxproof.glfzxzl.entity.GlFzxzlEntity" >
update GL_Fzxzl  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="kjnd != null and kjnd != ''"> and kjnd = #{kjnd} </if>
            <if test="lbdm != null and lbdm != ''"> and lbdm = #{lbdm} </if>
            <if test="fzdm != null and fzdm != ''"> and fzdm = #{fzdm} </if>
            <if test="fzmc != null and fzmc != ''"> and fzmc = #{fzmc} </if>
            <if test="zjm != null and zjm != ''"> and zjm = #{zjm} </if>
            <if test="f1 != null and f1 != ''"> and f1 = #{f1} </if>
            <if test="f2 != null and f2 != ''"> and f2 = #{f2} </if>
            <if test="syzt != null and syzt != ''"> and syzt = #{syzt} </if>
            <if test="bz != null and bz != ''"> and bz = #{bz} </if>
            <if test="sjly != null and sjly != ''"> and Sjly = #{sjly} </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="sfmx != null and sfmx != ''"> and SFMX = #{sfmx} </if>
            <if test="gnlb != null and gnlb != ''"> and GNLB = #{gnlb} </if>
            <if test="gnlbmc != null and gnlbmc != ''"> and GNLBMC = #{gnlbmc} </if>
    </trim>
</update>
<!--通过主键删除-->
<delete id="entity_delete">
    delete from GL_Fzxzl where gsdm = #{gsdm}
</delete>

</mapper>

