feat(订单): 添加订单退还状态字段

在OrderWithGoodsDTO中添加returnStatus字段用于标识订单退还状态
修改ShopOrderMapper查询语句,增加退还状态逻辑判断
This commit is contained in:
dzq 2025-07-16 09:34:51 +08:00
parent 91e61308a1
commit 4b055dac24
2 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,8 @@ public interface ShopOrderMapper extends BaseMapper<ShopOrderEntity> {
@Select("SELECT o.*, " + @Select("SELECT o.*, " +
"GROUP_CONCAT(DISTINCT og.goods_name) AS goodsNames, " + "GROUP_CONCAT(DISTINCT og.goods_name) AS goodsNames, " +
"GROUP_CONCAT(DISTINCT og.cover_img) AS coverImgs " + "GROUP_CONCAT(DISTINCT og.cover_img) AS coverImgs, " +
"CASE WHEN o.status = 2 AND MAX(CASE WHEN og.status = 1 THEN 1 ELSE 0 END) = 1 THEN 0 ELSE 1 END AS returnStatus " +
"FROM shop_order o " + "FROM shop_order o " +
"LEFT JOIN shop_order_goods og ON o.order_id = og.order_id AND og.deleted = 0 " + "LEFT JOIN shop_order_goods og ON o.order_id = og.order_id AND og.deleted = 0 " +
"LEFT JOIN cabinet_cell cc ON cc.cell_id = og.cell_id " + "LEFT JOIN cabinet_cell cc ON cc.cell_id = og.cell_id " +

View File

@ -9,4 +9,6 @@ import lombok.EqualsAndHashCode;
public class OrderWithGoodsDTO extends ShopOrderEntity { public class OrderWithGoodsDTO extends ShopOrderEntity {
private String goodsNames; private String goodsNames;
private String coverImgs; private String coverImgs;
// 0未退还 1已退还
private Integer returnStatus;
} }