浏览代码

订单,积分,分类,退货的功能优化

wang 1 周之前
父节点
当前提交
c1874e0ce4
共有 1 个文件被更改,包括 19 次插入20 次删除
  1. 19 20
      yami-shop-service/src/main/resources/mapper/OrderMapper.xml

+ 19 - 20
yami-shop-service/src/main/resources/mapper/OrderMapper.xml

@@ -33,7 +33,6 @@
     <resultMap id="MyOrderMap" type="com.yami.shop.bean.app.dto.MyOrderDto">
         <result column="order_number" jdbcType="VARCHAR" property="orderNumber"/>
         <result column="actual_total" jdbcType="DECIMAL" property="actualTotal"/>
-        <result column="status" jdbcType="INTEGER" property="status"/>
         <result column="order_type" jdbcType="VARCHAR" property="orderType"/>
         <result column="refund_type" jdbcType="INTEGER" property="refundType"/>
         <result column="return_money_sts" jdbcType="INTEGER" property="returnMoneySts"/>
@@ -524,10 +523,10 @@
             temp.hb_logistic_status,
             temp.offset_points,
             temp.pay_time,
-            temp.order_id, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.status,temp.shop_id,temp.addr_order_id FROM tz_order temp
+            temp.order_id, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id,temp.addr_order_id FROM tz_order temp
         WHERE temp.user_id = #{userId} and temp.delete_status = 0
         <if test="status != null and status != 0">
-            AND temp.status = #{status}
+            AND temp.hb_order_status = #{status}
         </if>
         ORDER BY temp.create_time DESC
         LIMIT #{adapter.begin} , #{adapter.size}
@@ -547,10 +546,10 @@
         JOIN tz_order_item oi ON temp.order_number = oi.order_number
         WHERE temp.user_id = #{userId} and temp.delete_status = 0
         <if test="status != null and status != 0">
-            AND temp.status = #{status}
+            AND temp.hb_order_status = #{status}
         </if>
         <if test="isComm != null">
-            AND temp.status = 5
+            AND temp.hb_order_status = 80
         </if>
         <if test="isComm != null">
             AND oi.comm_sts = #{isComm}
@@ -586,11 +585,11 @@
             tz_seckill s ON s.seckill_id = so.seckill_id
                               AND (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(so.`create_time`))/60 &gt; s.`max_cancel_time` and so.state = 0 ) t
             ON o.order_number = t.order_number
-        SET o.`status`=60,o.cancel_time = NOW(),o.update_time=NOW()
+        SET o.`hb_order_status`=60,o.cancel_time = NOW(),o.update_time=NOW()
     </update>
 
     <update id="updateToWaitGroup">
-        UPDATE tz_order SET status = 7,update_time=NOW() WHERE order_number = #{orderNumber}
+        UPDATE tz_order SET hb_order_status = 7,update_time=NOW() WHERE order_number = #{orderNumber}
     </update>
 
     <update id="updateToWaitDelivery">
@@ -624,14 +623,14 @@
     <select id="listMyOrderByParams" resultMap="MyOrderMap">
         SELECT
         o.order_type,o.actual_total,
