|
@@ -22,14 +22,17 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="getDpList" resultType="com.fjhx.sale.entity.documents.po.DocumentsProduct">
|
|
|
- SELECT IFNULL(t2.quantity, t3.quantity) as quantity,
|
|
|
+ SELECT IFNULL(t2.quantity, t3.quantity) AS quantity,
|
|
|
t1.*,
|
|
|
t2.product_id productId,
|
|
|
IFNULL(t2.pack_detail_id, t3.pack_detail_id) AS packDetailId,
|
|
|
- t3.unit AS productUnit
|
|
|
+ t3.unit AS productUnit,
|
|
|
+ pd.pack_quantity,
|
|
|
+ t1.quantity as sumQuantity
|
|
|
FROM documents_product t1
|
|
|
LEFT JOIN pack_detail_product t2 ON t1.business_id = t2.id
|
|
|
LEFT JOIN pack_detail_goods t3 ON t1.business_id = t3.id
|
|
|
+ left join pack_detail pd on pd.id = IFNULL(t2.pack_detail_id, t3.pack_detail_id)
|
|
|
WHERE t1.documents_id = #{documentId}
|
|
|
</select>
|
|
|
<select id="getMaxMoneyData" resultType="com.fjhx.sale.entity.documents.po.DocumentsProduct">
|