Compare commits

..

12 Commits

Author SHA1 Message Date
1d71bd8ccb 1.取消displayId的条件校验 2025-07-07 19:05:36 +08:00
eee82c36fa 1.修改查询员工分配大哥的逻辑 2025-07-07 16:00:02 +08:00
9944059525 1.修改分配主播的操作逻辑 2025-07-07 14:51:12 +08:00
e868054e8f 1.大哥数据添加是否分配字段 2025-07-07 14:39:48 +08:00
21466e5f86 1.批量修改已分配员工数据功能 2025-07-07 14:29:19 +08:00
693d7c704c 1.员工查询功能
2.修改 userid 字段为 Long 类型
2025-07-07 14:18:40 +08:00
5bd6bd18db 1.大哥员工业务查询自身数据 2025-07-07 13:59:56 +08:00
2d223d2a46 1.添加大哥员工业务功能 2025-07-07 13:34:38 +08:00
31a780518a 1.修改 owner_Id 为 user_Id,和主播业务保持一致 2025-07-07 13:24:46 +08:00
3baab6acbd 1.大哥筛选添加国家选项 2025-07-07 13:00:35 +08:00
dfd235c5fe 1.大哥筛选功能实现 2025-07-04 19:50:06 +08:00
37a9536eef 1.添加大哥管理接口 2025-07-04 19:12:37 +08:00
20 changed files with 1735 additions and 39 deletions

View File

