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
21158c3f
Commit
21158c3f
authored
Jan 13, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了动态查询
parent
6d72ff72
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
7 deletions
+32
-7
OpmArticleRepository.java
...rcisoft/business/opmArticle/dao/OpmArticleRepository.java
+1
-1
OpmArticle.java
...va/org/rcisoft/business/opmArticle/entity/OpmArticle.java
+9
-1
OpmArticleServiceImpl.java
...siness/opmArticle/service/impl/OpmArticleServiceImpl.java
+9
-1
OpmArticleMapper.xml
...es/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
+13
-4
No files found.
src/main/java/org/rcisoft/business/opmArticle/dao/OpmArticleRepository.java
View file @
21158c3f
...
...
@@ -25,7 +25,7 @@ public interface OpmArticleRepository extends CyBaseMapper<OpmArticle> {
* 分页查询 OpmArticle
*
*/
IPage
<
OpmArticle
>
queryOpmArticlePaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmArticle
cmsBanner
);
IPage
<
OpmArticle
>
queryOpmArticlePaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
OpmArticle
opmArticle
);
OpmArticle
selectByIdWithUrl
(
String
id
);
...
...
src/main/java/org/rcisoft/business/opmArticle/entity/OpmArticle.java
View file @
21158c3f
...
...
@@ -98,7 +98,7 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
private
String
memSex
;
/**
* 会员头像
* 会员头像
url
*/
@TableField
(
exist
=
false
)
private
String
memAvatar
;
...
...
@@ -165,5 +165,13 @@ public class OpmArticle extends CyIdIncreEntity<OpmArticle> {
*/
@TableField
(
exist
=
false
)
private
String
userId
;
/**
* 当前登录人ID
*/
@TableField
(
exist
=
false
)
private
String
loginUserId
;
}
src/main/java/org/rcisoft/business/opmArticle/service/impl/OpmArticleServiceImpl.java
View file @
21158c3f
...
...
@@ -4,6 +4,7 @@ package org.rcisoft.business.opmArticle.service.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.opmArticle.dao.OpmArticleRepository
;
import
org.rcisoft.business.opmArticle.entity.ArticleCommentVO
;
import
org.rcisoft.business.opmArticle.entity.LikeDTO
;
...
...
@@ -107,7 +108,14 @@ public class OpmArticleServiceImpl extends ServiceImpl<OpmArticleRepository, Opm
@Override
public
IPage
<
OpmArticle
>
findAllByPagination
(
CyPageInfo
<
OpmArticle
>
paginationUtility
,
OpmArticle
opmArticle
){
opmArticle
.
setUserId
(
CyUserUtil
.
getAuthenBusinessId
());
if
(
StringUtils
.
isNotEmpty
(
opmArticle
.
getUserId
())){
//设置查询用户 查询某个人的动态列表
opmArticle
.
setUserId
(
opmArticle
.
getUserId
());
}
if
(
StringUtils
.
isNotEmpty
(
CyUserUtil
.
getAuthenBusinessId
())){
//设置当前登录人id
opmArticle
.
setLoginUserId
(
CyUserUtil
.
getAuthenBusinessId
());
}
IPage
<
OpmArticle
>
result
=
baseMapper
.
queryOpmArticlePaged
(
paginationUtility
,
opmArticle
);
return
result
;
...
...
src/main/resources/mapper/business/opmArticle/mapper/OpmArticleMapper.xml
View file @
21158c3f
...
...
@@ -119,7 +119,7 @@
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
left join opm_user_like opl on opl.article_id = opa.business_id and opl.user_id = #{entity.
u
serId}
left join opm_user_like opl on opl.article_id = opa.business_id and opl.user_id = #{entity.
loginU
serId}
WHERE
opa.del_flag = '0'
<if
test=
"entity.flag !=null and entity.flag != '' "
>
...
...
@@ -143,8 +143,8 @@
<if
test=
"entity.topic !=null and entity.topic != '' "
>
and opt.topic_name like concat('%',#{entity.topic},'%')
</if>
<if
test=
"entity.
createBy !=null and entity.createBy
!= '' "
>
and opa.create_by = #{entity.
createBy
}
<if
test=
"entity.
userId !=null and entity.userId
!= '' "
>
and opa.create_by = #{entity.
userId
}
</if>
<if
test=
"entity.beginTime !=null and entity.beginTime != '' "
>
and opa.create_date
>
= #{entity.beginTime}
...
...
@@ -170,6 +170,14 @@
SELECT
opa.*,
mi.mem_code AS memCode,
mi.mem_sex AS memSex,
mi.mem_birthday AS memBirthday,
mi.mem_max_education AS memMaxEducation,
mi.mem_residence_province AS memResidenceProvince,
mi.mem_residence_city AS memResidenceCity,
mi.mem_career AS memCareer,
mi.mem_nick_name AS memNickName,
oi.url AS memAvatar,
GROUP_CONCAT( DISTINCT pic_urls.url ORDER BY pic_urls.url SEPARATOR ',' ) AS url
FROM
opm_article opa
...
...
@@ -187,10 +195,11 @@
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
LEFT JOIN oss_info oi ON oi.business_id = mi.avatar
WHERE
1 = 1
AND opa.del_flag = '0'
AND opa.business_id =
#{businessId}
AND opa.business_id =
123
GROUP BY
opa.business_id
ORDER BY
...
...
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