1.大哥筛选功能实现

This commit is contained in:
2025-07-04 19:50:06 +08:00
parent 37a9536eef
commit dfd235c5fe
5 changed files with 234 additions and 22 deletions

View File

@@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
@@ -49,8 +51,87 @@ public class BigBrotherPageReqVO extends PageParam {
@Schema(description = "该数据所属的账号id", example = "30487")
private String ownerId;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
/**
* 大哥的等级
*/
@Schema(description="大哥的等级最小值")
private Integer levelMin;
/**
* 大哥的等级
*/
@Schema(description="大哥的等级最大值")
private Integer levelMax;
/**
* 大哥打赏的金币
*/
@Schema(description="大哥打赏的金币最小值")
private Integer hostcoinsMin;
/**
* 大哥打赏的金币
*/
@Schema(description="大哥打赏的金币最大值")
private Integer hostcoinsMax;
/**
* 大哥打赏的历史最高金币
*/
@Schema(description="大哥打赏的历史最高金币最小值")
private Integer historicHighCoinsMin;
/**
* 大哥打赏的历史最高金币
*/
@Schema(description="大哥打赏的历史最高金币最大值")
private Integer historicHighCoinsMax;
/**
* 大哥历史打赏金币总和
*/
@Schema(description="大哥历史打赏金币总和")
private Integer totalGiftCoinsMin;
/**
* 大哥历史打赏金币总和
*/
@Schema(description="大哥历史打赏金币总和")
private Integer totalGiftCoinsMax;
/**
* 租户 Id
*/
@Schema(description="租户 Id")
private Long tenantId;
/**
* 数据插入时间
*/
@Schema(description = "创建时间开始(yyyy-MM-dd)", example = "2023-01-01")
private Date createTimeStart;
/**
* 数据插入时间
*/
@Schema(description = "创建时间结束(yyyy-MM-dd)", example = "2023-01-01")
private Date createTimeEnd;
/**
* 排序规则
*/
@Schema(description = "排序方式(asc/desc)", example = "desc")
private String sort;
/**
* 按照何种业务排序
*/
@Schema(description = "排序字段(historicHighCoins/totalGiftCoins/level等)", example = "hostsCoins")
private String sortName;
}

View File

@@ -76,5 +76,8 @@ public class BigBrotherDO extends BaseDO {
*/
private String ownerId;
/**
* 该数据所属的租户id
*/
private Long tenantId;
}

View File

@@ -6,8 +6,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo.BigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.EmployeeHostsPageReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 大哥数据 Mapper
@@ -17,22 +21,24 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface BigBrotherMapper extends BaseMapperX<BigBrotherDO> {
default PageResult<BigBrotherDO> selectPage(BigBrotherPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<BigBrotherDO>()
.eqIfPresent(BigBrotherDO::getDisplayId, reqVO.getDisplayId())
.eqIfPresent(BigBrotherDO::getUserIdStr, reqVO.getUserIdStr())
.likeIfPresent(BigBrotherDO::getNickname, reqVO.getNickname())
.eqIfPresent(BigBrotherDO::getLevel, reqVO.getLevel())
.eqIfPresent(BigBrotherDO::getHostcoins, reqVO.getHostcoins())
.eqIfPresent(BigBrotherDO::getFollowerCount, reqVO.getFollowerCount())
.eqIfPresent(BigBrotherDO::getFollowingCount, reqVO.getFollowingCount())
.eqIfPresent(BigBrotherDO::getRegion, reqVO.getRegion())
.eqIfPresent(BigBrotherDO::getHistoricHighCoins, reqVO.getHistoricHighCoins())
.eqIfPresent(BigBrotherDO::getTotalGiftCoins, reqVO.getTotalGiftCoins())
.eqIfPresent(BigBrotherDO::getHostDisplayId, reqVO.getHostDisplayId())
.eqIfPresent(BigBrotherDO::getOwnerId, reqVO.getOwnerId())
.betweenIfPresent(BigBrotherDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(BigBrotherDO::getId));
}
// default PageResult<BigBrotherDO> selectPage(BigBrotherPageReqVO reqVO) {
// return selectPage(reqVO, new LambdaQueryWrapperX<BigBrotherDO>()
// .eqIfPresent(BigBrotherDO::getDisplayId, reqVO.getDisplayId())
// .eqIfPresent(BigBrotherDO::getUserIdStr, reqVO.getUserIdStr())
// .likeIfPresent(BigBrotherDO::getNickname, reqVO.getNickname())
// .eqIfPresent(BigBrotherDO::getLevel, reqVO.getLevel())
// .eqIfPresent(BigBrotherDO::getHostcoins, reqVO.getHostcoins())
// .eqIfPresent(BigBrotherDO::getFollowerCount, reqVO.getFollowerCount())
// .eqIfPresent(BigBrotherDO::getFollowingCount, reqVO.getFollowingCount())
// .eqIfPresent(BigBrotherDO::getRegion, reqVO.getRegion())
// .eqIfPresent(BigBrotherDO::getHistoricHighCoins, reqVO.getHistoricHighCoins())
// .eqIfPresent(BigBrotherDO::getTotalGiftCoins, reqVO.getTotalGiftCoins())
// .eqIfPresent(BigBrotherDO::getHostDisplayId, reqVO.getHostDisplayId())
// .eqIfPresent(BigBrotherDO::getOwnerId, reqVO.getOwnerId())
// .betweenIfPresent(BigBrotherDO::getCreateTime, reqVO.getCreateTime())
// .orderByDesc(BigBrotherDO::getId));
// }
IPage<BigBrotherDO> selectPageWithXML(IPage<BigBrotherDO> page, @Param("dto")BigBrotherPageReqVO reqDTO);
}

View File

@@ -1,10 +1,14 @@
package cn.iocoder.yudao.module.tkdata.service.bigbrother;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo.BigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo.BigBrotherSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
import cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother.BigBrotherMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
@@ -89,7 +93,10 @@ public class BigBrotherServiceImpl implements BigBrotherService {
@Override
public PageResult<BigBrotherDO> getBigBrotherPage(BigBrotherPageReqVO pageReqVO) {
return bigBrotherMapper.selectPage(pageReqVO);
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
IPage<BigBrotherDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
IPage<BigBrotherDO> bigBrotherDOIPage = bigBrotherMapper.selectPageWithXML(iPage, pageReqVO);
return new PageResult<>(bigBrotherDOIPage.getRecords(),bigBrotherDOIPage.getTotal());
}
}