|
|
@@ -65,7 +65,20 @@
|
|
|
<result column="cus_id" property="cusId" typeHandler="UuidTypeHandler"/>
|
|
|
<result column="address_area" property="addressArea" typeHandler="JsonTypeHandler"/>
|
|
|
<result column="address_name" property="addressName"/>
|
|
|
- <result column="address_no" property="addressNo"/>
|
|
|
+ <result column="orgName" property="orgName"/>
|
|
|
+ <result column="orderTypeName" property="orderTypeName"/>
|
|
|
+ <result column="staffName" property="staffName"/>
|
|
|
+ <result column="cusCode" property="cusCode"/>
|
|
|
+ <result column="cusName" property="cusName"/>
|
|
|
+ <result column="cusPhone" property="cusPhone"/>
|
|
|
+ <result column="cusFrom" property="cusFrom"/>
|
|
|
+ <result column="cusFromName" property="cusFromName"/>
|
|
|
+ <result column="channelName" property="channelName"/>
|
|
|
+ <result column="orderStatusName" property="orderStatusName"/>
|
|
|
+ <result column="outStatusName" property="outStatusName"/>
|
|
|
+ <result column="makeStaffName" property="makeStaffName"/>
|
|
|
+
|
|
|
+ <result column="address_no" property="addressNo"/>
|
|
|
<result column="address_gcj02" property="addressGcj02" typeHandler="JsonTypeHandler"/>
|
|
|
<result column="address_full" property="addressFull"/>
|
|
|
<result column="contact_name" property="contactName"/>
|
|
|
@@ -100,8 +113,43 @@
|
|
|
<result column="op_app_code" property="opAppCode"/>
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
+ <collection property="orderItemResponseList" resultMap="orderItemListMap" columnPrefix="toi_"/>
|
|
|
+ </resultMap>
|
|
|
+ <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="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_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"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <result column="brand_name" property="brandName"/>
|
|
|
+ <result column="short_name" property="shortName"/>
|
|
|
+ <result column="op_create_time" property="opCreateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_create_user_id" property="opCreateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_update_time" property="opUpdateTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_update_user_id" property="opUpdateUserId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="op_app_code" property="opAppCode"/>
|
|
|
+ <result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="op_db_user" property="opDbUser"/>
|
|
|
</resultMap>
|
|
|
-
|
|
|
<!-- 通用条件列 -->
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
@@ -306,6 +354,106 @@
|
|
|
limit #{end} offset #{start}
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <sql id="Base_Column_List_Item_Response_Join">
|
|
|
+ toi.item_id AS toi_item_id,
|
|
|
+ toi.order_id AS toi_order_id,
|
|
|
+ toi.item_index AS toi_item_index,
|
|
|
+ toi.sku_id AS toi_sku_id,
|
|
|
+ toi.item_qty AS toi_item_qty,
|
|
|
+ toi.price_std AS toi_price_std,
|
|
|
+ toi.amt_std AS toi_amt_std,
|
|
|
+ toi.price_sale AS toi_price_sale,
|
|
|
+ toi.item_amt AS toi_item_amt,
|
|
|
+ toi.price_discount AS toi_price_discount,
|
|
|
+ toi.non_std_code AS toi_non_std_code,
|
|
|
+ toi.out_status AS toi_out_status,
|
|
|
+ toi.outing_qty AS toi_outing_qty,
|
|
|
+ toi.outing_amt AS toi_outing_amt,
|
|
|
+ toi.out_qty AS toi_out_qty,
|
|
|
+ toi.out_amt AS toi_out_amt,
|
|
|
+ toi.return_qty AS toi_return_qty,
|
|
|
+ toi.return_amt AS toi_return_amt,
|
|
|
+ toi.remarks AS toi_remarks,
|
|
|
+ toi.flg_valid AS toi_flg_valid,
|
|
|
+ toi.cp_id AS toi_cp_id,
|
|
|
+ tmgs.sku_code AS toi_sku_code,
|
|
|
+ tmgs.sku_model AS toi_sku_model,
|
|
|
+ tmgs.sku_name AS toi_sku_name,
|
|
|
+ tmgb.brand_name AS toi_brand_name,
|
|
|
+ tmgb.short_name AS toi_short_name
|
|
|
+
|
|
|
+ </sql>
|
|
|
+ <!-- 查询表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
|
|
|
+ <include refid="Condition"/>
|
|
|
+ order by t.op_create_time desc
|
|
|
+ <if test="pageSize != null and currentPage != null and pageSize != 0 and currentPage != 0">
|
|
|
+ limit #{end} offset #{start}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
|
|
|
<!-- 查询表t_psi_order,(条件查询)个数 -->
|
|
|
<select id="countByCond" resultType="Long">
|
|
|
@@ -313,6 +461,7 @@
|
|
|
count(1)
|
|
|
FROM dkic_b.t_psi_order as t
|
|
|
left join dkic_b.t_mst_customer tmc on t.cus_id = tmc.cus_id
|
|
|
+ left join dkic_b.t_psi_order_item toi on toi.order_id = t.order_id
|
|
|
<include refid="Condition"/>
|
|
|
</select>
|
|
|
|