Commit 3aba73e5 authored by 罗林杰's avatar 罗林杰

修改排行榜

parent 0b3842cf
......@@ -331,4 +331,18 @@ public class AppMemInfoController extends CyPaginationController<MemInfo> {
CyMessCons.MESSAGE_ALERT_ERROR,
likeDTO);
}
/**
* 排行榜
*/
@CyOpeLogAnno(title = "system-会员表管理-查询排行榜", businessType = CyLogTypeEnum.QUERY)
@Operation(summary="分页查询排行榜集合", description="分页查询排行榜集合")
@GetMapping(value = "/open/memInfo/rank")
public CyGridModel rankByPagination(MemInfo memInfo) {
IPage<MemInfo> memInfoIPage = memInfoServiceImpl.findRankByPagination(getPaginationUtility(), memInfo);
for (MemInfo record : memInfoIPage.getRecords()) {
record.setMemWxCode(null);
}
return getGridModelResponse();
}
}
......@@ -117,5 +117,10 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* 点赞
*/
Integer addLike(@Param("entity") MemLikeDTO likeDTO);
/**
* 排行榜
*/
IPage<MemInfo> queryRankPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
}
......@@ -370,6 +370,13 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
@Schema(name = "avatarOpen", description = "是否开放(1是、0否)")
private Integer avatarOpen;
/**
* @desc 被点赞数
* @column mem_liked_count
* @default
*/
private String memLikedCount;
/**
* 开始时间
*/
......
......@@ -98,4 +98,6 @@ public interface MemInfoService {
CyPersistModel deleteFollow(MemFollowDTO followDTO);
CyPersistModel addLike(MemLikeDTO likeDTO);
IPage<MemInfo> findRankByPagination(CyPageInfo<MemInfo> paginationUtility, MemInfo memInfo);
}
......@@ -589,4 +589,15 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
}
return new CyPersistModel(1);
}
/**
* 查询排行榜
* @param memInfo
* @return
*/
@Override
public IPage<MemInfo> findRankByPagination(CyPageInfo<MemInfo> paginationUtility, MemInfo memInfo){
return baseMapper.queryRankPaged(paginationUtility,memInfo);
}
}
......@@ -523,6 +523,25 @@
SELECT MAX(CASE WHEN ouf.business_id IS NOT NULL THEN 1 ELSE 0 END) AS isFollowed
FROM (SELECT 1 AS dummy) d LEFT JOIN opm_user_follow ouf ON ouf.user_id = #{entity.userId} AND ouf.target_id = #{entity.targetId};
</select>
<select id="queryRankPaged" resultType="org.rcisoft.business.memInfo.entity.MemInfo">
select
m.mem_nick_name,
m.mem_liked_count,
m.mem_code,
m.avatar
from mem_info m
where m.del_flag = 0
<if test="entity.memSex !=null and entity.memSex != '' ">
and m.mem_sex = #{entity.memSex}
</if>
<if test="entity.beginTime !=null and entity.beginTime != '' ">
and m.create_date &gt;= #{entity.beginTime}
</if>
<if test="entity.endTime !=null and entity.endTime != '' ">
and m.create_date &lt;= #{entity.endTime}
</if>
order by m.mem_liked_count desc
</select>
<delete id="deleteFollow" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO">
delete from opm_user_follow
where user_id = #{entity.userId} and target_id = #{entity.targetId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment