|
@@ -2053,7 +2053,7 @@
|
|
g.goods_id,
|
|
g.goods_id,
|
|
o.order_sn as receiptNo,
|
|
o.order_sn as receiptNo,
|
|
u.username as cashRegisterNo,
|
|
u.username as cashRegisterNo,
|
|
- o.pay_time as timeStampDetails,
|
|
|
|
|
|
+ o.create_time as timeStampDetails,
|
|
u.username as staffID,
|
|
u.username as staffID,
|
|
u.username as staffName,
|
|
u.username as staffName,
|
|
gs.hs_code as hsCode,
|
|
gs.hs_code as hsCode,
|
|
@@ -2074,10 +2074,8 @@
|
|
gs.goods_rate as taxRate,
|
|
gs.goods_rate as taxRate,
|
|
'专柜单品' as productCategory,
|
|
'专柜单品' as productCategory,
|
|
sup.child_supplier_name as supplierName,
|
|
sup.child_supplier_name as supplierName,
|
|
- o.order_status as orderStatus,
|
|
|
|
- g.tax_price as taxPrice,
|
|
|
|
- mor.out_refund_no as outRefundNo,
|
|
|
|
- mor.create_time as refundTime
|
|
|
|
|
|
+ '300' as orderStatus,
|
|
|
|
+ g.tax_price as taxPrice
|
|
FROM
|
|
FROM
|
|
mall_order o
|
|
mall_order o
|
|
LEFT JOIN mall_order_goods g ON o.id = g.order_id
|
|
LEFT JOIN mall_order_goods g ON o.id = g.order_id
|
|
@@ -2089,7 +2087,6 @@
|
|
left join mall_product_store_rela sr on sr.goods_id=gs.id
|
|
left join mall_product_store_rela sr on sr.goods_id=gs.id
|
|
left join mall_brand b on b.id=sr.brand_id
|
|
left join mall_brand b on b.id=sr.brand_id
|
|
left join mall_supplier sup on gs.supplier_id = sup.id
|
|
left join mall_supplier sup on gs.supplier_id = sup.id
|
|
- left join mall_order_refund mor on mor.out_refund_no = o.order_sn
|
|
|
|
WHERE 1=1
|
|
WHERE 1=1
|
|
<if test="orderSn != null and orderSn.trim() != ''">
|
|
<if test="orderSn != null and orderSn.trim() != ''">
|
|
AND o.order_sn LIKE concat('%',#{orderSn},'%')
|
|
AND o.order_sn LIKE concat('%',#{orderSn},'%')
|
|
@@ -2099,7 +2096,7 @@
|
|
AND o.order_status = #{orderStatus}
|
|
AND o.order_status = #{orderStatus}
|
|
</when>
|
|
</when>
|
|
<otherwise>
|
|
<otherwise>
|
|
- AND o.order_status in ('300','401')
|
|
|
|
|
|
+ AND o.order_status in ('401','300')
|
|
</otherwise>
|
|
</otherwise>
|
|
</choose>
|
|
</choose>
|
|
<if test="isOnfiilineOrder != null">
|
|
<if test="isOnfiilineOrder != null">
|
|
@@ -2115,6 +2112,76 @@
|
|
AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
</if>
|
|
</if>
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ union
|
|
|
|
+
|
|
|
|
+ SELECT distinct
|
|
|
|
+ o.id,
|
|
|
|
+ g.goods_id,
|
|
|
|
+ o.order_sn as receiptNo,
|
|
|
|
+ u.username as cashRegisterNo,
|
|
|
|
+ mor.create_time as timeStampDetails,
|
|
|
|
+ u.username as staffID,
|
|
|
|
+ u.username as staffName,
|
|
|
|
+ gs.hs_code as hsCode,
|
|
|
|
+ gs.hs_code_name as hsCodeName,
|
|
|
|
+ gs.goods_sn as ematouCode,
|
|
|
|
+ gs.plu as plu,
|
|
|
|
+ gs.mychem_id as mychemID,
|
|
|
|
+ gs.english_name as productNameEN,
|
|
|
|
+ gs.name as productNameCN,
|
|
|
|
+ gs.prod_barcode as barcode,
|
|
|
|
+ gs.ciq_prod_model as packSize,
|
|
|
|
+ uc.name as productSpecification,
|
|
|
|
+ b.name as brand,
|
|
|
|
+ gs.daily_price as edlp,
|
|
|
|
+ sr.bottom_line_price as costPrice,
|
|
|
|
+ g.number as unitSold,
|
|
|
|
+ g.actual_payment_amount as totalSalesInclTax,
|
|
|
|
+ gs.goods_rate as taxRate,
|
|
|
|
+ '专柜单品' as productCategory,
|
|
|
|
+ sup.child_supplier_name as supplierName,
|
|
|
|
+ o.order_status as orderStatus,
|
|
|
|
+ g.tax_price as taxPrice
|
|
|
|
+ FROM
|
|
|
|
+ mall_order o
|
|
|
|
+ LEFT JOIN mall_order_goods g ON o.id = g.order_id
|
|
|
|
+ left join mall_store s on o.store_id = s.id
|
|
|
|
+ LEFT JOIN mall_goods gs ON g.goods_id = gs.id
|
|
|
|
+ left join mall_sale_record record on record.order_sn = o.order_sn
|
|
|
|
+ LEFT JOIN sys_user u ON record.saller_id = u.user_id
|
|
|
|
+ left join sys_cus_unit_code uc on uc.code = gs.unit_code
|
|
|
|
+ left join mall_product_store_rela sr on sr.goods_id=gs.id
|
|
|
|
+ left join mall_brand b on b.id=sr.brand_id
|
|
|
|
+ left join mall_supplier sup on gs.supplier_id = sup.id
|
|
|
|
+ left join mall_order_refund mor on mor.out_refund_no = o.order_sn
|
|
|
|
+ WHERE 1=1
|
|
|
|
+ <if test="orderSn != null and orderSn.trim() != ''">
|
|
|
|
+ AND o.order_sn LIKE concat('%',#{orderSn},'%')
|
|
|
|
+ </if>
|
|
|
|
+ <choose>
|
|
|
|
+ <when test="orderStatus != null and orderStatus.trim() != ''">
|
|
|
|
+ AND o.order_status = #{orderStatus}
|
|
|
|
+ </when>
|
|
|
|
+ <otherwise>
|
|
|
|
+ AND o.order_status = '401'
|
|
|
|
+ </otherwise>
|
|
|
|
+ </choose>
|
|
|
|
+ <if test="isOnfiilineOrder != null">
|
|
|
|
+ AND o.is_onffline_order = #{isOnfiilineOrder}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="startTime != null and startTime != ''">
|
|
|
|
+ AND mor.create_time <![CDATA[ > ]]> #{startTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
+ AND mor.create_time <![CDATA[ < ]]> #{endTime}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="storeName != null and storeName != ''">
|
|
|
|
+ AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
|
|
+ </if>
|
|
|
|
+
|
|
|
|
+
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<update id="updateOrderInfo" parameterType="map">
|
|
<update id="updateOrderInfo" parameterType="map">
|
|
@@ -2211,9 +2278,9 @@
|
|
where
|
|
where
|
|
DATE_FORMAT(create_time,'%Y-%m-%d') != #{billDate}
|
|
DATE_FORMAT(create_time,'%Y-%m-%d') != #{billDate}
|
|
and order_id in (
|
|
and order_id in (
|
|
- select distinct order_id from mall_order_refund where DATE_FORMAT(create_time,'%Y-%m-%d') = #{billDate}
|
|
|
|
|
|
+ select distinct mor.order_id from mall_order_refund mor , mall_order o where mor.out_refund_no = o.order_sn and DATE_FORMAT(mor.create_time,'%Y-%m-%d') = #{billDate}
|
|
<if test="storeId != ''">
|
|
<if test="storeId != ''">
|
|
- and store_id = #{storeId}
|
|
|
|
|
|
+ and o.store_id = #{storeId}
|
|
</if>
|
|
</if>
|
|
)
|
|
)
|
|
</select>
|
|
</select>
|
|
@@ -2252,9 +2319,6 @@
|
|
<if test="storeId != ''">
|
|
<if test="storeId != ''">
|
|
and o.store_id = #{storeId}
|
|
and o.store_id = #{storeId}
|
|
</if>
|
|
</if>
|
|
- <if test="storeName != null and storeName != ''">
|
|
|
|
- AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
|
|
- </if>
|
|
|
|
order by o.order_status
|
|
order by o.order_status
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -2294,9 +2358,6 @@
|
|
<if test="storeId != ''">
|
|
<if test="storeId != ''">
|
|
and o.store_id = #{storeId}
|
|
and o.store_id = #{storeId}
|
|
</if>
|
|
</if>
|
|
- <if test="storeName != null and storeName != ''">
|
|
|
|
- AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
|
|
- </if>
|
|
|
|
order by o.order_status
|
|
order by o.order_status
|
|
</select>
|
|
</select>
|
|
|
|
|
|
@@ -2310,9 +2371,6 @@
|
|
<if test="storeId != ''">
|
|
<if test="storeId != ''">
|
|
and o.store_id = #{storeId}
|
|
and o.store_id = #{storeId}
|
|
</if>
|
|
</if>
|
|
- <if test="storeName != null and storeName != ''">
|
|
|
|
- AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
|
|
- </if>
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryRefundPreviousTaxDetailList" resultType="com.kmall.admin.dto.TaxDetailDto">
|
|
<select id="queryRefundPreviousTaxDetailList" resultType="com.kmall.admin.dto.TaxDetailDto">
|
|
@@ -2325,9 +2383,6 @@
|
|
<if test="storeId != ''">
|
|
<if test="storeId != ''">
|
|
and o.store_id = #{storeId}
|
|
and o.store_id = #{storeId}
|
|
</if>
|
|
</if>
|
|
- <if test="storeName != null and storeName != ''">
|
|
|
|
- AND s.store_name LIKE concat('%',#{storeName},'%')
|
|
|
|
- </if>
|
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="queryAll201Order" resultType="com.kmall.admin.entity.OrderEntity">
|
|
<select id="queryAll201Order" resultType="com.kmall.admin.entity.OrderEntity">
|