修改:
1.添加大哥信息查询筛选接口
This commit is contained in:
108
src/main/resources/mapper/ServerBigBrotherMapper.xml
Normal file
108
src/main/resources/mapper/ServerBigBrotherMapper.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?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.ServerBigBrotherMapper">
|
||||
<resultMap id="BaseResultMap" type="com.yupi.springbootinit.model.entity.ServerBigBrother">
|
||||
<!--@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="owner_id" jdbcType="VARCHAR" property="ownerId" />
|
||||
<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>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, display_id, user_id_str, nickname, `level`, hostcoins, follower_count, following_count,
|
||||
region, historic_high_coins, total_gift_coins, host_display_id, owner_id, create_time,
|
||||
update_time, creator, updater, deleted, tenant_id
|
||||
</sql>
|
||||
|
||||
<select id="selectPageByCondition" resultType="com.yupi.springbootinit.model.vo.bigbrother.ServerBigBrotherVO">
|
||||
select * from
|
||||
server_big_brother sbr left join server_country_info ci ON sbr.region = ci.country_name
|
||||
where sbr.tenant_id=#{dto.tenantId}
|
||||
<!-- 主播国家筛选 -->
|
||||
<if test="dto.region!= '' and dto.region != null">
|
||||
and ci.country_group_name =#{dto.region,jdbcType=VARCHAR}
|
||||
</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 dto.hostcoinsMax != '' ">
|
||||
and sbr.hostcoins >=#{dto.hostcoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.hostcoinsMax != null and dto.hostcoinsMin == null and dto.hostcoinsMin !='' ">
|
||||
and sbr.hostcoins <=#{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 dto.totalGiftCoinsMax != ''">
|
||||
and sbr.total_gift_coins >=#{dto.totalGiftCoinsMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.totalGiftCoinsMax != null and dto.totalGiftCoinsMin == null and dto.totalGiftCoinsMin != '' ">
|
||||
and sbr.total_gift_coins <=#{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 dto.levelMax != ''">
|
||||
and sbr.level >=#{dto.levelMin,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="dto.levelMax != null and dto.levelMin == null and dto.levelMin != '' ">
|
||||
and sbr.level <=#{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>
|
||||
<!-- 排序类型 -->
|
||||
order by
|
||||
<choose>
|
||||
<!-- 传空和默认的情况下按照时间降序排序 -->
|
||||
<when test="dto.sortName == '' and 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 == 'historicHighCoins' and dto.sort != null">
|
||||
sbr.historic_high_coins ${dto.sort}
|
||||
</if>
|
||||
<!-- 主播粉丝条件排序 -->
|
||||
<if test="dto.sortName == 'totalGiftCoins' and dto.sort != null">
|
||||
sbr.total_gift_coins ${dto.sort}
|
||||
</if>
|
||||
</when>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user