| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679 |
- <?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.usoftchina.saas.purchase.mapper.ProdIODetailMapper">
- <resultMap id="BaseResultMap" type="com.usoftchina.saas.purchase.po.ProdIODetail">
- <id column="pd_id" jdbcType="INTEGER" property="id" />
- <result column="pd_piid" jdbcType="INTEGER" property="pd_piid" />
- <result column="pd_inoutno" jdbcType="VARCHAR" property="pd_inoutno" />
- <result column="pd_piclass" jdbcType="VARCHAR" property="pd_piclass" />
- <result column="pd_pdno" jdbcType="INTEGER" property="pd_pdno" />
- <result column="pd_ordercode" jdbcType="VARCHAR" property="pd_ordercode" />
- <result column="pd_orderdetno" jdbcType="INTEGER" property="pd_orderdetno" />
- <result column="pd_prodid" jdbcType="INTEGER" property="pd_prodid" />
- <result column="pd_prodcode" jdbcType="VARCHAR" property="pd_prodcode" />
- <result column="pd_unit" jdbcType="VARCHAR" property="pd_unit" />
- <result column="pd_inqty" jdbcType="DOUBLE" property="pd_inqty" />
- <result column="pd_outqty" jdbcType="DOUBLE" property="pd_outqty" />
- <result column="pd_orderprice" jdbcType="DOUBLE" property="pd_orderprice" />
- <result column="pd_sendprice" jdbcType="DOUBLE" property="pd_sendprice" />
- <result column="pd_price" jdbcType="DOUBLE" property="pd_price" />
- <result column="pd_total" jdbcType="DOUBLE" property="pd_total" />
- <result column="pd_taxrate" jdbcType="DOUBLE" property="pd_taxrate" />
- <result column="pd_netprice" jdbcType="DOUBLE" property="pd_netprice" />
- <result column="pd_nettotal" jdbcType="DOUBLE" property="pd_nettotal" />
- <result column="pd_ordertotal" jdbcType="DOUBLE" property="pd_ordertotal" />
- <result column="pd_whid" jdbcType="INTEGER" property="pd_whid" />
- <result column="pd_whcode" jdbcType="VARCHAR" property="pd_whcode" />
- <result column="pd_whname" jdbcType="VARCHAR" property="pd_whname" />
- <result column="pd_inwhid" jdbcType="INTEGER" property="pd_inwhid" />
- <result column="pd_inwhcode" jdbcType="VARCHAR" property="pd_inwhcode" />
- <result column="pd_inwhname" jdbcType="VARCHAR" property="pd_inwhname" />
- <result column="pd_orderid" jdbcType="INTEGER" property="pd_orderid" />
- <result column="pd_sdid" jdbcType="INTEGER" property="pd_sdid" />
- <result column="pd_status" jdbcType="INTEGER" property="pd_status" />
- <result column="companyid" jdbcType="INTEGER" property="companyId" />
- <result column="updaterid" jdbcType="INTEGER" property="updaterId" />
- <result column="updatetime" jdbcType="TIMESTAMP" property="updateTime" />
- <result column="pd_text1" jdbcType="VARCHAR" property="pd_text1" />
- <result column="pd_text2" jdbcType="VARCHAR" property="pd_text2" />
- <result column="pd_text3" jdbcType="VARCHAR" property="pd_text3" />
- <result column="pd_text4" jdbcType="VARCHAR" property="pd_text4" />
- <result column="pd_text5" jdbcType="VARCHAR" property="pd_text5" />
- <result column="pd_remark" jdbcType="VARCHAR" property="pd_remark" />
- <result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
- <result column="pd_yqty" jdbcType="DOUBLE" property="pd_yqty" />
- <result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
- <association property="productDTO" javaType="com.usoftchina.saas.document.dto.ProductDTO">
- <id column="pr_id" property="id"/>
- <result column="pr_code" property="pr_code"/>
- <result column="pr_detail" property="pr_detail"/>
- <result column="pr_spec" property="pr_spec"/>
- <result column="pr_unit" property="pr_unit"/>
- <result column="pr_kind" property="pr_kind"/>
- <result column="pr_orispeccode" property="pr_orispeccode"/>
- <result column="pr_whid" property="pr_whid"/>
- <result column="pr_whcode" property="pr_whcode"/>
- <result column="pr_whname" property="pr_whname"/>
- <result column="pr_zxbzs" property="pr_zxbzs"/>
- <result column="pr_leadtime" property="pr_leadtime"/>
- <result column="pr_brand" property="pr_brand"/>
- <result column="pr_standardprice" property="pr_standardprice"/>
- <result column="pr_purcprice" property="pr_purcprice"/>
- <result column="pr_saleprice" property="pr_saleprice"/>
- <result column="pr_vendid" property="pr_vendid"/>
- <result column="pr_vendname" property="pr_vendname"/>
- <result column="pr_vendcode" property="pr_vendcode"/>
- <result column="pr_status" property="pr_status"/>
- <result column="pr_statuscode" property="pr_statuscode"/>
- <result column="pr_text1" property="pr_text1"/>
- <result column="pr_text2" property="pr_text2"/>
- <result column="pr_text3" property="pr_text3"/>
- <result column="pr_text4" property="pr_text4"/>
- </association>
- </resultMap>
- <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.usoftchina.saas.purchase.po.ProdIODetail">
- <result column="pd_remark" jdbcType="LONGVARCHAR" property="pd_remark" />
- </resultMap>
- <sql id="Base_Column_List">
- pd_id, pd_piid, pd_inoutno, pd_piclass, pd_pdno, pd_ordercode, pd_orderdetno, pd_prodid,
- pd_prodcode, pd_unit, pd_inqty, pd_outqty, pd_orderprice, pd_sendprice, pd_price,
- pd_total, pd_taxrate, pd_netprice, pd_nettotal, pd_whid, pd_whcode, pd_whname, pd_inwhid,
- pd_inwhcode, pd_inwhname, pd_orderid, pd_sdid, pd_status, companyid, updaterid, updatetime,
- pd_text1, pd_text2, pd_text3, pd_text4, pd_text5, pd_ym, pd_yqty,pd_ioid
- </sql>
- <sql id="Blob_Column_List">
- pd_remark
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
- select
- <include refid="Base_Column_List" />
- ,
- <include refid="Blob_Column_List" />
- from prodiodetail
- where pd_id = #{pd_id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from prodiodetail
- where pd_id = #{pd_id,jdbcType=INTEGER}
- </delete>
- <insert id="insertSelective" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
- <selectKey resultType="java.lang.Long" keyProperty="id">
- SELECT LAST_INSERT_ID() AS ID
- </selectKey>
- insert into prodiodetail
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="pd_piid != null">
- pd_piid,
- </if>
- <if test="pd_inoutno != null">
- pd_inoutno,
- </if>
- <if test="pd_piclass != null">
- pd_piclass,
- </if>
- <if test="pd_pdno != null">
- pd_pdno,
- </if>
- <if test="pd_ordercode != null">
- pd_ordercode,
- </if>
- <if test="pd_orderdetno != null">
- pd_orderdetno,
- </if>
- <if test="pd_prodid != null">
- pd_prodid,
- </if>
- <if test="pd_prodcode != null">
- pd_prodcode,
- </if>
- <if test="pd_unit != null">
- pd_unit,
- </if>
- <if test="pd_inqty != null">
- pd_inqty,
- </if>
- <if test="pd_outqty != null">
- pd_outqty,
- </if>
- <if test="pd_orderprice != null">
- pd_orderprice,
- </if>
- <if test="pd_sendprice != null">
- pd_sendprice,
- </if>
- <if test="pd_price != null">
- pd_price,
- </if>
- <if test="pd_total != null">
- pd_total,
- </if>
- <if test="pd_taxrate != null">
- pd_taxrate,
- </if>
- <if test="pd_netprice != null">
- pd_netprice,
- </if>
- <if test="pd_nettotal != null">
- pd_nettotal,
- </if>
- <if test="pd_whid != null">
- pd_whid,
- </if>
- <if test="pd_whcode != null">
- pd_whcode,
- </if>
- <if test="pd_whname != null">
- pd_whname,
- </if>
- <if test="pd_inwhid != null">
- pd_inwhid,
- </if>
- <if test="pd_inwhcode != null">
- pd_inwhcode,
- </if>
- <if test="pd_inwhname != null">
- pd_inwhname,
- </if>
- <if test="pd_orderid != null">
- pd_orderid,
- </if>
- <if test="pd_sdid != null">
- pd_sdid,
- </if>
- <if test="pd_status != null">
- pd_status,
- </if>
- <if test="companyId != null">
- companyid,
- </if>
- <if test="updaterId != null">
- updaterid,
- </if>
- <if test="updateTime != null">
- updatetime,
- </if>
- <if test="pd_text1 != null">
- pd_text1,
- </if>
- <if test="pd_text2 != null">
- pd_text2,
- </if>
- <if test="pd_text3 != null">
- pd_text3,
- </if>
- <if test="pd_text4 != null">
- pd_text4,
- </if>
- <if test="pd_text5 != null">
- pd_text5,
- </if>
- <if test="pd_ym != null">
- pd_ym,
- </if>
- <if test="pd_yqty != null">
- pd_yqty,
- </if>
- <if test="pd_remark != null">
- pd_remark,
- </if>
- <if test="pd_ioid != null">
- pd_ioid,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="pd_piid != null">
- #{pd_piid,jdbcType=INTEGER},
- </if>
- <if test="pd_inoutno != null">
- #{pd_inoutno,jdbcType=VARCHAR},
- </if>
- <if test="pd_piclass != null">
- #{pd_piclass,jdbcType=VARCHAR},
- </if>
- <if test="pd_pdno != null">
- #{pd_pdno,jdbcType=INTEGER},
- </if>
- <if test="pd_ordercode != null">
- #{pd_ordercode,jdbcType=VARCHAR},
- </if>
- <if test="pd_orderdetno != null">
- #{pd_orderdetno,jdbcType=INTEGER},
- </if>
- <if test="pd_prodid != null">
- #{pd_prodid,jdbcType=INTEGER},
- </if>
- <if test="pd_prodcode != null">
- #{pd_prodcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_unit != null">
- #{pd_unit,jdbcType=VARCHAR},
- </if>
- <if test="pd_inqty != null">
- #{pd_inqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_outqty != null">
- #{pd_outqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_orderprice != null">
- #{pd_orderprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_sendprice != null">
- #{pd_sendprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_price != null">
- #{pd_price,jdbcType=DOUBLE},
- </if>
- <if test="pd_total != null">
- #{pd_total,jdbcType=DOUBLE},
- </if>
- <if test="pd_taxrate != null">
- #{pd_taxrate,jdbcType=DOUBLE},
- </if>
- <if test="pd_netprice != null">
- #{pd_netprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_nettotal != null">
- #{pd_nettotal,jdbcType=DOUBLE},
- </if>
- <if test="pd_whid != null">
- #{pd_whid,jdbcType=INTEGER},
- </if>
- <if test="pd_whcode != null">
- #{pd_whcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_whname != null">
- #{pd_whname,jdbcType=VARCHAR},
- </if>
- <if test="pd_inwhid != null">
- #{pd_inwhid,jdbcType=INTEGER},
- </if>
- <if test="pd_inwhcode != null">
- #{pd_inwhcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_inwhname != null">
- #{pd_inwhname,jdbcType=VARCHAR},
- </if>
- <if test="pd_orderid != null">
- #{pd_orderid,jdbcType=INTEGER},
- </if>
- <if test="pd_sdid != null">
- #{pd_sdid,jdbcType=INTEGER},
- </if>
- <if test="pd_status != null">
- #{pd_status,jdbcType=INTEGER},
- </if>
- <if test="companyId != null">
- #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null">
- #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null">
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="pd_text1 != null">
- #{pd_text1,jdbcType=VARCHAR},
- </if>
- <if test="pd_text2 != null">
- #{pd_text2,jdbcType=VARCHAR},
- </if>
- <if test="pd_text3 != null">
- #{pd_text3,jdbcType=VARCHAR},
- </if>
- <if test="pd_text4 != null">
- #{pd_text4,jdbcType=VARCHAR},
- </if>
- <if test="pd_text5 != null">
- #{pd_text5,jdbcType=VARCHAR},
- </if>
- <if test="pd_ym != null">
- #{pd_ym,jdbcType=INTEGER},
- </if>
- <if test="pd_yqty != null">
- #{pd_yqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_remark != null">
- #{pd_remark,jdbcType=LONGVARCHAR},
- </if>
- <if test="pd_ioid != null">
- #{pd_ioid,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail">
- update prodiodetail
- <set>
- <if test="pd_piid != null">
- pd_piid = #{pd_piid,jdbcType=INTEGER},
- </if>
- <if test="pd_inoutno != null">
- pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
- </if>
- <if test="pd_piclass != null">
- pd_piclass = #{pd_piclass,jdbcType=VARCHAR},
- </if>
- <if test="pd_pdno != null">
- pd_pdno = #{pd_pdno,jdbcType=INTEGER},
- </if>
- <if test="pd_ordercode != null">
- pd_ordercode = #{pd_ordercode,jdbcType=VARCHAR},
- </if>
- <if test="pd_orderdetno != null">
- pd_orderdetno = #{pd_orderdetno,jdbcType=INTEGER},
- </if>
- <if test="pd_prodid != null">
- pd_prodid = #{pd_prodid,jdbcType=INTEGER},
- </if>
- <if test="pd_prodcode != null">
- pd_prodcode = #{pd_prodcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_unit != null">
- pd_unit = #{pd_unit,jdbcType=VARCHAR},
- </if>
- <if test="pd_inqty != null">
- pd_inqty = #{pd_inqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_outqty != null">
- pd_outqty = #{pd_outqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_orderprice != null">
- pd_orderprice = #{pd_orderprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_sendprice != null">
- pd_sendprice = #{pd_sendprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_price != null">
- pd_price = #{pd_price,jdbcType=DOUBLE},
- </if>
- <if test="pd_total != null">
- pd_total = #{pd_total,jdbcType=DOUBLE},
- </if>
- <if test="pd_taxrate != null">
- pd_taxrate = #{pd_taxrate,jdbcType=DOUBLE},
- </if>
- <if test="pd_netprice != null">
- pd_netprice = #{pd_netprice,jdbcType=DOUBLE},
- </if>
- <if test="pd_nettotal != null">
- pd_nettotal = #{pd_nettotal,jdbcType=DOUBLE},
- </if>
- <if test="pd_whid != null">
- pd_whid = #{pd_whid,jdbcType=INTEGER},
- </if>
- <if test="pd_whcode != null">
- pd_whcode = #{pd_whcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_whname != null">
- pd_whname = #{pd_whname,jdbcType=VARCHAR},
- </if>
- <if test="pd_inwhid != null">
- pd_inwhid = #{pd_inwhid,jdbcType=INTEGER},
- </if>
- <if test="pd_inwhcode != null">
- pd_inwhcode = #{pd_inwhcode,jdbcType=VARCHAR},
- </if>
- <if test="pd_inwhname != null">
- pd_inwhname = #{pd_inwhname,jdbcType=VARCHAR},
- </if>
- <if test="pd_orderid != null">
- pd_orderid = #{pd_orderid,jdbcType=INTEGER},
- </if>
- <if test="pd_sdid != null">
- pd_sdid = #{pd_sdid,jdbcType=INTEGER},
- </if>
- <if test="pd_status != null">
- pd_status = #{pd_status,jdbcType=INTEGER},
- </if>
- <if test="companyId != null">
- companyid = #{companyId,jdbcType=INTEGER},
- </if>
- <if test="updaterId != null">
- updaterid = #{updaterId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null">
- updatetime = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="pd_text1 != null">
- pd_text1 = #{pd_text1,jdbcType=VARCHAR},
- </if>
- <if test="pd_text2 != null">
- pd_text2 = #{pd_text2,jdbcType=VARCHAR},
- </if>
- <if test="pd_text3 != null">
- pd_text3 = #{pd_text3,jdbcType=VARCHAR},
- </if>
- <if test="pd_text4 != null">
- pd_text4 = #{pd_text4,jdbcType=VARCHAR},
- </if>
- <if test="pd_text5 != null">
- pd_text5 = #{pd_text5,jdbcType=VARCHAR},
- </if>
- <if test="pd_ym != null">
- pd_ym = #{pd_ym,jdbcType=INTEGER},
- </if>
- <if test="pd_yqty != null">
- pd_yqty = #{pd_yqty,jdbcType=DOUBLE},
- </if>
- <if test="pd_remark != null">
- pd_remark = #{pd_remark,jdbcType=LONGVARCHAR},
- </if>
- <if test="pd_ioid != null">
- pd_ioid = #{pd_ioid,jdbcType=LONGVARCHAR},
- </if>
- </set>
- where pd_id = #{id,jdbcType=INTEGER}
- </update>
- <insert id="batchInsert" parameterType="java.util.List" >
- insert into prodiodetail (pd_piid, pd_inoutno,
- pd_piclass, pd_pdno, pd_ordercode,
- pd_orderdetno, pd_prodid, pd_prodcode,
- pd_unit, pd_inqty, pd_outqty,
- pd_orderprice, pd_sendprice, pd_price,
- pd_total, pd_taxrate, pd_netprice,
- pd_nettotal, pd_whid, pd_whcode,
- pd_whname, pd_inwhid, pd_inwhcode,
- pd_inwhname, pd_orderid, pd_sdid,
- pd_status, companyid, updaterid,
- updatetime, pd_text1, pd_text2,
- pd_text3, pd_text4, pd_text5,
- pd_ym, pd_yqty, pd_ioid,
- pd_remark) VALUES
- <foreach collection="list" item="item" index="index" open="" close="" separator=",">
- (
- #{item.pd_piid,jdbcType=INTEGER},
- #{item.pd_inoutno,jdbcType=VARCHAR},
- #{item.pd_piclass,jdbcType=VARCHAR},
- #{item.pd_pdno,jdbcType=INTEGER},
- #{item.pd_ordercode,jdbcType=VARCHAR},
- #{item.pd_orderdetno,jdbcType=INTEGER},
- #{item.pd_prodid,jdbcType=INTEGER},
- #{item.pd_prodcode,jdbcType=VARCHAR},
- #{item.pd_unit,jdbcType=VARCHAR},
- #{item.pd_inqty,jdbcType=DOUBLE},
- #{item.pd_outqty,jdbcType=DOUBLE},
- #{item.pd_orderprice,jdbcType=DOUBLE},
- #{item.pd_sendprice,jdbcType=DOUBLE},
- #{item.pd_price,jdbcType=DOUBLE},
- #{item.pd_total,jdbcType=DOUBLE},
- #{item.pd_taxrate,jdbcType=DOUBLE},
- #{item.pd_netprice,jdbcType=DOUBLE},
- #{item.pd_nettotal,jdbcType=DOUBLE},
- #{item.pd_whid,jdbcType=INTEGER},
- #{item.pd_whcode,jdbcType=VARCHAR},
- #{item.pd_whname,jdbcType=VARCHAR},
- #{item.pd_inwhid,jdbcType=INTEGER},
- #{item.pd_inwhcode,jdbcType=VARCHAR},
- #{item.pd_inwhname,jdbcType=VARCHAR},
- #{item.pd_orderid,jdbcType=INTEGER},
- #{item.pd_sdid,jdbcType=INTEGER},
- #{item.pd_status,jdbcType=INTEGER},
- #{item.companyId,jdbcType=INTEGER},
- #{item.updaterId,jdbcType=INTEGER},
- #{item.updateTime,jdbcType=TIMESTAMP},
- #{item.pd_text1,jdbcType=VARCHAR},
- #{item.pd_text2,jdbcType=VARCHAR},
- #{item.pd_text3,jdbcType=VARCHAR},
- #{item.pd_text4,jdbcType=VARCHAR},
- #{item.pd_text5,jdbcType=VARCHAR},
- #{item.pd_ym,jdbcType=INTEGER},
- #{item.pd_yqty,jdbcType=DOUBLE},
- #{item.pd_ioid,jdbcType=INTEGER},
- #{item.pd_remark,jdbcType=LONGVARCHAR}
- )
- </foreach>
- </insert>
- <update id="batchUpdate" parameterType="com.usoftchina.saas.purchase.po.ProdIODetail" >
- <foreach collection="list" item="item" index="index" open="" close="" separator=";">
- update prodiodetail <set>
- <if test="item.pd_piid !=null">
- pd_piid = #{item.pd_piid},
- </if>
- <if test="item.pd_inoutno !=null">
- pd_inoutno = #{item.pd_inoutno},
- </if>
- <if test="item.pd_piclass !=null">
- pd_piclass = #{item.pd_piclass},
- </if>
- <if test="item.pd_pdno !=null">
- pd_pdno = #{item.pd_pdno},
- </if>
- <if test="item.pd_ordercode !=null">
- pd_ordercode = #{item.pd_ordercode},
- </if>
- <if test="item.pd_orderdetno !=null">
- pd_orderdetno = #{item.pd_orderdetno},
- </if>
- <if test="item.pd_prodid !=null">
- pd_prodid = #{item.pd_prodid},
- </if>
- <if test="item.pd_prodcode !=null">
- pd_prodcode = #{item.pd_prodcode},
- </if>
- <if test="item.pd_unit !=null">
- pd_unit = #{item.pd_unit},
- </if>
- <if test="item.pd_inqty !=null">
- pd_inqty = #{item.pd_inqty},
- </if>
- <if test="item.pd_outqty !=null">
- pd_outqty = #{item.pd_outqty},
- </if>
- <if test="item.pd_orderprice !=null">
- pd_orderprice = #{item.pd_orderprice},
- </if>
- <if test="item.pd_sendprice !=null">
- pd_sendprice = #{item.pd_sendprice},
- </if>
- <if test="item.pd_price !=null">
- pd_price = #{item.pd_price},
- </if>
- <if test="item.pd_total !=null">
- pd_total = #{item.pd_total},
- </if>
- <if test="item.pd_taxrate !=null">
- pd_taxrate = #{item.pd_taxrate},
- </if>
- <if test="item.pd_netprice !=null">
- pd_netprice = #{item.pd_netprice},
- </if>
- <if test="item.pd_nettotal !=null">
- pd_nettotal = #{item.pd_nettotal},
- </if>
- <if test="item.pd_whid !=null">
- pd_whid = #{item.pd_whid},
- </if>
- <if test="item.pd_whcode !=null">
- pd_whcode = #{item.pd_whcode},
- </if>
- <if test="item.pd_whname !=null">
- pd_whname = #{item.pd_whname},
- </if>
- <if test="item.pd_inwhid !=null">
- pd_inwhid = #{item.pd_inwhid},
- </if>
- <if test="item.pd_inwhcode !=null">
- pd_inwhcode = #{item.pd_inwhcode},
- </if>
- <if test="item.pd_inwhname !=null">
- pd_inwhname = #{item.pd_inwhname},
- </if>
- <if test="item.pd_orderid !=null">
- pd_orderid = #{item.pd_orderid},
- </if>
- <if test="item.pd_sdid !=null">
- pd_sdid = #{item.pd_sdid},
- </if>
- <if test="item.pd_status !=null">
- pd_status = #{item.pd_status},
- </if>
- <if test="item.pd_remark !=null">
- pd_remark = #{item.pd_remark},
- </if>
- <if test="item.companyId!=null">
- companyId = #{item.companyId},
- </if>
- <if test="item.updaterId!=null">
- updaterId = #{item.updaterId},
- </if>
- <if test="item.updateTime!=null">
- updateTime = #{item.updateTime},
- </if>
- pd_text1 = #{item.pd_text1},
- pd_text2 = #{item.pd_text2},
- pd_text3 = #{item.pd_text3},
- pd_text4 = #{item.pd_text4},
- pd_text5 = #{item.pd_text5},
- <if test="item.pd_ym!=null">
- pd_ym = #{item.pd_ym},
- </if>
- <if test="item.pd_yqty!=null">
- pd_yqty = #{item.pd_yqty},
- </if>
- </set>
- where PD_ID = #{item.id,jdbcType=INTEGER}
- </foreach>
- </update>
- <update id="updatePurchaseYqty" parameterType="long">
- update prodiodetail a
- set a.pd_yqty =ifnull((select b.pd_outqty from (select pd_ioid,sum(pd_outqty) pd_outqty from prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='采购验退单'
- and pi_ioid=#{id,jdbcType=INTEGER} GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
- where a.pd_piid = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectByFK" parameterType="long" resultMap="BaseResultMap">
- select * from prodiodetail a left join product b on b.pr_id= a.pd_prodid and a.companyid = b.companyid
- where pd_piid=#{id} order by pd_pdno
- </select>
- <delete id="deleteByFK" parameterType="java.lang.Long">
- delete from prodiodetail
- where pd_piid = #{id,jdbcType=INTEGER}
- </delete>
- <update id="calcProdIn">
- update prodiodetail set pd_netprice = ifnull(pd_orderprice,0)/(1+ifnull(pd_taxrate,0)/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
- update prodiodetail set pd_ordertotal = round(ifnull(pd_orderprice,0)*ifnull(pd_inqty,0),2),pd_nettotal = round(pd_netprice*ifnull(pd_inqty,0),2) where pd_piid = #{pi_id,jdbcType=INTEGER};
- update prodinout set pi_total = round((select sum(pd_ordertotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2) where pi_id = #{pi_id,jdbcType=INTEGER};
- update prodinout set pi_nettotal = round((select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2) where pi_id = #{pi_id,jdbcType=INTEGER};
- </update>
- <update id="calcProdOut">
- update prodiodetail set pd_netprice = ifnull(pd_orderprice,0)/(1+ifnull(pd_taxrate,0)/100) where pd_piid = #{pi_id,jdbcType=INTEGER};
- update prodiodetail set pd_ordertotal = round(ifnull(pd_orderprice,0)*ifnull(pd_outqty,0),2),pd_nettotal = round(pd_netprice*ifnull(pd_outqty,0),2) where pd_piid = #{pi_id,jdbcType=INTEGER};
- update prodinout set pi_total = round((select sum(pd_ordertotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2) where pi_id = #{pi_id,jdbcType=INTEGER};
- update prodinout set pi_nettotal = round((select sum(pd_nettotal) from prodiodetail where pd_piid = #{pi_id,jdbcType=INTEGER} ),2) where pi_id = #{pi_id,jdbcType=INTEGER};
- </update>
- <update id="getDefaultWarehouseByProduct">
- update prodiodetail
- set pd_whid=(select pr_whid from product where pd_prodid = pr_id),
- pd_whcode=(select pr_whcode from product where pd_prodid = pr_id),
- pd_whname=(select pr_whname from product where pd_prodid = pr_id)
- where pd_piid = #{pi_id,jdbcType=INTEGER};
- </update>
- </mapper>
|