mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-18 06:09:58 +08:00
update 查询订单sql
This commit is contained in:
@@ -83,6 +83,8 @@ public class QueryOrderDTO extends BaseEntity {
|
||||
*/
|
||||
private String payMode;
|
||||
|
||||
private List<String> payModeList;
|
||||
|
||||
/**
|
||||
* 订单编号列表
|
||||
*/
|
||||
|
||||
@@ -1066,7 +1066,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
QueryOrderDTO dto = QueryOrderDTO.builder()
|
||||
.startTime(DateUtils.formatDateTime(start))
|
||||
.endTime(DateUtils.formatDateTime(end))
|
||||
.payMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||||
// .payMode(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())
|
||||
.payModeList(Lists.newArrayList(OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue(), OrderPayModeEnum.PAYMENT_OF_ALIPAY.getValue()))
|
||||
.stationId(stationId)
|
||||
.orderStatus(OrderStatusEnum.ORDER_COMPLETE.getValue())
|
||||
.build();
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package com.jsowell.pile.util;
|
||||
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.pile.vo.web.OrderListVO;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 运营商工具类
|
||||
@@ -73,4 +75,19 @@ public class MerchantUtils {
|
||||
return new ArrayList<>(shuffled.subList(0, keepCount));
|
||||
}
|
||||
|
||||
public static List<String> getRandomNinetyPercentV2(List<OrderListVO> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
int total = list.size();
|
||||
int removeCount = (int) Math.ceil(total * 0.1);
|
||||
int keepCount = Math.max(1, total - removeCount);
|
||||
List<OrderListVO> shuffled = new ArrayList<>(list);
|
||||
Collections.shuffle(shuffled);
|
||||
List<OrderListVO> orderListVOS = new ArrayList<>(shuffled.subList(0, keepCount));
|
||||
// 提取orderCode
|
||||
List<String> codeList = orderListVOS.stream().map(OrderListVO::getOrderCode).collect(Collectors.toList());
|
||||
return codeList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2014,6 +2014,12 @@
|
||||
<if test="payMode != null and payMode != ''">
|
||||
and t1.pay_mode = #{payMode,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="payModeList != null and payModeList.size() != 0">
|
||||
and t1.pay_mode in
|
||||
<foreach close=")" collection="payModeList" item="payMode" open="(" separator=",">
|
||||
#{payMode}
|
||||
</foreach>
|
||||
</if>
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user