<?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.ruoyi.wzCk.ckInfo.mapper.WzOutboundOrderHMapper">
    
    <resultMap type="WzOutboundOrderH" id="WzOutboundOrderHResult">
        <result property="id"    column="id"    />
        <result property="qzr"    column="qzr"    />
        <result property="zdr"    column="zdr"    />
        <result property="lly"    column="lly"    />
        <result property="lybm"    column="lybm"    />
        <result property="ck"    column="ck"    />
        <result property="khybm"    column="khybm"    />
        <result property="kgymc"    column="kgymc"    />
        <result property="zdrq"    column="zdrq"    />
        <result property="djzt"    column="djzt"    />
        <result property="zsl"    column="zsl"    />
        <result property="qzrq"    column="qzrq"    />
        <result property="ckdh"    column="ckdh"    />
        <result property="ptzlh"    column="ptzlh"    />
        <result property="rwh"    column="rwh"    />
        <result property="gcxh"    column="gcxh"    />
        <result property="zbdw"    column="zbdw"    />
        <result property="zbyj"    column="zbyj"    />
        <result property="bh"    column="bh"    />
        <result property="sbmc"    column="sbmc"    />
        <result property="rwjd"    column="rwjd"    />
        <result property="dycs"    column="dycs"    />
        <result property="ckdzj"    column="ckdzj"    />
    </resultMap>

    <sql id="selectWzOutboundOrderHVo">
        select id, qzr, zdr, lly, lybm, ck, khybm, kgymc, zdrq, djzt, zsl, qzrq, ckdh, ptzlh, rwh, gcxh, zbdw, zbyj, bh, sbmc, rwjd, dycs, ckdzj from wz_outbound_order_h
    </sql>

    <select id="selectWzOutboundOrderHList" parameterType="WzOutboundOrderH" resultMap="WzOutboundOrderHResult">
        <include refid="selectWzOutboundOrderHVo"/>
        <where>  
            <if test="qzr != null  and qzr != ''"> and qzr = #{qzr}</if>
            <if test="zdr != null  and zdr != ''"> and zdr = #{zdr}</if>
            <if test="lly != null  and lly != ''"> and lly = #{lly}</if>
            <if test="lybm != null  and lybm != ''"> and lybm = #{lybm}</if>
            <if test="ck != null  and ck != ''"> and ck = #{ck}</if>
            <if test="khybm != null  and khybm != ''"> and khybm = #{khybm}</if>
            <if test="kgymc != null  and kgymc != ''"> and kgymc = #{kgymc}</if>
            <if test="zdrq != null  and zdrq != ''"> and zdrq = #{zdrq}</if>
            <if test="djzt != null  and djzt != ''"> and djzt = #{djzt}</if>
            <if test="zsl != null  and zsl != ''"> and zsl = #{zsl}</if>
            <if test="qzrq != null  and qzrq != ''"> and qzrq = #{qzrq}</if>
            <if test="ckdh != null  and ckdh != ''"> and ckdh = #{ckdh}</if>
            <if test="ptzlh != null  and ptzlh != ''"> and ptzlh = #{ptzlh}</if>
            <if test="rwh != null  and rwh != ''"> and rwh = #{rwh}</if>
            <if test="gcxh != null  and gcxh != ''"> and gcxh = #{gcxh}</if>
            <if test="zbdw != null  and zbdw != ''"> and zbdw = #{zbdw}</if>
            <if test="zbyj != null  and zbyj != ''"> and zbyj = #{zbyj}</if>
            <if test="bh != null  and bh != ''"> and bh = #{bh}</if>
            <if test="sbmc != null  and sbmc != ''"> and sbmc = #{sbmc}</if>
            <if test="rwjd != null  and rwjd != ''"> and rwjd = #{rwjd}</if>
            <if test="dycs != null  and dycs != ''"> and dycs = #{dycs}</if>
            <if test="ckdzj != null  and ckdzj != ''"> and ckdzj = #{ckdzj}</if>
        </where>
    </select>
    
    <select id="selectWzOutboundOrderHById" parameterType="Long" resultMap="WzOutboundOrderHResult">
        <include refid="selectWzOutboundOrderHVo"/>
        where id = #{id}
    </select>
    <select id="selectCkdhListFromCkinfoByTaskNo" resultType="com.ruoyi.wzCk.ckInfo.domain.WzOutboundOrderH">
        select ckdh,rwh from wz_outbound_order_h where rwh = #{taskno}
    </select>

    <insert id="insertWzOutboundOrderH" parameterType="WzOutboundOrderH" useGeneratedKeys="true" keyProperty="id">
        insert into wz_outbound_order_h
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="qzr != null">qzr,</if>
            <if test="zdr != null">zdr,</if>
            <if test="lly != null">lly,</if>
            <if test="lybm != null">lybm,</if>
            <if test="ck != null">ck,</if>
            <if test="khybm != null">khybm,</if>
            <if test="kgymc != null">kgymc,</if>
            <if test="zdrq != null">zdrq,</if>
            <if test="djzt != null">djzt,</if>
            <if test="zsl != null">zsl,</if>
            <if test="qzrq != null">qzrq,</if>
            <if test="ckdh != null">ckdh,</if>
            <if test="ptzlh != null">ptzlh,</if>
            <if test="rwh != null">rwh,</if>
            <if test="gcxh != null">gcxh,</if>
            <if test="zbdw != null">zbdw,</if>
            <if test="zbyj != null">zbyj,</if>
            <if test="bh != null">bh,</if>
            <if test="sbmc != null">sbmc,</if>
            <if test="rwjd != null">rwjd,</if>
            <if test="dycs != null">dycs,</if>
            <if test="ckdzj != null">ckdzj,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="qzr != null">#{qzr},</if>
            <if test="zdr != null">#{zdr},</if>
            <if test="lly != null">#{lly},</if>
            <if test="lybm != null">#{lybm},</if>
            <if test="ck != null">#{ck},</if>
            <if test="khybm != null">#{khybm},</if>
            <if test="kgymc != null">#{kgymc},</if>
            <if test="zdrq != null">#{zdrq},</if>
            <if test="djzt != null">#{djzt},</if>
            <if test="zsl != null">#{zsl},</if>
            <if test="qzrq != null">#{qzrq},</if>
            <if test="ckdh != null">#{ckdh},</if>
            <if test="ptzlh != null">#{ptzlh},</if>
            <if test="rwh != null">#{rwh},</if>
            <if test="gcxh != null">#{gcxh},</if>
            <if test="zbdw != null">#{zbdw},</if>
            <if test="zbyj != null">#{zbyj},</if>
            <if test="bh != null">#{bh},</if>
            <if test="sbmc != null">#{sbmc},</if>
            <if test="rwjd != null">#{rwjd},</if>
            <if test="dycs != null">#{dycs},</if>
            <if test="ckdzj != null">#{ckdzj},</if>
         </trim>
    </insert>

    <update id="updateWzOutboundOrderH" parameterType="WzOutboundOrderH">
        update wz_outbound_order_h
        <trim prefix="SET" suffixOverrides=",">
            <if test="qzr != null">qzr = #{qzr},</if>
            <if test="zdr != null">zdr = #{zdr},</if>
            <if test="lly != null">lly = #{lly},</if>
            <if test="lybm != null">lybm = #{lybm},</if>
            <if test="ck != null">ck = #{ck},</if>
            <if test="khybm != null">khybm = #{khybm},</if>
            <if test="kgymc != null">kgymc = #{kgymc},</if>
            <if test="zdrq != null">zdrq = #{zdrq},</if>
            <if test="djzt != null">djzt = #{djzt},</if>
            <if test="zsl != null">zsl = #{zsl},</if>
            <if test="qzrq != null">qzrq = #{qzrq},</if>
            <if test="ckdh != null">ckdh = #{ckdh},</if>
            <if test="ptzlh != null">ptzlh = #{ptzlh},</if>
            <if test="rwh != null">rwh = #{rwh},</if>
            <if test="gcxh != null">gcxh = #{gcxh},</if>
            <if test="zbdw != null">zbdw = #{zbdw},</if>
            <if test="zbyj != null">zbyj = #{zbyj},</if>
            <if test="bh != null">bh = #{bh},</if>
            <if test="sbmc != null">sbmc = #{sbmc},</if>
            <if test="rwjd != null">rwjd = #{rwjd},</if>
            <if test="dycs != null">dycs = #{dycs},</if>
            <if test="ckdzj != null">ckdzj = #{ckdzj},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteWzOutboundOrderHById" parameterType="Long">
        delete from wz_outbound_order_h where id = #{id}
    </delete>

    <delete id="deleteWzOutboundOrderHByIds" parameterType="String">
        delete from wz_outbound_order_h where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>