|
|
@@ -584,6 +584,20 @@
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <!-- 采购明细报表主表Count-->
|
|
|
+ <select id="getPurReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_purchase tpp
|
|
|
+ Left join dkic_b.t_mst_org tmo on tpp.org_id = tmo.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tpp.sup_id = tmp.sup_id
|
|
|
+ Left join dkic_b.t_mst_staff tms on tpp.staff_id = tms.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff tms1 on tpp.make_staff = tms1.staff_id
|
|
|
+ Left join dkic_b.t_mst_warehouse tmw on tpp.wh_id = tmw.wh_id
|
|
|
+ left join sys.t_data_kind tdk2 on tdk2.kind_code = tpp.pur_status
|
|
|
+ left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.pur_type
|
|
|
+ <include refid="Condition_PurReport"/>
|
|
|
+ </select>
|
|
|
+
|
|
|
<!-- 采购明细报表明细 -->
|
|
|
<select id="getPurDetailReport" resultType="java.util.Map">
|
|
|
select
|
|
|
@@ -627,8 +641,8 @@
|
|
|
FROM dkic_b.t_psi_purchase as tpp
|
|
|
Left join dkic_b.t_mst_org as tmo on tpp.org_id = tmo.org_id
|
|
|
Left join dkic_b.t_mst_supplier as tmp on tpp.sup_id = tmp.sup_id
|
|
|
- Left join dkic_b.t_mst_staff as tms on tpp.staff_id = tms.staff_id
|
|
|
- Left join dkic_b.t_mst_staff as tms1 on tpp.make_staff = tms1.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff as tms on tpp.staff_id = tms.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff as tms1 on tpp.make_staff = tms1.staff_id
|
|
|
Left join dkic_b.t_mst_warehouse as tmw on tpp.wh_id = tmw.wh_id
|
|
|
left join sys.t_data_kind as tdk2 on tdk2.kind_code = tpp.pur_status
|
|
|
left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.pur_type
|
|
|
@@ -647,6 +661,28 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 采购明细报表明细Count-->
|
|
|
+ <select id="getPurDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_purchase as tpp
|
|
|
+ Left join dkic_b.t_mst_org as tmo on tpp.org_id = tmo.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier as tmp on tpp.sup_id = tmp.sup_id
|
|
|
+ Left join dkic_b.t_mst_staff as tms on tpp.staff_id = tms.staff_id
|
|
|
+ Left join dkic_b.t_mst_staff as tms1 on tpp.make_staff = tms1.staff_id
|
|
|
+ Left join dkic_b.t_mst_warehouse as tmw on tpp.wh_id = tmw.wh_id
|
|
|
+ left join sys.t_data_kind as tdk2 on tdk2.kind_code = tpp.pur_status
|
|
|
+ left join sys.t_data_kind tdk1 on tdk1.kind_code = tpp.pur_type
|
|
|
+ left join dkic_b.t_psi_purchase_item as tppi on tppi.pur_id = tpp.pur_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tppi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join dkic_b.t_psi_order as tpo on tpo.order_id = tppi.from_id
|
|
|
+ left join dkic_b.t_psi_inbound_item as ibi on ibi.from_item_id=tppi.item_id
|
|
|
+ left join dkic_b.t_psi_inbound as ib on ibi.into_id=ib.into_id
|
|
|
+ left join sys.t_data_kind tdk1 on tdk1.kind_code = tppi.into_status
|
|
|
+ <include refid="Condition_PurDetailReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 销售明细报表主表 -->
|
|
|
<select id="getOrderReport" resultType="java.util.Map">
|
|
|
@@ -689,6 +725,20 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 销售明细报表主表Count-->
|
|
|
+ <select id="getOrderReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
+ left join dkic_b.t_mst_sale_channel as tmsc on t.sales_channel = tmsc.channel_id
|
|
|
+ left join dkic_b.t_mst_org as tmo on t.org_id = tmo.org_id
|
|
|
+ left join dkic_b.t_mst_staff as tms on t.staff_id = tms.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
|
|
|
+ left join dkic_b.t_mst_customer as tmc on t.cus_id = tmc.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data as tmdd on tmc.cus_from = tmdd.data_id
|
|
|
+ left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
|
|
|
+ left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
|
|
|
+ <include refid="Condition_OrdReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 销售明细报表明细 -->
|
|
|
<select id="getOrderDetailReport" resultType="java.util.Map">
|
|
|
@@ -758,6 +808,27 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 销售明细报表明细Count-->
|
|
|
+ <select id="getOrderDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
+ left join dkic_b.t_mst_sale_channel tmsc on t.sales_channel = tmsc.channel_id
|
|
|
+ left join dkic_b.t_mst_org tmo on t.org_id = tmo.org_id
|
|
|
+ left join dkic_b.t_mst_staff tms on t.staff_id = tms.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on t.make_staff = makestaff.staff_id
|
|
|
+ left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmc.cus_from = tmdd.data_id
|
|
|
+ left join sys.t_data_kind as tdk1 on t.order_type = tdk1.kind_code
|
|
|
+ left join sys.t_data_kind as tdk2 on t.order_status = tdk2.kind_code
|
|
|
+ left join dkic_b.t_psi_order_item as toi on toi.order_id = t.order_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = toi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join sys.t_data_kind as tdk3 on tdk3.kind_code = toi.out_status
|
|
|
+ left join dkic_b.t_psi_outbound as tpo on tpo.from_id=t.order_id
|
|
|
+ <include refid="Condition_OrdDetailReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 出库明细报表主表 -->
|
|
|
<select id="getOutboundReport" resultType="java.util.Map">
|
|
|
@@ -799,6 +870,20 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 出库明细报表主表Count-->
|
|
|
+ <select id="getOutboundReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_outbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
+ LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
|
|
|
+ <include refid="Condition_OutboundReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 出库明细报表明细 -->
|
|
|
<select id="getOutboundDetailReport" resultType="java.util.Map">
|
|
|
@@ -860,6 +945,27 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 出库明细报表明细Count-->
|
|
|
+ <select id="getOutboundDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_outbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.out_status
|
|
|
+ left join sys.t_data_kind tdktype ON tdktype.kind_code = t.out_type
|
|
|
+ left join dkic_b.t_psi_outbound_item as tpoi on tpoi.out_id = t.out_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = tpi.wh_id
|
|
|
+ <include refid="Condition_OutboundDetailReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 入库明细报表主表 -->
|
|
|
<select id="getInboundlReport" resultType="java.util.Map">
|
|
|
@@ -903,6 +1009,21 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 入库明细报表主表Count-->
|
|
|
+ <select id="getInboundlReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_inbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
|
|
|
+ left join sys.t_data_kind tdktype ON tdktype.kind_code = t.into_type
|
|
|
+ left join dkic_b.t_mst_warehouse as tmw on tmw.wh_id = t.wh_id
|
|
|
+ <include refid="Condition_IntoboundReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 入库明细报表明细 -->
|
|
|
<select id="getInboundDetailReport" resultType="java.util.Map">
|
|
|
@@ -962,6 +1083,26 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 入库明细报表明细Count-->
|
|
|
+ <select id="getInboundDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_psi_inbound as t
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ Left join dkic_b.t_mst_supplier tmp on tmp.sup_id = t.sup_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.cus_id
|
|
|
+ left join dkic_b.t_mst_dictionary_data tmdd on tmdd.data_id = tmc.cus_from
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.into_status
|
|
|
+ LEFT JOIN sys.t_data_kind tdktype ON tdktype.kind_code = t.into_type
|
|
|
+ left join dkic_b.t_psi_inbound_item as tpoi on tpoi.into_id = t.into_id
|
|
|
+ left join dkic_b.t_mst_goods_sku as tmgs on tmgs.sku_id = tpoi.sku_id
|
|
|
+ left join dkic_b.t_mst_goods_brand as tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
+ left join dkic_b.t_mst_goods_category as tmgc on tmgc.cat_id = tmgs.category_id
|
|
|
+ left join dkic_b.t_mst_goods_series as series on series.series_id = tmgs.series_id
|
|
|
+ left join dkic_b.t_psi_inventory as tpi on tpi.inv_id = tpoi.inv_id
|
|
|
+ <include refid="Condition_IntoboundDetailReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
<!-- 客户收款明细报表主表 -->
|
|
|
<select id="getRecPayDetailReport" resultType="java.util.Map">
|
|
|
@@ -992,15 +1133,21 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <!-- 客户收款明细报表主表Count-->
|
|
|
+ <select id="getRecPayDetailReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
+ FROM dkic_b.t_mac_rec_pay_item as tmrpi
|
|
|
+ left join dkic_b.t_mac_rec_pay t on tmrpi.rp_id = t.rp_id
|
|
|
+ left join dkic_b.t_mst_org tmo on tmo.org_id = t.org_id
|
|
|
+ left join dkic_b.t_mst_staff tms on tms.staff_id = t.staff_id
|
|
|
+ left join dkic_b.t_mst_staff as makestaff on makestaff.staff_id = t.make_staff
|
|
|
+ left join dkic_b.t_mst_customer tmc on tmc.cus_id = t.object_id
|
|
|
+ left join sys.t_data_kind as tdk1 on tdk1.kind_code = t.rp_type
|
|
|
+ left join dkic_b.t_mst_money_account tmma on tmma.mac_id = tmrpi.mac_id
|
|
|
+ <include refid="Condition_RecPayDetailReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
|
|
|
- <sql id="ConditionSalesTrackingReport">
|
|
|
- <where>
|
|
|
- <if test="cpId != null">
|
|
|
- tpo.cp_id = #{cpId}
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- </sql>
|
|
|
|
|
|
<sql id="ConditionPurTrackingReport">
|
|
|
<where>
|
|
|
@@ -1064,434 +1211,170 @@
|
|
|
left join dkic_b.t_mst_org tmo on tpo.org_id = tmo.org_id
|
|
|
left join dkic_b.t_mac_rec_pay tmrp on tmrp.biznis_id = tpo.order_id
|
|
|
<include refid="ConditionSalesTrackingReport"/>
|
|
|
- order by tpo.op_create_time desc
|
|
|
+ <if test="sort!=null and sort == 'balanceDesc'">
|
|
|
+ ORDER BY tpo.make_time desc
|
|
|
+ </if>
|
|
|
+ <if test="sort!=null and sort == 'balanceAsc'">
|
|
|
+ ORDER BY tpo.make_time asc
|
|
|
+ </if>
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
|
|
|
+ <sql id="ConditionSalesTrackingReport">
|
|
|
+ <where>
|
|
|
+ <if test="orderNo != null">
|
|
|
+ tpo.order_no = #{orderNo}
|
|
|
+ </if>
|
|
|
+ <if test="cusName != null">
|
|
|
+ tmc.cus_name = #{cusName}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ tpo.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ <if test="createtimeStart != null and createtimeEnd != null">
|
|
|
+ AND tpo.op_create_time >= #{createtimeStart}::timestamp with time zone
|
|
|
+ AND tpo.op_create_time < #{createtimeEnd}::timestamp with time zone + interval '1 day'
|
|
|
+ </if>
|
|
|
+ <if test="searchText != null">
|
|
|
+ AND (tpo.order_no like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmc.cus_code like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmc.cus_name like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tmc.cus_phone like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tpo.address_full like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ OR tpo.remarks like concat('%', my_ex.likequery(#{searchText}) , '%')
|
|
|
+ )
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
|
|
|
|
|
|
- <select id="getSalesTrackingReportCount" resultType="java.lang.Long">
|
|
|
- SELECT count(1)
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_order tpo
|
|
|
- <include refid="ConditionSalesTrackingReport"/>
|
|
|
- </select>
|
|
|
-
|
|
|
- <select id="getSalesTrackingReportDetail" resultType="java.util.Map">
|
|
|
- SELECT T
|
|
|
- ."id",
|
|
|
- T."no",
|
|
|
- T."itemId",
|
|
|
- T."type",
|
|
|
- T."skuCode",
|
|
|
- T."skuName",
|
|
|
- T."skuModel",
|
|
|
- T."skuImages",
|
|
|
- T."brandName",
|
|
|
- T."shortName",
|
|
|
- T."returnQty",
|
|
|
- T."outQty",
|
|
|
- T."outingQty",
|
|
|
- T."priceSale",
|
|
|
- T."itemQty",
|
|
|
- T."sumQuantity",
|
|
|
- T."sumAmount",
|
|
|
- T."sumAmtRec",
|
|
|
- T."sumShouldHandle",
|
|
|
- T."sumUsePaymentResidue",
|
|
|
- T."sumWaiveAmt",
|
|
|
- T."makeTime",
|
|
|
- T."whId",
|
|
|
- T."whName",
|
|
|
- T."remarks"
|
|
|
- FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tpo.order_id AS "id",
|
|
|
- tpo.order_no AS "no",
|
|
|
- tpoi.item_id AS "itemId",
|
|
|
- '销售订单' AS "type",
|
|
|
- tmgs.sku_code AS "skuCode",
|
|
|
- tmgs.sku_name AS "skuName",
|
|
|
- tmgs.sku_model AS "skuModel",
|
|
|
- tmgs.sku_images AS "skuImages",
|
|
|
- tmgb.brand_name AS "brandName",
|
|
|
- tmgb.short_name AS "shortName",
|
|
|
- tpo.return_qty AS "returnQty",
|
|
|
- tpo.out_qty AS "outQty",
|
|
|
- tpo.outing_qty AS "outingQty",
|
|
|
- tpoi.price_sale AS "priceSale",
|
|
|
- tpoi.item_qty AS "itemQty",
|
|
|
- tpo.sum_quantity AS "sumQuantity",
|
|
|
- tpo.sum_amount AS "sumAmount",
|
|
|
- 0.00 AS "sumAmtRec",
|
|
|
- 0.00 AS "sumShouldHandle",
|
|
|
- 0.00 AS "sumUsePaymentResidue",
|
|
|
- 0.00 AS "sumWaiveAmt",
|
|
|
- tpo.make_time AS "makeTime",
|
|
|
- tpoi.wh_id AS "whId",
|
|
|
- tmw.wh_name AS "whName",
|
|
|
- tpoi.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_order_item tpoi
|
|
|
- LEFT JOIN dkic_b.t_psi_order tpo ON tpo.order_id = tpoi.order_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tpoi.sku_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- LEFT JOIN dkic_b.t_mst_warehouse tmw ON tmw.wh_id = tpoi.wh_id
|
|
|
- WHERE
|
|
|
- tpo.order_id = #{id}::uuid
|
|
|
- UNION ALL
|
|
|
- SELECT
|
|
|
- tpobi.out_id AS "id",
|
|
|
- tpob.out_no AS "no",
|
|
|
- tpobi.item_id AS "itemId",
|
|
|
- '销售出库' AS "type",
|
|
|
- tmgs.sku_code AS "skuCode",
|
|
|
- tmgs.sku_name AS "skuName",
|
|
|
- tmgs.sku_model AS "skuModel",
|
|
|
- tmgs.sku_images AS "skuImages",
|
|
|
- tmgb.brand_name AS "brandName",
|
|
|
- tmgb.short_name AS "shortName",
|
|
|
- tpob.return_qty AS "returnQty",
|
|
|
- tpob.out_qty AS "outQty",
|
|
|
- tpob.outing_qty AS "outingQty",
|
|
|
- tpobi.price_out AS "priceSale",
|
|
|
- CASE
|
|
|
-
|
|
|
- WHEN tpobi.out_status = '出库状态-出库中' THEN
|
|
|
- tpobi.outing_qty ELSE tpobi.out_qty
|
|
|
- END AS "itemQty",
|
|
|
- 0.00 AS "sumQuantity",
|
|
|
- 0.00 AS "sumAmount",
|
|
|
- 0.00 AS "sumAmtRec",
|
|
|
- 0.00 AS "sumShouldHandle",
|
|
|
- 0.00 AS "sumUsePaymentResidue",
|
|
|
- 0.00 AS "sumWaiveAmt",
|
|
|
- tpob.make_time AS "makeTime",
|
|
|
- NULL AS "whId",
|
|
|
- NULL AS "whName",
|
|
|
- tpobi.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_outbound_item tpobi
|
|
|
- LEFT JOIN dkic_b.t_psi_outbound tpob ON tpob.out_id = tpobi.out_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tpobi.sku_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- WHERE
|
|
|
- tpob.from_id = #{id}::uuid
|
|
|
- AND tpob.out_type = '出库类型-销售出库' UNION ALL
|
|
|
- SELECT
|
|
|
- tpobi.out_id AS "id",
|
|
|
- tpob.out_no AS "no",
|
|
|
- tpobi.item_id AS "itemId",
|
|
|
- '销售退货' AS "type",
|
|
|
- tmgs.sku_code AS "skuCode",
|
|
|
- tmgs.sku_name AS "skuName",
|
|
|
- tmgs.sku_model AS "skuModel",
|
|
|
- tmgs.sku_images AS "skuImages",
|
|
|
- tmgb.brand_name AS "brandName",
|
|
|
- tmgb.short_name AS "shortName",
|
|
|
- tpob.return_qty AS "returnQty",
|
|
|
- tpob.out_qty AS "outQty",
|
|
|
- tpob.outing_qty AS "outingQty",
|
|
|
- tpobi.price_out AS "priceSale",
|
|
|
- CASE
|
|
|
-
|
|
|
- WHEN tpobi.out_status = '出库状态-出库中' THEN
|
|
|
- tpobi.outing_qty ELSE tpobi.out_qty
|
|
|
- END AS "itemQty",
|
|
|
- 0.00 AS "sumQuantity",
|
|
|
- 0.00 AS "sumAmount",
|
|
|
- 0.00 AS "sumAmtRec",
|
|
|
- 0.00 AS "sumShouldHandle",
|
|
|
- 0.00 AS "sumUsePaymentResidue",
|
|
|
- 0.00 AS "sumWaiveAmt",
|
|
|
- tpob.make_time AS "makeTime",
|
|
|
- NULL AS "whId",
|
|
|
- NULL AS "whName",
|
|
|
- tpobi.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_outbound_item tpobi
|
|
|
- LEFT JOIN dkic_b.t_psi_outbound tpob ON tpob.out_id = tpobi.out_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tpobi.sku_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- WHERE
|
|
|
- tpob.from_id = #{id}::uuid
|
|
|
- AND tpob.out_type = '出库类型-销售出库退货' UNION ALL
|
|
|
- SELECT
|
|
|
- tmrp.rp_id AS "id",
|
|
|
- tmrp.rp_no AS "no",
|
|
|
- NULL AS "itemId",
|
|
|
- '核销信息' AS "type",
|
|
|
- NULL AS "skuCode",
|
|
|
- NULL AS "skuName",
|
|
|
- NULL AS "skuModel",
|
|
|
- NULL AS "skuImages",
|
|
|
- NULL AS "brandName",
|
|
|
- NULL AS "shortName",
|
|
|
- NULL AS "returnQty",
|
|
|
- NULL AS "outQty",
|
|
|
- NULL AS "outingQty",
|
|
|
- NULL AS "priceSale",
|
|
|
- NULL AS "itemQty",
|
|
|
- tmrp.sum_amt_rec AS "sumAmtRec",
|
|
|
- tmrp.sum_should_handle AS "sumShouldHandle",
|
|
|
- tmrp.sum_use_payment_residue AS "sumUsePaymentResidue",
|
|
|
- tmrp.sum_waive_amt AS "sumWaiveAmt",
|
|
|
- NULL AS "makeTime",
|
|
|
- NULL AS "whId",
|
|
|
- NULL AS "whName",
|
|
|
- tmrp.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_mac_rec_pay tmrp
|
|
|
- WHERE
|
|
|
- tmrp.biznis_id = #{id}::uuid
|
|
|
- ) T
|
|
|
- </select>
|
|
|
-
|
|
|
- <!-- 采购跟踪表 列表查询 -->
|
|
|
- <select id="getPurTrackingReport" resultType="java.util.Map">
|
|
|
+ <!-- 销售明细查询 -->
|
|
|
+ <select id="getSalesItemReport" resultType="java.util.Map">
|
|
|
SELECT
|
|
|
- tpp.pur_id AS "purId"
|
|
|
- ,tpp.pur_no AS "purNo"
|
|
|
- ,tpp.pur_type AS "purType"
|
|
|
- ,sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) AS "purTypeName"
|
|
|
- ,tpp.org_id AS "orgId"
|
|
|
- ,tmo.org_name AS "orgName"
|
|
|
- ,tpp.staff_id AS "staffId"
|
|
|
- ,tpp.sup_id AS "supId"
|
|
|
- ,tpp.contact_name AS "contactName"
|
|
|
- ,tpp.contact_phone AS "contactPhone"
|
|
|
- ,tpp.wh_id AS "whId"
|
|
|
- ,tpp.pickup_date AS "pickupDate"
|
|
|
- ,tpp.sum_quantity AS "sumQuantity"
|
|
|
- ,tpp.sum_standard AS "sumStandard"
|
|
|
- ,tpp.sum_amount AS "sumAmount"
|
|
|
- ,tpp.pur_discount AS "purDiscount"
|
|
|
- ,tpp.pur_status AS "purStatus"
|
|
|
- ,sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "purStatusName"
|
|
|
- ,tpp.into_status AS "intoStatus"
|
|
|
- ,sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "intoStatusName"
|
|
|
- ,tpp.intoing_qty AS "intoingQty"
|
|
|
- ,tpp.intoing_amt AS "intoingAmt"
|
|
|
- ,tpp.into_qty AS "intoQty"
|
|
|
- ,tpp.into_amt AS "intoAmt"
|
|
|
- ,tpp.return_qty AS "returnQty"
|
|
|
- ,tpp.return_amt AS "returnAmt"
|
|
|
- ,tpp.amt_payable AS "amtPayable"
|
|
|
- ,tpp.amt_handle AS "amtHandle"
|
|
|
- ,tpp.amt_residue AS "amtResidue"
|
|
|
- ,tpp.remarks AS "remarks"
|
|
|
- ,tpp.annex_paths AS "annexPaths"
|
|
|
- ,tpp.make_staff AS "makeStaff"
|
|
|
- ,tpp.make_time AS "makeTime"
|
|
|
- ,tpp.flg_valid AS "flgValid"
|
|
|
- ,tms.sup_code AS "supCode"
|
|
|
- ,tms.sup_name As "supName"
|
|
|
- ,tms.contact_phone As "contactPhone"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_purchase tpp
|
|
|
- left join dkic_b.t_mst_supplier tms on tpp.sup_id = tms.sup_id
|
|
|
- left join sys.t_data_kind as tdk1 on tpp.pur_type = tdk1.kind_code
|
|
|
- left join sys.t_data_kind as tdk2 on tpp.pur_status = tdk2.kind_code
|
|
|
- left join sys.t_data_kind as tdk3 on tpp.into_status = tdk3.kind_code
|
|
|
- left join dkic_b.t_mst_org as tmo on tpp.org_id = tmo.org_id
|
|
|
- <include refid="ConditionPurTrackingReport"/>
|
|
|
- order by tpp.op_create_time desc
|
|
|
+ t.item_id AS "itemId",
|
|
|
+ t.order_id AS "orderId",
|
|
|
+ t.item_index AS "itemIndex",
|
|
|
+ t.sku_id AS "skuId",
|
|
|
+ tmgs.sku_code as "skuCode",
|
|
|
+ tmgs.sku_model as "skuModel",
|
|
|
+ tmgs.sku_name as "skuName",
|
|
|
+ t.item_qty AS "itemQty",
|
|
|
+ t.price_std AS "priceStd",
|
|
|
+ t.amt_std AS "amtStd",
|
|
|
+ t.price_sale AS "priceSale",
|
|
|
+ t.item_amt AS "itemAmt",
|
|
|
+ t.price_discount AS "priceDiscount",
|
|
|
+ t.non_std_code AS "nonStdCode",
|
|
|
+ t.out_status AS "outStatus",
|
|
|
+ t.outing_qty AS "outingQty",
|
|
|
+ t.outing_amt AS "outingAmt",
|
|
|
+ t.out_qty AS "outQty",
|
|
|
+ t.out_amt AS "outAmt",
|
|
|
+ t.return_qty AS "returnQty",
|
|
|
+ t.return_amt AS "returnAmt",
|
|
|
+ t.remarks,
|
|
|
+ t.wh_id AS "whId",
|
|
|
+ tmw.wh_name AS "whName"
|
|
|
+ FROM dkic_b.t_psi_order_item as t
|
|
|
+ inner join dkic_b.t_mst_goods_sku tmgs on t.sku_id = tmgs.sku_id
|
|
|
+ left join dkic_b.t_mst_warehouse tmw on tmw.wh_id = t.wh_id
|
|
|
+ <include refid="ConditionSaleItem"/>
|
|
|
+ order by t.item_index
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
- </select>
|
|
|
|
|
|
+ </select>
|
|
|
|
|
|
- <select id="getPurTrackingReportCount" resultType="java.lang.Long">
|
|
|
+ <sql id="ConditionSaleItem">
|
|
|
+ <where>
|
|
|
+ <if test="orderId != null and orderId != ''">
|
|
|
+ AND t.order_id = #{orderId}::uuid
|
|
|
+ </if>
|
|
|
+ <if test="itemIndex != null">
|
|
|
+ AND t.item_index = #{itemIndex}
|
|
|
+ </if>
|
|
|
+ <if test="skuId != null and skuId != ''">
|
|
|
+ AND t.sku_id = #{skuId}
|
|
|
+ </if>
|
|
|
+ <if test="itemQty != null">
|
|
|
+ AND t.item_qty = #{itemQty}
|
|
|
+ </if>
|
|
|
+ <if test="priceStd != null">
|
|
|
+ AND t.price_std = #{priceStd}
|
|
|
+ </if>
|
|
|
+ <if test="amtStd != null">
|
|
|
+ AND t.amt_std = #{amtStd}
|
|
|
+ </if>
|
|
|
+ <if test="priceSale != null">
|
|
|
+ AND t.price_sale = #{priceSale}
|
|
|
+ </if>
|
|
|
+ <if test="itemAmt != null">
|
|
|
+ AND t.item_amt = #{itemAmt}
|
|
|
+ </if>
|
|
|
+ <if test="priceDiscount != null">
|
|
|
+ AND t.price_discount = #{priceDiscount}
|
|
|
+ </if>
|
|
|
+ <if test="nonStdCode != null and nonStdCode != ''">
|
|
|
+ AND t.non_std_code = #{nonStdCode}
|
|
|
+ </if>
|
|
|
+ <if test="outStatus != null and outStatus != ''">
|
|
|
+ AND t.out_status = #{outStatus}
|
|
|
+ </if>
|
|
|
+ <if test="outingQty != null">
|
|
|
+ AND t.outing_qty = #{outingQty}
|
|
|
+ </if>
|
|
|
+ <if test="outingAmt != null">
|
|
|
+ AND t.outing_amt = #{outingAmt}
|
|
|
+ </if>
|
|
|
+ <if test="outQty != null">
|
|
|
+ AND t.out_qty = #{outQty}
|
|
|
+ </if>
|
|
|
+ <if test="outAmt != null">
|
|
|
+ AND t.out_amt = #{outAmt}
|
|
|
+ </if>
|
|
|
+ <if test="returnQty != null">
|
|
|
+ AND t.return_qty = #{returnQty}
|
|
|
+ </if>
|
|
|
+ <if test="returnAmt != null">
|
|
|
+ AND t.return_amt = #{returnAmt}
|
|
|
+ </if>
|
|
|
+ <if test="remarks != null and remarks != ''">
|
|
|
+ AND t.remarks = #{remarks}
|
|
|
+ </if>
|
|
|
+ <if test="flgValid != null">
|
|
|
+ AND t.flg_valid = #{flgValid}
|
|
|
+ </if>
|
|
|
+ <if test="cpId != null">
|
|
|
+ AND t.cp_id = #{cpId}
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ </sql>
|
|
|
+ <select id="getSalesItemReportCount" resultType="java.lang.Long">
|
|
|
SELECT count(1)
|
|
|
FROM
|
|
|
- dkic_b.t_psi_purchase tpp
|
|
|
- <include refid="ConditionPurTrackingReport"/>
|
|
|
+ FROM dkic_b.t_psi_order_item t
|
|
|
+ <include refid="ConditionSaleItem"/>
|
|
|
</select>
|
|
|
|
|
|
- <!--采购跟踪表通用查询映射结果 -->
|
|
|
- <resultMap id="PurTrackingReportResultMapResponse" type="com.dk.mdm.model.response.report.ReportResponse">
|
|
|
- <id column="id" property="id"/>
|
|
|
- <result column="no" property="no"/>
|
|
|
- <result column="type" property="type"/>
|
|
|
- <result column="contactPhone" property="contactPhone" />
|
|
|
- <result column="contactName" property="contactName" />
|
|
|
- <result column="whId" property="whId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="makeTime" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
- <result column="pickupDate" property="pickupDate" typeHandler="TimestampTypeHandler"/>
|
|
|
- <result column="sumQuantity" property="sumQuantity"/>
|
|
|
- <result column="intoQty" property="intoQty"/>
|
|
|
- <result column="returnQty" property="returnQty"/>
|
|
|
- <result column="sumAmtRec" property="sumAmtRec"/>
|
|
|
- <result column="sumShouldHandle" property="sumShouldHandle"/>
|
|
|
- <result column="sumUsePaymentResidue" property="sumUsePaymentResidue"/>
|
|
|
- <result column="sumWaiveAmt" property="sumWaiveAmt"/>
|
|
|
-
|
|
|
- <collection property="itemResponseList" resultMap="PurTrackingReportItemListMap" columnPrefix="list_"/>
|
|
|
- </resultMap>
|
|
|
-
|
|
|
- <!-- 采购跟踪表 关联映射-->
|
|
|
- <resultMap id="PurTrackingReportItemListMap" type="java.util.Map">
|
|
|
- <id column="itemId" property="itemId"/>
|
|
|
- <result column="id" property="id" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="type" property="type"/>
|
|
|
- <result column="skuId" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
- <result column="skuCode" property="skuCode"/>
|
|
|
- <result column="skuName" property="skuName"/>
|
|
|
- <result column="skuModel" property="skuModel"/>
|
|
|
- <result column="skuImages" property="skuImages" typeHandler="JsonTypeHandler"/>
|
|
|
- <result column="brandName" property="brandName"/>
|
|
|
- <result column="shortName" property="shortName"/>
|
|
|
- <result column="pricePur" property="pricePur"/>
|
|
|
- <result column="itemQty" property="itemQty"/>
|
|
|
- <result column="remarks" property="remarks"/>
|
|
|
- </resultMap>
|
|
|
-<!--采购跟踪表 明细查询-->
|
|
|
- <select id="getPurTrackingReportDetail" resultMap="PurTrackingReportResultMapResponse">
|
|
|
- SELECT T."id"
|
|
|
- ,T."no"
|
|
|
- ,T."type"
|
|
|
- ,T."contactName"
|
|
|
- ,T."contactPhone"
|
|
|
- ,T."whId"
|
|
|
- ,T."makeTime"
|
|
|
- ,T."pickupDate"
|
|
|
- ,T."sumQuantity"
|
|
|
- ,T."intoQty"
|
|
|
- ,T."returnQty"
|
|
|
- ,T."sumAmtRec"
|
|
|
- ,T."sumShouldHandle"
|
|
|
- ,T."sumUsePaymentResidue"
|
|
|
- ,T."sumWaiveAmt"
|
|
|
- ,T."itemId" AS list_itemId
|
|
|
- ,T."id" AS list_id
|
|
|
- ,T."type" AS list_type
|
|
|
- ,T."skuId" AS list_skuId
|
|
|
- ,T."skuCode" AS list_skuCode
|
|
|
- ,T. "skuName" AS list_skuName
|
|
|
- ,T."skuModel" AS list_skuModel
|
|
|
- ,T. "skuImages" AS list_skuImages
|
|
|
- ,T."brandName" AS list_brandName
|
|
|
- ,T."shortName" AS list_shortName
|
|
|
- ,T."pricePur" AS list_pricePur
|
|
|
- ,T."itemQty" AS list_itemQty
|
|
|
- ,T."remarks" AS list_remarks
|
|
|
+ <select id="getSalesTrackingReportCount" resultType="java.lang.Long">
|
|
|
+ SELECT count(1)
|
|
|
FROM
|
|
|
- (
|
|
|
- SELECT
|
|
|
- tpp.pur_id AS "id"
|
|
|
- ,tpp.pur_no AS "no"
|
|
|
- ,tpp.contact_name AS "contactName"
|
|
|
- ,tpp.contact_phone AS "contactPhone"
|
|
|
- ,tpp.wh_id AS "whId"
|
|
|
- ,tpp.make_time AS "makeTime"
|
|
|
- ,tpp.pickup_date AS "pickupDate"
|
|
|
- ,tpp.sum_quantity AS "sumQuantity"
|
|
|
- ,tpp.sum_amount AS "sumAmount"
|
|
|
- ,tpp.into_qty AS "intoQty"
|
|
|
- ,tpp.return_qty AS "returnQty"
|
|
|
- ,0.00 AS "sumAmtRec"
|
|
|
- ,0.00 AS "sumShouldHandle"
|
|
|
- ,0.00 AS "sumUsePaymentResidue"
|
|
|
- ,0.00 AS "sumWaiveAmt"
|
|
|
- ,tppi.item_id AS "itemId"
|
|
|
- ,'采购订单' AS "type"
|
|
|
- ,tppi.sku_id AS "skuId"
|
|
|
- ,tmgs.sku_code AS "skuCode"
|
|
|
- ,tmgs.sku_name AS "skuName"
|
|
|
- ,tmgs.sku_model AS "skuModel"
|
|
|
- ,tmgs.sku_images AS "skuImages"
|
|
|
- ,tmgb.brand_name AS "brandName"
|
|
|
- ,tmgb.short_name AS "shortName"
|
|
|
- ,tppi.price_pur AS "pricePur"
|
|
|
- ,tppi.item_qty AS "itemQty"
|
|
|
- ,tppi.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_purchase_item tppi
|
|
|
- LEFT JOIN dkic_b.t_psi_purchase tpp ON tpp.pur_id = tppi.pur_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tppi.sku_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- WHERE
|
|
|
- tpp.pur_id = = #{id}::uuid
|
|
|
- UNION ALL
|
|
|
- SELECT
|
|
|
- tpi.into_id AS "id"
|
|
|
- ,tpi.into_no AS "no"
|
|
|
- ,NULL AS "contactName"
|
|
|
- ,NULL AS "contactPhone"
|
|
|
- ,NULL AS "whId"
|
|
|
- ,NULL AS "makeTime"
|
|
|
- ,NULL AS "pickupDate"
|
|
|
- ,NULL AS "sumQuantity"
|
|
|
- ,NULL AS "sumAmount"
|
|
|
- ,NULL AS "intoQty"
|
|
|
- ,0 AS "returnQty"
|
|
|
- ,0.00 AS "sumAmtRec"
|
|
|
- ,0.00 AS "sumShouldHandle"
|
|
|
- ,0.00 AS "sumUsePaymentResidue"
|
|
|
- ,0.00 AS "sumWaiveAmt"
|
|
|
- ,tpii.item_id AS "itemId"
|
|
|
- ,'采购入库' AS "type"
|
|
|
- ,tpii.sku_id AS "skuId"
|
|
|
- ,tmgs.sku_code AS "skuCode"
|
|
|
- ,tmgs.sku_name AS "skuName"
|
|
|
- ,tmgs.sku_model AS "skuModel"
|
|
|
- ,tmgs.sku_images AS "skuImages"
|
|
|
- ,tmgb.brand_name AS "brandName"
|
|
|
- ,tmgb.short_name AS "shortName"
|
|
|
- ,tpii.price_into AS "pricePur"
|
|
|
- , CASE
|
|
|
- WHEN tpii.into_status = '入库状态-入库中' THEN tpii.intoing_qty
|
|
|
- ELSE tpii.into_qty
|
|
|
- END AS "itemQty"
|
|
|
- -- 入库中显示入库中数量 已入库显示 已入库数量
|
|
|
- ,tpii.remarks AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_psi_inbound_item tpii
|
|
|
- LEFT JOIN dkic_b.t_psi_inbound tpi ON tpi.into_id = tpii.into_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = tpii.sku_id
|
|
|
- LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
- WHERE
|
|
|
- tpi.from_id = = #{id}::uuid
|
|
|
- UNION ALL
|
|
|
- SELECT
|
|
|
- tmrp.rp_id AS "id"
|
|
|
- ,tmrp.rp_no AS "no"
|
|
|
- ,NULL AS "contactName"
|
|
|
- ,NULL AS "contactPhone"
|
|
|
- ,NULL AS "whId"
|
|
|
- ,NULL AS "makeTime"
|
|
|
- ,NULL AS "pickupDate"
|
|
|
- ,NULL AS "sumQuantity"
|
|
|
- ,NULL AS "sumAmount"
|
|
|
- ,NULL AS "intoQty"
|
|
|
- ,NULL AS "returnQty"
|
|
|
- ,tmrp.sum_amt_rec AS "sumAmtRec"
|
|
|
- ,tmrp.sum_should_handle AS "sumShouldHandle"
|
|
|
- ,tmrp.sum_use_payment_residue AS "sumUsePaymentResidue"
|
|
|
- ,tmrp.sum_waive_amt AS "sumWaiveAmt"
|
|
|
- ,Null AS "itemId"
|
|
|
- ,'核销信息' AS "type"
|
|
|
- ,Null AS "skuId"
|
|
|
- ,Null AS "skuCode"
|
|
|
- ,Null AS "skuName"
|
|
|
- ,Null AS "skuModel"
|
|
|
- ,Null AS "skuImages"
|
|
|
- ,Null AS "brandName"
|
|
|
- ,Null AS "shortName"
|
|
|
- ,Null AS "pricePur"
|
|
|
- ,Null AS "itemQty"
|
|
|
- ,Null AS "remarks"
|
|
|
- FROM
|
|
|
- dkic_b.t_mac_rec_pay tmrp
|
|
|
+ dkic_b.t_psi_order tpo
|
|
|
+ <include refid="ConditionSalesTrackingReport"/>
|
|
|
+ </select>
|
|
|
|
|
|
- WHERE
|
|
|
- tmrp.biznis_id= #{id}::uuid
|
|
|
- ) T
|
|
|
+ <!-- 收发存汇总报表 -->
|
|
|
+ <select id="getIvtSumReport" resultType="java.util.Map">
|
|
|
+ select dkic_b.f_query_ivt_rds(#{cpId},#{currentPage},#{pageSize}, #{querys, typeHandler=JsonTypeHandler})
|
|
|
+ </select>
|
|
|
|
|
|
+ <!-- 收发存汇总报表明细 -->
|
|
|
+ <select id="getIvtItemReport" resultType="java.util.Map">
|
|
|
+ select dkic_b.f_query_ivt_rds_item(#{cpId},#{invId} ::uuid,#{invType},#{accDateStart} ::date
|
|
|
+ ,#{accDateEnd} ::date,#{currentPage},#{pageSize})
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|