Browse Source

refactor(applet): 优化充值订单及用户订单查询功能

- 在充电订单分页查询中增加用户手机号关联查询和模糊搜索支持
- 修改ChargeOrderInfoQuery中equipmentId类型由Integer改为String
- 为充电订单添加按创建时间降序排序
- 为用户支付订单分页查询添加手机号模糊搜索及订单编号、状态筛选
- 新增UserOrderInfoesQuery分页查询对象占位类
- 扩展UserOrderInfoQuery添加手机号、订单状态和订单编号字段
- 在ChargeOrderInfoVO和UserOrderInfoVO中增加手机号字段用于展示
- AppletHomeController新增test3接口处理用户openid字符串更新,在更新时跳过空openid和已存在的用户
- 修正XssAndSqlInjectionFilter默认检查请求头,注释掉Referer头检查以避免误报
- WFTOrderService调整退款请求中的商户订单号为固定示例值,新增main方法测试退款功能,打印退款结果及状态日志
wzq 3 weeks ago
parent
commit
73fe8dfb15

+ 34 - 6
src/main/java/com/zsElectric/boot/business/controller/applet/AppletHomeController.java

@@ -1,29 +1,31 @@
 package com.zsElectric.boot.business.controller.applet;
 package com.zsElectric.boot.business.controller.applet;
 
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.zsElectric.boot.business.model.entity.Advertising;
 import com.zsElectric.boot.business.model.entity.Advertising;
-import com.zsElectric.boot.business.model.query.AdvertisingQuery;
-import com.zsElectric.boot.business.model.vo.AdvertisingVO;
-import com.zsElectric.boot.business.service.AdvertisingService;
-import com.zsElectric.boot.business.service.UserInfoService;
+import com.zsElectric.boot.business.model.entity.UserAccount;
+import com.zsElectric.boot.business.model.entity.UserInfo;
+import com.zsElectric.boot.business.model.entity.UserOrderInfo;
+import com.zsElectric.boot.business.service.*;
 import com.zsElectric.boot.charging.service.ChargingReceptionService;
 import com.zsElectric.boot.charging.service.ChargingReceptionService;
 import com.zsElectric.boot.common.constant.SystemConstants;
 import com.zsElectric.boot.common.constant.SystemConstants;
 import com.zsElectric.boot.common.util.electric.RequestParmsEntity;
 import com.zsElectric.boot.common.util.electric.RequestParmsEntity;
 import com.zsElectric.boot.common.util.electric.ResponseParmsEntity;
 import com.zsElectric.boot.common.util.electric.ResponseParmsEntity;
 import com.zsElectric.boot.core.web.Result;
 import com.zsElectric.boot.core.web.Result;
+import com.zsElectric.boot.system.service.UserService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Operation;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.zsElectric.boot.business.model.query.StationInfoQuery;
 import com.zsElectric.boot.business.model.query.StationInfoQuery;
 import com.zsElectric.boot.business.model.vo.BannerInfoVO;
 import com.zsElectric.boot.business.model.vo.BannerInfoVO;
 import com.zsElectric.boot.business.model.vo.StationInfoMapVO;
 import com.zsElectric.boot.business.model.vo.StationInfoMapVO;
 import com.zsElectric.boot.business.model.vo.StationInfoVO;
 import com.zsElectric.boot.business.model.vo.StationInfoVO;
-import com.zsElectric.boot.business.service.AppletHomeService;
 import com.zsElectric.boot.core.web.PageResult;
 import com.zsElectric.boot.core.web.PageResult;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
 import lombok.RequiredArgsConstructor;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
@@ -113,4 +115,30 @@ public class AppletHomeController {
         int restoredCount = userInfoService.restoreDeletedUsersByOrderAndAccount();
         int restoredCount = userInfoService.restoreDeletedUsersByOrderAndAccount();
         log.info("恢复用户数量:{}", restoredCount);
         log.info("恢复用户数量:{}", restoredCount);
     }
     }
