<?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.ckDetail.mapper.WzOutboundOrderBMapper">
    
    <resultMap type="WzOutboundOrderB" id="WzOutboundOrderBResult">
        <result property="id"    column="id"    />
        <result property="wlbm"    column="wlbm"    />
        <result property="wlmc"    column="wlmc"    />
        <result property="ggxh"    column="ggxh"    />
        <result property="ph"    column="ph"    />
        <result property="xxjsgf"    column="xxjsgf"    />
        <result property="jsbz"    column="jsbz"    />
        <result property="zldj"    column="zldj"    />
        <result property="fzxs"    column="fzxs"    />
        <result property="sccj"    column="sccj"    />
        <result property="gcjk"    column="gcjk"    />
        <result property="cgdj"    column="cgdj"    />
        <result property="nbdj"    column="nbdj"    />
        <result property="bljhdjh"    column="bljhdjh"    />
        <result property="hh"    column="hh"    />
        <result property="ckrq"    column="ckrq"    />
        <result property="sfzsl"    column="sfzsl"    />
        <result property="yfzsl"    column="yfzsl"    />
        <result property="rkpch"    column="rkpch"    />
        <result property="xhgljszb"    column="xhgljszb"    />
        <result property="gxdh"    column="gxdh"    />
        <result property="dpah"    column="dpah"    />
        <result property="hgzscqk"    column="hgzscqk"    />
        <result property="zbyxq"    column="zbyxq"    />
        <result property="wgbs"    column="wgbs"    />
        <result property="gyspch"    column="gyspch"    />
        <result property="kwh"    column="kwh"    />
        <result property="zbdw"    column="zbdw"    />
        <result property="zbyj"    column="zbyj"    />
        <result property="rwh"    column="rwh"    />
        <result property="yqjfl"    column="yqjfl"    />
        <result property="ckbz"    column="ckbz"    />
        <result property="ckdbtzj"    column="ckdbtzj"    />
        <result property="ckdbtizj"    column="ckdbtizj"    />
        <result property="lydjh"    column="lydjh"    />
        <result property="lydlxbm"    column="lydlxbm"    />
        <result property="lyjylxzj"    column="lyjylxzj"    />
        <result property="js"    column="js"    />
        <result property="tm"    column="tm"    />
        <result property="ckdh"    column="ckdh"    />
        <result property="fydw"    column="fydw"    />
        <result property="zxsjc"    column="zxsjc"    />
    </resultMap>

    <sql id="selectWzOutboundOrderBVo">
        select id, wlbm, wlmc, ggxh, ph, xxjsgf, jsbz, zldj, fzxs, sccj, gcjk, cgdj, nbdj, bljhdjh, hh, ckrq, sfzsl, yfzsl, rkpch, xhgljszb, gxdh, dpah, hgzscqk, zbyxq, wgbs, gyspch, kwh, zbdw, zbyj, rwh, yqjfl, ckbz, ckdbtzj, ckdbtizj, lydjh, lydlxbm, lyjylxzj, js, tm, ckdh, fydw, zxsjc from wz_outbound_order_b
    </sql>

    <select id="selectWzOutboundOrderBList" parameterType="WzOutboundOrderB" resultMap="WzOutboundOrderBResult">
        <include refid="selectWzOutboundOrderBVo"/>
        <where>  
            <if test="wlbm != null  and wlbm != ''"> and wlbm = #{wlbm}</if>
            <if test="wlmc != null  and wlmc != ''"> and wlmc = #{wlmc}</if>
            <if test="ggxh != null  and ggxh != ''"> and ggxh = #{ggxh}</if>
            <if test="ph != null  and ph != ''"> and ph = #{ph}</if>
            <if test="xxjsgf != null  and xxjsgf != ''"> and xxjsgf = #{xxjsgf}</if>
            <if test="jsbz != null  and jsbz != ''"> and jsbz = #{jsbz}</if>
            <if test="zldj != null  and zldj != ''"> and zldj = #{zldj}</if>
            <if test="fzxs != null  and fzxs != ''"> and fzxs = #{fzxs}</if>
            <if test="sccj != null  and sccj != ''"> and sccj = #{sccj}</if>
            <if test="gcjk != null  and gcjk != ''"> and gcjk = #{gcjk}</if>
            <if test="cgdj != null "> and cgdj = #{cgdj}</if>
            <if test="nbdj != null "> and nbdj = #{nbdj}</if>
            <if test="bljhdjh != null  and bljhdjh != ''"> and bljhdjh = #{bljhdjh}</if>
            <if test="hh != null  and hh != ''"> and hh = #{hh}</if>
            <if test="ckrq != null  and ckrq != ''"> and ckrq = #{ckrq}</if>
            <if test="sfzsl != null "> and sfzsl = #{sfzsl}</if>
            <if test="yfzsl != null "> and yfzsl = #{yfzsl}</if>
            <if test="rkpch != null  and rkpch != ''"> and rkpch = #{rkpch}</if>
            <if test="xhgljszb != null  and xhgljszb != ''"> and xhgljszb = #{xhgljszb}</if>
            <if test="gxdh != null  and gxdh != ''"> and gxdh = #{gxdh}</if>
            <if test="dpah != null  and dpah != ''"> and dpah = #{dpah}</if>
            <if test="hgzscqk != null  and hgzscqk != ''"> and hgzscqk = #{hgzscqk}</if>
            <if test="zbyxq != null  and zbyxq != ''"> and zbyxq = #{zbyxq}</if>
            <if test="wgbs != null  and wgbs != ''"> and wgbs = #{wgbs}</if>
            <if test="gyspch != null  and gyspch != ''"> and gyspch = #{gyspch}</if>
            <if test="kwh != null  and kwh != ''"> and kwh = #{kwh}</if>
            <if test="zbdw != null  and zbdw != ''"> and zbdw = #{zbdw}</if>
            <if test="zbyj != null  and zbyj != ''"> and zbyj = #{zbyj}</if>
            <if test="rwh != null  and rwh != ''"> and rwh = #{rwh}</if>
            <if test="yqjfl != null  and yqjfl != ''"> and yqjfl = #{yqjfl}</if>
            <if test="ckbz != null  and ckbz != ''"> and ckbz = #{ckbz}</if>
            <if test="ckdbtzj != null  and ckdbtzj != ''"> and ckdbtzj = #{ckdbtzj}</if>
            <if test="ckdbtizj != null  and ckdbtizj != ''"> and ckdbtizj = #{ckdbtizj}</if>
            <if test="lydjh != null  and lydjh != ''"> and lydjh = #{lydjh}</if>
            <if test="lydlxbm != null  and lydlxbm != ''"> and lydlxbm = #{lydlxbm}</if>
            <if test="lyjylxzj != null  and lyjylxzj != ''"> and lyjylxzj = #{lyjylxzj}</if>
            <if test="js != null  and js != ''"> and js = #{js}</if>
            <if test="tm != null  and tm != ''"> and tm = #{tm}</if>
            <if test="ckdh != null  and ckdh != ''"> and ckdh = #{ckdh}</if>
            <if test="fydw != null  and fydw != ''"> and fydw = #{fydw}</if>
            <if test="zxsjc != null  and zxsjc != ''"> and zxsjc = #{zxsjc}</if>
        </where>
    </select>
    
    <select id="selectWzOutboundOrderBById" parameterType="Long" resultMap="WzOutboundOrderBResult">
        <include refid="selectWzOutboundOrderBVo"/>
        where id = #{id}
    </select>
    <select id="selectProjectCostFromCkDetailByTaskNo"
            resultType="com.ruoyi.wzCk.ckDetail.domain.WzOutboundOrderB">
        select sfzsl,cgdj,nbdj,rwh from wz_outbound_order_b where rwh = #{taskno}
    </select>
    <select id="selectProjectCostFromCkDetailByCkdh"
            resultType="com.ruoyi.wzCk.ckDetail.domain.WzOutboundOrderB">
        select sfzsl,cgdj,nbdj,rwh,ckdh from wz_outbound_order_b where rwh = #{ckdh}
    </select>
    <select id="getCkDetailDataCountByCkdh" resultType="java.lang.Integer">
        select count(*) from wz_outbound_order_b where rwh = #{ckdh}
    </select>

    <insert id="insertWzOutboundOrderB" parameterType="WzOutboundOrderB" useGeneratedKeys="true" keyProperty="id">
        insert into wz_outbound_order_b
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="wlbm != null">wlbm,</if>
            <if test="wlmc != null">wlmc,</if>
            <if test="ggxh != null">ggxh,</if>
            <if test="ph != null">ph,</if>
            <if test="xxjsgf != null">xxjsgf,</if>
            <if test="jsbz != null">jsbz,</if>
            <if test="zldj != null">zldj,</if>
            <if test="fzxs != null">fzxs,</if>
            <if test="sccj != null">sccj,</if>
            <if test="gcjk != null">gcjk,</if>
            <if test="cgdj != null">cgdj,</if>
            <if test="nbdj != null">nbdj,</if>
            <if test="bljhdjh != null">bljhdjh,</if>
            <if test="hh != null">hh,</if>
            <if test="ckrq != null">ckrq,</if>
            <if test="sfzsl != null">sfzsl,</if>
            <if test="yfzsl != null">yfzsl,</if>
            <if test="rkpch != null">rkpch,</if>
            <if test="xhgljszb != null">xhgljszb,</if>
            <if test="gxdh != null">gxdh,</if>
            <if test="dpah != null">dpah,</if>
            <if test="hgzscqk != null">hgzscqk,</if>
            <if test="zbyxq != null">zbyxq,</if>
            <if test="wgbs != null">wgbs,</if>
            <if test="gyspch != null">gyspch,</if>
            <if test="kwh != null">kwh,</if>
            <if test="zbdw != null">zbdw,</if>
            <if test="zbyj != null">zbyj,</if>
            <if test="rwh != null">rwh,</if>
            <if test="yqjfl != null">yqjfl,</if>
            <if test="ckbz != null">ckbz,</if>
            <if test="ckdbtzj != null">ckdbtzj,</if>
            <if test="ckdbtizj != null">ckdbtizj,</if>
            <if test="lydjh != null">lydjh,</if>
            <if test="lydlxbm != null">lydlxbm,</if>
            <if test="lyjylxzj != null">lyjylxzj,</if>
            <if test="js != null">js,</if>
            <if test="tm != null">tm,</if>
            <if test="ckdh != null">ckdh,</if>
            <if test="fydw != null">fydw,</if>
            <if test="zxsjc != null">zxsjc,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="wlbm != null">#{wlbm},</if>
            <if test="wlmc != null">#{wlmc},</if>
            <if test="ggxh != null">#{ggxh},</if>
            <if test="ph != null">#{ph},</if>
            <if test="xxjsgf != null">#{xxjsgf},</if>
            <if test="jsbz != null">#{jsbz},</if>
            <if test="zldj != null">#{zldj},</if>
            <if test="fzxs != null">#{fzxs},</if>
            <if test="sccj != null">#{sccj},</if>
            <if test="gcjk != null">#{gcjk},</if>
            <if test="cgdj != null">#{cgdj},</if>
            <if test="nbdj != null">#{nbdj},</if>
            <if test="bljhdjh != null">#{bljhdjh},</if>
            <if test="hh != null">#{hh},</if>
            <if test="ckrq != null">#{ckrq},</if>
            <if test="sfzsl != null">#{sfzsl},</if>
            <if test="yfzsl != null">#{yfzsl},</if>
            <if test="rkpch != null">#{rkpch},</if>
            <if test="xhgljszb != null">#{xhgljszb},</if>
            <if test="gxdh != null">#{gxdh},</if>
            <if test="dpah != null">#{dpah},</if>
            <if test="hgzscqk != null">#{hgzscqk},</if>
            <if test="zbyxq != null">#{zbyxq},</if>
            <if test="wgbs != null">#{wgbs},</if>
            <if test="gyspch != null">#{gyspch},</if>
            <if test="kwh != null">#{kwh},</if>
            <if test="zbdw != null">#{zbdw},</if>
            <if test="zbyj != null">#{zbyj},</if>
            <if test="rwh != null">#{rwh},</if>
            <if test="yqjfl != null">#{yqjfl},</if>
            <if test="ckbz != null">#{ckbz},</if>
            <if test="ckdbtzj != null">#{ckdbtzj},</if>
            <if test="ckdbtizj != null">#{ckdbtizj},</if>
            <if test="lydjh != null">#{lydjh},</if>
            <if test="lydlxbm != null">#{lydlxbm},</if>
            <if test="lyjylxzj != null">#{lyjylxzj},</if>
            <if test="js != null">#{js},</if>
            <if test="tm != null">#{tm},</if>
            <if test="ckdh != null">#{ckdh},</if>
            <if test="fydw != null">#{fydw},</if>
            <if test="zxsjc != null">#{zxsjc},</if>
         </trim>
    </insert>

    <update id="updateWzOutboundOrderB" parameterType="WzOutboundOrderB">
        update wz_outbound_order_b
        <trim prefix="SET" suffixOverrides=",">
            <if test="wlbm != null">wlbm = #{wlbm},</if>
            <if test="wlmc != null">wlmc = #{wlmc},</if>
            <if test="ggxh != null">ggxh = #{ggxh},</if>
            <if test="ph != null">ph = #{ph},</if>
            <if test="xxjsgf != null">xxjsgf = #{xxjsgf},</if>
            <if test="jsbz != null">jsbz = #{jsbz},</if>
            <if test="zldj != null">zldj = #{zldj},</if>
            <if test="fzxs != null">fzxs = #{fzxs},</if>
            <if test="sccj != null">sccj = #{sccj},</if>
            <if test="gcjk != null">gcjk = #{gcjk},</if>
            <if test="cgdj != null">cgdj = #{cgdj},</if>
            <if test="nbdj != null">nbdj = #{nbdj},</if>
            <if test="bljhdjh != null">bljhdjh = #{bljhdjh},</if>
            <if test="hh != null">hh = #{hh},</if>
            <if test="ckrq != null">ckrq = #{ckrq},</if>
            <if test="sfzsl != null">sfzsl = #{sfzsl},</if>
            <if test="yfzsl != null">yfzsl = #{yfzsl},</if>
            <if test="rkpch != null">rkpch = #{rkpch},</if>
            <if test="xhgljszb != null">xhgljszb = #{xhgljszb},</if>
            <if test="gxdh != null">gxdh = #{gxdh},</if>
            <if test="dpah != null">dpah = #{dpah},</if>
            <if test="hgzscqk != null">hgzscqk = #{hgzscqk},</if>
            <if test="zbyxq != null">zbyxq = #{zbyxq},</if>
            <if test="wgbs != null">wgbs = #{wgbs},</if>
            <if test="gyspch != null">gyspch = #{gyspch},</if>
            <if test="kwh != null">kwh = #{kwh},</if>
            <if test="zbdw != null">zbdw = #{zbdw},</if>
            <if test="zbyj != null">zbyj = #{zbyj},</if>
            <if test="rwh != null">rwh = #{rwh},</if>
            <if test="yqjfl != null">yqjfl = #{yqjfl},</if>
            <if test="ckbz != null">ckbz = #{ckbz},</if>
            <if test="ckdbtzj != null">ckdbtzj = #{ckdbtzj},</if>
            <if test="ckdbtizj != null">ckdbtizj = #{ckdbtizj},</if>
            <if test="lydjh != null">lydjh = #{lydjh},</if>
            <if test="lydlxbm != null">lydlxbm = #{lydlxbm},</if>
            <if test="lyjylxzj != null">lyjylxzj = #{lyjylxzj},</if>
            <if test="js != null">js = #{js},</if>
            <if test="tm != null">tm = #{tm},</if>
            <if test="ckdh != null">ckdh = #{ckdh},</if>
            <if test="fydw != null">fydw = #{fydw},</if>
            <if test="zxsjc != null">zxsjc = #{zxsjc},</if>
        </trim>
        where id = #{id}
    </update>

    <delete id="deleteWzOutboundOrderBById" parameterType="Long">
        delete from wz_outbound_order_b where id = #{id}
    </delete>

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