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
870b8d1b
Commit
870b8d1b
authored
Feb 20, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了app动态查询,增加了黑名单限制
parent
0a549b52
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
8 deletions
+72
-8
OpmArticleRepository.java
...rcisoft/business/opmArticle/dao/OpmArticleRepository.java
+6
-1
OpmArticleServiceImpl.java
...siness/opmArticle/service/impl/OpmArticleServiceImpl.java
+3
-3
OpmArticleMapper.xml
...es/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
+63
-4
No files found.
src/main/java/org/rcisoft/business/opmArticle/dao/OpmArticleRepository.java
View file @
870b8d1b
...
@@ -24,11 +24,16 @@ public interface OpmArticleRepository extends CyBaseMapper<OpmArticle> {
...
@@ -24,11 +24,16 @@ public interface OpmArticleRepository extends CyBaseMapper<OpmArticle> {
List
<
OpmArticle
>
queryOpmArticle
(
@Param
(
"entity"
)
OpmArticle
cmsBanner
);
List
<
OpmArticle
>
queryOpmArticle
(
@Param
(
"entity"
)
OpmArticle
cmsBanner
);
/**
/**
* 分页查询 OpmArticle
*
管理端-
分页查询 OpmArticle
*
*
*/
*/
IPage
<
OpmArticle
>
queryOpmArticlePaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmArticle
opmArticle
);
IPage
<
OpmArticle
>
queryOpmArticlePaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmArticle
opmArticle
);
/**
* app-分页查询 OpmArticle
*
*/
IPage
<
OpmArticle
>
appQueryOpmArticlePaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmArticle
opmArticle
);
OpmArticle
selectArticleDetail
(
@Param
(
"articleId"
)
Integer
articleId
,
@Param
(
"loginUserId"
)
String
loginUserId
);
OpmArticle
selectArticleDetail
(
@Param
(
"articleId"
)
Integer
articleId
,
@Param
(
"loginUserId"
)
String
loginUserId
);
...
...
src/main/java/org/rcisoft/business/opmArticle/service/impl/OpmArticleServiceImpl.java
View file @
870b8d1b
...
@@ -183,15 +183,15 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
...
@@ -183,15 +183,15 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
//关注
//关注
//查询该用户关注对象的id集合
//查询该用户关注对象的id集合
List
<
Integer
>
list
=
memInfoRepository
.
queryFollowIdById
(
CyUserUtil
.
getAuthenBusinessId
());
List
<
Integer
>
list
=
memInfoRepository
.
queryFollowIdById
(
CyUserUtil
.
getAuthenBusinessId
());
opmArticle
.
setFollowList
(
list
);
if
(
list
.
isEmpty
()){
if
(
list
.
isEmpty
()){
result
=
paginationUtility
;
result
=
paginationUtility
;
}
else
{
}
else
{
opmArticle
.
setFollowList
(
list
);
if
(
StringUtils
.
isNotEmpty
(
CyUserUtil
.
getAuthenBusinessId
())){
if
(
StringUtils
.
isNotEmpty
(
CyUserUtil
.
getAuthenBusinessId
())){
//设置当前登录人id 用来查询该用户对文章是否已点赞
//设置当前登录人id 用来查询该用户对文章是否已点赞
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
}
}
result
=
baseMapper
.
q
ueryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
result
=
baseMapper
.
appQ
ueryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
}
}
}
else
{
}
else
{
//话题 最近
//话题 最近
...
@@ -199,7 +199,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
...
@@ -199,7 +199,7 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
//设置当前登录人id 用来查询该用户对文章是否已点赞
//设置当前登录人id 用来查询该用户对文章是否已点赞
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
}
}
result
=
baseMapper
.
q
ueryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
result
=
baseMapper
.
appQ
ueryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
}
}
}
else
{
}
else
{
//管理端
//管理端
...
...
src/main/resources/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
View file @
870b8d1b
...
@@ -121,9 +121,6 @@
...
@@ -121,9 +121,6 @@
mi.mem_wx_code,
mi.mem_wx_code,
mi.business_id AS memberId,
mi.business_id AS memberId,
mi.avatar AS avatarId,
mi.avatar AS avatarId,
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike,
oi.url AS memAvatar,
oi.url AS memAvatar,
GROUP_CONCAT(DISTINCT pic_urls.url ORDER BY pic_urls.url SEPARATOR ',') AS url
GROUP_CONCAT(DISTINCT pic_urls.url ORDER BY pic_urls.url SEPARATOR ',') AS url
FROM
FROM
...
@@ -131,7 +128,6 @@
...
@@ -131,7 +128,6 @@
LEFT JOIN opm_topic opt ON opa.topic_id = opt.business_id
LEFT JOIN opm_topic opt ON opa.topic_id = opt.business_id
LEFT JOIN mem_info mi ON opa.create_by = mi.user_id
LEFT JOIN mem_info mi ON opa.create_by = mi.user_id
LEFT JOIN oss_info oi ON mi.avatar = oi.business_id
LEFT JOIN oss_info oi ON mi.avatar = oi.business_id
LEFT JOIN opm_article_like oal on oal.article_id = opa.business_id and oal.user_id = #{entity.loginUserId}
LEFT JOIN (
LEFT JOIN (
SELECT
SELECT
opm_article.business_id,
opm_article.business_id,
...
@@ -184,6 +180,69 @@
...
@@ -184,6 +180,69 @@
<if
test=
"entity.commentCount !=null and entity.commentCount != '' "
>
<if
test=
"entity.commentCount !=null and entity.commentCount != '' "
>
and opa.comment_count
>
= #{entity.commentCount}
and opa.comment_count
>
= #{entity.commentCount}
</if>
</if>
GROUP BY
opa.business_id
ORDER BY
opa.create_date DESC
</select>
<select
id=
"appQueryOpmArticlePaged"
resultType=
"org.rcisoft.business.opmArticle.entity.OpmArticle"
>
SELECT
opa.business_id,
opa.flag,
opa.del_flag,
opa.comment_count,
opa.like_count,
opa.exam_status,
opa.is_article,
opa.create_date,
opa.content,
opa.create_by AS userId,
opa.picture_id,
opt.topic_name AS topic,
mi.mem_code,
mi.mem_nick_name,
mi.mem_sex,
mi.mem_birthday,
mi.mem_residence_province,
mi.mem_residence_city,
mi.mem_max_education,
mi.mem_career,
mi.mem_wx_code,
mi.business_id AS memberId,
mi.avatar AS avatarId,
CASE
WHEN oal.business_id IS NOT NULL THEN 1 ELSE 0
END AS isLike,
oi.url AS memAvatar,
GROUP_CONCAT(DISTINCT pic_urls.url ORDER BY pic_urls.url SEPARATOR ',') AS url
FROM
opm_article opa
LEFT JOIN opm_topic opt ON opa.topic_id = opt.business_id
LEFT JOIN mem_info mi ON opa.create_by = mi.user_id
LEFT JOIN oss_info oi ON mi.avatar = oi.business_id
LEFT JOIN opm_article_like oal on oal.article_id = opa.business_id and oal.user_id = #{entity.loginUserId}
LEFT JOIN (
SELECT
opm_article.business_id,
CAST(JSON_UNQUOTE(JSON_EXTRACT(picture_id, CONCAT('$.id[', jt_ids.idx - 1, ']'))) AS UNSIGNED) AS picture_id
FROM
opm_article,
JSON_TABLE(JSON_EXTRACT(opm_article.picture_id, '$.id'), '$[*]' COLUMNS (idx FOR ORDINALITY)) AS jt_ids
WHERE
opm_article.del_flag = '0'
) AS pic_ids ON opa.business_id = pic_ids.business_id
LEFT JOIN oss_info pic_urls ON pic_ids.picture_id = pic_urls.business_id
WHERE 1=1
and opa.del_flag = '0'
and opa.flag = '1'
and opa.create_by not in (
select obl.target_id
from opm_black_list obl
where obl.user_id = #{entity.loginUserId}
)
<if
test=
"entity.topicId !=null and entity.topicId != 0 "
>
and opa.topic_id = #{entity.topicId}
</if>
<if
test=
"entity.followList != null and entity.followList.size > 0"
>
<if
test=
"entity.followList != null and entity.followList.size > 0"
>
and opa.create_by IN
and opa.create_by IN
<foreach
item=
"item"
index=
"index"
collection=
"entity.followList"
<foreach
item=
"item"
index=
"index"
collection=
"entity.followList"
...
...
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