Commit 427cf8e4f6dfc63913e3830efd56dfd8683da28c
1 parent
94effa87
【功能优化】订单日志根据创建时间倒序
Showing
1 changed file
with
5 additions
and
1 deletions
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/mysql/order/TradeOrderLogMapper.java
| @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.order; | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.order; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 3 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 4 | import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderLogDO; | 4 | import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderLogDO; |
| 5 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | ||
| 5 | import org.apache.ibatis.annotations.Mapper; | 6 | import org.apache.ibatis.annotations.Mapper; |
| 6 | 7 | ||
| 7 | import java.util.List; | 8 | import java.util.List; |
| @@ -10,7 +11,10 @@ import java.util.List; | @@ -10,7 +11,10 @@ import java.util.List; | ||
| 10 | public interface TradeOrderLogMapper extends BaseMapperX<TradeOrderLogDO> { | 11 | public interface TradeOrderLogMapper extends BaseMapperX<TradeOrderLogDO> { |
| 11 | 12 | ||
| 12 | default List<TradeOrderLogDO> selectListByOrderId(Long orderId) { | 13 | default List<TradeOrderLogDO> selectListByOrderId(Long orderId) { |
| 13 | - return selectList(TradeOrderLogDO::getOrderId, orderId); | 14 | + LambdaQueryWrapper<TradeOrderLogDO> queryWrapper = new LambdaQueryWrapper<>(); |
| 15 | + queryWrapper.eq(TradeOrderLogDO::getOrderId, orderId); | ||
| 16 | + queryWrapper.orderByDesc(TradeOrderLogDO::getCreateTime); | ||
| 17 | + return selectList(queryWrapper); | ||
| 14 | } | 18 | } |
| 15 | 19 | ||
| 16 | } | 20 | } |