|
@@ -98,38 +98,39 @@
|
|
|
<result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
<result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="flg_valid" property="flgValid"/>
|
|
<result column="flg_valid" property="flgValid"/>
|
|
|
<result column="cp_id" property="cpId"/>
|
|
<result column="cp_id" property="cpId"/>
|
|
|
- <collection property="orderItemResponseList" resultMap="orderItemListMap" columnPrefix="toi_"/>
|
|
|
|
|
|
|
+ <result column="orderItemResponseList" property="orderItemResponseList" typeHandler="JsonTypeHandler"/>
|
|
|
|
|
+<!-- <collection property="orderItemResponseList" resultMap="orderItemListMap" />-->
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
<resultMap id="orderItemListMap" type="java.util.Map">
|
|
<resultMap id="orderItemListMap" type="java.util.Map">
|
|
|
- <id column="item_id" property="itemId"/>
|
|
|
|
|
- <result column="order_id" property="orderId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="item_index" property="itemIndex"/>
|
|
|
|
|
- <result column="order_no" property="orderNo"/>
|
|
|
|
|
- <result column="sku_id" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
- <result column="item_qty" property="itemQty"/>
|
|
|
|
|
- <result column="price_std" property="priceStd"/>
|
|
|
|
|
- <result column="amt_std" property="amtStd"/>
|
|
|
|
|
- <result column="price_standard" property="priceStandard"/>
|
|
|
|
|
- <result column="price_sale" property="priceSale"/>
|
|
|
|
|
- <result column="item_amt" property="itemAmt"/>
|
|
|
|
|
- <result column="price_discount" property="priceDiscount"/>
|
|
|
|
|
- <result column="non_std_code" property="nonStdCode"/>
|
|
|
|
|
- <result column="out_status" property="outStatus"/>
|
|
|
|
|
- <result column="outing_qty" property="outingQty"/>
|
|
|
|
|
- <result column="outing_amt" property="outingAmt"/>
|
|
|
|
|
- <result column="out_qty" property="outQty"/>
|
|
|
|
|
- <result column="out_amt" property="outAmt"/>
|
|
|
|
|
- <result column="sku_code" property="skuCode"/>
|
|
|
|
|
- <result column="sku_name" property="skuName"/>
|
|
|
|
|
- <result column="sku_model" property="skuModel"/>
|
|
|
|
|
- <result column="return_qty" property="returnQty"/>
|
|
|
|
|
- <result column="return_amt" property="returnAmt"/>
|
|
|
|
|
|
|
+ <id column="itemId" property="itemId"/>
|
|
|
|
|
+ <result column="orderId" property="orderId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="itemIndex" property="itemIndex"/>
|
|
|
|
|
+ <result column="orderNo" property="orderNo"/>
|
|
|
|
|
+ <result column="skuId" property="skuId" typeHandler="UuidTypeHandler"/>
|
|
|
|
|
+ <result column="itemQty" property="itemQty"/>
|
|
|
|
|
+ <result column="priceStd" property="priceStd"/>
|
|
|
|
|
+ <result column="amtStd" property="amtStd"/>
|
|
|
|
|
+ <result column="priceStandard" property="priceStandard"/>
|
|
|
|
|
+ <result column="priceSale" property="priceSale"/>
|
|
|
|
|
+ <result column="itemAmt" property="itemAmt"/>
|
|
|
|
|
+ <result column="priceDiscount" property="priceDiscount"/>
|
|
|
|
|
+ <result column="nonStdCode" property="nonStdCode"/>
|
|
|
|
|
+ <result column="outStatus" property="outStatus"/>
|
|
|
|
|
+ <result column="outingQty" property="outingQty"/>
|
|
|
|
|
+ <result column="outingAmt" property="outingAmt"/>
|
|
|
|
|
+ <result column="outQty" property="outQty"/>
|
|
|
|
|
+ <result column="outAmt" property="outAmt"/>
|
|
|
|
|
+ <result column="skuCode" property="skuCode"/>
|
|
|
|
|
+ <result column="skuName" property="skuName"/>
|
|
|
|
|
+ <result column="skuModel" property="skuModel"/>
|
|
|
|
|
+ <result column="returnQty" property="returnQty"/>
|
|
|
|
|
+ <result column="returnAmt" property="returnAmt"/>
|
|
|
<result column="remarks" property="remarks"/>
|
|
<result column="remarks" property="remarks"/>
|
|
|
- <result column="flg_valid" property="flgValid"/>
|
|
|
|
|
- <result column="cp_id" property="cpId"/>
|
|
|
|
|
- <result column="price_purchase" property="pricePurchase"/>
|
|
|
|
|
- <result column="brand_name" property="brandName"/>
|
|
|
|
|
- <result column="short_name" property="shortName"/>
|
|
|
|
|
|
|
+ <result column="flgValid" property="flgValid"/>
|
|
|
|
|
+ <result column="cpId" property="cpId"/>
|
|
|
|
|
+ <result column="pricePurchase" property="pricePurchase"/>
|
|
|
|
|
+ <result column="brandName" property="brandName"/>
|
|
|
|
|
+ <result column="shortName" property="shortName"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -540,68 +541,110 @@
|
|
|
</sql>
|
|
</sql>
|
|
|
|
|
|
|
|
<!-- 查询表t_psi_order,(条件查询+分页)列表 -->
|
|
<!-- 查询表t_psi_order,(条件查询+分页)列表 -->
|
|
|
- <select id="purSaleSelectByCond" resultMap="BaseResultMapResponse">
|
|
|
|
|
- SELECT t.order_id,
|
|
|
|
|
- t.order_no,
|
|
|
|
|
- t.order_type,
|
|
|
|
|
- sys.f_get_name_i18n(tdk1.kind_name_i18n, #{i18n}) as "orderTypeName",
|
|
|
|
|
- t.org_id,
|
|
|
|
|
- tmo.org_name as "orgName",
|
|
|
|
|
- t.staff_id,
|
|
|
|
|
- tms.staff_name as "staffName",
|
|
|
|
|
- t.cus_id,
|
|
|
|
|
- tmc.cus_code as "cusCode",
|
|
|
|
|
- tmc.cus_name as "cusName",
|
|
|
|
|
- tmc.cus_phone as "cusPhone",
|
|
|
|
|
- tmc.cus_from as "cusFrom",
|
|
|
|
|
- tmdd.data_value as "cusFromName",
|
|
|
|
|
- t.address_area,
|
|
|
|
|
- t.address_name,
|
|
|
|
|
- t.address_no,
|
|
|
|
|
- t.address_gcj02,
|
|
|
|
|
- t.address_full,
|
|
|
|
|
- t.contact_name,
|
|
|
|
|
- t.contact_phone,
|
|
|
|
|
- t.sales_channel,
|
|
|
|
|
- tmsc.channel_name as "channelName",
|
|
|
|
|
- t.delivery_date,
|
|
|
|
|
- t.sum_quantity,
|
|
|
|
|
- t.sum_standard,
|
|
|
|
|
- t.sum_amount,
|
|
|
|
|
- t.sale_discount,
|
|
|
|
|
- t.order_status,
|
|
|
|
|
- sys.f_get_name_i18n(tdk2.kind_name_i18n, #{i18n}) as "orderStatusName",
|
|
|
|
|
- t.out_status,
|
|
|
|
|
- sys.f_get_name_i18n(tdk3.kind_name_i18n, #{i18n}) as "outStatusName",
|
|
|
|
|
- t.outing_qty,
|
|
|
|
|
- t.outing_amt,
|
|
|
|
|
- t.out_qty,
|
|
|
|
|
- t.out_amt,
|
|
|
|
|
- t.return_qty,
|
|
|
|
|
- t.return_amt,
|
|
|
|
|
- t.amt_receivable,
|
|
|
|
|
- t.amt_handle,
|
|
|
|
|
- t.amt_residue,
|
|
|
|
|
- t.remarks,
|
|
|
|
|
- t.annex_paths,
|
|
|
|
|
- makestaff.staff_name as "makeStaffName",
|
|
|
|
|
- t.make_time,
|
|
|
|
|
- t.cp_id,
|
|
|
|
|
- t.flg_valid,
|
|
|
|
|
- <include refid="Base_Column_List_Item_Response_Join"/>
|
|
|
|
|
- FROM dkic_b.t_psi_order as t
|
|
|
|
|
- left join dkic_b.t_psi_order_item toi on toi.order_id = t.order_id
|
|
|
|
|
- left join dkic_b.t_mst_goods_sku tmgs on tmgs.sku_id = toi.sku_id
|
|
|
|
|
- left join dkic_b.t_mst_goods_brand tmgb on tmgb.brand_id = tmgs.brand_id
|
|
|
|
|
- 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 sys.t_data_kind as tdk3 on t.out_status = tdk3.kind_code
|
|
|
|
|
|
|
+ <select id="purSaleSelectByCond" resultType="Map">
|
|
|
|
|
+ SELECT T
|
|
|
|
|
+ .order_no AS "orderNo",
|
|
|
|
|
+ T.order_type AS "orderType",
|
|
|
|
|
+ sys.f_get_name_i18n ( tdk1.kind_name_i18n, #{ i18n } ) AS "orderTypeName",
|
|
|
|
|
+ T.org_id AS "orgId",
|
|
|
|
|
+ tmo.org_name AS "orgName",
|
|
|
|
|
+ T.staff_id AS "staffId",
|
|
|
|
|
+ tms.staff_name AS "staffName",
|
|
|
|
|
+ T.cus_id AS "cusId",
|
|
|
|
|
+ tmc.cus_code AS "cusCode",
|
|
|
|
|
+ tmc.cus_name AS "cusName",
|
|
|
|
|
+ tmc.cus_phone AS "cusPhone",
|
|
|
|
|
+ tmc.cus_from AS "cusFrom",
|
|
|
|
|
+ tmdd.data_value AS "dataValue",
|
|
|
|
|
+ T.address_area AS "addressArea",
|
|
|
|
|
+ T.address_name AS "addressName",
|
|
|
|
|
+ T.address_no AS "addressNo",
|
|
|
|
|
+ T.address_gcj02 AS "addressGcj02",
|
|
|
|
|
+ T.address_full AS "addressFull",
|
|
|
|
|
+ T.contact_name AS "contactName",
|
|
|
|
|
+ T.contact_phone AS "contactPhone",
|
|
|
|
|
+ T.sales_channel AS "salesChannel",
|
|
|
|
|
+ tmsc.channel_name AS "channelName",
|
|
|
|
|
+ T.delivery_date AS "deliveryDate",
|
|
|
|
|
+ T.sum_quantity AS "sumQuantity",
|
|
|
|
|
+ T.sum_standard AS "sumStandard",
|
|
|
|
|
+ T.sum_amount AS "sumAmount",
|
|
|
|
|
+ T.sale_discount AS "saleDiscount",
|
|
|
|
|
+ T.order_status AS "orderStatus",
|
|
|
|
|
+ sys.f_get_name_i18n ( tdk2.kind_name_i18n, #{ i18n } ) AS "orderStatusName",
|
|
|
|
|
+ T.out_status AS "outStatus",
|
|
|
|
|
+ sys.f_get_name_i18n ( tdk3.kind_name_i18n, #{ i18n } ) AS "outStatusName",
|
|
|
|
|
+ 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.amt_receivable AS "amtReceivable",
|
|
|
|
|
+ T.amt_handle AS "amtHandle",
|
|
|
|
|
+ T.amt_residue AS "amtResidue",
|
|
|
|
|
+ T.remarks AS "remarks",
|
|
|
|
|
+ T.annex_paths AS "annexPaths",
|
|
|
|
|
+ makestaff.staff_name AS "makeStaffName",
|
|
|
|
|
+ T.make_time AS "annexPaths",
|
|
|
|
|
+ T.cp_id AS "cpId",
|
|
|
|
|
+ T.flg_valid AS "flgValid",
|
|
|
|
|
+ (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ json_agg ( row_to_json ( item ) )
|
|
|
|
|
+ FROM
|
|
|
|
|
+ (
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ toi.item_id AS "itemId",
|
|
|
|
|
+ T.order_id AS "orderId",
|
|
|
|
|
+ T.order_no AS "orderNo",
|
|
|
|
|
+ toi.order_id AS "orderId",
|
|
|
|
|
+ toi.item_index AS "itemIndex",
|
|
|
|
|
+ toi.sku_id AS "skuId",
|
|
|
|
|
+ toi.item_qty AS "itemQty",
|
|
|
|
|
+ toi.price_std AS "priceStd",
|
|
|
|
|
+ toi.amt_std AS "amtStd",
|
|
|
|
|
+ toi.price_sale AS "priceSale",
|
|
|
|
|
+ toi.item_amt AS "itemAmt",
|
|
|
|
|
+ toi.price_discount AS "priceDiscount",
|
|
|
|
|
+ toi.non_std_code AS "nonStdCode",
|
|
|
|
|
+ toi.out_status AS "outStatus",
|
|
|
|
|
+ toi.outing_qty AS "outingQty",
|
|
|
|
|
+ toi.outing_amt AS "outingAmt",
|
|
|
|
|
+ toi.out_qty AS "outQty",
|
|
|
|
|
+ toi.out_amt AS "outAmt",
|
|
|
|
|
+ toi.return_qty AS "returnQty",
|
|
|
|
|
+ toi.return_amt AS "returnAmt",
|
|
|
|
|
+ toi.remarks AS "remarks",
|
|
|
|
|
+ toi.flg_valid AS "flgValid",
|
|
|
|
|
+ toi.cp_id AS "cpId",
|
|
|
|
|
+ tmgs.sku_code AS "skuCode",
|
|
|
|
|
+ tmgs.sku_model AS "skuModel",
|
|
|
|
|
+ tmgs.sku_name AS "skuName",
|
|
|
|
|
+ tmgb.brand_name AS "brandName",
|
|
|
|
|
+ tmgb.short_name AS "shortName",
|
|
|
|
|
+ tmgs.price_purchase AS "pricePurchase",
|
|
|
|
|
+ tmgs.price_standard AS "priceStandard"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ dkic_b.t_psi_order_item toi
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_sku tmgs ON tmgs.sku_id = toi.sku_id
|
|
|
|
|
+ LEFT JOIN dkic_b.t_mst_goods_brand tmgb ON tmgb.brand_id = tmgs.brand_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ toi.order_id = T.order_id
|
|
|
|
|
+ ) item
|
|
|
|
|
+ ) AS "orderItemResponseList"
|
|
|
|
|
+ FROM
|
|
|
|
|
+ dkic_b.t_psi_order
|
|
|
|
|
+ AS T LEFT JOIN dkic_b.t_psi_order_item toi ON toi.order_id = T.order_id
|
|
|
|
|
+ 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 sys.t_data_kind AS tdk3 ON T.out_status = tdk3.kind_code
|
|
|
<include refid="Condition"/>
|
|
<include refid="Condition"/>
|
|
|
order by t.op_create_time desc
|
|
order by t.op_create_time desc
|
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
<if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|