|
|
@@ -155,6 +155,142 @@
|
|
|
<result column="op_timestamp" property="opTimestamp" typeHandler="TimestampTypeHandler"/>
|
|
|
<result column="op_db_user" property="opDbUser"/>
|
|
|
</resultMap>
|
|
|
+
|
|
|
+
|
|
|
+ <!--小程序用 查询销售订单带明细-->
|
|
|
+ <resultMap id="BaseResultMapDetailResponse" type="com.dk.mdm.model.response.sale.OrderResponse">
|
|
|
+ <id column="order_id" property="orderId"/>
|
|
|
+ <result column="order_no" property="orderNo"/>
|
|
|
+ <result column="order_type" property="orderType"/>
|
|
|
+ <result column="org_id" property="orgId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="staff_id" property="staffId" typeHandler="UuidTypeHandler"/>
|
|
|
+ <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="address_gcj02" property="addressGcj02" typeHandler="JsonTypeHandler"/>
|
|
|
+ <result column="address_full" property="addressFull"/>
|
|
|
+ <result column="contact_name" property="contactName"/>
|
|
|
+ <result column="contact_phone" property="contactPhone"/>
|
|
|
+ <result column="sales_channel" property="salesChannel" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="delivery_date" property="deliveryDate" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="sum_quantity" property="sumQuantity"/>
|
|
|
+ <result column="sum_standard" property="sumStandard"/>
|
|
|
+ <result column="sum_amount" property="sumAmount"/>
|
|
|
+ <result column="sale_discount" property="saleDiscount"/>
|
|
|
+ <result column="order_status" property="orderStatus"/>
|
|
|
+ <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="return_qty" property="returnQty"/>
|
|
|
+ <result column="return_amt" property="returnAmt"/>
|
|
|
+ <result column="amt_receivable" property="amtReceivable"/>
|
|
|
+ <result column="amt_handle" property="amtHandle"/>
|
|
|
+ <result column="amt_residue" property="amtResidue"/>
|
|
|
+ <result column="remarks" property="remarks"/>
|
|
|
+ <result column="annex_paths" property="annexPaths" typeHandler="JsonTypeHandler"/>
|
|
|
+ <result column="make_staff" property="makeStaff" typeHandler="UuidTypeHandler"/>
|
|
|
+ <result column="make_time" property="makeTime" typeHandler="TimestampTypeHandler"/>
|
|
|
+ <result column="flg_valid" property="flgValid"/>
|
|
|
+ <result column="cp_id" property="cpId"/>
|
|
|
+ <collection property="orderItemResponseList" resultMap="itemListMap" columnPrefix="list_"/>
|
|
|
+ </resultMap>
|
|
|
+ <!--小程序用 关联映射-->
|
|
|
+ <resultMap id="itemListMap" type="java.util.Map">
|
|
|
+ <result column="item_id" property="itemId"/>
|
|
|
+ <result column="order_id" property="orderId"/>
|
|
|
+ <result column="item_index" property="itemIndex"/>
|
|
|
+ <result column="sku_id" property="skuId" />
|
|
|
+ <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="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="sku_code" property="skuCode"/>
|
|
|
+ <result column="sku_model" property="skuModel"/>
|
|
|
+ <result column="sku_name" property="skuName"/>
|
|
|
+ <result column="brand_name" property="brandName"/>
|
|
|
+ <result column="short_name" property="shortName"/>
|
|
|
+ <result column="price_purchase" property="pricePurchase"/>
|
|
|
+ <result column="price_standard" property="priceStandard"/>
|
|
|
+
|
|
|
+ </resultMap>
|
|
|
+ <!--小程序用 总单-->
|
|
|
+ <sql id="Base_Column_List_Detail_Join">
|
|
|
+ t.order_id,
|
|
|
+ t.order_no,
|
|
|
+ t.order_type,
|
|
|
+ t.org_id,
|
|
|
+ t.staff_id,
|
|
|
+ t.cus_id,
|
|
|
+ t.address_area,
|
|
|
+ t.address_name,
|
|
|
+ t.address_no,
|
|
|
+ t.address_gcj02,
|
|
|
+ t.address_full,
|
|
|
+ t.contact_name,
|
|
|
+ t.contact_phone,
|
|
|
+ t.sales_channel,
|
|
|
+ t.delivery_date,
|
|
|
+ t.sum_quantity,
|
|
|
+ t.sum_standard,
|
|
|
+ t.sum_amount, t.sale_discount,
|
|
|
+ t.order_status, t.out_status,
|
|
|
+ t.outing_qty, t.outing_amt, t.out_qty,
|
|
|
+ t.out_amt, t.return_qty, t.return_amt,
|
|
|
+ t.amt_receivable, amt_handle, amt_residue,
|
|
|
+ t.remarks, t.annex_paths, t.make_staff, t.make_time,
|
|
|
+ t.flg_valid, t.cp_id
|
|
|
+ </sql>
|
|
|
+ <!--小程序用 明细-->
|
|
|
+ <sql id="Base_Column_List_Item_Response_Detail_Join">
|
|
|
+ toi.item_id AS list_item_id,
|
|
|
+ toi.order_id AS list_order_id,
|
|
|
+ toi.item_index AS list_item_index,
|
|
|
+ toi.sku_id AS list_sku_id,
|
|
|
+ toi.item_qty AS list_item_qty,
|
|
|
+ toi.price_std AS list_price_std,
|
|
|
+ toi.amt_std AS list_amt_std,
|
|
|
+ toi.price_sale AS list_price_sale,
|
|
|
+ toi.item_amt AS list_item_amt,
|
|
|
+ toi.price_discount AS list_price_discount,
|
|
|
+ toi.non_std_code AS list_non_std_code,
|
|
|
+ toi.out_status AS list_out_status,
|
|
|
+ toi.outing_qty AS list_outing_qty,
|
|
|
+ toi.outing_amt AS list_outing_amt,
|
|
|
+ toi.out_qty AS list_out_qty,
|
|
|
+ toi.out_amt AS list_out_amt,
|
|
|
+ toi.return_qty AS list_return_qty,
|
|
|
+ toi.return_amt AS list_return_amt,
|
|
|
+ toi.remarks AS list_remarks,
|
|
|
+ toi.flg_valid AS list_flg_valid,
|
|
|
+ toi.cp_id AS list_cp_id,
|
|
|
+ tmgs.sku_code AS list_sku_code,
|
|
|
+ tmgs.sku_model AS list_sku_model,
|
|
|
+ tmgs.sku_name AS list_sku_name,
|
|
|
+ tmgb.brand_name AS list_brand_name,
|
|
|
+ tmgb.short_name AS list_short_name,
|
|
|
+ tmgs.price_purchase AS list_price_purchase,
|
|
|
+ tmgs.price_standard AS list_price_standard
|
|
|
+
|
|
|
+ </sql>
|
|
|
+
|
|
|
+
|
|
|
<!-- 通用条件列 -->
|
|
|
<sql id="Condition">
|
|
|
<where>
|
|
|
@@ -750,5 +886,27 @@
|
|
|
</update>
|
|
|
|
|
|
|
|
|
+<!-- 小程序 条件查询(总单带明细)-->
|
|
|
+ <select id="selectByCondDetail" resultMap="BaseResultMapDetailResponse">
|
|
|
+ SELECT
|
|
|
+ <include refid="Base_Column_List_Detail_Join"/>,
|
|
|
+ <include refid="Base_Column_List_Item_Response_Detail_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
|
|
|
+ <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>
|
|
|
|
|
|
+ <!--小程序-->
|
|
|
+ <select id="countByCondDetail" resultType="Long">
|
|
|
+ SELECT
|
|
|
+ count(1)
|
|
|
+ FROM dkic_b.t_psi_order as t
|
|
|
+ <include refid="Condition"/>
|
|
|
+ </select>
|
|
|
</mapper>
|