-        oi.pic,oi.price,oi.prod_id,oi.prod_name,oi.sku_name,ifnull(oi.use_score,0) as use_score,oi.prod_count,oi.order_item_id,o.status,o.order_number,oi.comm_sts,
+        oi.pic,oi.price,oi.prod_id,oi.prod_name,oi.sku_name,ifnull(oi.use_score,0) as use_score,oi.prod_count,oi.order_item_id,o.hb_order_status,o.order_number,oi.comm_sts,
         sd.shop_id,sd.shop_name
         FROM (
-        SELECT temp.order_type, temp.create_time, temp.order_number,temp.actual_total,temp.status,temp.shop_id,prod_name
+        SELECT temp.order_type, temp.create_time, temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id,prod_name
         FROM tz_order temp
         WHERE temp.user_id = #{userId} and temp.delete_status = 0
         <if test="status != null and status != 0">
-            AND temp.status = #{status}
+            AND temp.hb_order_status = #{status}
         </if>
         <if test="orderNumber != null and orderNumber != ''">
             AND temp.order_number LIKE CONCAT("%",#{orderNumber},"%")
@@ -668,7 +667,7 @@
             join tz_shop_detail sd on o.shop_id = sd.shop_id
             WHERE o.user_id = #{userId} and o.delete_status = 0
             <if test="status != null and status != 0">
-                AND o.status = #{status}
+                AND o.hb_order_status = #{status}
             </if>
             <if test="orderNumber != null and orderNumber != ''">
                 AND o.order_number LIKE CONCAT("%",#{orderNumber},"%")
@@ -692,7 +691,7 @@
         ) AS temp
     </select>
     <select id="listOrdersDetialByOrderInfo" resultMap="orderAndOrderItemAndUserAddrMap">
-        SELECT *,oi.prod_name,uao.address,uao.address_name,uao.addr_detail as item_prod_name,oi.actual_total as oi_actual_total,temp.prod_name as order_prod_name,oi.status as oi_status
+        SELECT *,oi.prod_name,uao.address,uao.address_name,uao.addr_detail as item_prod_name,oi.actual_total as oi_actual_total,temp.prod_name as order_prod_name,oi.hb_order_status as oi_status
         FROM
         (
         SELECT o.*,sd.shop_name FROM tz_order o
@@ -702,14 +701,14 @@
                 and o.order_number = #{orderParam.orderNumber}
             </if>
             <if test="orderParam.status != null">
-                and o.status = #{orderParam.status}
+                and o.hb_order_status = #{orderParam.status}
             </if>
             <if test="orderParam.shopId != null">
                 and o.shop_id = #{orderParam.shopId}
             </if>
             <if test="orderParam.isPayed != null">
                 and o.is_payed = #{orderParam.isPayed}
-                and o.status != 6
+                and o.hb_order_status != 60
             </if>
             <if test="orderParam.startTime != null">
                 and o.create_time &gt; #{orderParam.startTime}
@@ -762,7 +761,7 @@
         </foreach>
     </select>
     <select id="getOrderDetailByOrderNumberAndShopId" resultMap="orderAndOrderItemAndUserAddrMap">
-        SELECT o.*,oi.prod_name as item_prod_name,oi.*,uao.*,u.`nick_name`,u.user_mobile,oi.status as oi_status, IF(o.refund_type = 1,
+        SELECT o.*,oi.prod_name as item_prod_name,oi.*,uao.*,u.`nick_name`,u.user_mobile,oi.hb_order_status as oi_status, IF(o.refund_type = 1,
             o.rms,r.return_money_sts) AS oi_return_money_sts
         FROM (
             SELECT temp.*,tr.refund_type,tr.return_money_sts rms
@@ -781,14 +780,14 @@
     </select>
     <select id="OrderCommentByUserIdAndStatus" resultMap="MyOrderMap">
         SELECT
-        o.order_type,o.actual_total,o.status,o.order_number,o.freight_amount,o.create_time,
+        o.order_type,o.actual_total,o.hb_order_status,o.order_number,o.freight_amount,o.create_time,
         pc.rec_time,
         oi.pic,oi.price,oi.prod_name,oi.pic,oi.sku_name,oi.use_score,oi.prod_id,oi.rec_time,oi.prod_count,oi.order_item_id,oi.comm_sts,
         sd.shop_id,sd.shop_name,oi.actual_total as oi_actual_total
         FROM (
-        SELECT DISTINCT temp.order_type, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.status,temp.shop_id FROM tz_order temp
+        SELECT DISTINCT temp.order_type, temp.create_time, temp.freight_amount,temp.order_number,temp.actual_total,temp.hb_order_status,temp.shop_id FROM tz_order temp
         JOIN tz_order_item toi ON temp.order_number = toi.order_number AND toi.comm_sts = #{isComm}
-        WHERE temp.user_id = #{userId} and temp.delete_status = 0 AND temp.status = 5
+        WHERE temp.user_id = #{userId} and temp.delete_status = 0 AND temp.hb_order_status = 80
         ORDER BY temp.create_time DESC
         LIMIT #{adapter.begin} , #{adapter.size}
         )AS o
@@ -806,7 +805,7 @@
         left JOIN tz_prod_comm pc ON pc.order_item_id = oi.order_item_id
         where oi.comm_sts = #{isComm} and o.user_id = #{userId}
         <if test="isComm == 1">
-            AND o.status = 5
+            AND o.hb_order_status = 80
         </if>
         ORDER BY pc.rec_time DESC
         LIMIT #{adapter.begin} , #{adapter.size}
@@ -818,7 +817,7 @@
         left JOIN tz_order_item oi ON o.order_number = oi.order_number
         where oi.comm_sts = #{isComm} and o.user_id = #{userId}
         <if test="isComm == 1">
-            AND o.status = 5
+            AND o.hb_order_status = 80
         </if>
     </select>