1. 添加员工主播备注字段
2. 修改员工主播分页查询方式
This commit is contained in:
@@ -102,7 +102,6 @@ public class EmployeeHostsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/allocation")
|
@PostMapping("/allocation")
|
||||||
@Parameter(name = "hostsList", description = "主播信息List", required = true)
|
|
||||||
@Operation(summary = "批量分配主播给员工")
|
@Operation(summary = "批量分配主播给员工")
|
||||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")
|
@PreAuthorize("@ss.hasPermission('server:employee-hosts:allocation')")
|
||||||
public CommonResult<Integer> deleteNewHostsList(@RequestBody List<EmployeeHostsSaveReqVO> hostsList) {
|
public CommonResult<Integer> deleteNewHostsList(@RequestBody List<EmployeeHostsSaveReqVO> hostsList) {
|
||||||
|
|||||||
@@ -51,5 +51,76 @@ public class EmployeeHostsPageReqVO extends PageParam {
|
|||||||
|
|
||||||
@Schema(description = "数据插入时间")
|
@Schema(description = "数据插入时间")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日金币最大值
|
||||||
|
*/
|
||||||
|
@Schema(description = "昨日金币查询最大值", example = "5000")
|
||||||
|
private Integer yesterdayCoinsMax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 昨日金币最小值
|
||||||
|
*/
|
||||||
|
@Schema(description = "昨日金币查询最小值", example = "500")
|
||||||
|
private Integer yesterdayCoinsMin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关注数量最大值
|
||||||
|
*/
|
||||||
|
@Schema(description = "关注数量查询最大值", example = "1000")
|
||||||
|
private Integer fllowernumMax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关注数量最小值
|
||||||
|
*/
|
||||||
|
@Schema(description = "关注数量查询最小值", example = "100")
|
||||||
|
private Integer fllowernumMin;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝数量最大值
|
||||||
|
*/
|
||||||
|
@Schema(description = "粉丝数量查询最大值", example = "50000")
|
||||||
|
private Integer fansMax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉丝数量最小值
|
||||||
|
*/
|
||||||
|
@Schema(description = "粉丝数量查询最小值", example = "1000")
|
||||||
|
private Integer fansMin;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "在线人数最大值", example = "5000")
|
||||||
|
private Integer onlineFansMax;
|
||||||
|
|
||||||
|
@Schema(description = "在线人数最小值", example = " 10")
|
||||||
|
private Integer onlineFansMin;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播金币最大值
|
||||||
|
*/
|
||||||
|
@Schema(description = "主播金币查询最大值", example = "10000")
|
||||||
|
private Integer hostsCoinsMax;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播金币最小值
|
||||||
|
*/
|
||||||
|
@Schema(description = "主播金币查询最小值", example = "1000")
|
||||||
|
private Integer hostsCoinsMin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序规则
|
||||||
|
*/
|
||||||
|
@Schema(description = "排序方式(asc/desc)", example = "desc")
|
||||||
|
private String sort;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按照何种业务排序
|
||||||
|
*/
|
||||||
|
@Schema(description = "排序字段(createTime/hostsCoins/fans等)", example = "hostsCoins")
|
||||||
|
private String sortName;
|
||||||
|
|
||||||
|
private Long tenantId;
|
||||||
}
|
}
|
||||||
@@ -68,4 +68,6 @@ public class EmployeeHostsRespVO {
|
|||||||
@ExcelProperty("数据插入时间")
|
@ExcelProperty("数据插入时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "1")
|
||||||
|
private String remake;
|
||||||
}
|
}
|
||||||
@@ -49,4 +49,7 @@ public class EmployeeHostsSaveReqVO {
|
|||||||
@Schema(description = "操作状态", example = "1")
|
@Schema(description = "操作状态", example = "1")
|
||||||
private Integer operationStatus;
|
private Integer operationStatus;
|
||||||
|
|
||||||
|
@Schema(description = "备注", example = "1")
|
||||||
|
private String remake;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts;
|
package cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -76,5 +77,5 @@ public class EmployeeHostsDO extends BaseDO {
|
|||||||
*/
|
*/
|
||||||
private Integer operationStatus;
|
private Integer operationStatus;
|
||||||
|
|
||||||
|
private String remake;
|
||||||
}
|
}
|
||||||
@@ -5,9 +5,13 @@ import java.util.*;
|
|||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import cn.iocoder.yudao.module.tkdata.controller.admin.newhosts.vo.NewHostsPageReqVO;
|
||||||
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO;
|
||||||
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工分配主播表,结构和主播表相同,多了user_id 字段来区分所属员工 Mapper
|
* 员工分配主播表,结构和主播表相同,多了user_id 字段来区分所属员工 Mapper
|
||||||
@@ -17,42 +21,42 @@ import cn.iocoder.yudao.module.tkdata.controller.admin.employeehosts.vo.*;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
||||||
|
|
||||||
default PageResult<EmployeeHostsDO> selectPage(EmployeeHostsPageReqVO reqVO) {
|
// default PageResult<EmployeeHostsDO> selectPage(EmployeeHostsPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
|
// return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
|
||||||
.likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
|
// .likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
|
||||||
.eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
// .eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
||||||
.eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
|
// .eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
|
// .betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
|
||||||
.eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
|
// .eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
|
// .betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
|
// .betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
|
// .betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
|
// .betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
|
||||||
.eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
|
// .eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
|
||||||
.likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
|
// .likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
|
||||||
.eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
|
// .eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
|
// .betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.orderByDesc(EmployeeHostsDO::getId));
|
// .orderByDesc(EmployeeHostsDO::getId));
|
||||||
}
|
// }
|
||||||
|
|
||||||
default PageResult<EmployeeHostsDO> selectPageWithSelf(EmployeeHostsPageReqVO reqVO) {
|
// default PageResult<EmployeeHostsDO> selectPageWithSelf(EmployeeHostsPageReqVO reqVO) {
|
||||||
return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
|
// return selectPage(reqVO, new LambdaQueryWrapperX<EmployeeHostsDO>()
|
||||||
.likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
|
// .likeIfPresent(EmployeeHostsDO::getHostsId, reqVO.getHostsId())
|
||||||
.eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
// .eqIfPresent(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
||||||
.eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
|
// .eqIfPresent(EmployeeHostsDO::getHostsLevel, reqVO.getHostsLevel())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
|
// .betweenIfPresent(EmployeeHostsDO::getHostsCoins, reqVO.getHostsCoins())
|
||||||
.eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
|
// .eqIfPresent(EmployeeHostsDO::getInvitationType, reqVO.getInvitationType())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
|
// .betweenIfPresent(EmployeeHostsDO::getOnlineFans, reqVO.getOnlineFans())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
|
// .betweenIfPresent(EmployeeHostsDO::getFans, reqVO.getFans())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
|
// .betweenIfPresent(EmployeeHostsDO::getFllowernum, reqVO.getFllowernum())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
|
// .betweenIfPresent(EmployeeHostsDO::getYesterdayCoins, reqVO.getYesterdayCoins())
|
||||||
.eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
|
// .eqIfPresent(EmployeeHostsDO::getCountry, reqVO.getCountry())
|
||||||
.likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
|
// .likeIfPresent(EmployeeHostsDO::getHostsKind, reqVO.getHostsKind())
|
||||||
.eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
|
// .eqIfPresent(EmployeeHostsDO::getOperationStatus, reqVO.getOperationStatus())
|
||||||
.betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
|
// .betweenIfPresent(EmployeeHostsDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.eq(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
// .eq(EmployeeHostsDO::getUserId, reqVO.getUserId())
|
||||||
.orderByDesc(EmployeeHostsDO::getId));
|
// .orderByDesc(EmployeeHostsDO::getId));
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -60,5 +64,5 @@ public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
|||||||
|
|
||||||
int batchInsertIgnore(List<EmployeeHostsDO> list);
|
int batchInsertIgnore(List<EmployeeHostsDO> list);
|
||||||
|
|
||||||
|
IPage<EmployeeHostsDO> selectPageWithXML(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,11 @@ package cn.iocoder.yudao.module.tkdata.service.employeehosts;
|
|||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||||
|
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||||
|
import cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO;
|
||||||
|
import cn.iocoder.yudao.module.tkdata.dal.mysql.newhosts.NewHostsMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -35,6 +40,9 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
@Resource
|
@Resource
|
||||||
private EmployeeHostsMapper employeeHostsMapper;
|
private EmployeeHostsMapper employeeHostsMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private NewHostsMapper newHostsMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long createEmployeeHosts(EmployeeHostsSaveReqVO createReqVO) {
|
public Long createEmployeeHosts(EmployeeHostsSaveReqVO createReqVO) {
|
||||||
// 插入
|
// 插入
|
||||||
@@ -89,28 +97,41 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<EmployeeHostsDO> getEmployeeHostsPage(EmployeeHostsPageReqVO pageReqVO) {
|
public PageResult<EmployeeHostsDO> getEmployeeHostsPage(EmployeeHostsPageReqVO pageReqVO) {
|
||||||
return employeeHostsMapper.selectPage(pageReqVO);
|
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
|
||||||
|
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
||||||
|
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXML(iPage, pageReqVO);
|
||||||
|
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Integer allocationHostsEmployee(List<EmployeeHostsSaveReqVO> hostsList) {
|
public Integer allocationHostsEmployee(List<EmployeeHostsSaveReqVO> hostsList) {
|
||||||
int count = 0;
|
|
||||||
// for (EmployeeHostsSaveReqVO employeeHostsSaveReqVO : hostsList) {
|
|
||||||
// int i = employeeHostsMapper.insertIgnore();
|
|
||||||
// count += i;
|
|
||||||
// }
|
|
||||||
ArrayList<EmployeeHostsDO> employeeHostsDOS = new ArrayList<>();
|
ArrayList<EmployeeHostsDO> employeeHostsDOS = new ArrayList<>();
|
||||||
|
ArrayList<NewHostsDO> newHostsDOArrayList = new ArrayList<>();
|
||||||
for (EmployeeHostsSaveReqVO employeeHostsSaveReqVO : hostsList) {
|
for (EmployeeHostsSaveReqVO employeeHostsSaveReqVO : hostsList) {
|
||||||
|
NewHostsDO newHostsDO = new NewHostsDO();
|
||||||
|
newHostsDO.setId(employeeHostsSaveReqVO.getId());
|
||||||
|
newHostsDO.setUserId(employeeHostsSaveReqVO.getUserId());
|
||||||
|
newHostsDO.setIsAssigned(1);
|
||||||
|
newHostsDOArrayList.add(newHostsDO);
|
||||||
employeeHostsDOS.add(BeanUtils.toBean(employeeHostsSaveReqVO, EmployeeHostsDO.class));
|
employeeHostsDOS.add(BeanUtils.toBean(employeeHostsSaveReqVO, EmployeeHostsDO.class));
|
||||||
}
|
}
|
||||||
return employeeHostsMapper.batchInsertIgnore(employeeHostsDOS);
|
int i = employeeHostsMapper.batchInsertIgnore(employeeHostsDOS);
|
||||||
|
newHostsMapper.updateBatch(newHostsDOArrayList);
|
||||||
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<EmployeeHostsDO> getEmployeeHostsPageWithSelf(EmployeeHostsPageReqVO pageReqVO) {
|
public PageResult<EmployeeHostsDO> getEmployeeHostsPageWithSelf(EmployeeHostsPageReqVO pageReqVO) {
|
||||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||||
pageReqVO.setUserId(loginUser.getId());
|
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
|
||||||
return employeeHostsMapper.selectPage(pageReqVO);
|
if (loginUser != null) {
|
||||||
|
pageReqVO.setUserId(loginUser.getId());
|
||||||
|
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
||||||
|
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXML(iPage, pageReqVO);
|
||||||
|
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -57,4 +57,121 @@
|
|||||||
#{item.operationStatus}, #{item.hostsKind})
|
#{item.operationStatus}, #{item.hostsKind})
|
||||||
</foreach>
|
</foreach>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||||
|
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
|
||||||
|
yesterday_coins,ns.create_time, country, online_fans,hosts_kind,remake from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||||
|
WHERE tenant_id =#{req.tenantId,jdbcType=BIGINT}
|
||||||
|
and ns.user_id =#{req.userId,jdbcType=BIGINT}
|
||||||
|
<!-- 主播国家筛选 -->
|
||||||
|
<if test="req.country!= '' and req.country != null">
|
||||||
|
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<!-- 按照入库时间筛选主播 -->
|
||||||
|
<if test="req.createTime != null">
|
||||||
|
and DATE(ns.create_time) =#{req.createTime}
|
||||||
|
</if>
|
||||||
|
<!-- 主播 Id 模糊搜索 -->
|
||||||
|
<if test="req.hostsId != '' and req.hostsId != null ">
|
||||||
|
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
||||||
|
</if>
|
||||||
|
|
||||||
|
<!-- 主播等级筛选 -->
|
||||||
|
<if test="req.hostsLevel != null and req.hostsLevel != ''">
|
||||||
|
and ns.hosts_level =#{req.hostsLevel,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<!-- 今日主播金币筛选 -->
|
||||||
|
<if test="req.hostsCoinsMin != null and req.hostsCoinsMax == null and req.hostsCoinsMax != '' ">
|
||||||
|
and ns.hosts_coins >=#{req.hostsCoinsMin,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.hostsCoinsMax != null and req.hostsCoinsMin == null and req.hostsCoinsMin !='' ">
|
||||||
|
and ns.hosts_coins <=#{req.hostsCoinsMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.hostsCoinsMin != null and req.hostsCoinsMax != null " >
|
||||||
|
and ns.hosts_coins between #{req.hostsCoinsMin,jdbcType=INTEGER} and #{req.hostsCoinsMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 昨日主播金币筛选 -->
|
||||||
|
<if test="req.yesterdayCoinsMin != null and req.yesterdayCoinsMax == null and req.yesterdayCoinsMax != ''">
|
||||||
|
and ns.yesterday_coins >=#{req.yesterdayCoinsMin,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.yesterdayCoinsMax != null and req.yesterdayCoinsMin == null and req.yesterdayCoinsMin != '' ">
|
||||||
|
and ns.yesterday_coins <=#{req.yesterdayCoinsMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.yesterdayCoinsMin != null and req.yesterdayCoinsMax != null " >
|
||||||
|
and ns.yesterday_coins between #{req.yesterdayCoinsMin,jdbcType=INTEGER} and #{req.yesterdayCoinsMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 主播粉丝数筛选-->
|
||||||
|
<if test="req.fansMin != null and req.fansMax == null and req.fansMax != ''">
|
||||||
|
and ns.fans >=#{req.fansMin,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.fansMax != null and req.fansMin == null and req.fansMin != '' ">
|
||||||
|
and ns.fans <=#{req.fansMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.fansMin != null and req.fansMax != null " >
|
||||||
|
and ns.fans between #{req.fansMin,jdbcType=INTEGER} and #{req.fansMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 主播关注筛选-->
|
||||||
|
<if test="req.fllowernumMin != null and req.fllowernumMax == null and req.fllowernumMax != ''">
|
||||||
|
and ns.fllowernum >=#{req.fllowernumMin,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.fllowernumMax != null and req.fllowernumMin == null and req.fllowernumMin != ''">
|
||||||
|
and ns.fllowernum <=#{req.fllowernumMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.fllowernumMin != null and req.fllowernumMax != null " >
|
||||||
|
and ns.fllowernum between #{req.fllowernumMin,jdbcType=INTEGER} and #{req.fllowernumMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 主播在线人数筛选-->
|
||||||
|
<if test="req.onlineFansMin != null and req.onlineFansMax == null and req.onlineFansMax != '' ">
|
||||||
|
and ns.online_fans >=#{req.onlineFansMin,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.onlineFansMax != null and req.onlineFansMin == null and req.onlineFansMin != ''">
|
||||||
|
and ns.online_fans <= #{req.onlineFansMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="req.onlineFansMin != null and req.onlineFansMax != null " >
|
||||||
|
and ns.online_fans between #{req.onlineFansMin,jdbcType=INTEGER} and #{req.onlineFansMax,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 邀请类筛选 -->
|
||||||
|
<if test="req.invitationType != null">
|
||||||
|
and ns.Invitation_type =#{req.invitationType,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<!-- 排序类型 -->
|
||||||
|
order by
|
||||||
|
<choose>
|
||||||
|
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||||
|
<when test="req.sortName == '' and req.sortName == null">
|
||||||
|
ns.create_time desc
|
||||||
|
</when>
|
||||||
|
<!-- sortNmae 有值的情况下排序 -->
|
||||||
|
<when test="req.sortName != null and req.sort != null ">
|
||||||
|
<if test="req.sortName == 'createTime' and req.sort != null">
|
||||||
|
ns.create_time ${req.sort}
|
||||||
|
</if>
|
||||||
|
<!-- 昨日主播金币条件排序 -->
|
||||||
|
<if test="req.sortName == 'yesterdayCoins' and req.sort != null">
|
||||||
|
ns.yesterday_coins ${req.sort}
|
||||||
|
</if>
|
||||||
|
<!-- 主播金币条件排序 -->
|
||||||
|
<if test="req.sortName == 'hostsCoins' and req.sort != null">
|
||||||
|
ns.hosts_coins ${req.sort}
|
||||||
|
</if>
|
||||||
|
<!-- 主播粉丝条件排序 -->
|
||||||
|
<if test="req.sortName == 'fans' and req.sort != null">
|
||||||
|
ns.fans ${req.sort}
|
||||||
|
</if>
|
||||||
|
<!-- 主播关注数量排序 -->
|
||||||
|
<if test="req.sortName == 'fllowernum' and req.sort != null">
|
||||||
|
ns.fllowernum ${req.sort}
|
||||||
|
</if>
|
||||||
|
<!-- 主播直播间在线数量排序 -->
|
||||||
|
<if test="req.sortName == 'onlineFans' and req.sort != null">
|
||||||
|
ns.online_fans ${req.sort}
|
||||||
|
</if>
|
||||||
|
</when>
|
||||||
|
<otherwise>
|
||||||
|
ns.create_time desc
|
||||||
|
</otherwise>
|
||||||
|
</choose>
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -12,12 +12,15 @@
|
|||||||
|
|
||||||
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO">
|
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.newhosts.NewHostsDO">
|
||||||
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
|
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
|
||||||
yesterday_coins,ns.create_time, country, online_fans,hosts_kind ,is_assigned from server_new_hosts ns join server_country_info ci ON ns.country = ci.country_name
|
yesterday_coins,ns.create_time, country, online_fans,hosts_kind ,is_assigned from server_new_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||||
WHERE tenant_id =#{req.tenantId,jdbcType=BIGINT}
|
WHERE tenant_id =#{req.tenantId,jdbcType=BIGINT}
|
||||||
<!-- 主播国家筛选 -->
|
<!-- 主播国家筛选 -->
|
||||||
<if test="req.country!= '' and req.country != null">
|
<if test="req.country!= '' and req.country != null">
|
||||||
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
|
and ci.country_group_name =#{req.country,jdbcType=VARCHAR}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="req.userId != null and req.userId != ''" >
|
||||||
|
and ns.user_id =#{req.userId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
<!-- 按照入库时间筛选主播 -->
|
<!-- 按照入库时间筛选主播 -->
|
||||||
<if test="req.createTime != null">
|
<if test="req.createTime != null">
|
||||||
and DATE(ns.create_time) =#{req.createTime}
|
and DATE(ns.create_time) =#{req.createTime}
|
||||||
|
|||||||
Reference in New Issue
Block a user