|
|
@@ -41,6 +41,36 @@
|
|
|
<result column="pd_ym" jdbcType="INTEGER" property="pd_ym" />
|
|
|
<result column="pd_yqty" jdbcType="INTEGER" property="pd_yqty" />
|
|
|
<result column="pd_ioid" jdbcType="INTEGER" property="pd_ioid" />
|
|
|
+ <association property="product" javaType="com.usoftchina.saas.document.entities.Product">
|
|
|
+ <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_docdate" property="pr_docdate"/>
|
|
|
+ <result column="pr_recordmanid" property="pr_recordmanid"/>
|
|
|
+ <result column="pr_recordman" property="pr_recordman"/>
|
|
|
+ <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" />
|
|
|
@@ -131,11 +161,8 @@
|
|
|
</select>
|
|
|
<select id="selectByExample" parameterType="com.usoftchina.saas.purchase.po.ProdIODetailExample" resultMap="BaseResultMap">
|
|
|
select
|
|
|
- <if test="distinct">
|
|
|
- distinct
|
|
|
- </if>
|
|
|
- <include refid="Base_Column_List" />
|
|
|
- from prodiodetail
|
|
|
+ *
|
|
|
+ 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>
|
|
|
@@ -198,7 +225,6 @@
|
|
|
</selectKey>
|
|
|
insert into prodiodetail
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
-
|
|
|
<if test="pd_piid != null">
|
|
|
pd_piid,
|
|
|
</if>
|
|
|
@@ -316,11 +342,8 @@
|
|
|
<if test="pd_ioid != null">
|
|
|
pd_ioid,
|
|
|
</if>
|
|
|
-
|
|
|
-
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
-
|
|
|
<if test="pd_piid != null">
|
|
|
#{pd_piid,jdbcType=INTEGER},
|
|
|
</if>
|
|
|
@@ -901,58 +924,386 @@
|
|
|
)
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
+
|
|
|
+ <insert id="batchInsert1" parameterType="java.util.List" >
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=",">
|
|
|
+ insert into prodiodetail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="item.pd_piid != null">
|
|
|
+ pd_piid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inoutno != null">
|
|
|
+ pd_inoutno,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_piclass != null">
|
|
|
+ pd_piclass,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_pdno != null">
|
|
|
+ pd_pdno,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ordercode != null">
|
|
|
+ pd_ordercode,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderdetno != null">
|
|
|
+ pd_orderdetno,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_prodid != null">
|
|
|
+ pd_prodid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_prodcode != null">
|
|
|
+ pd_prodcode,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_unit != null">
|
|
|
+ pd_unit,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inqty != null">
|
|
|
+ pd_inqty,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_outqty != null">
|
|
|
+ pd_outqty,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderprice != null">
|
|
|
+ pd_orderprice,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_sendprice != null">
|
|
|
+ pd_sendprice,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_price != null">
|
|
|
+ pd_price,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_total != null">
|
|
|
+ pd_total,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_taxrate != null">
|
|
|
+ pd_taxrate,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_netprice != null">
|
|
|
+ pd_netprice,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_nettotal != null">
|
|
|
+ pd_nettotal,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whid != null">
|
|
|
+ pd_whid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whcode != null">
|
|
|
+ pd_whcode,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whname != null">
|
|
|
+ pd_whname,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhid != null">
|
|
|
+ pd_inwhid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhcode != null">
|
|
|
+ pd_inwhcode,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhname != null">
|
|
|
+ pd_inwhname,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderid != null">
|
|
|
+ pd_orderid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_sdid != null">
|
|
|
+ pd_sdid,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_status != null">
|
|
|
+ pd_status,
|
|
|
+ </if>
|
|
|
+ <if test="item.companyId != null">
|
|
|
+ companyid,
|
|
|
+ </if>
|
|
|
+ <if test="item.updaterId != null">
|
|
|
+ updaterid,
|
|
|
+ </if>
|
|
|
+ <if test="item.updateTime != null">
|
|
|
+ updatetime,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text1 != null">
|
|
|
+ pd_text1,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text2 != null">
|
|
|
+ pd_text2,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text3 != null">
|
|
|
+ pd_text3,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text4 != null">
|
|
|
+ pd_text4,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text5 != null">
|
|
|
+ pd_text5,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ym != null">
|
|
|
+ pd_ym,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_yqty != null">
|
|
|
+ pd_yqty,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_remark != null">
|
|
|
+ pd_remark,
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ioid != null">
|
|
|
+ pd_ioid,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="item.pd_piid != null">
|
|
|
+ #{item.pd_piid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inoutno != null">
|
|
|
+ #{item.pd_inoutno,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_piclass != null">
|
|
|
+ #{item.pd_piclass,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_pdno != null">
|
|
|
+ #{item.pd_pdno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ordercode != null">
|
|
|
+ #{item.pd_ordercode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderdetno != null">
|
|
|
+ #{item.pd_orderdetno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_prodid != null">
|
|
|
+ #{item.pd_prodid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_prodcode != null">
|
|
|
+ #{item.pd_prodcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_unit != null">
|
|
|
+ #{item.pd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inqty != null">
|
|
|
+ #{item.pd_inqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_outqty != null">
|
|
|
+ #{item.pd_outqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderprice != null">
|
|
|
+ #{item.pd_orderprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_sendprice != null">
|
|
|
+ #{item.pd_sendprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_price != null">
|
|
|
+ #{item.pd_price,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_total != null">
|
|
|
+ #{item.pd_total,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_taxrate != null">
|
|
|
+ #{item.pd_taxrate,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_netprice != null">
|
|
|
+ #{item.pd_netprice,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_nettotal != null">
|
|
|
+ #{item.pd_nettotal,jdbcType=DOUBLE},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whid != null">
|
|
|
+ #{item.pd_whid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whcode != null">
|
|
|
+ #{item.pd_whcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_whname != null">
|
|
|
+ #{item.pd_whname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhid != null">
|
|
|
+ #{item.pd_inwhid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhcode != null">
|
|
|
+ #{item.pd_inwhcode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_inwhname != null">
|
|
|
+ #{item.pd_inwhname,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_orderid != null">
|
|
|
+ #{item.pd_orderid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_sdid != null">
|
|
|
+ #{item.pd_sdid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_status != null">
|
|
|
+ #{item.pd_status,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.companyId != null">
|
|
|
+ #{item.companyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.updaterId != null">
|
|
|
+ #{item.updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.updateTime != null">
|
|
|
+ #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text1 != null">
|
|
|
+ #{item.pd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text2 != null">
|
|
|
+ #{item.pd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text3 != null">
|
|
|
+ #{item.pd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text4 != null">
|
|
|
+ #{item.pd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_text5 != null">
|
|
|
+ #{item.pd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ym != null">
|
|
|
+ #{item.pd_ym,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_yqty != null">
|
|
|
+ #{item.pd_yqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_remark != null">
|
|
|
+ #{item.pd_remark,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="item.pd_ioid != null">
|
|
|
+ #{item.pd_ioid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+
|
|
|
+ </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>
|
|
|
- pd_piid = #{item.pd_piid},
|
|
|
- pd_inoutno = #{item.pd_inoutno},
|
|
|
- pd_piclass = #{item.pd_piclass},
|
|
|
- pd_pdno = #{item.pd_pdno},
|
|
|
- pd_ordercode = #{item.pd_orderdetno},
|
|
|
- pd_orderdetno = #{item.pd_unit},
|
|
|
- pd_prodid = #{item.pd_prodid},
|
|
|
- pd_prodcode = #{item.pd_prodcode},
|
|
|
- pd_unit = #{item.pd_unit},
|
|
|
- pd_inqty = #{item.pd_inqty},
|
|
|
- pd_outqty = #{item.pd_outqty},
|
|
|
- pd_orderprice = #{item.pd_orderprice},
|
|
|
- pd_sendprice = #{item.pd_sendprice},
|
|
|
- pd_price = #{item.pd_price},
|
|
|
- pd_total = #{item.pd_total},
|
|
|
- pd_taxrate= #{item.pd_taxrate},
|
|
|
- pd_netprice= #{item.pd_netprice},
|
|
|
- pd_nettotal= #{item.pd_nettotal},
|
|
|
- pd_whid= #{item.pd_whid},
|
|
|
- pd_whcode= #{item.pd_whcode},
|
|
|
- pd_whname= #{item.pd_whname},
|
|
|
- pd_inwhid= #{item.pd_inwhid},
|
|
|
- pd_inwhcode= #{item.pd_inwhcode},
|
|
|
- pd_inwhname= #{item.pd_inwhname},
|
|
|
- pd_orderid= #{item.pd_orderid},
|
|
|
- pd_sdid= #{item.pd_sdid},
|
|
|
- pd_status= #{item.pd_status},
|
|
|
- pd_remark= #{item.pd_remark},
|
|
|
- companyId = #{item.companyId},
|
|
|
- updaterId = #{item.updaterId},
|
|
|
- updateTime = #{item.updateTime},
|
|
|
+ <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},
|
|
|
- pd_ym = #{item.pd_ym},
|
|
|
- pd_yqty = #{item.pd_yqty}
|
|
|
+ <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="java.lang.Long">
|
|
|
+ <update id="updatePurchaseYqty" parameterType="java.lang.Integer">
|
|
|
|
|
|
update prodiodetail a
|
|
|
-set a.pd_yqty =ifnull((select b.pd_outqty from (select pd_outqty,pd_ioid from prodiodetail where pd_piclass='采购验退单') b where ifnull(b.pd_ioid ,0)= a.pd_id ),0)
|
|
|
-where a.pd_piid = #{id,jdbcType=INTEGER}
|
|
|
+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>
|
|
|
|
|
|
|
|
|
+ <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>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</mapper>
|