Authored by LUOXC

add query

... ... @@ -21,6 +21,8 @@ public class TradeBillsReq extends PageRequestBO{
private Integer id;
private Long orderCode;
private Long orderCode2;
private Integer uid;
... ...
... ... @@ -31,7 +31,14 @@
income_outcome=1
and deal_status != 1
<if test="billsTradeReq.orderCode != null">
and (order_code = #{billsTradeReq.orderCode} or paid_order_code = #{billsTradeReq.orderCode})
and (
order_code = #{billsTradeReq.orderCode}
or paid_order_code = #{billsTradeReq.orderCode}
<if test="billsTradeReq.orderCode2 != null">
or order_code = #{billsTradeReq.orderCode2}
or paid_order_code = #{billsTradeReq.orderCode2}
</if>
)
</if>
<if test="billsTradeReq.uid != null">
and uid = #{billsTradeReq.uid}
... ...
... ... @@ -73,7 +73,9 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
private TradeBillsMapper tradeBillsMapper;
@Autowired
private StoredSellerMapper storedSellerMapper;
private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
@Autowired
private SellerOrderMapper sellerOrderMapper;
@Autowired
private SellerWalletDetailMapper sellerWalletDetailMapper;
... ... @@ -235,6 +237,17 @@ public class TradeBillsServiceImpl implements ITradeBillsService {
req.setPayErrorCode(null);
}
if (Objects.nonNull(req.getOrderCode())){
req.setOrderCode2(Optional.of(req.getOrderCode())
.map(e->buyerOrderGoodsMapper.selectByOrderCodeOne(e.toString()))
.map(e->e.getSkup())
.map(e->sellerOrderMapper.selectBySkups(Lists.newArrayList(e)))
.filter(CollectionUtils::isNotEmpty)
.map(e->e.get(0).getOrderCode())
.map(Long::valueOf)
.orElse(null));
}
int total = tradeBillsMapper.selectCountByCondition(req);
if (total == 0) {
... ...