@@ -0,0 +1,109 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother;
import cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo.BigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo.BigBrotherRespVO;
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.service.bigbrother.BigBrotherService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 大哥数据")
@RestController
@RequestMapping("/server/big-brother")
@Validated
public class BigBrotherController {
@Resource
private BigBrotherService bigBrotherService;
@PostMapping("/create")
@Operation(summary = "创建大哥数据")
@PreAuthorize("@ss.hasPermission('server:big-brother:create')")
public CommonResult<Integer> createBigBrother(@Valid @RequestBody BigBrotherSaveReqVO createReqVO) {
return success(bigBrotherService.createBigBrother(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新大哥数据")
@PreAuthorize("@ss.hasPermission('server:big-brother:update')")
public CommonResult<Boolean> updateBigBrother(@Valid @RequestBody BigBrotherSaveReqVO updateReqVO) {
bigBrotherService.updateBigBrother(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除大哥数据")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('server:big-brother:delete')")
public CommonResult<Boolean> deleteBigBrother(@RequestParam("id") Integer id) {
bigBrotherService.deleteBigBrother(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除大哥数据")
@PreAuthorize("@ss.hasPermission('server:big-brother:delete')")
public CommonResult<Boolean> deleteBigBrotherList(@RequestParam("ids") List<Integer> ids) {
bigBrotherService.deleteBigBrotherListByIds(ids);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得大哥数据")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('server:big-brother:query')")
public CommonResult<BigBrotherRespVO> getBigBrother(@RequestParam("id") Integer id) {
BigBrotherDO bigBrother = bigBrotherService.getBigBrother(id);
return success(BeanUtils.toBean(bigBrother, BigBrotherRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得大哥数据分页")
@PreAuthorize("@ss.hasPermission('server:big-brother:query')")
public CommonResult<PageResult<BigBrotherRespVO>> getBigBrotherPage(@Valid BigBrotherPageReqVO pageReqVO) {
PageResult<BigBrotherDO> pageResult = bigBrotherService.getBigBrotherPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, BigBrotherRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出大哥数据 Excel")
@PreAuthorize("@ss.hasPermission('server:big-brother:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportBigBrotherExcel(@Valid BigBrotherPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<BigBrotherDO> list = bigBrotherService.getBigBrotherPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "大哥数据.xls", "数据", BigBrotherRespVO.class,
BeanUtils.toBean(list, BigBrotherRespVO.class));
}
}

View File

@@ -0,0 +1,142 @@
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;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 大哥数据分页 Request VO")
@Data
public class BigBrotherPageReqVO extends PageParam {
@Schema(description = "大哥的display_id", example = "862")
private String displayId;
@Schema(description = "大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "李四")
private String nickname;
@Schema(description = "大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "29086")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "18376")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "22001")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "30487")
private Long userId;
@Schema(description = "是否分配", example = "0")
private Byte isAssigned;
/**
* 大哥的等级
*/
@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")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTimeStart;
/**
* 数据插入时间
*/
@Schema(description = "创建时间结束(yyyy-MM-dd)", example = "2023-01-01")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTimeEnd;
/**
* 排序规则
*/
@Schema(description = "排序方式(asc/desc)", example = "desc")
private String sort;
/**
* 按照何种业务排序
*/
@Schema(description = "排序字段(historicHighCoins/totalGiftCoins/level等)", example = "hostsCoins")
private String sortName;
@Schema(description = "国家名称")
private String countryName;
}

View File

@@ -0,0 +1,74 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 大哥数据 Response VO")
@Data
@ExcelIgnoreUnannotated
public class BigBrotherRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22765")
@ExcelProperty("主键id")
private Integer id;
@Schema(description = "大哥的display_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "862")
@ExcelProperty("大哥的display_id")
private String displayId;
@Schema(description = "大哥的用户id")
@ExcelProperty("大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "李四")
@ExcelProperty("大哥的用户昵称")
private String nickname;
@Schema(description = "大哥的等级")
@ExcelProperty("大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
@ExcelProperty("大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "29086")
@ExcelProperty("大哥的粉丝数")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "18376")
@ExcelProperty("大哥的关注数")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
@ExcelProperty("大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
@ExcelProperty("大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
@ExcelProperty("大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "22001")
@ExcelProperty("大哥所在的直播间的主播display_id")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "30487")
@ExcelProperty("该数据所属的账号id")
private Long userId;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "是否分配")
@ExcelProperty("是否分配")
private Byte isAssigned;
}

View File

@@ -0,0 +1,58 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.bigbrother.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 大哥数据新增/修改 Request VO")
@Data
public class BigBrotherSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22765")
private Integer id;
@Schema(description = "大哥的display_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "862")
@NotEmpty(message = "大哥的display_id不能为空")
private String displayId;
@Schema(description = "大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "李四")
private String nickname;
@Schema(description = "大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "29086")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "18376")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "22001")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "30487")
private Long userId;
@Schema(description = "操作状态", example = "30487")
private Byte operation_status;
@Schema(description = "是否分配", example = "0")
private Byte isAssigned;
}

View File

@@ -0,0 +1,128 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherRespVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
import cn.iocoder.yudao.module.tkdata.service.employeebigbrother.EmployeeBigBrotherService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 大哥数据员工业务")
@RestController
@RequestMapping("/server/employee-big-brother")
@Validated
public class EmployeeBigBrotherController {
@Resource
private EmployeeBigBrotherService employeeBigBrotherService;
@PostMapping("/create")
@Operation(summary = "创建大哥数据员工业务")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:create')")
public CommonResult<Integer> createEmployeeBigBrother(@Valid @RequestBody EmployeeBigBrotherSaveReqVO createReqVO) {
return success(employeeBigBrotherService.createEmployeeBigBrother(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新大哥数据员工业务")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:update')")
public CommonResult<Boolean> updateEmployeeBigBrother(@Valid @RequestBody EmployeeBigBrotherSaveReqVO updateReqVO) {
employeeBigBrotherService.updateEmployeeBigBrother(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除大哥数据员工业务")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:delete')")
public CommonResult<Boolean> deleteEmployeeBigBrother(@RequestParam("id") Integer id) {
employeeBigBrotherService.deleteEmployeeBigBrother(id);
return success(true);
}
@DeleteMapping("/delete-list")
@Parameter(name = "ids", description = "编号", required = true)
@Operation(summary = "批量删除大哥数据员工业务")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:delete')")
public CommonResult<Boolean> deleteEmployeeBigBrotherList(@RequestParam("ids") List<Integer> ids) {
employeeBigBrotherService.deleteEmployeeBigBrotherListByIds(ids);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得大哥数据员工业务")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:query')")
public CommonResult<EmployeeBigBrotherRespVO> getEmployeeBigBrother(@RequestParam("id") Integer id) {
EmployeeBigBrotherDO employeeBigBrother = employeeBigBrotherService.getEmployeeBigBrother(id);
return success(BeanUtils.toBean(employeeBigBrother, EmployeeBigBrotherRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得大哥数据员工业务分页")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:query')")
public CommonResult<PageResult<EmployeeBigBrotherRespVO>> getEmployeeBigBrotherPage(@Valid EmployeeBigBrotherPageReqVO pageReqVO) {
PageResult<EmployeeBigBrotherDO> pageResult = employeeBigBrotherService.getEmployeeBigBrotherPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, EmployeeBigBrotherRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出大哥数据员工业务 Excel")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEmployeeBigBrotherExcel(@Valid EmployeeBigBrotherPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<EmployeeBigBrotherDO> list = employeeBigBrotherService.getEmployeeBigBrotherPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "大哥数据员工业务.xls", "数据", EmployeeBigBrotherRespVO.class,
BeanUtils.toBean(list, EmployeeBigBrotherRespVO.class));
}
@PostMapping("/allocation")
@Operation(summary = "分配大哥给员工")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:allocation')")
public CommonResult<Boolean> createEmployeeBigBrother(@Valid @RequestBody List<EmployeeBigBrotherSaveReqVO> createReqVO) {
return success(employeeBigBrotherService.allocationEmployeeBigBrother(createReqVO));
}
@GetMapping("/self_page")
@Operation(summary = "获得大哥数据员工业务分页")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:selfquery')")
public CommonResult<PageResult<EmployeeBigBrotherRespVO>> getEmployeeBigBrotherPageWithSelf(@Valid EmployeeBigBrotherPageReqVO pageReqVO) {
PageResult<EmployeeBigBrotherDO> pageResult = employeeBigBrotherService.getEmployeeBigBrotherPageWithSelf(pageReqVO);
return success(BeanUtils.toBean(pageResult, EmployeeBigBrotherRespVO.class));
}
@PutMapping("/batch_update")
@Operation(summary = "批量更新已分配给员工的大哥数据")
@PreAuthorize("@ss.hasPermission('server:employee-big-brother:batchupdate')")
public CommonResult<Boolean> batchupdateEmployeeBigBrother(@RequestBody List<EmployeeBigBrotherSaveReqVO> updateReqVO) {
employeeBigBrotherService.batchUpdateEmployeeBigBrother(updateReqVO);
return success(true);
}
}

View File

@@ -0,0 +1,141 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 大哥数据员工业务分页 Request VO")
@Data
public class EmployeeBigBrotherPageReqVO extends PageParam {
@Schema(description = "大哥的display_id", example = "15943")
private String displayId;
@Schema(description = "大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "张三")
private String nickname;
@Schema(description = "大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "9021")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "17240")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "2057")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "533")
private Long userId;
@Schema(description = "是否洽谈", example = "2")
private Integer operationStatus;
/**
* 大哥的等级
*/
@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")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTimeStart;
/**
* 数据插入时间
*/
@Schema(description = "创建时间结束(yyyy-MM-dd)", example = "2023-01-01")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTimeEnd;
/**
* 排序规则
*/
@Schema(description = "排序方式(asc/desc)", example = "desc")
private String sort;
/**
* 按照何种业务排序
*/
@Schema(description = "排序字段(historicHighCoins/totalGiftCoins/level等)", example = "hostsCoins")
private String sortName;
@Schema(description = "国家名称")
private String countryName;
}

View File

@@ -0,0 +1,75 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 大哥数据员工业务 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EmployeeBigBrotherRespVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31905")
@ExcelProperty("主键id")
private Integer id;
@Schema(description = "大哥的display_id", requiredMode = Schema.RequiredMode.REQUIRED, example = "15943")
@ExcelProperty("大哥的display_id")
private String displayId;
@Schema(description = "大哥的用户id")
@ExcelProperty("大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "张三")
@ExcelProperty("大哥的用户昵称")
private String nickname;
@Schema(description = "大哥的等级")
@ExcelProperty("大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
@ExcelProperty("大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "9021")
@ExcelProperty("大哥的粉丝数")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "17240")
@ExcelProperty("大哥的关注数")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
@ExcelProperty("大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
@ExcelProperty("大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
@ExcelProperty("大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "2057")
@ExcelProperty("大哥所在的直播间的主播display_id")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "533")
@ExcelProperty("该数据所属的账号id")
private String userId;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "是否洽谈", example = "2")
@ExcelProperty("是否洽谈")
private Integer operationStatus;
}

View File

@@ -0,0 +1,54 @@
package cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 大哥数据员工业务新增/修改 Request VO")
@Data
public class EmployeeBigBrotherSaveReqVO {
@Schema(description = "主键id", requiredMode = Schema.RequiredMode.REQUIRED, example = "31905")
private Integer id;
@Schema(description = "大哥的display_id", example = "15943")
private String displayId;
@Schema(description = "大哥的用户id")
private String userIdStr;
@Schema(description = "大哥的用户昵称", example = "张三")
private String nickname;
@Schema(description = "大哥的等级")
private Integer level;
@Schema(description = "大哥打赏的金币")
private Integer hostcoins;
@Schema(description = "大哥的粉丝数", example = "9021")
private Integer followerCount;
@Schema(description = "大哥的关注数", example = "17240")
private Integer followingCount;
@Schema(description = "大哥所在的地区")
private String region;
@Schema(description = "大哥打赏的历史最高金币")
private Integer historicHighCoins;
@Schema(description = "大哥历史打赏金币总和")
private Integer totalGiftCoins;
@Schema(description = "大哥所在的直播间的主播display_id", example = "2057")
private String hostDisplayId;
@Schema(description = "该数据所属的账号id", example = "533")
private Long userId;
@Schema(description = "是否洽谈", example = "2")
private Integer operationStatus;
}

View File

@@ -0,0 +1,85 @@
package cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 大哥数据 DO
*
* @author 总后台
*/
@TableName("server_big_brother")
@KeySequence("server_big_brother_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BigBrotherDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Integer id;
/**
* 大哥的display_id
*/
private String displayId;
/**
* 大哥的用户id
*/
private String userIdStr;
/**
* 大哥的用户昵称
*/
private String nickname;
/**
* 大哥的等级
*/
private Integer level;
/**
* 大哥打赏的金币
*/
private Integer hostcoins;
/**
* 大哥的粉丝数
*/
private Integer followerCount;
/**
* 大哥的关注数
*/
private Integer followingCount;
/**
* 大哥所在的地区
*/
private String region;
/**
* 大哥打赏的历史最高金币
*/
private Integer historicHighCoins;
/**
* 大哥历史打赏金币总和
*/
private Integer totalGiftCoins;
/**
* 大哥所在的直播间的主播display_id
*/
private String hostDisplayId;
/**
* 该数据所属的账号id
*/
private Long userId;
/**
* 该数据所属的租户id
*/
private Long tenantId;
private Integer isAssigned;
}

View File

@@ -0,0 +1,83 @@
package cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 大哥数据员工业务 DO
*
* @author ziin
*/
@TableName("server_employee_big_brother")
@KeySequence("server_employee_big_brother_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EmployeeBigBrotherDO extends BaseDO {
/**
* 主键id
*/
@TableId
private Integer id;
/**
* 大哥的display_id
*/
private String displayId;
/**
* 大哥的用户id
*/
private String userIdStr;
/**
* 大哥的用户昵称
*/
private String nickname;
/**
* 大哥的等级
*/
private Integer level;
/**
* 大哥打赏的金币
*/
private Integer hostcoins;
/**
* 大哥的粉丝数
*/
private Integer followerCount;
/**
* 大哥的关注数
*/
private Integer followingCount;
/**
* 大哥所在的地区
*/
private String region;
/**
* 大哥打赏的历史最高金币
*/
private Integer historicHighCoins;
/**
* 大哥历史打赏金币总和
*/
private Integer totalGiftCoins;
/**
* 大哥所在的直播间的主播display_id
*/
private String hostDisplayId;
/**
* 该数据所属的账号id
*/
private Long userId;
/**
* 是否洽谈
*/
private Integer operationStatus;
}

View File

@@ -0,0 +1,44 @@
package cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother;
import java.util.*;
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
*
* @author 总后台
*/
@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));
// }
IPage<BigBrotherDO> selectPageWithXML(IPage<BigBrotherDO> page, @Param("dto")BigBrotherPageReqVO reqDTO);
}

View File

@@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 大哥数据员工业务 Mapper
*
* @author ziin
*/
@Mapper
public interface EmployeeBigBrotherMapper extends BaseMapperX<EmployeeBigBrotherDO> {
IPage<EmployeeBigBrotherDO> selectPage(@Param("page") IPage<EmployeeBigBrotherDO> iPage,@Param("dto") EmployeeBigBrotherPageReqVO pageReqVO);
IPage<EmployeeBigBrotherDO> selectPagewithSelf(@Param("page") IPage<EmployeeBigBrotherDO> iPage,@Param("dto") EmployeeBigBrotherPageReqVO pageReqVO);
}

View File

@@ -21,45 +21,6 @@ import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> { public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
// default PageResult<EmployeeHostsDO> selectPage(EmployeeHostsPageReqVO reqVO) {
// return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
// .likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
// .eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
// .eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
// .betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
// .eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
// .betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
// .betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
// .betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
// .betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
// .eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
// .likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
// .eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
// .betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
// .orderByDesc(EmployeeHostsDO::getId));
// }
// default PageResult<EmployeeHostsDO> selectPageWithSelf(EmployeeHostsPageReqVO reqVO) {
// return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
// .likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
// .eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
// .eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
// .betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
// .eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
// .betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
// .betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
// .betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
// .betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
// .eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
// .likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
// .eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
// .betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
// .eq(EmployeeHostsDO::getUserId, reqVO.getUserId())
// .orderByDesc(EmployeeHostsDO::getId));
// }
int insertIgnore(EmployeeHostsDO bean); int insertIgnore(EmployeeHostsDO bean);
int batchInsertIgnore(List<EmployeeHostsDO> list); int batchInsertIgnore(List<EmployeeHostsDO> list);

View File

@@ -12,4 +12,6 @@ public interface ErrorCodeConstants {
//===============主播信息 1_001_300_000================= //===============主播信息 1_001_300_000=================
ErrorCode NEW_HOSTS_NOT_EXISTS = new ErrorCode(1_001_301_000, "主播数据不存在"); ErrorCode NEW_HOSTS_NOT_EXISTS = new ErrorCode(1_001_301_000, "主播数据不存在");
ErrorCode EMPLOYEE_HOSTS_NOT_EXISTS = new ErrorCode(1_001_301_001, "分配员工数据不存在"); ErrorCode EMPLOYEE_HOSTS_NOT_EXISTS = new ErrorCode(1_001_301_001, "分配员工数据不存在");
ErrorCode BIG_BROTHER_NOT_EXISTS = new ErrorCode(1_001_401_001, "大哥数据不存在");
ErrorCode EMPLOYEE_BIG_BROTHER_NOT_EXISTS = new ErrorCode(1_001_401_001, "大哥数据员工业务不存在");
} }

View File

@@ -0,0 +1,63 @@
package cn.iocoder.yudao.module.tkdata.service.bigbrother;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
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;
/**
* 大哥数据 Service 接口
*
* @author 总后台
*/
public interface BigBrotherService {
/**
* 创建大哥数据
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createBigBrother(@Valid BigBrotherSaveReqVO createReqVO);
/**
* 更新大哥数据
*
* @param updateReqVO 更新信息
*/
void updateBigBrother(@Valid BigBrotherSaveReqVO updateReqVO);
/**
* 删除大哥数据
*
* @param id 编号
*/
void deleteBigBrother(Integer id);
/**
* 批量删除大哥数据
*
* @param ids 编号
*/
void deleteBigBrotherListByIds(List<Integer> ids);
/**
* 获得大哥数据
*
* @param id 编号
* @return 大哥数据
*/
BigBrotherDO getBigBrother(Integer id);
/**
* 获得大哥数据分页
*
* @param pageReqVO 分页查询
* @return 大哥数据分页
*/
PageResult<BigBrotherDO> getBigBrotherPage(BigBrotherPageReqVO pageReqVO);
}

View File

@@ -0,0 +1,102 @@
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;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.BIG_BROTHER_NOT_EXISTS;
/**
* 大哥数据 Service 实现类
*
* @author 总后台
*/
@Service
@Validated
public class BigBrotherServiceImpl implements BigBrotherService {
@Resource
private BigBrotherMapper bigBrotherMapper;
@Override
public Integer createBigBrother(BigBrotherSaveReqVO createReqVO) {
// 插入
BigBrotherDO bigBrother = BeanUtils.toBean(createReqVO, BigBrotherDO.class);
bigBrotherMapper.insert(bigBrother);
// 返回
return bigBrother.getId();
}
@Override
public void updateBigBrother(BigBrotherSaveReqVO updateReqVO) {
// 校验存在
validateBigBrotherExists(updateReqVO.getId());
// 更新
BigBrotherDO updateObj = BeanUtils.toBean(updateReqVO, BigBrotherDO.class);
bigBrotherMapper.updateById(updateObj);
}
@Override
public void deleteBigBrother(Integer id) {
// 校验存在
validateBigBrotherExists(id);
// 删除
bigBrotherMapper.deleteById(id);
}
@Override
public void deleteBigBrotherListByIds(List<Integer> ids) {
// 校验存在
validateBigBrotherExists(ids);
// 删除
bigBrotherMapper.deleteByIds(ids);
}
private void validateBigBrotherExists(List<Integer> ids) {
List<BigBrotherDO> list = bigBrotherMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(BIG_BROTHER_NOT_EXISTS);
}
}
private void validateBigBrotherExists(Integer id) {
if (bigBrotherMapper.selectById(id) == null) {
throw exception(BIG_BROTHER_NOT_EXISTS);
}
}
@Override
public BigBrotherDO getBigBrother(Integer id) {
return bigBrotherMapper.selectById(id);
}
@Override
public PageResult<BigBrotherDO> getBigBrotherPage(BigBrotherPageReqVO 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());
}
}

View File

@@ -0,0 +1,68 @@
package cn.iocoder.yudao.module.tkdata.service.employeebigbrother;
import java.util.*;
import javax.validation.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
/**
* 大哥数据员工业务 Service 接口
*
* @author ziin
*/
public interface EmployeeBigBrotherService {
/**
* 创建大哥数据员工业务
*
* @param createReqVO 创建信息
* @return 编号
*/
Integer createEmployeeBigBrother(@Valid EmployeeBigBrotherSaveReqVO createReqVO);
/**
* 更新大哥数据员工业务
*
* @param updateReqVO 更新信息
*/
void updateEmployeeBigBrother(@Valid EmployeeBigBrotherSaveReqVO updateReqVO);
/**
* 删除大哥数据员工业务
*
* @param id 编号
*/
void deleteEmployeeBigBrother(Integer id);
/**
* 批量删除大哥数据员工业务
*
* @param ids 编号
*/
void deleteEmployeeBigBrotherListByIds(List<Integer> ids);
/**
* 获得大哥数据员工业务
*
* @param id 编号
* @return 大哥数据员工业务
*/
EmployeeBigBrotherDO getEmployeeBigBrother(Integer id);
/**
* 获得大哥数据员工业务分页
*
* @param pageReqVO 分页查询
* @return 大哥数据员工业务分页
*/
PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPage(EmployeeBigBrotherPageReqVO pageReqVO);
Boolean allocationEmployeeBigBrother(@Valid List<EmployeeBigBrotherSaveReqVO> createReqVO);
PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPageWithSelf(@Valid EmployeeBigBrotherPageReqVO pageReqVO);
void batchUpdateEmployeeBigBrother(@Valid List<EmployeeBigBrotherSaveReqVO> updateReqVO);
}

View File

@@ -0,0 +1,152 @@
package cn.iocoder.yudao.module.tkdata.service.employeebigbrother;
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherPageReqVO;
import cn.iocoder.yudao.module.tkdata.controller.admin.employeebigbrother.vo.EmployeeBigBrotherSaveReqVO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO;
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO;
import cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother.BigBrotherMapper;
import cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother.EmployeeBigBrotherMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.generator.IFill;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
import static cn.iocoder.yudao.module.tkdata.enums.ErrorCodeConstants.EMPLOYEE_BIG_BROTHER_NOT_EXISTS;
/**
* 大哥数据员工业务 Service 实现类
*
* @author ziin
*/
@Service
@Validated
public class EmployeeBigBrotherServiceImpl implements EmployeeBigBrotherService {
@Resource
private EmployeeBigBrotherMapper employeeBigBrotherMapper;
@Resource
private BigBrotherMapper bigBrotherMapper;
@Override
public Integer createEmployeeBigBrother(EmployeeBigBrotherSaveReqVO createReqVO) {
// 插入
EmployeeBigBrotherDO employeeBigBrother = BeanUtils.toBean(createReqVO, EmployeeBigBrotherDO.class);
employeeBigBrotherMapper.insert(employeeBigBrother);
// 返回
return employeeBigBrother.getId();
}
@Override
public void updateEmployeeBigBrother(EmployeeBigBrotherSaveReqVO updateReqVO) {
// 校验存在
validateEmployeeBigBrotherExists(updateReqVO.getId());
// 更新
EmployeeBigBrotherDO updateObj = BeanUtils.toBean(updateReqVO, EmployeeBigBrotherDO.class);
employeeBigBrotherMapper.updateById(updateObj);
}
@Override
public void deleteEmployeeBigBrother(Integer id) {
// 校验存在
validateEmployeeBigBrotherExists(id);
// 删除
employeeBigBrotherMapper.deleteById(id);
}
@Override
public void deleteEmployeeBigBrotherListByIds(List<Integer> ids) {
// 校验存在
validateEmployeeBigBrotherExists(ids);
// 删除
employeeBigBrotherMapper.deleteByIds(ids);
}
private void validateEmployeeBigBrotherExists(List<Integer> ids) {
List<EmployeeBigBrotherDO> list = employeeBigBrotherMapper.selectByIds(ids);
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
throw exception(EMPLOYEE_BIG_BROTHER_NOT_EXISTS);
}
}
private void validateEmployeeBigBrotherExists(Integer id) {
if (employeeBigBrotherMapper.selectById(id) == null) {
throw exception(EMPLOYEE_BIG_BROTHER_NOT_EXISTS);
}
}
@Override
public EmployeeBigBrotherDO getEmployeeBigBrother(Integer id) {
return employeeBigBrotherMapper.selectById(id);
}
@Override
public PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPage(EmployeeBigBrotherPageReqVO pageReqVO) {
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
IPage<EmployeeBigBrotherDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
IPage<EmployeeBigBrotherDO> bigBrotherDOIPage = employeeBigBrotherMapper.selectPage(iPage, pageReqVO);
return new PageResult<>(bigBrotherDOIPage.getRecords(),bigBrotherDOIPage.getTotal());
}
@Override
public Boolean allocationEmployeeBigBrother(List<EmployeeBigBrotherSaveReqVO> createReqVO) {
ArrayList<EmployeeBigBrotherDO> employeeBigBrotherDOS = new ArrayList<>();
ArrayList<BigBrotherDO> bigBrotherDOS = new ArrayList<>();
for (EmployeeBigBrotherSaveReqVO employeeBigBrotherSaveReqVO : createReqVO) {
BigBrotherDO bigBrotherDO = new BigBrotherDO();
bigBrotherDO.setId(employeeBigBrotherSaveReqVO.getId());
bigBrotherDO.setUserId(employeeBigBrotherSaveReqVO.getUserId());
bigBrotherDO.setIsAssigned(1);
bigBrotherDOS.add(bigBrotherDO);
EmployeeBigBrotherDO employeeBigBrotherDO = BeanUtils.toBean(employeeBigBrotherSaveReqVO, EmployeeBigBrotherDO.class);
employeeBigBrotherDO.setOperationStatus(0);
employeeBigBrotherDO.setId(null);
employeeBigBrotherDOS.add(employeeBigBrotherDO);
}
employeeBigBrotherMapper.insertBatch(employeeBigBrotherDOS);
return bigBrotherMapper.updateBatch(bigBrotherDOS);
}
@Override
public PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPageWithSelf(EmployeeBigBrotherPageReqVO pageReqVO) {
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
if (loginUser!= null){
pageReqVO.setUserId(loginUser.getId());
IPage<EmployeeBigBrotherDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
IPage<EmployeeBigBrotherDO> bigBrotherDOIPage = employeeBigBrotherMapper.selectPagewithSelf(iPage, pageReqVO);
return new PageResult<>(bigBrotherDOIPage.getRecords(),bigBrotherDOIPage.getTotal());
}else{
return null;
}
}
@Override
public void batchUpdateEmployeeBigBrother(List<EmployeeBigBrotherSaveReqVO> updateReqVO) {
ArrayList<EmployeeBigBrotherDO> employeeBigBrotherDOS = new ArrayList<>();
for (EmployeeBigBrotherSaveReqVO employeeBigBrotherSaveReqVO : updateReqVO) {
employeeBigBrotherDOS.add(BeanUtils.toBean(employeeBigBrotherSaveReqVO, EmployeeBigBrotherDO.class));
}
employeeBigBrotherMapper.updateBatch(employeeBigBrotherDOS);
}
}

View File

@@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.tkdata.dal.mysql.bigbrother.BigBrotherMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO">
<!--@mbg.generated-->
<!--@Table server_big_brother-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="display_id" jdbcType="VARCHAR" property="displayId" />
<result column="user_id_str" jdbcType="VARCHAR" property="userIdStr" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="hostcoins" jdbcType="INTEGER" property="hostcoins" />
<result column="follower_count" jdbcType="INTEGER" property="followerCount" />
<result column="following_count" jdbcType="INTEGER" property="followingCount" />
<result column="region" jdbcType="VARCHAR" property="region" />
<result column="historic_high_coins" jdbcType="INTEGER" property="historicHighCoins" />
<result column="total_gift_coins" jdbcType="INTEGER" property="totalGiftCoins" />
<result column="host_display_id" jdbcType="VARCHAR" property="hostDisplayId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="BIGINT" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
</resultMap>
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.bigbrother.BigBrotherDO">
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
sbr.host_display_id,sbr.create_time, sbr.is_assigned from
server_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
where sbr.tenant_id=#{dto.tenantId}
and sbr.deleted = 0
<!-- 大哥所属国家筛选 -->
<if test="dto.region!= '' and dto.region != null">
and ci.country_group_name =#{dto.region,jdbcType=VARCHAR}
</if>
<if test="dto.countryName != null and dto.countryName != ''">
and sbr.region = #{dto.countryName}
</if>
<!-- 大哥入库时间筛选 -->
<if test="dto.createTimeStart != null and dto.createTimeEnd != null">
and sbr.create_time BETWEEN #{dto.createTimeStart,jdbcType=TIMESTAMP} and #{dto.createTimeEnd,jdbcType=TIMESTAMP}
</if>
<!-- 大哥 Id 模糊搜索 -->
<if test="dto.displayId != null and dto.displayId != '' ">
and sbr.display_id like concat(#{dto.displayId,jdbcType=VARCHAR},'%')
</if>
<!-- 大哥打赏金币筛选 -->
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax == null ">
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null ">
and sbr.hostcoins &lt;=#{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥打赏总金币筛选 -->
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
and sbr.total_gift_coins >=#{dto.totalGiftCoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMax != null and dto.totalGiftCoinsMin == null ">
and sbr.total_gift_coins &lt;=#{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax != null " >
and sbr.total_gift_coins between #{dto.totalGiftCoinsMin,jdbcType=INTEGER} and #{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥等级筛选 -->
<if test="dto.levelMin != null and dto.levelMax == null ">
and sbr.level >=#{dto.levelMin,jdbcType=INTEGER}
</if>
<if test="dto.levelMax != null and dto.levelMin == null ">
and sbr.level &lt;=#{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.levelMin != null and dto.levelMax != null " >
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.isAssigned != null">
and sbr.is_assigned =#{dto.isAssigned}
</if>
group by sbr.display_id
order by
<!-- 排序类型 -->
<choose>
<!-- 传空和默认的情况下按照时间降序排序 -->
<when test="dto.sortName == '' or dto.sortName == null">
sbr.create_time desc
</when>
<!-- sortNmae 有值的情况下排序 -->
<when test="dto.sortName != null and dto.sort != null ">
<if test="dto.sortName == 'createTime' and dto.sort != null">
sbr.create_time ${dto.sort}
</if>
<!-- 大哥等级排序 -->
<if test="dto.sortName == 'level' and dto.sort != null">
sbr.level ${dto.sort}
</if>
<!-- 大哥打赏金币排序 -->
<if test="dto.sortName == 'hostsCoins' and dto.sort != null">
sbr.hostcoins ${dto.sort}
</if>
<!-- 大哥打赏总金币排序 -->
<if test="dto.sortName == 'totalGiftCoins' and dto.sort != null">
sbr.total_gift_coins ${dto.sort}
</if>
</when>
</choose>
</select>
</mapper>

View File

@@ -0,0 +1,210 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.tkdata.dal.mysql.employeebigbrother.EmployeeBigBrotherMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO">
<!--@mbg.generated-->
<!--@Table server_big_brother-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="display_id" jdbcType="VARCHAR" property="displayId" />
<result column="user_id_str" jdbcType="VARCHAR" property="userIdStr" />
<result column="nickname" jdbcType="VARCHAR" property="nickname" />
<result column="level" jdbcType="INTEGER" property="level" />
<result column="hostcoins" jdbcType="INTEGER" property="hostcoins" />
<result column="follower_count" jdbcType="INTEGER" property="followerCount" />
<result column="following_count" jdbcType="INTEGER" property="followingCount" />
<result column="region" jdbcType="VARCHAR" property="region" />
<result column="historic_high_coins" jdbcType="INTEGER" property="historicHighCoins" />
<result column="total_gift_coins" jdbcType="INTEGER" property="totalGiftCoins" />
<result column="host_display_id" jdbcType="VARCHAR" property="hostDisplayId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="creator" jdbcType="BIGINT" property="creator" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="deleted" jdbcType="BOOLEAN" property="deleted" />
<result column="operation_status" jdbcType="BOOLEAN" property="operationStatus"/>
</resultMap>
<select id="selectPagewithSelf"
resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO">
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status from
server_employee_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
where sbr.tenant_id=#{dto.tenantId}
and sbr.deleted = 0
and sbr.user_id = #{dto.userId,jdbcType=VARCHAR}
<!-- 大哥所属国家筛选 -->
<if test="dto.region!= '' and dto.region != null">
and ci.country_group_name =#{dto.region,jdbcType=VARCHAR}
</if>
<if test="dto.countryName != null and dto.countryName != ''">
and sbr.region = #{dto.countryName}
</if>
<!-- 大哥入库时间筛选 -->
<if test="dto.createTimeStart != null and dto.createTimeEnd != null">
and sbr.create_time BETWEEN #{dto.createTimeStart,jdbcType=TIMESTAMP} and #{dto.createTimeEnd,jdbcType=TIMESTAMP}
</if>
<!-- 大哥 Id 模糊搜索 -->
<if test="dto.displayId != null and dto.displayId != '' ">
and sbr.display_id like concat(#{dto.displayId,jdbcType=VARCHAR},'%')
</if>
<!-- 大哥打赏金币筛选 -->
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax == null ">
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null ">
and sbr.hostcoins &lt;=#{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥打赏总金币筛选 -->
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
and sbr.total_gift_coins >=#{dto.totalGiftCoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMax != null and dto.totalGiftCoinsMin == null ">
and sbr.total_gift_coins &lt;=#{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax != null " >
and sbr.total_gift_coins between #{dto.totalGiftCoinsMin,jdbcType=INTEGER} and #{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥等级筛选 -->
<if test="dto.levelMin != null and dto.levelMax == null ">
and sbr.level >=#{dto.levelMin,jdbcType=INTEGER}
</if>
<if test="dto.levelMax != null and dto.levelMin == null ">
and sbr.level &lt;=#{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.levelMin != null and dto.levelMax != null " >
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.operationStatus != null">
and sbr.operation_status =#{dto.operationStatus}
</if>
group by sbr.display_id
order by
<!-- 排序类型 -->
<choose>
<!-- 传空和默认的情况下按照时间降序排序 -->
<when test="dto.sortName == '' or dto.sortName == null">
sbr.create_time desc
</when>
<!-- sortNmae 有值的情况下排序 -->
<when test="dto.sortName != null and dto.sort != null ">
<if test="dto.sortName == 'createTime' and dto.sort != null">
sbr.create_time ${dto.sort}
</if>
<!-- 大哥等级排序 -->
<if test="dto.sortName == 'level' and dto.sort != null">
sbr.level ${dto.sort}
</if>
<!-- 大哥打赏金币排序 -->
<if test="dto.sortName == 'hostsCoins' and dto.sort != null">
sbr.hostcoins ${dto.sort}
</if>
<!-- 大哥打赏总金币排序 -->
<if test="dto.sortName == 'totalGiftCoins' and dto.sort != null">
sbr.total_gift_coins ${dto.sort}
</if>
</when>
</choose>
</select>
<select id="selectPage"
resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeebigbrother.EmployeeBigBrotherDO">
select sbr.id, sbr.display_id, sbr.user_id_str,sbr.nickname,sbr.level,sbr.hostcoins,
sbr.follower_count, sbr.following_count, sbr.region, sbr.historic_high_coins, sbr.total_gift_coins,
sbr.host_display_id,sbr.create_time, sbr.user_id, sbr.operation_status from
server_employee_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
where sbr.tenant_id=#{dto.tenantId}
and sbr.deleted = 0
<if test="dto.userId != null" >
and sbr.user_id = #{dto.userId,jdbcType=VARCHAR}
</if>
<!-- 大哥所属国家筛选 -->
<if test="dto.region!= '' and dto.region != null">
and ci.country_group_name =#{dto.region,jdbcType=VARCHAR}
</if>
<if test="dto.countryName != null and dto.countryName != ''">
and sbr.region = #{dto.countryName}
</if>
<!-- 大哥入库时间筛选 -->
<if test="dto.createTimeStart != null and dto.createTimeEnd != null">
and sbr.create_time BETWEEN #{dto.createTimeStart,jdbcType=TIMESTAMP} and #{dto.createTimeEnd,jdbcType=TIMESTAMP}
</if>
<!-- 大哥 Id 模糊搜索 -->
<if test="dto.displayId != null and dto.displayId != '' ">
and sbr.display_id like concat(#{dto.displayId,jdbcType=VARCHAR},'%')
</if>
<!-- 大哥打赏金币筛选 -->
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax == null ">
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null ">
and sbr.hostcoins &lt;=#{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.hostcoinsMin != null and dto.hostcoinsMax != null " >
and sbr.hostcoins between #{dto.hostcoinsMin,jdbcType=INTEGER} and #{dto.hostcoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥打赏总金币筛选 -->
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax == null ">
and sbr.total_gift_coins >=#{dto.totalGiftCoinsMin,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMax != null and dto.totalGiftCoinsMin == null ">
and sbr.total_gift_coins &lt;=#{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<if test="dto.totalGiftCoinsMin != null and dto.totalGiftCoinsMax != null " >
and sbr.total_gift_coins between #{dto.totalGiftCoinsMin,jdbcType=INTEGER} and #{dto.totalGiftCoinsMax,jdbcType=INTEGER}
</if>
<!-- 大哥等级筛选 -->
<if test="dto.levelMin != null and dto.levelMax == null ">
and sbr.level >=#{dto.levelMin,jdbcType=INTEGER}
</if>
<if test="dto.levelMax != null and dto.levelMin == null ">
and sbr.level &lt;=#{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.levelMin != null and dto.levelMax != null " >
and sbr.level between #{dto.levelMin,jdbcType=INTEGER} and #{dto.levelMax,jdbcType=INTEGER}
</if>
<if test="dto.operationStatus != null">
and sbr.operation_status =#{dto.operationStatus}
</if>
group by sbr.display_id
order by
<!-- 排序类型 -->
<choose>
<!-- 传空和默认的情况下按照时间降序排序 -->
<when test="dto.sortName == '' or dto.sortName == null">
sbr.create_time desc
</when>
<!-- sortNmae 有值的情况下排序 -->
<when test="dto.sortName != null and dto.sort != null ">
<if test="dto.sortName == 'createTime' and dto.sort != null">
sbr.create_time ${dto.sort}
</if>
<!-- 大哥等级排序 -->
<if test="dto.sortName == 'level' and dto.sort != null">
sbr.level ${dto.sort}
</if>
<!-- 大哥打赏金币排序 -->
<if test="dto.sortName == 'hostsCoins' and dto.sort != null">
sbr.hostcoins ${dto.sort}
</if>
<!-- 大哥打赏总金币排序 -->
<if test="dto.sortName == 'totalGiftCoins' and dto.sort != null">
sbr.total_gift_coins ${dto.sort}
</if>
</when>
</choose>
</select>
</mapper>