init
This commit is contained in:
@@ -22,17 +22,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="sort" column="sort"/>
|
||||
</resultMap>
|
||||
<select id="pageApp" resultType="com.ruoyi.xq.dto.app.dynamic.DynamicListVo">
|
||||
select t1.id, t1.content, t1.user_id,t1.create_time,
|
||||
t2.avatar, t2.nickname, t2.birthday, t2.gender, t2.residence_city, t2.education,
|
||||
t2.profession
|
||||
select t1.id, t1.content, t1.user_id,t1.create_time as create_time,
|
||||
t2.avatar, t2.nickname, t2.birthday, t2.gender, t2.residence_city_name, t2.education,
|
||||
t2.profession,ifnull(count(t3.id),0) as star_num
|
||||
from xq_dynamic t1
|
||||
join xq_user t2 on t1.user_id = t2.id
|
||||
left join xq_dynamic_star t3 on t1.id = t3.dynamic_id
|
||||
where t1.audit_status = 2 and t2.status = 0
|
||||
<where>
|
||||
<if test="query.gender != null">
|
||||
and t2.gender = #{query.gender}
|
||||
</if>
|
||||
<if test="query.birthdayBegin != null">
|
||||
and t2.birthday >= #{query.birthdayBegin}
|
||||
</if>
|
||||
<if test="query.birthdayEnd != null">
|
||||
<![CDATA[
|
||||
and t2.birthday <= #{query.birthdayEnd}
|
||||
]]>
|
||||
</if>
|
||||
<if test="query.residenceCode != null and query.residenceCode != ''">
|
||||
and t1.residence_code like concat(#{query.residenceCode},'%')
|
||||
</if>
|
||||
</where>
|
||||
group by t1.id
|
||||
<choose>
|
||||
<when test="query.sortBy != null and query.sortBy == 2">
|
||||
order by star_num desc
|
||||
</when>
|
||||
<otherwise>
|
||||
order by create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
<select id="pageAdmin" resultType="com.ruoyi.xq.dto.admin.dynamic.DynamicAdminVo">
|
||||
select t1.*, t2.nickname, t2.mobile,t2.avatar
|
||||
|
||||
28
ruoyi-xq/src/main/resources/mapper/xq/DynamicStarMapper.xml
Normal file
28
ruoyi-xq/src/main/resources/mapper/xq/DynamicStarMapper.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?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.xq.mapper.DynamicStarMapper">
|
||||
|
||||
<resultMap type="com.ruoyi.xq.domain.DynamicStar" id="DynamicStarResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="starUserId" column="star_user_id"/>
|
||||
<result property="starUsercode" column="star_usercode"/>
|
||||
<result property="dynamicId" column="dynamic_id"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
<select id="myStarDynamic" resultType="com.ruoyi.xq.dto.app.dynamic.MyStarDynamicListVO">
|
||||
select
|
||||
t3.id as star_user_id, t3.usercode as star_usercode,
|
||||
t3.nickname as star_nickname, t3.avatar as star_avatar,
|
||||
t1.dynamic_id, t1.create_time
|
||||
from xq_dynamic_star t1
|
||||
join xq_dynamic t2 on t1.dynamic_id = t2.id
|
||||
join xq_user t3 on t1.star_user_id = t3.id
|
||||
where t2.audit_status = 2 and t2.user_id = #{query.userId}
|
||||
order by t1.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and t1.education = #{params.education}
|
||||
</if>
|
||||
<if test="params.residenceCode != null and params.residenceCode != ''">
|
||||
and t1.education like concat(#{params.residenceCode},'%')
|
||||
and t1.residence_code like concat(#{params.residenceCode},'%')
|
||||
</if>
|
||||
<if test="params.vipQuery != null">
|
||||
<if test="params.vipQuery.profession != null and params.vipQuery.profession != ''">
|
||||
|
||||
Reference in New Issue
Block a user