Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
68295482
Commit
68295482
authored
May 16, 2018
by
Junling Bu
Browse files
update[litemall-db]: 基于mybatis generator的逻辑删除插件来进行删除操作。
parent
653cf50f
Changes
20
Hide whitespace changes
Inline
Side-by-side
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdService.java
View file @
68295482
...
...
@@ -57,12 +57,7 @@ public class LitemallAdService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallAd
ad
=
adMapper
.
selectByPrimaryKey
(
id
);
if
(
ad
==
null
){
return
;
}
ad
.
setDeleted
(
true
);
adMapper
.
updateByPrimaryKey
(
ad
);
adMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallAd
ad
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAddressService.java
View file @
68295482
...
...
@@ -34,12 +34,7 @@ public class LitemallAddressService {
}
public
void
delete
(
Integer
id
)
{
LitemallAddress
address
=
addressMapper
.
selectByPrimaryKey
(
id
);
if
(
address
==
null
){
return
;
}
address
.
setDeleted
(
true
);
addressMapper
.
updateByPrimaryKey
(
address
);
addressMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
LitemallAddress
findDefault
(
Integer
userId
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallAdminService.java
View file @
68295482
...
...
@@ -53,12 +53,7 @@ public class LitemallAdminService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallAdmin
admin
=
adminMapper
.
selectByPrimaryKey
(
id
);
if
(
admin
==
null
){
return
;
}
admin
.
setDeleted
(
true
);
adminMapper
.
updateByPrimaryKey
(
admin
);
adminMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallAdmin
admin
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallBrandService.java
View file @
68295482
...
...
@@ -75,12 +75,7 @@ public class LitemallBrandService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallBrand
brand
=
brandMapper
.
selectByPrimaryKey
(
id
);
if
(
brand
==
null
){
return
;
}
brand
.
setDeleted
(
true
);
brandMapper
.
updateByPrimaryKey
(
brand
);
brandMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallBrand
brand
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCartService.java
View file @
68295482
...
...
@@ -50,9 +50,7 @@ public class LitemallCartService {
public
int
delete
(
List
<
Integer
>
productIdList
,
int
userId
)
{
LitemallCartExample
example
=
new
LitemallCartExample
();
example
.
or
().
andUserIdEqualTo
(
userId
).
andProductIdIn
(
productIdList
);
LitemallCart
cart
=
new
LitemallCart
();
cart
.
setDeleted
(
true
);
return
cartMapper
.
updateByExampleSelective
(
cart
,
example
);
return
cartMapper
.
logicalDeleteByExample
(
example
);
}
public
LitemallCart
findById
(
Integer
id
)
{
...
...
@@ -107,11 +105,6 @@ public class LitemallCartService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallCart
cart
=
cartMapper
.
selectByPrimaryKey
(
id
);
if
(
cart
==
null
){
return
;
}
cart
.
setDeleted
(
true
);
cartMapper
.
updateByPrimaryKey
(
cart
);
cartMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
}
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCategoryService.java
View file @
68295482
...
...
@@ -87,12 +87,7 @@ public class LitemallCategoryService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallCategory
category
=
categoryMapper
.
selectByPrimaryKey
(
id
);
if
(
category
==
null
){
return
;
}
category
.
setDeleted
(
true
);
categoryMapper
.
updateByPrimaryKey
(
category
);
categoryMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallCategory
category
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCollectService.java
View file @
68295482
...
...
@@ -42,12 +42,7 @@ public class LitemallCollectService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallCollect
collect
=
collectMapper
.
selectByPrimaryKey
(
id
);
if
(
collect
==
null
){
return
;
}
collect
.
setDeleted
(
true
);
collectMapper
.
updateByPrimaryKey
(
collect
);
collectMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
int
add
(
LitemallCollect
collect
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallCommentService.java
View file @
68295482
...
...
@@ -107,12 +107,7 @@ public class LitemallCommentService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallComment
comment
=
commentMapper
.
selectByPrimaryKey
(
id
);
if
(
comment
==
null
){
return
;
}
comment
.
setDeleted
(
true
);
commentMapper
.
updateByPrimaryKey
(
comment
);
commentMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallComment
comment
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallFootprintService.java
View file @
68295482
...
...
@@ -34,12 +34,7 @@ public class LitemallFootprintService {
}
public
void
deleteById
(
Integer
id
){
LitemallFootprint
footprint
=
footprintMapper
.
selectByPrimaryKey
(
id
);
if
(
footprint
==
null
){
return
;
}
footprint
.
setDeleted
(
true
);
footprintMapper
.
updateByPrimaryKey
(
footprint
);
footprintMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallFootprint
footprint
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGoodsAttributeService.java
View file @
68295482
...
...
@@ -50,12 +50,7 @@ public class LitemallGoodsAttributeService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallGoodsAttribute
goodsAttribute
=
goodsAttributeMapper
.
selectByPrimaryKey
(
id
);
if
(
goodsAttribute
==
null
){
return
;
}
goodsAttribute
.
setDeleted
(
true
);
goodsAttributeMapper
.
updateByPrimaryKey
(
goodsAttribute
);
goodsAttributeMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallGoodsAttribute
goodsAttribute
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGoodsService.java
View file @
68295482
...
...
@@ -169,12 +169,7 @@ public class LitemallGoodsService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallGoods
goods
=
goodsMapper
.
selectByPrimaryKey
(
id
);
if
(
goods
==
null
){
return
;
}
goods
.
setDeleted
(
true
);
goodsMapper
.
updateByPrimaryKeySelective
(
goods
);
goodsMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallGoods
goods
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallGoodsSpecificationService.java
View file @
68295482
...
...
@@ -57,12 +57,7 @@ public class LitemallGoodsSpecificationService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallGoodsSpecification
goodsSpecification
=
goodsSpecificationMapper
.
selectByPrimaryKey
(
id
);
if
(
goodsSpecification
==
null
){
return
;
}
goodsSpecification
.
setDeleted
(
true
);
goodsSpecificationMapper
.
updateByPrimaryKey
(
goodsSpecification
);
goodsSpecificationMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallGoodsSpecification
goodsSpecification
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallIssueService.java
View file @
68295482
...
...
@@ -22,12 +22,7 @@ public class LitemallIssueService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallIssue
issue
=
issueMapper
.
selectByPrimaryKey
(
id
);
if
(
issue
==
null
){
return
;
}
issue
.
setDeleted
(
true
);
issueMapper
.
updateByPrimaryKey
(
issue
);
issueMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallIssue
issue
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallKeywordService.java
View file @
68295482
...
...
@@ -86,11 +86,6 @@ public class LitemallKeywordService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallKeyword
keywords
=
keywordsMapper
.
selectByPrimaryKey
(
id
);
if
(
keywords
==
null
){
return
;
}
keywords
.
setDeleted
(
true
);
keywordsMapper
.
updateByPrimaryKey
(
keywords
);
keywordsMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
}
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallOrderService.java
View file @
68295482
...
...
@@ -136,12 +136,7 @@ public class LitemallOrderService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallOrder
order
=
orderMapper
.
selectByPrimaryKey
(
id
);
if
(
order
==
null
){
return
;
}
order
.
setDeleted
(
true
);
orderMapper
.
updateByPrimaryKey
(
order
);
orderMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
int
count
()
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallProductService.java
View file @
68295482
...
...
@@ -54,12 +54,7 @@ public class LitemallProductService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallProduct
product
=
productMapper
.
selectByPrimaryKey
(
id
);
if
(
product
==
null
){
return
;
}
product
.
setDeleted
(
true
);
productMapper
.
updateByPrimaryKey
(
product
);
productMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallProduct
product
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallSearchHistoryService.java
View file @
68295482
...
...
@@ -29,9 +29,7 @@ public class LitemallSearchHistoryService {
public
void
deleteByUid
(
int
uid
)
{
LitemallSearchHistoryExample
example
=
new
LitemallSearchHistoryExample
();
example
.
or
().
andUserIdEqualTo
(
uid
);
LitemallSearchHistory
searchHistory
=
new
LitemallSearchHistory
();
searchHistory
.
setDeleted
(
true
);
searchHistoryMapper
.
updateByExampleSelective
(
searchHistory
,
example
);
searchHistoryMapper
.
logicalDeleteByExample
(
example
);
}
public
void
deleteById
(
Integer
id
)
{
...
...
@@ -40,7 +38,7 @@ public class LitemallSearchHistoryService {
return
;
}
searchHistory
.
setDeleted
(
true
);
searchHistoryMapper
.
upda
teByPrimaryKey
(
searchHistory
);
searchHistoryMapper
.
logicalDele
teByPrimaryKey
(
id
);
}
public
void
add
(
LitemallSearchHistory
searchHistory
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallStorageService.java
View file @
68295482
...
...
@@ -18,9 +18,7 @@ public class LitemallStorageService {
public
void
deleteByKey
(
String
key
)
{
LitemallStorageExample
example
=
new
LitemallStorageExample
();
example
.
or
().
andKeyEqualTo
(
key
);
LitemallStorage
storage
=
new
LitemallStorage
();
storage
.
setDeleted
(
true
);
storageMapper
.
updateByExampleSelective
(
storage
,
example
);
storageMapper
.
logicalDeleteByExample
(
example
);
}
public
void
add
(
LitemallStorage
storageInfo
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallTopicService.java
View file @
68295482
...
...
@@ -92,12 +92,7 @@ public class LitemallTopicService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallTopic
topic
=
topicMapper
.
selectByPrimaryKey
(
id
);
if
(
topic
==
null
){
return
;
}
topic
.
setDeleted
(
true
);
topicMapper
.
updateByPrimaryKeySelective
(
topic
);
topicMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
public
void
add
(
LitemallTopic
topic
)
{
...
...
litemall-db/src/main/java/org/linlinjava/litemall/db/service/LitemallUserService.java
View file @
68295482
...
...
@@ -83,11 +83,6 @@ public class LitemallUserService {
}
public
void
deleteById
(
Integer
id
)
{
LitemallUser
user
=
userMapper
.
selectByPrimaryKey
(
id
);
if
(
user
==
null
){
return
;
}
user
.
setDeleted
(
true
);
userMapper
.
updateByPrimaryKey
(
user
);
userMapper
.
logicalDeleteByPrimaryKey
(
id
);
}
}
Write
Preview
Supports
Markdown
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