feat(order): 添加订单实体关联字段和查询功能

- 在ShopOrder实体中添加店铺ID、店铺名称、配送员ID、配送员名称、仓库ID、仓库名称字段
- 添加送达拍照记录字段用于记录配送完成时的照片
- 修改ShopOrderMapper.xml中的关联查询SQL,增加店铺、配送员、仓库表的LEFT JOIN关联
- 添加店铺名称、配送员名称、仓库名称的别名查询映射
- 在ShopOrderParam参数类中添加店铺ID、配送员ID、仓库ID查询条件字段
- 更新动态SQL条件判断,支持按店铺ID、配送员ID、仓库ID进行筛选查询
This commit is contained in:
2026-02-01 01:45:15 +08:00
parent 7f7b7527a0
commit f364d180ea
3 changed files with 46 additions and 1 deletions

View File

@@ -63,6 +63,27 @@ public class ShopOrder implements Serializable {
@Schema(description = "商户编号") @Schema(description = "商户编号")
private String merchantCode; private String merchantCode;
@Schema(description = "店铺ID")
private Integer storeId;
@Schema(description = "店铺名称")
@TableField(exist = false)
private String storeName;
@Schema(description = "配送员ID")
private Integer riderId;
@Schema(description = "配送员名称")
@TableField(exist = false)
private String riderName;
@Schema(description = "仓库ID")
private Integer warehouseId;
@Schema(description = "仓库名称")
@TableField(exist = false)
private String warehouseName;
@Schema(description = "使用的优惠券id") @Schema(description = "使用的优惠券id")
private Integer couponId; private Integer couponId;
@@ -103,6 +124,9 @@ public class ShopOrder implements Serializable {
@Schema(description = "配送结束时间") @Schema(description = "配送结束时间")
private String sendEndTime; private String sendEndTime;
@Schema(description = "送达拍照记录")
private String sendEndImg;
@Schema(description = "发货店铺id") @Schema(description = "发货店铺id")
private Integer expressMerchantId; private Integer expressMerchantId;

View File

@@ -4,9 +4,12 @@
<!-- 关联查询sql --> <!-- 关联查询sql -->
<sql id="selectSql"> <sql id="selectSql">
SELECT a.*,b.nickname, b.avatar,b.phone as phone SELECT a.*,b.nickname, b.avatar,b.phone as phone, c.name as storeName, d.real_name as riderName, e.name as warehouseName
FROM shop_order a FROM shop_order a
LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id LEFT JOIN gxwebsoft_core.sys_user b ON a.user_id = b.user_id
LEFT JOIN shop_store c ON a.store_id = c.id
LEFT JOIN shop_rider d ON a.rider_id = d.id
LEFT JOIN shop_warehouse e ON a.warehouse_id = e.id
<where> <where>
<if test="param.orderId != null"> <if test="param.orderId != null">
AND a.order_id = #{param.orderId} AND a.order_id = #{param.orderId}
@@ -38,6 +41,15 @@
<if test="param.merchantCode != null"> <if test="param.merchantCode != null">
AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%') AND a.merchant_code LIKE CONCAT('%', #{param.merchantCode}, '%')
</if> </if>
<if test="param.storeId != null">
AND a.store_id LIKE CONCAT('%', #{param.storeId}, '%')
</if>
<if test="param.riderId != null">
AND a.rider_id LIKE CONCAT('%', #{param.riderId}, '%')
</if>
<if test="param.warehouseId != null">
AND a.warehouse_id LIKE CONCAT('%', #{param.warehouseId}, '%')
</if>
<if test="param.couponId != null"> <if test="param.couponId != null">
AND a.coupon_id = #{param.couponId} AND a.coupon_id = #{param.couponId}
</if> </if>

View File

@@ -58,6 +58,15 @@ public class ShopOrderParam extends BaseParam {
@Schema(description = "商户编号") @Schema(description = "商户编号")
private String merchantCode; private String merchantCode;
@Schema(description = "店铺ID")
private Integer storeId;
@Schema(description = "配送员ID")
private Integer riderId;
@Schema(description = "仓库ID")
private Integer warehouseId;
@Schema(description = "使用的优惠券id") @Schema(description = "使用的优惠券id")
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer couponId; private Integer couponId;