Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
81f0dfe3
提交
81f0dfe3
authored
7月 07, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交
上级
861b16d1
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
41 行增加
和
26 行删除
+41
-26
TbCfUserInfoDao.java
...admin/src/main/java/com/platform/dao/TbCfUserInfoDao.java
+2
-0
PostServiceImpl.java
.../main/java/com/platform/service/impl/PostServiceImpl.java
+9
-0
PostDao.xml
...orm-admin/src/main/resources/com/platform/dao/PostDao.xml
+21
-24
TbCfUserInfoDao.xml
...n/src/main/resources/com/platform/dao/TbCfUserInfoDao.xml
+7
-0
common.js
platform-admin/src/main/webapp/js/common.js
+1
-1
hashtag.js
platform-admin/src/main/webapp/js/sys/hashtag.js
+1
-1
没有找到文件。
platform-admin/src/main/java/com/platform/dao/TbCfUserInfoDao.java
浏览文件 @
81f0dfe3
...
...
@@ -18,4 +18,6 @@ public interface TbCfUserInfoDao extends BaseDao<TbCfUserInfoEntity> {
long
queryUserTotal
();
List
<
String
>
getUserIdsByNick
(
String
nick
);
List
<
String
>
getUserIds
(
String
name
);
}
platform-admin/src/main/java/com/platform/service/impl/PostServiceImpl.java
浏览文件 @
81f0dfe3
...
...
@@ -6,6 +6,7 @@ import com.platform.service.PostService;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.ShiroUtils
;
import
com.platform.vo.PostVo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -70,6 +71,14 @@ public class PostServiceImpl implements PostService {
@Override
public
List
<
PostVo
>
queryList
(
Map
<
String
,
Object
>
map
)
{
List
<
PostVo
>
list
=
new
ArrayList
<>();
String
author
=
(
String
)
map
.
get
(
"author"
);
if
(!
StringUtils
.
isBlank
(
author
))
{
map
.
put
(
"ids"
,
tbCfUserInfoDao
.
getUserIds
(
author
));
}
String
topic
=
(
String
)
map
.
get
(
"topic"
);
if
(!
StringUtils
.
isBlank
(
topic
))
{
}
List
<
PostEntity
>
postList
=
postDao
.
queryList
(
map
);
postList
.
forEach
(
post
->
{
String
userType
=
post
.
getUserType
().
toString
();
...
...
platform-admin/src/main/resources/com/platform/dao/PostDao.xml
浏览文件 @
81f0dfe3
...
...
@@ -65,14 +65,14 @@
LEFT JOIN ( SELECT count( 1 ) likes, post_id FROM post_like GROUP BY post_id ) l ON p.id = l.post_id
WHERE 1=1
and p.archived!=0
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<if
test=
"title != null and title.trim() != ''"
>
AND caption LIKE concat('%',#{title},'%')
</if>
<if
test=
"author != null and author.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
AND p.user_id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"topic != null and topic.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
...
...
@@ -93,14 +93,11 @@
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from post
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<if
test=
"title != null and title.trim() != ''"
>
AND caption LIKE concat('%',#{title},'%')
</if>
<if
test=
"author != null and author.trim() != ''"
>
AND
name LIKE concat('%',#{name},'%')
AND
user_id =#{userId}
</if>
<if
test=
"topic != null and topic.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
...
...
@@ -151,22 +148,22 @@
<update
id=
"update"
parameterType=
"com.platform.entity.PostEntity"
>
update post
<set>
<if
test=
"archived != null"
>
`archived` = #{archived},
</if>
<if
test=
"archivedBy != null"
>
`archived_by` = #{archivedBy},
</if>
<if
test=
"archivedDate != null"
>
`archived_date` = #{archivedDate},
</if>
<if
test=
"userType != null"
>
`user_type` = #{userType},
</if>
<if
test=
"createDate != null"
>
`create_date` = #{createDate},
</if>
<if
test=
"createdBy != null"
>
`created_by` = #{createdBy},
</if>
<if
test=
"updateDate != null"
>
`update_date` = #{updateDate},
</if>
<if
test=
"updatedBy != null"
>
`updated_by` = #{updatedBy},
</if>
<if
test=
"version != null"
>
`version` = #{version},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"caption != null"
>
`caption` = #{caption},
</if>
<if
test=
"category != null"
>
`category` = #{category},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"isTop != null"
>
`is_top` = #{isTop},
</if>
<if
test=
"itemIds != null"
>
`item_ids` = #{itemIds},
</if>
<if
test=
"tagIds != null"
>
`tag_ids` = #{tagIds},
</if>
<if
test=
"archived != null"
>
`archived` = #{archived},
</if>
<if
test=
"archivedBy != null"
>
`archived_by` = #{archivedBy},
</if>
<if
test=
"archivedDate != null"
>
`archived_date` = #{archivedDate},
</if>
<if
test=
"userType != null"
>
`user_type` = #{userType},
</if>
<if
test=
"createDate != null"
>
`create_date` = #{createDate},
</if>
<if
test=
"createdBy != null"
>
`created_by` = #{createdBy},
</if>
<if
test=
"updateDate != null"
>
`update_date` = #{updateDate},
</if>
<if
test=
"updatedBy != null"
>
`updated_by` = #{updatedBy},
</if>
<if
test=
"version != null"
>
`version` = #{version},
</if>
<if
test=
"picture != null"
>
`picture` = #{picture},
</if>
<if
test=
"caption != null"
>
`caption` = #{caption},
</if>
<if
test=
"category != null"
>
`category` = #{category},
</if>
<if
test=
"userId != null"
>
`user_id` = #{userId},
</if>
<if
test=
"isTop != null"
>
`is_top` = #{isTop},
</if>
<if
test=
"itemIds != null"
>
`item_ids` = #{itemIds},
</if>
<if
test=
"tagIds != null"
>
`tag_ids` = #{tagIds},
</if>
<if
test=
"title != null"
>
`title` = #{title}
</if>
</set>
where id = #{id}
...
...
platform-admin/src/main/resources/com/platform/dao/TbCfUserInfoDao.xml
浏览文件 @
81f0dfe3
...
...
@@ -96,6 +96,13 @@
<select
id=
"getUserIdsByNick"
resultType=
"string"
>
select user_id from tb_cf_user_info where nick LIKE concat('%',#{name},'%')
</select>
<select
id=
"getUserIds"
resultType=
"string"
>
select user_id from tb_cf_user_info where nick LIKE concat('%',#{name},'%')
UNION
select user_id from sys_user where user_name LIKE concat('%',#{name},'%')
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_cf_user_info
WHERE 1=1
...
...
platform-admin/src/main/webapp/js/common.js
浏览文件 @
81f0dfe3
...
...
@@ -596,7 +596,7 @@ statusFormat = function (cellvalue) {
* @param cellvalue
* @returns {string}
*/
status
1Format
=
function
(
cellvalue
)
{
status
Format1
=
function
(
cellvalue
)
{
return
cellvalue
==
1
?
'正常'
:
'已删除'
;
};
...
...
platform-admin/src/main/webapp/js/sys/hashtag.js
浏览文件 @
81f0dfe3
...
...
@@ -7,7 +7,7 @@ $(function () {
{
label
:
'创建人'
,
name
:
'createdBy'
,
index
:
'created_by'
,
width
:
80
},
{
label
:
'用户ID'
,
name
:
'userId'
,
index
:
'user_id'
,
width
:
80
},
{
label
:
'帖子数量'
,
name
:
'count'
,
index
:
'count'
,
width
:
80
},
{
label
:
'状态'
,
name
:
'archived'
,
index
:
'archived'
,
width
:
80
,
formatter
:
status
1Format
},
{
label
:
'状态'
,
name
:
'archived'
,
index
:
'archived'
,
width
:
80
,
formatter
:
status
Format1
},
{
label
:
'创建时间'
,
name
:
'createDate'
,
index
:
'create_date'
,
width
:
80
}
]
});
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论