Commit 1f9e0d86 authored by gaoyingwei's avatar gaoyingwei

Merge remote-tracking branch 'origin/master' into master

parents e33fb70c 7df1a7a4
...@@ -31,6 +31,21 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> { ...@@ -31,6 +31,21 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
*/ */
IPage<MemInfo> queryMemInfosPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo); IPage<MemInfo> queryMemInfosPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
/**
* 查询我喜欢的会员列表
*/
IPage<MemInfo> queryMeFollowPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
/**
* 查询喜欢我的会员列表
*/
IPage<MemInfo> queryFollowMePaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
/**
* 查询互相喜欢的会员列表
*/
IPage<MemInfo> queryEachFollowPaged(CyPageInfo cyPageInfo,@Param("entity") MemInfo memInfo);
/** /**
* 根据roleKey查询角色 * 根据roleKey查询角色
* @param roleKey * @param roleKey
......
...@@ -547,16 +547,25 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> { ...@@ -547,16 +547,25 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
/** /**
* 我喜欢的数量 * 我喜欢的数量
*/ */
@TableField(exist = false)
private Integer meFollowCount; private Integer meFollowCount;
/** /**
* 喜欢我的数量 * 喜欢我的数量
*/ */
@TableField(exist = false)
private Integer followMeCount; private Integer followMeCount;
/** /**
* 互相喜欢的数量 * 互相喜欢的数量
*/ */
@TableField(exist = false)
private Integer eachFollowCount; private Integer eachFollowCount;
/**
* 查询类型 1:我喜欢的 2:喜欢我的 3:互相喜欢的
*/
@TableField(exist = false)
private String queryType;
} }
...@@ -241,6 +241,20 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo> ...@@ -241,6 +241,20 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if (StringUtils.isNotEmpty(loginUserId)){ if (StringUtils.isNotEmpty(loginUserId)){
memInfo.setLoginUserId(Integer.valueOf(loginUserId)); memInfo.setLoginUserId(Integer.valueOf(loginUserId));
} }
//查询我喜欢的 喜欢我的 互相喜欢的会员列表(应用于小程序端-我的)
if (StringUtils.isNotEmpty(memInfo.getQueryType())){
if (memInfo.getQueryType().equals("1")){
//我喜欢的
return baseMapper.queryMeFollowPaged(paginationUtility,memInfo);
} else if(memInfo.getQueryType().equals("2")){
//喜欢我的
return baseMapper.queryFollowMePaged(paginationUtility,memInfo);
} else if(memInfo.getQueryType().equals("3")){
//互相喜欢的
return baseMapper.queryEachFollowPaged(paginationUtility,memInfo);
}
}
//查询会员表集合
return baseMapper.queryMemInfosPaged(paginationUtility,memInfo); return baseMapper.queryMemInfosPaged(paginationUtility,memInfo);
} }
......
...@@ -560,6 +560,30 @@ ...@@ -560,6 +560,30 @@
a.user_id = #{userId} a.user_id = #{userId}
</select> </select>
<select id="queryMeFollowPaged" resultType="org.rcisoft.business.memInfo.entity.MemInfo">
SELECT mi.*
FROM opm_user_follow ouf
LEFT JOIN sys_user su ON su.business_id = ouf.target_id
LEFT JOIN mem_info mi ON mi.user_id = su.business_id
WHERE 1=1
and ouf.user_id = #{entity.loginUserId}
</select>
<select id="queryFollowMePaged" resultType="org.rcisoft.business.memInfo.entity.MemInfo">
SELECT mi.*
FROM opm_user_follow ouf
LEFT JOIN sys_user su ON su.business_id = ouf.user_id
LEFT JOIN mem_info mi ON mi.user_id = su.business_id
WHERE 1=1
and ouf.target_id = #{entity.loginUserId}
</select>
<select id="queryEachFollowPaged" resultType="org.rcisoft.business.memInfo.entity.MemInfo">
SELECT mi.*
FROM opm_user_follow a
LEFT JOIN opm_user_follow b ON a.user_id = b.target_id and a.target_id = b.user_id
LEFT JOIN mem_info mi ON mi.user_id = b.user_id
WHERE 1=1
and b.target_id = #{entity.loginUserId}
</select>
<delete id="deleteFollow" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO"> <delete id="deleteFollow" parameterType="org.rcisoft.business.memInfo.entity.MemFollowDTO">
delete from opm_user_follow delete from opm_user_follow
where user_id = #{entity.userId} and target_id = #{entity.targetId} 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