Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
b6e3ab8f
Commit
b6e3ab8f
authored
Dec 01, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户商品关联表删除,直接用商品表记录用户id
parent
83b3e878
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/ItemDaoImpl.java
ch-dao/src/main/java/com/wwdz/ch/db/impl/ItemDaoImpl.java
+9
-0
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/impl/ItemDaoImpl.java
View file @
b6e3ab8f
...
@@ -24,6 +24,9 @@ public class ItemDaoImpl implements ItemDao {
...
@@ -24,6 +24,9 @@ public class ItemDaoImpl implements ItemDao {
//商品来源是中国,所对应的编码
//商品来源是中国,所对应的编码
private
final
static
List
<
Integer
>
CHINESE_SOURCE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
,
7
,
8
,
10
,
11
,
1000
,
2000
);
private
final
static
List
<
Integer
>
CHINESE_SOURCE_LIST
=
Arrays
.
asList
(
1
,
2
,
3
,
7
,
8
,
10
,
11
,
1000
,
2000
);
//用户上传的商品source=1000
private
final
static
int
SOURCE_BY_USER
=
1000
;
@Autowired
@Autowired
ItemMapper
itemMapper
;
ItemMapper
itemMapper
;
...
@@ -398,12 +401,16 @@ public class ItemDaoImpl implements ItemDao {
...
@@ -398,12 +401,16 @@ public class ItemDaoImpl implements ItemDao {
return
updateById
(
item
)
>
0
;
return
updateById
(
item
)
>
0
;
}
}
//--------------------------承接原来用户发布商品关联表--------------------------//
@Override
@Override
public
List
<
UserItemsRelation
>
listByUserIds
(
Long
userId
,
List
<
Long
>
userIds
)
{
public
List
<
UserItemsRelation
>
listByUserIds
(
Long
userId
,
List
<
Long
>
userIds
)
{
ItemExample
example
=
new
ItemExample
();
ItemExample
example
=
new
ItemExample
();
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
JdbcHelper
.
ifPresent
(
userId
,
criteria
::
andUserIdEqualTo
);
JdbcHelper
.
ifPresent
(
userId
,
criteria
::
andUserIdEqualTo
);
JdbcHelper
.
ifPresent
(
userIds
,
criteria
::
andUserIdIn
);
JdbcHelper
.
ifPresent
(
userIds
,
criteria
::
andUserIdIn
);
criteria
.
andSourceEqualTo
(
SOURCE_BY_USER
);
List
<
Item
>
items
=
itemMapper
.
selectByExample
(
example
);
List
<
Item
>
items
=
itemMapper
.
selectByExample
(
example
);
return
convertList
(
items
);
return
convertList
(
items
);
}
}
...
@@ -414,6 +421,7 @@ public class ItemDaoImpl implements ItemDao {
...
@@ -414,6 +421,7 @@ public class ItemDaoImpl implements ItemDao {
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdEqualTo
(
itemId
);
criteria
.
andIdEqualTo
(
itemId
);
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andUserIdEqualTo
(
userId
);
criteria
.
andSourceEqualTo
(
SOURCE_BY_USER
);
return
itemMapper
.
countByExample
(
example
)
>
0
;
return
itemMapper
.
countByExample
(
example
)
>
0
;
}
}
...
@@ -422,6 +430,7 @@ public class ItemDaoImpl implements ItemDao {
...
@@ -422,6 +430,7 @@ public class ItemDaoImpl implements ItemDao {
ItemExample
example
=
new
ItemExample
();
ItemExample
example
=
new
ItemExample
();
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
ItemExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIdEqualTo
(
itemId
);
criteria
.
andIdEqualTo
(
itemId
);
criteria
.
andSourceEqualTo
(
SOURCE_BY_USER
);
Item
item
=
itemMapper
.
selectOneByExample
(
example
);
Item
item
=
itemMapper
.
selectOneByExample
(
example
);
return
convert
(
item
);
return
convert
(
item
);
}
}
...
...
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