+
+    @Operation(summary = "test3")
+    @PostMapping("/test3")
+    @Transactional(rollbackFor = Exception.class)
+    public void test3(){
+        List<UserInfo> list = userInfoService.list();
+
+        for (UserInfo userInfo : list) {
+
+            if (ObjectUtil.isEmpty(userInfo.getOpenid())) {
+                continue;
+            }
+            String openid = userInfo.getOpenid();
+            String result = openid.substring(openid.indexOf("oIE4l"));
+
+            UserInfo one = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class).eq(UserInfo::getOpenid, openid));
+            if (one != null) {
+                log.info("用户ID:{},用户openid:{},------{}", one.getId(), openid,one.getOpenid());
+                continue;
+            }
+
+            userInfo.setOpenid(result);
+            userInfoService.updateById(userInfo);
+        }
+
+    }
 }
 }

+ 4 - 1
src/main/java/com/zsElectric/boot/business/model/query/ChargeOrderInfoQuery.java

@@ -19,7 +19,7 @@ import java.time.LocalDateTime;
 public class ChargeOrderInfoQuery extends BasePageQuery {
 public class ChargeOrderInfoQuery extends BasePageQuery {
 
 
     @Schema(description = "充电桩编号")
     @Schema(description = "充电桩编号")
-    private Integer equipmentId;
+    private String equipmentId;
 
 
     @Schema(description = "状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电")
     @Schema(description = "状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电")
     private Integer status;
     private Integer status;
@@ -33,6 +33,9 @@ public class ChargeOrderInfoQuery extends BasePageQuery {
     @Schema(description = "状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电")
     @Schema(description = "状态0待启动 1 充电中 2 结算中 3 已完成, 5未成功充电")
     private String phoneNum;
     private String phoneNum;
 
 
+    @Schema(description = "充电订单号")
+    private String chargeOrderNo;
+
     @Schema(description = "1 主动停止 2 充满停止 3 余额不足停止, 4电桩按钮停止")
     @Schema(description = "1 主动停止 2 充满停止 3 余额不足停止, 4电桩按钮停止")
     private Integer stopType;
     private Integer stopType;
 
 

+ 8 - 0
src/main/java/com/zsElectric/boot/business/model/query/UserOrderInfoQuery.java

@@ -21,4 +21,12 @@ public class UserOrderInfoQuery extends BasePageQuery {
     @Schema(description = "用户ID")
     @Schema(description = "用户ID")
     private Long userId;
     private Long userId;
 
 
+    @Schema(description = "手机号")
+    private Long phone;
+
+    @Schema(description = "订单状态 1 待支付  2 已支付 3 已取消 4 已退款")
+    private Integer orderStatus;
+
+    @Schema(description = "订单编号")
+    private String orderNo;
 }
 }

+ 22 - 0
src/main/java/com/zsElectric/boot/business/model/query/UserOrderInfoesQuery.java

@@ -0,0 +1,22 @@
+package com.zsElectric.boot.business.model.query;
+
+import com.zsElectric.boot.common.base.BasePageQuery;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Getter;
+import lombok.Setter;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.math.BigDecimal;
+
+/**
+ * 用户支付订单信息分页查询对象
+ *
+ * @author wzq
+ * @since 2026-01-05 09:33
+ */
+@Schema(description ="用户支付订单信息查询对象")
+@Getter
+@Setter
+public class UserOrderInfoesQuery extends BasePageQuery {
+
+}

+ 2 - 0
src/main/java/com/zsElectric/boot/business/model/vo/ChargeOrderInfoVO.java

@@ -120,4 +120,6 @@ public class ChargeOrderInfoVO implements Serializable {
     private String connectorName;
     private String connectorName;
     @Schema(description = "充电站名称")
     @Schema(description = "充电站名称")
     private String stationName;
     private String stationName;
+    @Schema(description = "用户手机号")
+    private String phone;
 }
 }

+ 2 - 0
src/main/java/com/zsElectric/boot/business/model/vo/UserOrderInfoVO.java

@@ -62,4 +62,6 @@ public class UserOrderInfoVO implements Serializable {
     private LocalDateTime updateTime;
     private LocalDateTime updateTime;
     @Schema(description = "逻辑删除(0-未删除 1-已删除)")
     @Schema(description = "逻辑删除(0-未删除 1-已删除)")
     private Integer isDeleted;
     private Integer isDeleted;
+    @Schema(description = "手机号")
+    private String phone;
 }
 }

