83 lines
3.1 KiB
XML
83 lines
3.1 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.AnchorTopMapper">
|
|
<!--// 1-生效 2-过期 3-待生效-->
|
|
<select id="pageAdmin" resultType="com.ruoyi.cai.dto.admin.vo.AnchorTopAdminVo">
|
|
select t1.*,t2.price,
|
|
t3.usercode,t3.nickname,t3.mobile,t3.avatar,t3.gender,t3.age,t3.status,
|
|
t4.status as online_status,
|
|
<![CDATA[
|
|
case when t1.begin_time > now() then 3
|
|
when t1.end_time < now() then 2
|
|
else 1 end as top_status
|
|
]]>
|
|
from cai_anchor_top t1
|
|
left join cai_anchor t2 on t1.user_id = t2.user_id
|
|
left join cai_user t3 on t1.user_id = t3.id
|
|
left join cai_user_online t4 on t1.user_id = t4.user_id
|
|
<where>
|
|
<if test="bo.usercode != null and bo.usercode != ''">
|
|
and t3.usercode = #{bo.usercode}
|
|
</if>
|
|
<if test="bo.nickname != null and bo.nickname != ''">
|
|
and t3.nickname = #{bo.nickname}
|
|
</if>
|
|
<if test="bo.mobile != null and bo.mobile != ''">
|
|
and t3.mobile = #{bo.mobile}
|
|
</if>
|
|
<if test="bo.onlineStatus != null">
|
|
and t4.status = #{bo.onlineStatus}
|
|
</if>
|
|
<if test="bo.startPrice != null and bo.startPrice > 0">
|
|
<![CDATA[
|
|
and t2.price >= #{bo.startPrice}
|
|
]]>
|
|
</if>
|
|
<if test="bo.endPrice != null and bo.endPrice > 0">
|
|
<![CDATA[
|
|
and t2.price <= #{bo.endPrice}
|
|
]]>
|
|
</if>
|
|
<if test="bo.topStatus != null">
|
|
<if test="bo.topStatus == 1">
|
|
<![CDATA[
|
|
and t1.begin_time <= now() and t1.end_time >= now()
|
|
]]>
|
|
</if>
|
|
<if test="bo.topStatus == 2">
|
|
<![CDATA[
|
|
and t1.end_time < now()
|
|
]]>
|
|
</if>
|
|
<if test="bo.topStatus == 3">
|
|
<![CDATA[
|
|
and t1.begin_time > now()
|
|
]]>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
order by t1.sort_by desc
|
|
</select>
|
|
<select id="anchorTop" 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
|
|
join cai_anchor_top t4 on t1.id = t4.user_id
|
|
where t1.status = 0 and t1.is_anchor = 1 and t2.index_display = 1 and t1.usercode > 100
|
|
and t3.status = 1
|
|
<![CDATA[
|
|
and t4.begin_time <= now() and t4.end_time >= now()
|
|
]]>
|
|
order by t4.sort_by desc
|
|
limit #{limit}
|
|
</select>
|
|
|
|
|
|
</mapper>
|