feat(ticket): 添加订单状态查询功能
- 移除 GltTicketOrder 中 orderNo 字段的 @TableField(exist = false) 注解 - 在 GltTicketOrderParam 中添加 orderNo 字段并导入 TableField 注解 - 在 GltUserTicket 中添加 orderStatus 字段用于存储订单状态 - 更新 GltUserTicketMapper.xml 中的关联查询 SQL,添加订单状态字段映射 - 修改关联条件从 order_id 改为 order_no 进行关联查询 - 在查询条件中添加订单状态的筛选功能 - 在 GltUserTicketParam 中添加 orderStatus 查询参数
This commit is contained in:
@@ -32,7 +32,6 @@ public class GltTicketOrder implements Serializable {
|
|||||||
private Integer userTicketId;
|
private Integer userTicketId;
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
@Schema(description = "订单编号")
|
||||||
@TableField(exist = false)
|
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
@Schema(description = "门店ID")
|
@Schema(description = "门店ID")
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ public class GltUserTicket implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@Schema(description = "订单状态")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
@Schema(description = "排序(数字越小越靠前)")
|
||||||
private Integer sortNumber;
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
<!-- 关联查询sql -->
|
<!-- 关联查询sql -->
|
||||||
<sql id="selectSql">
|
<sql id="selectSql">
|
||||||
SELECT a.*, u.nickname, u.avatar, u.phone, m.name AS templateName, o.pay_price AS payPrice
|
SELECT a.*, u.nickname, u.avatar, u.phone, m.name AS templateName, o.pay_price AS payPrice, o.order_status as orderStatus
|
||||||
FROM glt_user_ticket a
|
FROM glt_user_ticket a
|
||||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||||
LEFT JOIN glt_ticket_template m ON a.template_id = m.id
|
LEFT JOIN glt_ticket_template m ON a.template_id = m.id
|
||||||
<!-- 使用 order_id + tenant_id 关联,避免 order_no 跨租户/重复导致 a.id 数据被 JOIN 放大 -->
|
<!-- 使用 order_id + tenant_id 关联,避免 order_no 跨租户/重复导致 a.id 数据被 JOIN 放大 -->
|
||||||
LEFT JOIN shop_order o ON a.order_id = o.order_id AND a.tenant_id = o.tenant_id AND o.deleted = 0
|
LEFT JOIN shop_order o ON a.order_no = o.order_no AND a.tenant_id = o.tenant_id AND o.deleted = 0
|
||||||
<where>
|
<where>
|
||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
@@ -26,6 +26,9 @@
|
|||||||
<if test="param.orderNo != null">
|
<if test="param.orderNo != null">
|
||||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.orderStatus != null">
|
||||||
|
AND o.order_status = #{param.orderStatus}
|
||||||
|
</if>
|
||||||
<if test="param.orderGoodsId != null">
|
<if test="param.orderGoodsId != null">
|
||||||
AND a.order_goods_id = #{param.orderGoodsId}
|
AND a.order_goods_id = #{param.orderGoodsId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.glt.param;
|
package com.gxwebsoft.glt.param;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
@@ -38,6 +39,9 @@ public class GltTicketOrderParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer riderId;
|
private Integer riderId;
|
||||||
|
|
||||||
|
@Schema(description = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
@Schema(description = "配送状态:10待配送、20配送中、30待客户确认、40已完成")
|
@Schema(description = "配送状态:10待配送、20配送中、30待客户确认、40已完成")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer deliveryStatus;
|
private Integer deliveryStatus;
|
||||||
|
|||||||
@@ -40,6 +40,10 @@ public class GltUserTicketParam extends BaseParam {
|
|||||||
@Schema(description = "订单编号")
|
@Schema(description = "订单编号")
|
||||||
private String orderNo;
|
private String orderNo;
|
||||||
|
|
||||||
|
@Schema(description = "订单状态")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer orderStatus;
|
||||||
|
|
||||||
@Schema(description = "订单商品ID")
|
@Schema(description = "订单商品ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer orderGoodsId;
|
private Integer orderGoodsId;
|
||||||
|
|||||||
Reference in New Issue
Block a user