1.修改查询员工分配大哥的逻辑

This commit is contained in:
2025-07-07 16:00:02 +08:00
parent 9944059525
commit eee82c36fa
3 changed files with 91 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ import org.apache.ibatis.annotations.Param;
@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

@@ -101,7 +101,7 @@ public class EmployeeBigBrotherServiceImpl implements EmployeeBigBrotherService
public PageResult<EmployeeBigBrotherDO> getEmployeeBigBrotherPage(EmployeeBigBrotherPageReqVO pageReqVO) {
pageReqVO.setTenantId(TenantContextHolder.getTenantId());
IPage<EmployeeBigBrotherDO> iPage = new Page<>(pageReqVO.getPageNo(),pageReqVO.getPageSize());
IPage<EmployeeBigBrotherDO> bigBrotherDOIPage = employeeBigBrotherMapper.selectPagewithSelf(iPage, pageReqVO);
IPage<EmployeeBigBrotherDO> bigBrotherDOIPage = employeeBigBrotherMapper.selectPage(iPage, pageReqVO);
return new PageResult<>(bigBrotherDOIPage.getRecords(),bigBrotherDOIPage.getTotal());
}
@@ -118,6 +118,7 @@ public class EmployeeBigBrotherServiceImpl implements EmployeeBigBrotherService
bigBrotherDOS.add(bigBrotherDO);
EmployeeBigBrotherDO employeeBigBrotherDO = BeanUtils.toBean(employeeBigBrotherSaveReqVO, EmployeeBigBrotherDO.class);
employeeBigBrotherDO.setOperationStatus(0);
employeeBigBrotherDO.setId(null);
employeeBigBrotherDOS.add(employeeBigBrotherDO);
}
employeeBigBrotherMapper.insertBatch(employeeBigBrotherDOS);

View File

@@ -119,4 +119,92 @@
</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>