优惠券:完善APP优惠券查询接口

This commit is contained in:
owen
2023-09-26 20:44:22 +08:00
parent a431bccc02
commit 0a3a6825d5
17 changed files with 169 additions and 106 deletions

View File

@@ -10,7 +10,6 @@ import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageRecordDO;
import cn.iocoder.yudao.module.trade.service.brokerage.bo.UserBrokerageSummaryBO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.yulichang.toolkit.LambdaUtils;
import com.github.yulichang.toolkit.MPJWrappers;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -62,7 +61,7 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> {
Integer status) {
List<Map<String, Object>> list = selectMaps(MPJWrappers.lambdaJoin(BrokerageRecordDO.class)
.select(BrokerageRecordDO::getUserId)
.selectCount(BrokerageRecordDO::getId, LambdaUtils.getName(UserBrokerageSummaryBO::getCount))
.selectCount(BrokerageRecordDO::getId, UserBrokerageSummaryBO::getCount)
.selectSum(BrokerageRecordDO::getPrice)
.in(BrokerageRecordDO::getUserId, userIds)
.eq(BrokerageRecordDO::getBizId, bizType)
@@ -71,7 +70,7 @@ public interface BrokerageRecordMapper extends BaseMapperX<BrokerageRecordDO> {
return BeanUtil.copyToList(list, UserBrokerageSummaryBO.class);
// return selectJoinList(UserBrokerageSummaryBO.class, MPJWrappers.lambdaJoin(BrokerageRecordDO.class)
// .select(BrokerageRecordDO::getUserId)
// .selectCount(BrokerageRecordDO::getId, LambdaUtils.getName(UserBrokerageSummaryBO::getCount))
// .selectCount(BrokerageRecordDO::getId, UserBrokerageSummaryBO::getCount)
// .selectSum(BrokerageRecordDO::getPrice)
// .in(BrokerageRecordDO::getUserId, userIds)
// .eq(BrokerageRecordDO::getBizId, bizType)

View File

@@ -8,7 +8,6 @@ import cn.iocoder.yudao.module.trade.controller.admin.brokerage.vo.withdraw.Brok
import cn.iocoder.yudao.module.trade.dal.dataobject.brokerage.BrokerageWithdrawDO;
import cn.iocoder.yudao.module.trade.service.brokerage.bo.UserWithdrawSummaryBO;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.github.yulichang.toolkit.LambdaUtils;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import org.apache.ibatis.annotations.Mapper;
@@ -45,7 +44,7 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO
default List<UserWithdrawSummaryBO> selectCountAndSumPriceByUserIdAndStatus(Collection<Long> userIds, Integer status) {
List<Map<String, Object>> list = selectMaps(new MPJLambdaWrapper<BrokerageWithdrawDO>()
.select(BrokerageWithdrawDO::getUserId)
.selectCount(BrokerageWithdrawDO::getId, LambdaUtils.getName(UserWithdrawSummaryBO::getCount))
.selectCount(BrokerageWithdrawDO::getId, UserWithdrawSummaryBO::getCount)
.selectSum(BrokerageWithdrawDO::getPrice)
.in(BrokerageWithdrawDO::getUserId, userIds)
.eq(BrokerageWithdrawDO::getStatus, status)
@@ -54,7 +53,7 @@ public interface BrokerageWithdrawMapper extends BaseMapperX<BrokerageWithdrawDO
// selectJoinList有BUG会与租户插件冲突解析SQL时发生异常 https://gitee.com/best_handsome/mybatis-plus-join/issues/I84GYW
// return selectJoinList(UserWithdrawSummaryBO.class, new MPJLambdaWrapper<BrokerageWithdrawDO>()
// .select(BrokerageWithdrawDO::getUserId)
// .selectCount(BrokerageWithdrawDO::getId, LambdaUtils.getName(UserWithdrawSummaryBO::getCount))
// .selectCount(BrokerageWithdrawDO::getId, UserWithdrawSummaryBO::getCount)
// .selectSum(BrokerageWithdrawDO::getPrice)
// .in(BrokerageWithdrawDO::getUserId, userIds)
// .eq(BrokerageWithdrawDO::getStatus, status)