feat(resource): 调整查询功能和数据统计
parent
6c7e09065c
commit
ff14025812
|
@ -115,7 +115,8 @@ public class ModelImageLikeServiceImpl extends ServiceImpl<ModelImageLikeMapper,
|
|||
OrderItem orderItem = new OrderItem(pageDomain.getOrderByColumn(), isAsc);
|
||||
page.addOrder(orderItem);
|
||||
|
||||
baseMapper.selectPage(page, null);
|
||||
baseMapper.selectPage(page, new LambdaQueryWrapper<ModelImageLike>()
|
||||
.eq(ModelImageLike::getUserId, SecurityUtils.getUserId()));
|
||||
// 获取分页数据
|
||||
List<ModelImageLike> modelImageList = page.getRecords();
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.mcwl.resource.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
@ -88,7 +89,8 @@ public class ModelLikeServiceImpl extends ServiceImpl<ModelLikeMapper, ModelLike
|
|||
Page<ModelLike> page = initPage(pageDomain);
|
||||
|
||||
|
||||
baseMapper.selectPage(page, null);
|
||||
baseMapper.selectPage(page, new LambdaQueryWrapper<ModelLike>()
|
||||
.eq(ModelLike::getUserId, SecurityUtils.getUserId()));
|
||||
|
||||
List<ModelLike> modelLikeList = page.getRecords();
|
||||
List<ModelLikeVo> modelLikeVoList = new ArrayList<>();
|
||||
|
|
|
@ -95,7 +95,8 @@ public class WorkFlowLikeServiceImpl extends ServiceImpl<WorkFlowLikeMapper, Wor
|
|||
Page<WorkFlowLike> page = initPage(pageDomain);
|
||||
|
||||
|
||||
baseMapper.selectPage(page, null);
|
||||
baseMapper.selectPage(page, new LambdaQueryWrapper<WorkFlowLike>()
|
||||
.eq(WorkFlowLike::getUserId, SecurityUtils.getUserId()));
|
||||
|
||||
List<WorkFlowLike> workFlowLikeList = page.getRecords();
|
||||
List<WorkFlowLikeVo> modelLikeVoList = new ArrayList<>();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</update>
|
||||
|
||||
<select id="sumLikeNumber" resultType="java.lang.Long">
|
||||
SELECT sum(like_num) sum
|
||||
SELECT COALESCE(sum(like_num), 0) sum
|
||||
FROM model_image
|
||||
where user_id = #{userId}
|
||||
ORDER BY(user_id);
|
||||
|
@ -36,7 +36,7 @@
|
|||
</select>
|
||||
|
||||
<select id="sumImageNumber" resultType="java.lang.Long">
|
||||
SELECT count(*)
|
||||
SELECT COALESCE(count(*), 0)
|
||||
FROM model_image
|
||||
where user_id = #{userId}
|
||||
and del_flag = 0
|
||||
|
|
|
@ -75,14 +75,14 @@
|
|||
|
||||
|
||||
<select id="sumNumber" resultType="java.lang.Long">
|
||||
SELECT sum(numbers)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
SELECT COALESCE(sum(numbers), 0) sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
|
||||
<select id="sumLikeNumber" resultType="java.lang.Long">
|
||||
SELECT sum(like_num)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
SELECT COALESCE(sum(like_num), 0) sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
<select id="sumRunNumber" resultType="java.lang.Long">
|
||||
SELECT sum(reals)sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
SELECT COALESCE(sum(reals), 0) sum FROM model where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
<select id="selectAllModelsSortedByTopStatus" resultType="com.mcwl.resource.domain.ModelProduct">
|
||||
SELECT is_top FROM model ORDER BY is_top DESC;
|
||||
|
@ -102,7 +102,7 @@
|
|||
</if>
|
||||
</select>
|
||||
<select id="sumModelNumber" resultType="java.lang.Long">
|
||||
SELECT count(*)
|
||||
SELECT COALESCE(count(*), 0)
|
||||
FROM model
|
||||
where user_id = #{userId}
|
||||
and del_flag = 0
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
</select>
|
||||
|
||||
<select id="selectBean" resultType="java.lang.Long">
|
||||
SELECT count(id) bean FROM sys_user_attention where to_user_id = #{userId} ORDER BY(to_user_id);
|
||||
SELECT COALESCE(count(id), 0) bean FROM sys_user_attention where to_user_id = #{userId} ORDER BY(to_user_id);
|
||||
</select>
|
||||
|
||||
<select id="selectAttentionCount" resultType="java.lang.Long">
|
||||
SELECT count(id)attention FROM sys_user_attention where user_id = #{userId} ORDER BY(user_id);
|
||||
SELECT COALESCE(count(id), 0) attention FROM sys_user_attention where user_id = #{userId} ORDER BY(user_id);
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
</if>
|
||||
</select>
|
||||
<select id="sumWorkFlowNumber" resultType="java.lang.Long">
|
||||
SELECT count(*) sum
|
||||
SELECT COALESCE(count(*), 0) sum
|
||||
FROM work_flow
|
||||
where user_id = #{userId}
|
||||
and del_flag = '0'
|
||||
|
|
Loading…
Reference in New Issue