+ 34 - 1
src/main/java/com/zsElectric/boot/business/service/WFTOrderService.java

@@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
+import java.io.IOException;
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.math.RoundingMode;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
@@ -871,7 +872,7 @@ public class WFTOrderService {
 
 
         SortedMap<String, String> params = new TreeMap<>();
         SortedMap<String, String> params = new TreeMap<>();
 
 
-        params.put("out_trade_no", userOrderInfo.getOrderNo());//商户订单号
+        params.put("out_trade_no", "ZSWL20250507000000551068");//商户订单号
         params.put("out_refund_no", out_refund_no);//商户退款单号
         params.put("out_refund_no", out_refund_no);//商户退款单号
         params.put("attach", reason);//退款原因
         params.put("attach", reason);//退款原因
         params.put("total_fee", amount_fee(userOrderInfo.getOrderMoney()));//原订单金额
         params.put("total_fee", amount_fee(userOrderInfo.getOrderMoney()));//原订单金额
@@ -1068,4 +1069,36 @@ public class WFTOrderService {
             log.info("========== 退款状态查询完成 ==========");
             log.info("========== 退款状态查询完成 ==========");
         }
         }
     }
     }
+
+    public static void main(String[] args) throws IOException {
+        SortedMap<String, String> params = new TreeMap<>();
+        SwiftpassConfig swiftpassConfig = new SwiftpassConfig();
+        params.put("out_trade_no", "ZSWL20250507000000551068");//商户订单号
+        params.put("out_refund_no", "TK20250507000000551068");//商户退款单号
+        params.put("attach", "");//退款原因
+        params.put("total_fee", "2000");//原订单金额
+        params.put("refund_fee", "1953");//退款金额
+        params.put("sign_type", "RSA_1_256");
+        PayUtill payUtill = new PayUtill();
+        swiftpassConfig.setKey("f5131b3f07acb965a59041b690a29911");
+        swiftpassConfig.setMchPrivateKey("MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDeFB5G2OYT762PpUytCw7Du40i6WnzcmbvEE9IXPXi+QirPwMvW9mBqNDIUk5hQS3ZnHjj80YQRWG6yksjE6kHAYIWahCDiaPlBqYvYSJ8ePzbT61THZJbzqFaIG3svW7xq9nsUmzVBub0ATIzC1DQRu9ZTdrj/iuMUEhJyJ8IHrTP09eTwNYdoagHQlKWRVoNE3LuU4GXG3VCbkQ2ixbMo8dXBisDIi3GYOSFWzota6H+OCp9Mta1jTqdwALKAU9PNlRkQwOMLk2OmMqGUhImVVpl+eGrIYn3iARce0alNFg8hghFMJ8MKpSxJDM6YHNOJQ06S25YYhTpd+C2/VOBAgMBAAECggEBAM/W9ksJ/bJU0xOn+W3N9oB7C+jLmMwtmmZM1lZ8IefNeC6Ep59wD81ISDXiydY9YQLTbVSxPjZGKOPfJZjrcnrLD4uYsmHYtFnI8klPWC40MTmzhRxPhcWESgAGb7prw+RMGIUS0yY/8nAUmn2pLnXunVzv/1b3bpxAGpdrOmMmU28GBt9AlXiIpVmnxnkhp66c4zFj5gvvVoDrz9m/6Acyn6n7yccCHD2iYw0D78GPItEWky38tH/FV0lRcCCYAf5fc2nFnicrdgj1RYjqTWxM7A92UecviTAbiuPO6CQQl7+sMtGU2d6UeKj0Xrrl2gly+lOS97P/NcLtZf5vklECgYEA8SMlCg5AToSkIwal7dXYgM2VlNFwSRDuO3hEVoWe7bM/LkEp8dqSpV025ZtngTY/qziXsGP/7l8bcS1th19cX/+/MFFOWsoxtqvOam2Elp+Qg1johEfnWI+Bo4WiQ5CHYNQRN3cuiWTc5HHuI0KQAEPx/aYogD057X2FIsiu6S0CgYEA68RAFsupZ6R8BhJbfY2CK07XLNvXu5DAYBmU3trmQFnaxXeQFfhQ8hi9m5Awu14YCnRmHzc8+QXFD/GqTAbxtImc6AZQKWdLuUntkitPWmJK6dtJC8Is3U9Yqz5+CkSmgZSfqW0DvEt7jagoNfpKgy29Qq4r35b6JsDXtnTQICUCgYEAjmwnkEzihn2pRFbE4jiP62OBmagqHb22N8HM+x1oxRQ9mOA8GfDy9GCd7/ddpt+Xs1V1omUt4GikGLCwJGiacsjm727WTKFnw3CuNgYBbcVI4Ys9qgOeDJyWATMIp8dRbktS7+OgxN2h6fuwn3rM+psm7p2ZBkUjVbXxUJ4fUPECgYEAw1wmAv2VjRUF0/4oI5w7bWlx8XDljT1/uuHXsuZN/qq2FgRht2LAqCsKCjprtwZcA2W6LUmXU32Ncg29ICxs4j1ZcAWzLOu0GoAAxKrwoSNrkeYr2/t1M5kJDzTEOfvywNMHjduQSdl+Mr5RO5D/Zz1iYztxjV9MPwpydHTM9KUCgYAHuT98NkBilMxQNNmUB13E10MYQvZuiGVFZtT3up69Elpmtm7Z5cEW7QNG0g1LPPfkzfWPsq+6I98FmozLickqvjntdpul4czTITn8SNHqoxvdbcVnDipF1KwlHcnXhjO1KjSZg3a/iv554OR3/rbD9SWDzDAT7Zy6zX9n8OwGRA==");
+        swiftpassConfig.setPlatPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2HOacYJOO9zsWPVmauV/YCeR78RsRDtusdLEngi/JkPkZVSE0X47z2RpJncGyV1QfdHv0udVEND4bvjXku4qUJp5DYAulm6pDXdcwWPcdI77V7dqoDvYm9Cc8kGj9s+/0xeuxX4qJmwzFTf7XjRfTT7+OVSvFnnButAkgMuD3cW1rtcQYeY9S9puQneN1i1+Lek5GCpW5PFsezK6QMgrpB1TFVSF5tloUODfc4fBDY5quGxn29Fo9gzJXO8ehoRft/JEaS4rNqmlfbvaJfEROXALlKoUX8Iki050ss7WwIBS6xuV08JnHTUHzHmAzOscwyYmT3RZChPgluWuyYW30wIDAQAB");
+        swiftpassConfig.setMch_id("105520131602");
+        swiftpassConfig.setAppid("wx9894a01b9e92c368");
+        swiftpassConfig.setSecret("b1e83dbcf83af310c38c0a138739ddcf");
+        swiftpassConfig.setReq_url("https://eoap.cebbank.com/uiap/bcac/pay/pay/gateway");
+        swiftpassConfig.setNotify_url("https://4ad6a4a6.r28.cpolar.top/applet/v1/wft/order/notify");
+        Map<String, String> refund = payUtill.refund(params, swiftpassConfig);
+
+        log.info("最终拿到的微信支付通知数据:" + refund);
+        if (Objects.equals(refund.get("status"), "0")) {
+
+            log.info("退款调用成功!");
+            if (Objects.equals(refund.get("result_code"), "0")) {
+                log.info("退款成功!");
+                log.info("订单:{},退款成功!原因:{}");
+
+        }
+    }
+}
 }
 }

