|
@@ -114,6 +114,8 @@
|
|
|
<result column="cost_price" property="costPrice"/>
|
|
<result column="cost_price" property="costPrice"/>
|
|
|
<result column="cost_amt" property="costAmt"/>
|
|
<result column="cost_amt" property="costAmt"/>
|
|
|
<result column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
|
|
<result column="into_id" property="intoId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="price_purchase" property="pricePurchase"/>
|
|
|
|
|
+
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
<!-- 通用条件列 -->
|
|
<!-- 通用条件列 -->
|
|
@@ -665,9 +667,13 @@
|
|
|
SELECT t.item_id,
|
|
SELECT t.item_id,
|
|
|
t.order_id,
|
|
t.order_id,
|
|
|
tpo.order_no,
|
|
tpo.order_no,
|
|
|
|
|
+ tms.cus_code,
|
|
|
|
|
+ tms.cus_name,
|
|
|
|
|
+ tms.cus_phone,
|
|
|
|
|
+ tpo.make_time AS "makingTime",
|
|
|
t.item_index,
|
|
t.item_index,
|
|
|
t.sku_id,
|
|
t.sku_id,
|
|
|
- tmgs.sku_code as "skuCode",
|
|
|
|
|
|
|
+ tmgs.sku_code,
|
|
|
tmgs.sku_model as "skuModel",
|
|
tmgs.sku_model as "skuModel",
|
|
|
tmgs.sku_name as "skuName",
|
|
tmgs.sku_name as "skuName",
|
|
|
sys.f_remove_zero(t.item_qty) as item_qty,
|
|
sys.f_remove_zero(t.item_qty) as item_qty,
|
|
@@ -680,7 +686,7 @@
|
|
|
t.fact_amt,
|
|
t.fact_amt,
|
|
|
t.use_place,
|
|
t.use_place,
|
|
|
t.discount,
|
|
t.discount,
|
|
|
- t.non_std_code,
|
|
|
|
|
|
|
+ t.non_std_code AS "nonStdCode",
|
|
|
t.out_status,
|
|
t.out_status,
|
|
|
sys.f_remove_zero(t.outing_qty) as outing_qty,
|
|
sys.f_remove_zero(t.outing_qty) as outing_qty,
|
|
|
t.outing_amt,
|
|
t.outing_amt,
|
|
@@ -699,8 +705,10 @@
|
|
|
,ul.unit_name as "unitName"
|
|
,ul.unit_name as "unitName"
|
|
|
,u2.unit_name as "subUnitName"
|
|
,u2.unit_name as "subUnitName"
|
|
|
,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,t.box,t.piece) as "boxPiece"
|
|
,dkic_b.f_box_piece(u2.unit_name,ul.unit_name,t.box,t.piece) as "boxPiece"
|
|
|
|
|
+ ,tmgs.price_purchase
|
|
|
FROM dkic_b.t_psi_order_item as t
|
|
FROM dkic_b.t_psi_order_item as t
|
|
|
left join dkic_b.t_psi_order as tpo on tpo.order_id = t.order_id
|
|
left join dkic_b.t_psi_order as tpo on tpo.order_id = t.order_id
|
|
|
|
|
+ left join dkic_b.t_mst_customer as tms on tpo.cus_id = tms.cus_id
|
|
|
LEFT join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
LEFT join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
left join dkic_b.t_mst_unit ul on t.unit_id = ul.unit_id
|
|
left join dkic_b.t_mst_unit ul on t.unit_id = ul.unit_id
|
|
|
left join dkic_b.t_mst_unit u2 on t.sub_unit_id = u2.unit_id
|
|
left join dkic_b.t_mst_unit u2 on t.sub_unit_id = u2.unit_id
|
|
@@ -708,6 +716,12 @@
|
|
|
group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
|
<where>
|
|
<where>
|
|
|
t.item_qty - coalesce(sumQty,0) > 0
|
|
t.item_qty - coalesce(sumQty,0) > 0
|
|
|
|
|
+ AND t.sku_id is not null
|
|
|
|
|
+ AND t.flg_valid
|
|
|
|
|
+ AND tpo.flg_valid
|
|
|
|
|
+ <if test="cpId != null">
|
|
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
|
|
+ </if>
|
|
|
<if test="orderNo != null">
|
|
<if test="orderNo != null">
|
|
|
AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
</if>
|
|
</if>
|
|
@@ -728,6 +742,12 @@
|
|
|
group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
group by from_item_id) as pi on pi.from_item_id = t.item_id
|
|
|
<where>
|
|
<where>
|
|
|
t.item_qty - coalesce(sumQty,0) > 0
|
|
t.item_qty - coalesce(sumQty,0) > 0
|
|
|
|
|
+ AND t.sku_id is not null
|
|
|
|
|
+ AND t.flg_valid
|
|
|
|
|
+ AND tpo.flg_valid
|
|
|
|
|
+ <if test="cpId != null">
|
|
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
|
|
+ </if>
|
|
|
<if test="orderNo != null">
|
|
<if test="orderNo != null">
|
|
|
AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
AND tpo.order_no like concat('%', my_ex.likequery(#{orderNo}) , '%')
|
|
|
</if>
|
|
</if>
|