|
|
@@ -143,6 +143,33 @@
|
|
|
<sql id="Blob_Column_List">
|
|
|
pd_remark
|
|
|
</sql>
|
|
|
+ <select id="selectByExampleWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultMap="ResultMapWithBLOBs">
|
|
|
+ select
|
|
|
+ <if test="distinct">
|
|
|
+ distinct
|
|
|
+ </if>
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ ,
|
|
|
+ <include refid="Blob_Column_List" />
|
|
|
+ from prodiodetail
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <select id="selectByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultMap="BaseResultMap">
|
|
|
+ select
|
|
|
+ *
|
|
|
+ from prodiodetail a left join product b on a.pd_prodid = b.pr_id and a.companyid = b.companyid
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ <if test="orderByClause != null">
|
|
|
+ order by ${orderByClause}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
|
|
@@ -151,11 +178,19 @@
|
|
|
from prodiodetail
|
|
|
where pd_id = #{pd_id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ delete from prodiodetail where pd_id = #{pd_id}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteByForeignKey" parameterType="java.lang.Long">
|
|
|
+ delete from prodiodetail where pd_piid = #{pd_id}
|
|
|
+ </delete>
|
|
|
+ <delete id="deleteByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample">
|
|
|
delete from prodiodetail
|
|
|
- where pd_id = #{pd_id,jdbcType=INTEGER}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
</delete>
|
|
|
- <insert id="insert" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
|
|
|
insert into prodiodetail (pd_id, pd_piid, pd_inoutno,
|
|
|
pd_piclass, pd_pdno, pd_ordercode,
|
|
|
pd_orderdetno, pd_prodid, pd_prodcode,
|
|
|
@@ -186,7 +221,7 @@
|
|
|
#{pd_ioid,jdbcType=INTEGER}
|
|
|
)
|
|
|
</insert>
|
|
|
- <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
|
|
|
<selectKey resultType="java.lang.Long" keyProperty="id">
|
|
|
SELECT LAST_INSERT_ID() AS ID
|
|
|
</selectKey>
|
|
|
@@ -430,7 +465,233 @@
|
|
|
</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
- <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
|
|
|
+ <select id="countByExample" parameterType="com.usoftchina.saas.storage.po.ProdIODetailExample" resultType="java.lang.Long">
|
|
|
+ select count(*) from prodiodetail
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+ <update id="updateByExampleSelective" parameterType="map">
|
|
|
+ update prodiodetail
|
|
|
+ <set>
|
|
|
+ <if test="record.pd_id != null">
|
|
|
+ pd_id = #{record.pd_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_piid != null">
|
|
|
+ pd_piid = #{record.pd_piid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_inoutno != null">
|
|
|
+ pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_piclass != null">
|
|
|
+ pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_pdno != null">
|
|
|
+ pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_ordercode != null">
|
|
|
+ pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_orderdetno != null">
|
|
|
+ pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_prodid != null">
|
|
|
+ pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_prodcode != null">
|
|
|
+ pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_unit != null">
|
|
|
+ pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_inqty != null">
|
|
|
+ pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_outqty != null">
|
|
|
+ pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_orderprice != null">
|
|
|
+ pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_sendprice != null">
|
|
|
+ pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_price != null">
|
|
|
+ pd_price = #{record.pd_price,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_total != null">
|
|
|
+ pd_total = #{record.pd_total,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_taxrate != null">
|
|
|
+ pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_netprice != null">
|
|
|
+ pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_nettotal != null">
|
|
|
+ pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_whid != null">
|
|
|
+ pd_whid = #{record.pd_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_whcode != null">
|
|
|
+ pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_whname != null">
|
|
|
+ pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_inwhid != null">
|
|
|
+ pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_inwhcode != null">
|
|
|
+ pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_inwhname != null">
|
|
|
+ pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_orderid != null">
|
|
|
+ pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_sdid != null">
|
|
|
+ pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_status != null">
|
|
|
+ pd_status = #{record.pd_status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.companyid != null">
|
|
|
+ companyid = #{record.companyid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.updaterid != null">
|
|
|
+ updaterid = #{record.updaterid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.updatetime != null">
|
|
|
+ updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_text1 != null">
|
|
|
+ pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_text2 != null">
|
|
|
+ pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_text3 != null">
|
|
|
+ pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_text4 != null">
|
|
|
+ pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_text5 != null">
|
|
|
+ pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_ym != null">
|
|
|
+ pd_ym = #{record.pd_ym,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_yqty != null">
|
|
|
+ pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_remark != null">
|
|
|
+ pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="record.pd_ioid != null">
|
|
|
+ pd_ioid = #{record.pd_ioid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+
|
|
|
+ </set>
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExampleWithBLOBs" parameterType="map">
|
|
|
+ update prodiodetail
|
|
|
+ set pd_id = #{record.pd_id,jdbcType=INTEGER},
|
|
|
+ pd_piid = #{record.pd_piid,jdbcType=INTEGER},
|
|
|
+ pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
|
|
|
+ pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
|
|
|
+ pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
|
|
|
+ pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
|
|
|
+ pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
|
|
|
+ pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
|
|
|
+ pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
|
|
|
+ pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
|
|
|
+ pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
|
|
|
+ pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
|
|
|
+ pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
|
|
|
+ pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
|
|
|
+ pd_price = #{record.pd_price,jdbcType=DOUBLE},
|
|
|
+ pd_total = #{record.pd_total,jdbcType=DOUBLE},
|
|
|
+ pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
|
|
|
+ pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
|
|
|
+ pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
|
|
|
+ pd_whid = #{record.pd_whid,jdbcType=INTEGER},
|
|
|
+ pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
|
|
|
+ pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
|
|
|
+ pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
|
|
|
+ pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
|
|
|
+ pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
|
|
|
+ pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
|
|
|
+ pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
|
|
|
+ pd_status = #{record.pd_status,jdbcType=INTEGER},
|
|
|
+ companyid = #{record.companyid,jdbcType=INTEGER},
|
|
|
+ updaterid = #{record.updaterid,jdbcType=INTEGER},
|
|
|
+ updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
|
|
+ pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
|
|
|
+ pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
|
|
|
+ pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
|
|
|
+ pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
|
|
|
+ pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
|
|
|
+ pd_ym = #{record.pd_ym,jdbcType=INTEGER},
|
|
|
+ pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
|
|
|
+ pd_remark = #{record.pd_remark,jdbcType=LONGVARCHAR},
|
|
|
+ pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByExample" parameterType="map">
|
|
|
+ update prodiodetail
|
|
|
+ set pd_id = #{record.pd_id,jdbcType=INTEGER},
|
|
|
+ pd_piid = #{record.pd_piid,jdbcType=INTEGER},
|
|
|
+ pd_inoutno = #{record.pd_inoutno,jdbcType=VARCHAR},
|
|
|
+ pd_piclass = #{record.pd_piclass,jdbcType=VARCHAR},
|
|
|
+ pd_pdno = #{record.pd_pdno,jdbcType=INTEGER},
|
|
|
+ pd_ordercode = #{record.pd_ordercode,jdbcType=VARCHAR},
|
|
|
+ pd_orderdetno = #{record.pd_orderdetno,jdbcType=INTEGER},
|
|
|
+ pd_prodid = #{record.pd_prodid,jdbcType=INTEGER},
|
|
|
+ pd_prodcode = #{record.pd_prodcode,jdbcType=VARCHAR},
|
|
|
+ pd_unit = #{record.pd_unit,jdbcType=VARCHAR},
|
|
|
+ pd_inqty = #{record.pd_inqty,jdbcType=INTEGER},
|
|
|
+ pd_outqty = #{record.pd_outqty,jdbcType=INTEGER},
|
|
|
+ pd_orderprice = #{record.pd_orderprice,jdbcType=DOUBLE},
|
|
|
+ pd_sendprice = #{record.pd_sendprice,jdbcType=DOUBLE},
|
|
|
+ pd_price = #{record.pd_price,jdbcType=DOUBLE},
|
|
|
+ pd_total = #{record.pd_total,jdbcType=DOUBLE},
|
|
|
+ pd_taxrate = #{record.pd_taxrate,jdbcType=DOUBLE},
|
|
|
+ pd_netprice = #{record.pd_netprice,jdbcType=DOUBLE},
|
|
|
+ pd_nettotal = #{record.pd_nettotal,jdbcType=DOUBLE},
|
|
|
+ pd_whid = #{record.pd_whid,jdbcType=INTEGER},
|
|
|
+ pd_whcode = #{record.pd_whcode,jdbcType=VARCHAR},
|
|
|
+ pd_whname = #{record.pd_whname,jdbcType=VARCHAR},
|
|
|
+ pd_inwhid = #{record.pd_inwhid,jdbcType=INTEGER},
|
|
|
+ pd_inwhcode = #{record.pd_inwhcode,jdbcType=VARCHAR},
|
|
|
+ pd_inwhname = #{record.pd_inwhname,jdbcType=VARCHAR},
|
|
|
+ pd_orderid = #{record.pd_orderid,jdbcType=INTEGER},
|
|
|
+ pd_sdid = #{record.pd_sdid,jdbcType=INTEGER},
|
|
|
+ pd_status = #{record.pd_status,jdbcType=INTEGER},
|
|
|
+ companyid = #{record.companyid,jdbcType=INTEGER},
|
|
|
+ updaterid = #{record.updaterid,jdbcType=INTEGER},
|
|
|
+ updatetime = #{record.updatetime,jdbcType=TIMESTAMP},
|
|
|
+ pd_text1 = #{record.pd_text1,jdbcType=VARCHAR},
|
|
|
+ pd_text2 = #{record.pd_text2,jdbcType=VARCHAR},
|
|
|
+ pd_text3 = #{record.pd_text3,jdbcType=VARCHAR},
|
|
|
+ pd_text4 = #{record.pd_text4,jdbcType=VARCHAR},
|
|
|
+ pd_text5 = #{record.pd_text5,jdbcType=VARCHAR},
|
|
|
+ pd_ym = #{record.pd_ym,jdbcType=INTEGER},
|
|
|
+ pd_yqty = #{record.pd_yqty,jdbcType=INTEGER},
|
|
|
+ pd_ioid = #{record.pd_ioid,jdbcType=INTEGER}
|
|
|
+ <if test="_parameter != null">
|
|
|
+ <include refid="Update_By_Example_Where_Clause" />
|
|
|
+ </if>
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
|
|
|
update prodiodetail
|
|
|
<set>
|
|
|
<if test="pd_piid != null">
|
|
|
@@ -553,7 +814,7 @@
|
|
|
</set>
|
|
|
where pd_id = #{id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
|
|
|
+ <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
|
|
|
update prodiodetail
|
|
|
set pd_piid = #{pd_piid,jdbcType=INTEGER},
|
|
|
pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
|
|
|
@@ -596,7 +857,7 @@
|
|
|
pd_ioid = #{pd_ioid,jdbcType=INTEGER}
|
|
|
where pd_id = #{pd_id,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
- <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdInOut">
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.storage.po.ProdIODetail">
|
|
|
update prodiodetail
|
|
|
set pd_piid = #{pd_piid,jdbcType=INTEGER},
|
|
|
pd_inoutno = #{pd_inoutno,jdbcType=VARCHAR},
|
|
|
@@ -911,15 +1172,7 @@
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.ProdInOut" >
|
|
|
+ <update id="batchUpdate" parameterType="com.usoftchina.saas.storage.po.ProdIODetail" >
|
|
|
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
update prodiodetail <set>
|
|
|
<if test="item.pd_piid !=null">
|
|
|
@@ -1031,20 +1284,39 @@
|
|
|
</foreach>
|
|
|
</update>
|
|
|
|
|
|
- <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
|
|
|
-
|
|
|
-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_puid=#{id,jdbcType=INTEGER} GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
|
|
|
-where a.pd_piid = (select pi_id from prodinout where pi_puid=#{id,jdbcType=INTEGER} and pi_class='采购验收单')
|
|
|
+ <update id="updateSaleOutYqty" parameterType="long">
|
|
|
+update prodiodetail
|
|
|
+ set a.pd_yqty =ifnull((select b.pd_inqty from (select pi_said,sum(pd_inqty) pd_inqty from prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售退货单'
|
|
|
+and pi_said=#{id} GROUP BY pd_ioid) b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
|
|
|
+where a.pd_piid = (select pi_id from prodinout where pi_said=#{id} and pi_class='销售出货单')
|
|
|
+ </update>
|
|
|
+ <update id="updateSaleYqty" parameterType="long">
|
|
|
+ update saledtail
|
|
|
+ set a.sd_yqty =ifnull((
|
|
|
+ select b.pd_ounqty from (select pi_said,sum(pd_outqty) pd_outqty
|
|
|
+ from prodiodetail left join prodinout on pd_piid = pi_id where pd_piclass='销售出货单'
|
|
|
+ and pi_said=#{id} GROUP BY pi_said) b where ifnull(b.pd_ioid ,0)= a.pd_id
|
|
|
+ ),0)
|
|
|
+ where a.sd_said = #{id}
|
|
|
</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>
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ <update id="updatePDSaleIN" parameterType="long">
|
|
|
+ update prodiodetail set
|
|
|
+ pd_total=ifnull(pd_inqty,0)*ifnull(pd_orderprice,0),
|
|
|
+ pd_netprice = ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100),
|
|
|
+ pd_nettotal = (ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100))*ifnull(pd_inqty)
|
|
|
+ where pd_piid=#{id}
|
|
|
+ </update>
|
|
|
+ <update id="updatePDSaleOut" parameterType="long">
|
|
|
+ update prodiodetail set
|
|
|
+ pd_total=ifnull(pd_outqty,0)*ifnull(pd_orderprice,0),
|
|
|
+ pd_netprice = ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100),
|
|
|
+ pd_nettotal = (ifnull(pd_sendprice,0)/(1+ifnull(pd_taxrate,0)/100))*ifnull(pd_outqty)
|
|
|
+ where pd_piid=#{id}
|
|
|
+ </update>
|
|
|
</mapper>
|