+ 1 - 1
src/main/java/com/zsElectric/boot/core/filter/XssAndSqlInjectionFilter.java

@@ -53,7 +53,7 @@ public class XssAndSqlInjectionFilter implements Filter {
      * 默认需要检查的请求头
      * 默认需要检查的请求头
      */
      */
     private static final Set<String> DEFAULT_CHECK_HEADERS = new HashSet<>(Arrays.asList(
     private static final Set<String> DEFAULT_CHECK_HEADERS = new HashSet<>(Arrays.asList(
-            "Referer",
+//            "Referer",
             "X-Forwarded-For"
             "X-Forwarded-For"
     ));
     ));
 
 

+ 69 - 60
src/main/resources/mapper/business/ChargeOrderInfoMapper.xml

@@ -5,76 +5,85 @@
     <!-- 获取充电订单信息分页列表 -->
     <!-- 获取充电订单信息分页列表 -->
     <select id="getChargeOrderInfoPage" resultType="com.zsElectric.boot.business.model.vo.ChargeOrderInfoVO">
     <select id="getChargeOrderInfoPage" resultType="com.zsElectric.boot.business.model.vo.ChargeOrderInfoVO">
         SELECT
         SELECT
-                id,
-                user_id,
-                order_type,
-                equipment_id,
-                charge_order_no,
-                start_time,
-                end_time,
-                charge_time,
-                status,
-                third_party_total_cost,
-                third_party_serverfee,
-                third_party_elecfee,
-                total_charge,
-                real_cost,
-                real_service_cost,
-                stop_type,
-                phone_num,
-                plate_num,
-                stop_reason,
-                charge_details,
-                third_party_station_id,
-                pre_amt,
-                real_predict_service_cost,
-                masp_amount,
-                masp_real_amount,
-                total_masp_money,
-                masp_status,
-                masp_time,
-                masp_desc,
-                discount_money,
-                discount_desc,
-                discount_info_id,
-                real_third_cost,
-                firm_id,
-                firm_price,
-                coupon_price,
-                coupon_id,
-                remark,
-                create_by,
-                create_time,
-                update_by,
-                update_time,
-                version,
-                is_deleted
+        a.id,
+        a.user_id,
+        a.order_type,
+        a.equipment_id,
+        a.charge_order_no,
+        a.start_time,
+        a.end_time,
+        a.charge_time,
+        a.status,
+        a.third_party_total_cost,
+        a.third_party_serverfee,
+        a.third_party_elecfee,
+        a.total_charge,
+        a.real_cost,
+        a.real_service_cost,
+        a.stop_type,
+        a.phone_num,
+        a.plate_num,
+        a.stop_reason,
+        a.charge_details,
+        a.third_party_station_id,
+        a.pre_amt,
+        a.real_predict_service_cost,
+        a.masp_amount,
+        a.masp_real_amount,
+        a.total_masp_money,
+        a.masp_status,
+        a.masp_time,
+        a.masp_desc,
+        a.discount_money,
+        a.discount_desc,
+        a.discount_info_id,
+        a.real_third_cost,
+        a.firm_id,
+        a.firm_price,
+        a.coupon_price,
+        a.coupon_id,
+        a.remark,
+        a.create_by,
+        a.create_time,
+        a.update_by,
+        a.update_time,
+        a.version,
+        a.is_deleted,
+        b.phone
         FROM
         FROM
-            c_charge_order_info
+        c_charge_order_info a
+        left join c_user_info b ON a.user_id = b.id
         <where>
         <where>
-        is_deleted = 0
-         <if test="queryParams.maspStatus != null">
-                AND masp_status = #{queryParams.maspStatus}
+            a.is_deleted = 0
+            <if test="queryParams.equipmentId != null">
+                AND a.equipment_id = #{queryParams.equipmentId}
             </if>
             </if>
-         <if test="queryParams.status != null">
-                AND status = #{queryParams.status}
+            <if test="queryParams.maspStatus != null">
+                AND a.masp_status = #{queryParams.maspStatus}
             </if>
             </if>
-        <if test="queryParams.startTime != null">
-                AND create_time <![CDATA[  >=  ]]> #{queryParams.startTime,jdbcType=DATE}
+            <if test="queryParams.status != null">
+                AND a.status = #{queryParams.status}
+            </if>
+            <if test="queryParams.startTime != null">
+                AND a.create_time <![CDATA[  >=  ]]> #{queryParams.startTime,jdbcType=DATE}
+            </if>
+            <if test="queryParams.endTime != null">
+                AND a.create_time <![CDATA[  <=  ]]> #{queryParams.endTime,jdbcType=DATE}
             </if>
             </if>
-        <if test="queryParams.endTime != null">
-                AND create_time <![CDATA[  <=  ]]> #{queryParams.endTime,jdbcType=DATE}
+            <if test="queryParams.stopType != null">
+                AND a.stop_type = #{queryParams.stopType}
             </if>
             </if>
-        <if test="queryParams.phoneNum != null">
-                AND phone_num = #{queryParams.phoneNum}
+            <if test="queryParams.orderType != null">
+                AND a.order_type = #{queryParams.orderType}
             </if>
             </if>
-        <if test="queryParams.stopType != null">
-                AND stop_type = #{queryParams.stopType}
+            <if test="queryParams.phoneNum != null and queryParams.phoneNum != ''">
+                AND b.phone like concat('%',#{queryParams.phoneNum},'%')
             </if>
             </if>
-        <if test="queryParams.orderType != null">
-                AND order_type = #{queryParams.orderType}
+            <if test="queryParams.chargeOrderNo != null and queryParams.chargeOrderNo != ''">
+                AND a.charge_order_no like concat('%',#{queryParams.chargeOrderNo},'%')
             </if>
             </if>
         </where>
         </where>
+        ORDER BY a.create_time DESC
     </select>
     </select>
     <select id="getPage" resultType="com.zsElectric.boot.business.model.vo.ChargeOrderInfoVO">
     <select id="getPage" resultType="com.zsElectric.boot.business.model.vo.ChargeOrderInfoVO">
         SELECT
         SELECT

+ 35 - 24
src/main/resources/mapper/business/UserOrderInfoMapper.xml

@@ -5,32 +5,43 @@
     <!-- 获取用户支付订单信息分页列表 -->
     <!-- 获取用户支付订单信息分页列表 -->
     <select id="getUserOrderInfoPage" resultType="com.zsElectric.boot.business.model.vo.UserOrderInfoVO">
     <select id="getUserOrderInfoPage" resultType="com.zsElectric.boot.business.model.vo.UserOrderInfoVO">
         SELECT
         SELECT
-        id,
-        user_id,
-        order_no,
-        order_money,
-        last_money,
-        pay_time,
-        level_id,
-        out_trade_no,
-        order_status,
-        order_type,
-        transaction_id,
-        refund_money,
-        refund_time,
-        remark,
-        version,
-        create_time,
-        update_time,
-        is_deleted
+        a.id,
+        a.user_id,
+        a.order_no,
+        a.order_money,
+        a.last_money,
+        a.pay_time,
+        a.level_id,
+        a.out_trade_no,
+        a.order_status,
+        a.order_type,
+        a.transaction_id,
+        a.refund_money,
+        a.refund_time,
+        a.remark,
+        a.version,
+        a.create_time,
+        a.update_time,
+        a.is_deleted,
+        b.phone
         FROM
         FROM
-        c_user_order_info
-        <where> is_deleted = 0
-        <if test="queryParams.userId != null">
-            AND user_id = #{queryParams.userId}
-        </if>
+        c_user_order_info a
+        left join c_user_info b on a.user_id = b.id
+        <where>a.is_deleted = 0
+            <if test="queryParams.userId != null">
+                AND a.user_id = #{queryParams.userId}
+            </if>
+            <if test="queryParams.orderStatus != null">
+                AND a.order_status = #{queryParams.orderStatus}
+            </if>
+            <if test="queryParams.phone != null and queryParams.phone != ''">
+                AND b.phone like concat('%',#{queryParams.phone},'%')
+            </if>
+            <if test="queryParams.orderNo != null">
+                AND a.order_no = #{queryParams.orderNo}
+            </if>
         </where>
         </where>
-        ORDER BY create_time DESC
+        ORDER BY a.create_time DESC
     </select>
     </select>
 
 
 </mapper>
 </mapper>