Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李伟
cust-api
Commits
bc9e1526
Commit
bc9e1526
authored
Jan 22, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了会员详情接口,查询出了我喜欢的,喜欢我的,互相喜欢的三种数量
parent
3442a933
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
1 deletion
+42
-1
MemInfoRepository.java
...a/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
+6
-0
MemFollowDTO.java
...ava/org/rcisoft/business/memInfo/entity/MemFollowDTO.java
+2
-0
MemInfo.java
...ain/java/org/rcisoft/business/memInfo/entity/MemInfo.java
+15
-0
MemInfoServiceImpl.java
...oft/business/memInfo/service/impl/MemInfoServiceImpl.java
+8
-1
MemInfoMapper.xml
...esources/mapper/business/memInfo/mapper/MemInfoMapper.xml
+11
-0
No files found.
src/main/java/org/rcisoft/business/memInfo/dao/MemInfoRepository.java
View file @
bc9e1526
...
@@ -141,5 +141,11 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
...
@@ -141,5 +141,11 @@ public interface MemInfoRepository extends CyBaseMapper<MemInfo> {
* 排行榜
* 排行榜
*/
*/
IPage
<
MemInfo
>
queryRankPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
MemInfo
memInfo
);
IPage
<
MemInfo
>
queryRankPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
MemInfo
memInfo
);
/**
* 查询我喜欢的 喜欢我的 互相喜欢的数量
*/
MemInfo
selectUserFollowCount
(
Integer
userId
);
}
}
src/main/java/org/rcisoft/business/memInfo/entity/MemFollowDTO.java
View file @
bc9e1526
...
@@ -5,6 +5,8 @@ import lombok.Data;
...
@@ -5,6 +5,8 @@ import lombok.Data;
@Data
@Data
public
class
MemFollowDTO
{
public
class
MemFollowDTO
{
private
Integer
businessId
;
private
Integer
userId
;
private
Integer
userId
;
private
Integer
targetId
;
private
Integer
targetId
;
...
...
src/main/java/org/rcisoft/business/memInfo/entity/MemInfo.java
View file @
bc9e1526
...
@@ -543,5 +543,20 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
...
@@ -543,5 +543,20 @@ public class MemInfo extends CyIdIncreEntity<MemInfo> {
*/
*/
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
Integer
loginUserId
;
private
Integer
loginUserId
;
/**
* 我喜欢的数量
*/
private
Integer
meFollowCount
;
/**
* 喜欢我的数量
*/
private
Integer
followMeCount
;
/**
* 互相喜欢的数量
*/
private
Integer
eachFollowCount
;
}
}
src/main/java/org/rcisoft/business/memInfo/service/impl/MemInfoServiceImpl.java
View file @
bc9e1526
...
@@ -214,7 +214,14 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
...
@@ -214,7 +214,14 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
*/
*/
@Override
@Override
public
MemInfo
findById
(
int
id
){
public
MemInfo
findById
(
int
id
){
return
baseMapper
.
selectDetailById
(
id
);
//查询基本信息
MemInfo
memInfo
=
baseMapper
.
selectDetailById
(
id
);
//查询我喜欢的 喜欢我的 互相喜欢的数量
MemInfo
memInfo1
=
baseMapper
.
selectUserFollowCount
(
memInfo
.
getUserId
());
memInfo
.
setFollowMeCount
(
memInfo1
.
getFollowMeCount
());
memInfo
.
setMeFollowCount
(
memInfo1
.
getMeFollowCount
());
memInfo
.
setEachFollowCount
(
memInfo1
.
getEachFollowCount
());
return
memInfo
;
}
}
/**
/**
...
...
src/main/resources/mapper/business/memInfo/mapper/MemInfoMapper.xml
View file @
bc9e1526
...
@@ -548,7 +548,18 @@
...
@@ -548,7 +548,18 @@
<select
id=
"queryFollowIdById"
resultType=
"java.lang.Integer"
>
<select
id=
"queryFollowIdById"
resultType=
"java.lang.Integer"
>
select ouf.target_id from opm_user_follow ouf WHERE ouf.user_id = #{userId}
select ouf.target_id from opm_user_follow ouf WHERE ouf.user_id = #{userId}
</select>
</select>
<select
id=
"selectUserFollowCount"
resultType=
"org.rcisoft.business.memInfo.entity.MemInfo"
>
SELECT
( SELECT COUNT( business_id ) FROM opm_user_follow WHERE user_id = #{userId} ) AS meFollowCount,
( SELECT COUNT( business_id ) FROM opm_user_follow WHERE target_id = #{userId} ) AS followMeCount,
COUNT( b.business_id ) AS eachFollowCount
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
WHERE
a.user_id = #{userId}
</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}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment