1.区分员工和管理的查询接口
This commit is contained in:
@@ -81,7 +81,7 @@ public class EmployeeHostsController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得员工分配主播分页")
|
@Operation(summary = "管理获得员工分配主播分页")
|
||||||
@PreAuthorize("@ss.hasPermission('server:employee-hosts:query')")
|
@PreAuthorize("@ss.hasPermission('server:employee-hosts:query')")
|
||||||
public CommonResult<PageResult<EmployeeHostsRespVO>> getEmployeeHostsPage(@Valid EmployeeHostsPageReqVO pageReqVO) {
|
public CommonResult<PageResult<EmployeeHostsRespVO>> getEmployeeHostsPage(@Valid EmployeeHostsPageReqVO pageReqVO) {
|
||||||
PageResult<EmployeeHostsDO> pageResult = employeeHostsService.getEmployeeHostsPage(pageReqVO);
|
PageResult<EmployeeHostsDO> pageResult = employeeHostsService.getEmployeeHostsPage(pageReqVO);
|
||||||
|
|||||||
@@ -64,5 +64,7 @@ public interface EmployeeHostsMapper extends BaseMapperX<EmployeeHostsDO> {
|
|||||||
|
|
||||||
int batchInsertIgnore(List<EmployeeHostsDO> list);
|
int batchInsertIgnore(List<EmployeeHostsDO> list);
|
||||||
|
|
||||||
|
IPage<EmployeeHostsDO> selectPageWithXMLWithSelf(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
||||||
|
|
||||||
IPage<EmployeeHostsDO> selectPageWithXML(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
IPage<EmployeeHostsDO> selectPageWithXML(IPage<EmployeeHostsDO> page, @Param("req") EmployeeHostsPageReqVO reqVO);
|
||||||
}
|
}
|
||||||
@@ -130,7 +130,7 @@ public class EmployeeHostsServiceImpl implements EmployeeHostsService {
|
|||||||
if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
pageReqVO.setUserId(loginUser.getId());
|
pageReqVO.setUserId(loginUser.getId());
|
||||||
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
IPage<EmployeeHostsDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
|
||||||
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXML(iPage, pageReqVO);
|
IPage<EmployeeHostsDO> newHostsDOIPage = employeeHostsMapper.selectPageWithXMLWithSelf(iPage, pageReqVO);
|
||||||
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
return new PageResult<>(newHostsDOIPage.getRecords(),newHostsDOIPage.getTotal());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectPageWithXML" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
<select id="selectPageWithXMLWithSelf" resultType="cn.iocoder.yudao.module.tkdata.dal.dataobject.employeehosts.EmployeeHostsDO">
|
||||||
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,remake ,operation_status from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
yesterday_coins,ns.create_time, country, online_fans,hosts_kind,remake ,operation_status from server_employee_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}
|
||||||
@@ -73,6 +73,9 @@
|
|||||||
<if test="req.createTime != null">
|
<if test="req.createTime != null">
|
||||||
and DATE(ns.create_time) =#{req.createTime}
|
and DATE(ns.create_time) =#{req.createTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="req.operationStatus != null">
|
||||||
|
and operation_status =#{req.operationStatus,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
<!-- 主播 Id 模糊搜索 -->
|
<!-- 主播 Id 模糊搜索 -->
|
||||||
<if test="req.hostsId != '' and req.hostsId != null ">
|
<if test="req.hostsId != '' and req.hostsId != null ">
|
||||||
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
and ns.hosts_id like concat(#{req.hostsId,jdbcType=VARCHAR},'%')
|
||||||
@@ -174,4 +177,124 @@
|
|||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<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 ,operation_status,user_id from server_employee_hosts ns left join server_country_info ci ON ns.country = ci.country_name
|
||||||
|
WHERE tenant_id = #{req.tenantId,jdbcType=BIGINT}
|
||||||
|
<!-- 筛选员工名下主播 -->
|
||||||
|
<if test="req.userId != null and req.userId != ''">
|
||||||
|
and user_id = #{req.userId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<!-- 主播国家筛选 -->
|
||||||
|
<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>
|
||||||
|
<if test="req.operationStatus != null">
|
||||||
|
and operation_status =#{req.operationStatus,jdbcType=INTEGER}
|
||||||
|
</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>
|
||||||
Reference in New Issue
Block a user