diff --git a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/controller/admin/bigbrother/vo/BigBrotherPageReqVO.java b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/controller/admin/bigbrother/vo/BigBrotherPageReqVO.java index 3941227..78d26ea 100644 --- a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/controller/admin/bigbrother/vo/BigBrotherPageReqVO.java +++ b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/controller/admin/bigbrother/vo/BigBrotherPageReqVO.java @@ -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; + } \ No newline at end of file diff --git a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/dataobject/bigbrother/BigBrotherDO.java b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/dataobject/bigbrother/BigBrotherDO.java index 32c98f1..671873e 100644 --- a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/dataobject/bigbrother/BigBrotherDO.java +++ b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/dataobject/bigbrother/BigBrotherDO.java @@ -76,5 +76,8 @@ public class BigBrotherDO extends BaseDO { */ private String ownerId; - + /** + * 该数据所属的租户id + */ + private Long tenantId; } \ No newline at end of file diff --git a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/mysql/bigbrother/BigBrotherMapper.java b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/mysql/bigbrother/BigBrotherMapper.java index a9f558e..98a856d 100644 --- a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/mysql/bigbrother/BigBrotherMapper.java +++ b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/dal/mysql/bigbrother/BigBrotherMapper.java @@ -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 { - default PageResult selectPage(BigBrotherPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .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 selectPage(BigBrotherPageReqVO reqVO) { +// return selectPage(reqVO, new LambdaQueryWrapperX() +// .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 selectPageWithXML(IPage page, @Param("dto")BigBrotherPageReqVO reqDTO); } \ No newline at end of file diff --git a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/service/bigbrother/BigBrotherServiceImpl.java b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/service/bigbrother/BigBrotherServiceImpl.java index 80f7429..9850462 100644 --- a/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/service/bigbrother/BigBrotherServiceImpl.java +++ b/tkdata-model-server/src/main/java/cn/iocoder/yudao/module/tkdata/service/bigbrother/BigBrotherServiceImpl.java @@ -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 getBigBrotherPage(BigBrotherPageReqVO pageReqVO) { - return bigBrotherMapper.selectPage(pageReqVO); + pageReqVO.setTenantId(TenantContextHolder.getTenantId()); + IPage iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize()); + IPage bigBrotherDOIPage = bigBrotherMapper.selectPageWithXML(iPage, pageReqVO); + return new PageResult<>(bigBrotherDOIPage.getRecords(),bigBrotherDOIPage.getTotal()); } } \ No newline at end of file diff --git a/tkdata-model-server/src/main/resources/mapper/bigbrother/BigBrotherMapper.xml b/tkdata-model-server/src/main/resources/mapper/bigbrother/BigBrotherMapper.xml new file mode 100644 index 0000000..ea6ba37 --- /dev/null +++ b/tkdata-model-server/src/main/resources/mapper/bigbrother/BigBrotherMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file