146 lines
6.0 KiB
XML
146 lines
6.0 KiB
XML
<?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.ruoyi.cai.mapper.AnchorMapper">
|
|
|
|
<resultMap type="com.ruoyi.cai.domain.Anchor" id="CaiAnchorResult">
|
|
<result property="id" column="id"/>
|
|
<result property="userId" column="user_id"/>
|
|
<result property="openVideoStatus" column="open_video_status"/>
|
|
<result property="videoStatus" column="video_status"/>
|
|
<result property="orderSwitch" column="order_switch"/>
|
|
<result property="indexDisplay" column="index_display"/>
|
|
<result property="giveScore" column="give_score"/>
|
|
<result property="serviceCount" column="service_count"/>
|
|
<result property="serviceTime" column="service_time"/>
|
|
<result property="videoRate" column="video_rate"/>
|
|
<result property="giftRate" column="gift_rate"/>
|
|
<result property="recommendStatus" column="recommend_status"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="status" column="status"/>
|
|
</resultMap>
|
|
<update id="incsServiceTimeAndCount">
|
|
update cai_anchor
|
|
set service_count = service_count + #{count},
|
|
service_time = service_time + #{callTime}
|
|
where user_id = #{toUid}
|
|
</update>
|
|
<select id="pageAdmin" resultType="com.ruoyi.cai.dto.admin.vo.AnchorAdminVo">
|
|
select
|
|
t1.*,t2.age,t2.avatar,t2.usercode,t2.nickname,t2.mobile,t2.gender,t2.age,t2.city,
|
|
t3.status as online_status
|
|
from cai_anchor t1
|
|
left join cai_user t2 on t1.user_id = t2.id
|
|
left join cai_user_online t3 on t1.user_id = t3.user_id
|
|
<where>
|
|
<if test="bo.mobile != null and bo.mobile != ''">
|
|
and t2.mobile = #{bo.mobile}
|
|
</if>
|
|
<if test="bo.usercode != null and bo.usercode != ''">
|
|
and t2.usercode = #{bo.usercode}
|
|
</if>
|
|
<if test="bo.onlineStatus != null">
|
|
and t3.status = #{bo.onlineStatus}
|
|
</if>
|
|
<if test="bo.startPrice != null and bo.startPrice > 0">
|
|
<![CDATA[
|
|
and t1.price >= #{bo.startPrice}
|
|
]]>
|
|
</if>
|
|
<if test="bo.endPrice != null and bo.endPrice > 0">
|
|
<![CDATA[
|
|
and t1.price <= #{bo.endPrice}
|
|
]]>
|
|
</if>
|
|
</where>
|
|
order by t1.create_time desc
|
|
</select>
|
|
<select id="pageApp" resultType="com.ruoyi.cai.dto.app.vo.AnchorListVo">
|
|
select t1.id as user_id,t1.avatar,t1.gender,t1.city,t1.nickname,t1.usercode,t1.city_id,t1.city,t2.give_score,
|
|
t2.price,t3.status as online
|
|
from cai_user t1
|
|
join cai_anchor t2 on t1.id = t2.user_id
|
|
join cai_user_online t3 on t1.id = t3.user_id
|
|
where t1.status = 0 and t1.is_anchor = 1 and t2.index_display = 1 and t1.usercode > 100
|
|
<if test="query.cityId != null and query.cityId != ''">
|
|
and t1.city_id = #{query.cityId}
|
|
</if>
|
|
<if test="query.cityId != null and query.cityId != ''">
|
|
and t1.city_id = #{query.cityId}
|
|
</if>
|
|
<if test="query.onlineStatus != null">
|
|
and t3.status = #{query.onlineStatus}
|
|
</if>
|
|
<if test="query.openVideoStatus != null">
|
|
and t2.open_video_status = #{query.openVideoStatus}
|
|
</if>
|
|
<if test="query.type != null">
|
|
<if test="query.type == 0">
|
|
order by t2.recommend_status desc,t2.update_time desc
|
|
</if>
|
|
<if test="query.type == 1">
|
|
order by t3.last_live_time desc,t2.recommend_status desc
|
|
</if>
|
|
<if test="query.type == 2">
|
|
order by t1.create_time desc, t2.recommend_status desc
|
|
</if>
|
|
</if>
|
|
</select>
|
|
<select id="pageAppV2" resultType="com.ruoyi.cai.dto.app.vo.AnchorListVo">
|
|
select t1.id as user_id,t1.avatar,t1.gender,t1.city,t1.nickname,t1.usercode,t1.city_id,t1.city,t2.give_score,
|
|
t2.price,t3.status as online
|
|
from cai_user t1
|
|
join cai_anchor t2 on t1.id = t2.user_id
|
|
join cai_user_online t3 on t1.id = t3.user_id
|
|
where t1.status = 0 and t1.is_anchor = 1 and t2.index_display = 1 and t1.usercode > 100
|
|
<if test="query.cityId != null and query.cityId != ''">
|
|
and t1.city_id = #{query.cityId}
|
|
</if>
|
|
<if test="query.cityId != null and query.cityId != ''">
|
|
and t1.city_id = #{query.cityId}
|
|
</if>
|
|
<if test="query.onlineStatus != null">
|
|
and t3.status = #{query.onlineStatus}
|
|
</if>
|
|
<if test="query.openVideoStatus != null">
|
|
and t2.open_video_status = #{query.openVideoStatus}
|
|
</if>
|
|
<if test="!query.hiddenStatusUser">
|
|
and t2.hidden_status = 0
|
|
</if>
|
|
<if test="query.type != null">
|
|
<if test="query.type == 0">
|
|
order by t2.top_show_rank desc
|
|
</if>
|
|
<if test="query.type == 1">
|
|
order by t2.top_show_rank desc
|
|
</if>
|
|
<if test="query.type == 2">
|
|
order by t2.top_show_rank desc
|
|
</if>
|
|
<if test="query.type == 3">
|
|
order by t2.top_show_rank desc
|
|
</if>
|
|
</if>
|
|
</select>
|
|
<select id="anchorStatus" resultType="com.ruoyi.cai.dto.app.vo.anchor.AnchorStatusDTO">
|
|
select
|
|
t1.user_id,t1.id as anchor_id,
|
|
case
|
|
when t1.open_video_status = 1 and t1.video_status = 0 and t2.status = 1 then 1
|
|
when t1.video_status = 1 then 2
|
|
when t1.open_video_status = 0 then 3
|
|
ELSE 0
|
|
end as anchor_status
|
|
from cai_anchor t1
|
|
left join cai_user_online t2 on t1.user_id = t2.user_id
|
|
where t1.user_id in
|
|
<foreach collection="userList" separator="," open="(" close=")" item="value">
|
|
#{value}
|
|
</foreach>
|
|
</select>
|
|
|
|
|
|
</mapper>
|