<?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.oeryszb.dao.impl.OerYszbDaoImpl">
    <resultMap id="get-OerYszbEntity-result" type="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        <result property="mlId" column="mlId" />
        <result property="djlxId" column="djlxId" />
        <result property="gsdm" column="gsdm" />
        <result property="kjnd" column="kjnd" />
        <result property="bnxId" column="bnxId" />
        <!--<result property="DataID" column="DataID"/>-->
        <result property="xh" column="xh" />
        <result property="zbdm" column="zbdm" />
        <result property="zbId" column="zbId" />
        <result property="jhId" column="jhId" />
        <result property="kzzbId" column="kzzbId" />
        <result property="kmdm" column="kmdm" />
        <result property="kmmc" column="kmmc" />
        <result property="je" column="je" />
        <result property="zy" column="zy" />
    </resultMap>

   <sql id="OerYszbEntity_Base_Column_List">
 MLID,DJLXID,GSDM,KJND,BNXID
   </sql>
    <insert id="entity_insert" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        insert into OER_YSZB(
        <if test="mlId != null and mlId !='' "> MLID, </if>
        <if test="djlxId != null and djlxId !='' "> DJLXID, </if>
        <if test="kjnd != null and kjnd !='' "> KJND, </if>
        <if test="bnxId != null and bnxId !='' "> BNXID, </if>
        <if test="dataId != null and dataId !='' "> DataID, </if>
        <if test="xh != null and xh !=''"> XH, </if>
        <if test="zbdm != null and zbdm !='' "> ZBDM, </if>
        <if test="zbId != null and zbId !='' "> ZBID, </if>
        <if test="jhId != null and jhId !='' "> JHID, </if>
        <if test="kzzbId != null and kzzbId !='' "> KZZBID, </if>
        <if test="kmdm != null and kmdm !='' "> KMDM, </if>
        <if test="kmmc != null and kmmc !='' "> KMMC,</if>
        <if test="je != null and je !='' "> JE, </if>
        <if test="zy != null and zy !='' ">ZY,</if>
        <if test="gsdm != null and gsdm !='' "> GSDM </if>
        )
        values (
        <if test="mlId != null and mlId !='' "> #{mlId}, </if>
        <if test="djlxId != null and djlxId !='' "> #{djlxId}, </if>
        <if test="kjnd != null and kjnd !='' "> #{kjnd}, </if>
        <if test="bnxId != null and bnxId !='' "> #{bnxId}, </if>
        <if test="dataId != null and dataId !='' "> #{dataId}, </if>
        <if test="xh != null and xh !=''"> #{xh}, </if>
        <if test="zbdm != null and zbdm !='' "> #{zbdm}, </if>
        <if test="zbId != null and zbId !='' "> #{zbId}, </if>
        <if test="jhId != null and jhId !='' "> #{jhId}, </if>
        <if test="kzzbId != null and kzzbId !='' "> #{kzzbId}, </if>
        <if test="kmdm != null and kmdm !='' "> #{kmdm}, </if>
        <if test="kmmc != null and kmmc !='' "> #{kmmc},</if>
        <if test="je != null and je !='' "> #{je}, </if>
        <if test="zy != null and zy !='' "> #{zy},</if>
        <if test="gsdm != null and gsdm !='' "> #{gsdm} </if>
        )
    </insert>

    <update id="entity_update" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        update OER_YSZB  set
        <trim suffix="" suffixOverrides=",">
            <if test="mlId != null and mlId !='' "> MLID=#{mlId}, </if>
            <if test="djlxId != null and djlxId !='' "> DJLXID=#{djlxId}, </if>
            <if test="kjnd != null and kjnd !='' "> KJND=#{kjnd}, </if>
            <if test="bnxId != null and bnxId !='' "> BNXID=#{bnxId}, </if>
            <if test="dataId != null and dataId !='' "> DataID=#{dataId}, </if>
            <if test="xh != null and xh !=''">XH= #{xh}, </if>
            <if test="zbdm != null and zbdm !='' ">ZBDM= #{zbdm}, </if>
            <if test="zbId != null and zbId !='' "> ZBID=#{zbId}, </if>
            <if test="jhId != null and jhId !='' ">JHID= #{jhId}, </if>
            <if test="kzzbId != null and kzzbId !='' "> KZZBID=#{kzzbId}, </if>
            <if test="kmdm != null and kmdm !='' ">KMDM= #{kmdm}, </if>
            <if test="kmmc != null and kmmc !='' "> KMMC=#{kmmc},</if>
            <if test="je != null and je !='' "> JE=#{je}, </if>
            <if test="zy != null and zy !='' "> ZY=#{zy},</if>
            <if test="gsdm != null and gsdm !='' ">GSDM #{gsdm} </if>
        </trim>
        where  mlId= #{mlId}
    </update>

    <update id="OerYszbEntity_update_yszb" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        update OER_YSZB  set
        <trim suffix="" suffixOverrides=",">
            <if test="djlxId != null and djlxId !='' "> DJLXID=#{djlxId}, </if>
            <if test="bnxId != null and bnxId !='' "> BNXID=#{bnxId}, </if>
            <if test="dataId != null and dataId !='' "> DataID=#{dataId}, </if>
            <if test="xh != null and xh !=''">XH= #{xh}, </if>
            <if test="zbdm != null and zbdm !='' ">ZBDM= #{zbdm}, </if>
            <if test="jhId != null and jhId !='' ">JHID= #{jhId}, </if>
            <if test="kzzbId != null and kzzbId !='' "> KZZBID=#{kzzbId}, </if>
            <if test="kmdm != null and kmdm !='' ">KMDM= #{kmdm}, </if>
            <if test="kmmc != null and kmmc !='' "> KMMC=#{kmmc},</if>
            <if test="je != null and je !='' "> JE=#{je}, </if>
            <if test="zy != null and zy !='' "> ZY=#{zy},</if>
        </trim>
        where  mlId= #{mlId} and kjnd=#{kjnd} and gsdm=#{gsdm} and ZBID=#{zbId}
        <if test="xh != null and xh !='' "> and XH= #{xh}  </if>
    </update>

    <delete id="entity_delete" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        DELETE
        FROM
            oer_yszb
        WHERE
            GSDM = #{gsdm}
          AND KJND = #{kjnd}
          AND MLID = #{mlId}
    </delete>

    <delete id="OerYszbEntity_delete_yszb" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        DELETE
        FROM
            oer_yszb
        WHERE
            GSDM = #{gsdm}
          AND KJND = #{kjnd}
          AND MLID = #{mlId}
          and ZBID=#{zbId}
        <if test="xh != null and xh !='' "> and XH= #{xh}  </if>
    </delete>
    <delete id="OerYszbEntity_delete" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        DELETE
        FROM
            oer_yszb
        WHERE
            GSDM = #{gsdm}
          AND KJND = #{kjnd}
          AND MLID = #{mlId}
    </delete>
    <insert id="OerYszbEntity_insert" parameterType="com.hzya.frame.grpU8.nxproof.oeryszb.entity.OerYszbEntity">
        insert into OER_YSZB(
        <if test="mlId != null and mlId !='' "> MLID, </if>
        <if test="djlxId != null and djlxId !='' "> DJLXID, </if>
        <if test="kjnd != null and kjnd !='' "> KJND, </if>
        <if test="bnxId != null and bnxId !='' "> BNXID, </if>
        <if test="dataId != null and dataId !='' "> DataID, </if>
        <if test="xh != null and xh !=''"> XH, </if>
        <if test="zbdm != null and zbdm !='' "> ZBDM, </if>
        <if test="zbId != null and zbId !='' "> ZBID, </if>
        <if test="jhId != null and jhId !='' "> JHID, </if>
        <if test="kzzbId != null and kzzbId !='' "> KZZBID, </if>
        <if test="kmdm != null and kmdm !='' "> KMDM, </if>
        <if test="kmmc != null and kmmc !='' "> KMMC,</if>
        <if test="je != null and je !='' "> JE, </if>
        <if test="zy != null and zy !='' ">ZY,</if>
        <if test="gsdm != null and gsdm !='' "> GSDM </if>
        )
        values (
        <if test="mlId != null and mlId !='' "> #{mlId}, </if>
        <if test="djlxId != null and djlxId !='' "> #{djlxId}, </if>
        <if test="kjnd != null and kjnd !='' "> #{kjnd}, </if>
        <if test="bnxId != null and bnxId !='' "> #{bnxId}, </if>
        <if test="dataId != null and dataId !='' "> #{dataId}, </if>
        <if test="xh != null and xh !=''"> #{xh}, </if>
        <if test="zbdm != null and zbdm !='' "> #{zbdm}, </if>
        <if test="zbId != null and zbId !='' "> #{zbId}, </if>
        <if test="jhId != null and jhId !='' "> #{jhId}, </if>
        <if test="kzzbId != null and kzzbId !='' "> #{kzzbId}, </if>
        <if test="kmdm != null and kmdm !='' "> #{kmdm}, </if>
        <if test="kmmc != null and kmmc !='' "> #{kmmc},</if>
        <if test="je != null and je !='' "> #{je}, </if>
        <if test="zy != null and zy !='' "> #{zy},</if>
        <if test="gsdm != null and gsdm !='' "> #{gsdm} </if>
        )
    </insert>
</mapper>
