Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
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
西魏
cms_sys
Commits
6346898c
Commit
6346898c
authored
Sep 03, 2020
by
luoxj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文章伪删除
parent
ce8319ed
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
10 deletions
+31
-10
5.0.0-to-5.1-mysql.sql
doc/5.0.0-to-5.1-mysql.sql
+0
-0
mcms-5.1.sql
doc/mcms-5.1.sql
+0
-0
CategoryBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
+6
-1
IContentDao.java
src/main/java/net/mingsoft/cms/dao/IContentDao.java
+7
-0
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+18
-9
No files found.
doc/5.0.0-to-5.1-mysql.sql
View file @
6346898c
This diff is collapsed.
Click to expand it.
doc/mcms-5.1.sql
View file @
6346898c
This diff is collapsed.
Click to expand it.
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
View file @
6346898c
...
...
@@ -27,6 +27,7 @@ import net.mingsoft.base.dao.IBaseDao;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.dao.ICategoryDao
;
import
net.mingsoft.cms.dao.IContentDao
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.basic.util.PinYinUtil
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -48,6 +49,9 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz {
@Autowired
private
ICategoryDao
categoryDao
;
@Autowired
private
IContentDao
contentDao
;
@Override
protected
IBaseDao
getDao
()
{
...
...
@@ -157,7 +161,8 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz {
ids
[
i
]
=
Integer
.
parseInt
(
childrenList
.
get
(
i
).
getId
());
}
categoryDao
.
delete
(
ids
);
deleteEntity
(
categoryId
);
// 删除文章
contentDao
.
deleteEntityByCategoryIds
(
ids
);
}
}
}
src/main/java/net/mingsoft/cms/dao/IContentDao.java
View file @
6346898c
...
...
@@ -34,4 +34,10 @@ public interface IContentDao extends IBaseDao {
*/
int
getSearchCount
(
@Param
(
"tableName"
)
String
tableName
,
@Param
(
"diyList"
)
List
diyList
,
@Param
(
"map"
)
Map
<
String
,
Object
>
map
,
@Param
(
"websiteId"
)
int
websiteId
,
@Param
(
"ids"
)
String
ids
);
/**
* 分类编号删除文章
* @param ids
*/
void
deleteEntityByCategoryIds
(
@Param
(
"ids"
)
int
[]
ids
);
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
6346898c
...
...
@@ -159,13 +159,14 @@
<!--根据id获取-->
<select
id=
"getEntity"
resultMap=
"resultMap"
parameterType=
"int"
>
select * from cms_content where id=#{id}
select * from cms_content where id=#{id}
and del=0
</select>
<!--根据实体获取-->
<select
id=
"getByEntity"
resultMap=
"resultMap"
parameterType=
"net.mingsoft.cms.entity.ContentEntity"
>
select * from cms_content
<where>
del=0
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT('%',#{contentTitle},'%')
</if>
<if
test=
"contentCategoryId != null and contentCategoryId != ''"
>
and content_category_id=#{contentCategoryId}
</if>
<if
test=
"contentType != null and contentType != ''"
>
and content_type=#{contentType}
</if>
...
...
@@ -185,7 +186,6 @@
<if
test=
"createDate != null"
>
and create_date=#{createDate}
</if>
<if
test=
"updateBy > 0"
>
and update_by=#{updateBy}
</if>
<if
test=
"updateDate != null"
>
and update_date=#{updateDate}
</if>
<if
test=
"del != null"
>
and del=#{del}
</if>
</where>
limit 0,1
</select>
...
...
@@ -193,12 +193,21 @@
<!--删除-->
<delete
id=
"deleteEntity"
parameterType=
"int"
>
delete from cms_content where id=#{id}
update cms_content set del=1 where id=#{id}
</delete>
<!--删除-->
<delete
id=
"deleteEntityByCategoryIds"
>
update cms_content set del=1
<where>
content_category_id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</where>
</delete>
<!--批量删除-->
<delete
id=
"delete"
>
delete from cms_content
update cms_content set del=1
<where>
id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
...
...
@@ -206,7 +215,7 @@
</delete>
<!--查询全部-->
<select
id=
"queryAll"
resultMap=
"resultMap"
>
select * from cms_content order by id desc
select * from cms_content
where del=0
order by id desc
</select>
<!--条件查询-->
<select
id=
"query"
resultMap=
"resultContentMap"
>
...
...
@@ -214,6 +223,7 @@
select ct.*,cc.category_path from cms_content ct
join cms_category cc on ct.content_category_id=cc.id
<where>
ct.del=0
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT('%',#{contentTitle},'%')
</if>
<if
test=
"contentCategoryId != null and contentCategoryId != ''"
>
and content_category_id=#{contentCategoryId}
</if>
<if
test=
"contentType != null and contentType != ''"
>
and content_type LIKE CONCAT('%',#{contentType},'%')
</if>
...
...
@@ -233,7 +243,6 @@
<if
test=
"createDate != null"
>
and ct.create_date=#{createDate}
</if>
<if
test=
"updateBy > 0"
>
and ct.update_by=#{updateBy}
</if>
<if
test=
"updateDate != null"
>
and update_date=#{updateDate}
</if>
<if
test=
"del != null"
>
and ct.del=#{del}
</if>
</where>
)ct ORDER BY date_format(ct.content_datetime,'%Y-%m-%d') desc,content_sort desc
</select>
...
...
@@ -254,9 +263,9 @@
cms_content.id article_id,c.*
FROM cms_content
LEFT JOIN cms_category c ON content_category_id = c.id
where
where
del=0
<if
test=
"appId > 0"
>
cms_content.app_id = #{appId}
and
cms_content.app_id = #{appId}
</if>
<!-- 查询子栏目数据 -->
<if
test=
"contentCategoryId > 0"
>
...
...
@@ -302,7 +311,7 @@
<if
test=
"tableName!=null and tableName!='' and diyMap!=null"
>
left join ${tableName} d on d.link_id=a.id
</if>
<where>
a.app_id = #{websiteId}
a.
del=0 and a.
app_id = #{websiteId}
<if
test=
"ids!=null and ids!=''"
>
and FIND_IN_SET(content_category_id,#{ids})
</if>
...
...
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