1.批量修改员工主播状态

This commit is contained in:
2025-07-03 20:37:09 +08:00
parent 4f7e0e4576
commit 7bf4b80281
9 changed files with 657 additions and 7 deletions

View File

@@ -0,0 +1,144 @@
<?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="com.yupi.springbootinit.mapper.ServerEmployeeHostsMapper">
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.ServerEmployeeHosts">
<!--@mbg.generated-->
<!--@Table server_employee_hosts-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="hosts_id" jdbcType="VARCHAR" property="hostsId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="hosts_level" jdbcType="VARCHAR" property="hostsLevel" />
<result column="hosts_coins" jdbcType="INTEGER" property="hostsCoins" />
<result column="Invitation_type" jdbcType="INTEGER" property="invitationType" />
<result column="online_fans" jdbcType="INTEGER" property="onlineFans" />
<result column="fans" jdbcType="INTEGER" property="fans" />
<result column="fllowernum" jdbcType="INTEGER" property="fllowernum" />
<result column="yesterday_coins" jdbcType="INTEGER" property="yesterdayCoins" />
<result column="country" jdbcType="VARCHAR" property="country" />
<result column="operation_status" jdbcType="INTEGER" property="operationStatus" />
<result column="hosts_kind" jdbcType="VARCHAR" property="hostsKind" />
<result column="tenant_id" jdbcType="BIGINT" property="tenantId" />
<result column="creator" jdbcType="BIGINT" property="creator" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="updater" jdbcType="VARCHAR" property="updater" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="deleted" jdbcType="TINYINT" property="deleted" />
<result column="remake" jdbcType="VARCHAR" property="remake" />
<result column="uid" jdbcType="VARCHAR" property="uid" />
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, hosts_id, user_id, hosts_level, hosts_coins, Invitation_type, online_fans, fans,
fllowernum, yesterday_coins, country, operation_status, hosts_kind, tenant_id, creator,
create_time, updater, update_time, deleted, remake, `uid`
</sql>
<select id="selectPageByCondition" resultType="com.yupi.springbootinit.model.vo.hosts.ServerEmployeeHostsVO">
select ns.id,hosts_id, hosts_level, hosts_coins, Invitation_type, fans, fllowernum,
yesterday_coins,ns.create_time, country, online_fans,hosts_kind, uid from server_new_hosts ns left join server_country_info ci ON ns.country = ci.country_name
where ns.tenant_id=#{hostInfoDTO.tenantId}
<!-- 主播国家筛选 -->
<if test="hostInfoDTO.country!= '' and hostInfoDTO.country != null">
and ci.country_group_name =#{hostInfoDTO.country,jdbcType=VARCHAR}
</if>
<!-- 按照入库时间筛选主播 -->
<if test="hostInfoDTO.createTime != null">
and DATE(ns.create_time) =#{hostInfoDTO.createTime}
</if>
<!-- 主播 Id 模糊搜索 -->
<if test="hostInfoDTO.hostsId != '' and hostInfoDTO.hostsId != null ">
and ns.hosts_id like concat(#{hostInfoDTO.hostsId,jdbcType=VARCHAR},'%')
</if>
<!-- 今日主播金币筛选 -->
<if test="hostInfoDTO.hostsCoinsMin != null and hostInfoDTO.hostsCoinsMax == null ">
and ns.hosts_coins >=#{hostInfoDTO.hostsCoinsMin,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.hostsCoinsMax != null and hostInfoDTO.hostsCoinsMin == null ">
and ns.hosts_coins &lt;=#{hostInfoDTO.hostsCoinsMax,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.hostsCoinsMin != null and hostInfoDTO.hostsCoinsMax != null " >
and ns.hosts_coins between #{hostInfoDTO.hostsCoinsMin,jdbcType=INTEGER} and #{hostInfoDTO.hostsCoinsMax,jdbcType=INTEGER}
</if>
<!-- 昨日主播金币筛选 -->
<if test="hostInfoDTO.yesterdayCoinsMin != null and hostInfoDTO.yesterdayCoinsMax == null ">
and ns.yesterday_coins >=#{hostInfoDTO.yesterdayCoinsMin,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.yesterdayCoinsMax != null and hostInfoDTO.yesterdayCoinsMin == null ">
and ns.yesterday_coins &lt;=#{hostInfoDTO.yesterdayCoinsMax,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.yesterdayCoinsMin != null and hostInfoDTO.yesterdayCoinsMax != null " >
and ns.yesterday_coins between #{hostInfoDTO.yesterdayCoinsMin,jdbcType=INTEGER} and #{hostInfoDTO.yesterdayCoinsMax,jdbcType=INTEGER}
</if>
<!-- 主播粉丝数筛选-->
<if test="hostInfoDTO.fansMin != null and hostInfoDTO.fansMax == null ">
and ns.fans >=#{hostInfoDTO.fansMin,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.fansMax != null and hostInfoDTO.fansMin == null ">
and ns.fans &lt;=#{hostInfoDTO.fansMax,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.fansMin != null and hostInfoDTO.fansMax != null " >
and ns.fans between #{hostInfoDTO.fansMin,jdbcType=INTEGER} and #{hostInfoDTO.fansMax,jdbcType=INTEGER}
</if>
<!-- 主播关注筛选-->
<if test="hostInfoDTO.fllowernumMin != null and hostInfoDTO.fllowernumMax == null">
and ns.fllowernum >=#{hostInfoDTO.fllowernumMin,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.fllowernumMax != null and hostInfoDTO.fllowernumMin == null">
and ns.fllowernum &lt;=#{hostInfoDTO.fllowernumMax,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.fllowernumMin != null and hostInfoDTO.fllowernumMax != null " >
and ns.fllowernum between #{hostInfoDTO.fllowernumMin,jdbcType=INTEGER} and #{hostInfoDTO.fllowernumMax,jdbcType=INTEGER}
</if>
<!-- 主播在线人数筛选-->
<if test="hostInfoDTO.onlineFansMin != null and hostInfoDTO.onlineFansMax == null ">
and ns.online_fans >=#{hostInfoDTO.onlineFansMin,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.onlineFansMax != null and hostInfoDTO.onlineFansMin == null ">
and ns.online_fans &lt;= #{hostInfoDTO.onlineFansMax,jdbcType=INTEGER}
</if>
<if test="hostInfoDTO.onlineFansMin != null and hostInfoDTO.onlineFansMax != null " >
and ns.online_fans between #{hostInfoDTO.onlineFansMin,jdbcType=INTEGER} and #{hostInfoDTO.onlineFansMax,jdbcType=INTEGER}
</if>
<!-- 邀请类筛选 -->
<if test="hostInfoDTO.invitationType != null">
and ns.Invitation_type =#{hostInfoDTO.invitationType,jdbcType=INTEGER}
</if>
<!-- 排序类型 -->
order by
<choose>
<!-- 传空和默认的情况下按照时间降序排序 -->
<when test="hostInfoDTO.sortName == '' and hostInfoDTO.sortName == null">
ns.create_time desc
</when>
<!-- sortNmae 有值的情况下排序 -->
<when test="hostInfoDTO.sortName != null and hostInfoDTO.sort != null ">
<if test="hostInfoDTO.sortName == 'createTime' and hostInfoDTO.sort != null">
ns.create_time ${hostInfoDTO.sort}
</if>
<!-- 昨日主播金币条件排序 -->
<if test="hostInfoDTO.sortName == 'yesterdayCoins' and hostInfoDTO.sort != null">
ns.yesterday_coins ${hostInfoDTO.sort}
</if>
<!-- 主播金币条件排序 -->
<if test="hostInfoDTO.sortName == 'hostsCoins' and hostInfoDTO.sort != null">
ns.hosts_coins ${hostInfoDTO.sort}
</if>
<!-- 主播粉丝条件排序 -->
<if test="hostInfoDTO.sortName == 'fans' and hostInfoDTO.sort != null">
ns.fans ${hostInfoDTO.sort}
</if>
<!-- 主播关注数量排序 -->
<if test="hostInfoDTO.sortName == 'fllowernum' and hostInfoDTO.sort != null">
ns.fllowernum ${hostInfoDTO.sort}
</if>
<!-- 主播直播间在线数量排序 -->
<if test="hostInfoDTO.sortName == 'onlineFans' and hostInfoDTO.sort != null">
ns.online_fans ${hostInfoDTO.sort}
</if>
</when>
<otherwise>
ns.create_time desc
</otherwise>
</choose>
</select>
</mapper>