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
711d31cc
Commit
711d31cc
authored
Sep 21, 2023
by
muhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改 查询sql
parent
d99392f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
4 additions
and
20 deletions
+4
-20
ch-dao/src/main/java/com/wwdz/ch/db/dao/FavoritesItemsRelationDao.java
...in/java/com/wwdz/ch/db/dao/FavoritesItemsRelationDao.java
+0
-8
ch-dao/src/main/java/com/wwdz/ch/db/impl/FavoritesItemsRelationDaoImpl.java
...va/com/wwdz/ch/db/impl/FavoritesItemsRelationDaoImpl.java
+0
-5
ch-dao/src/main/java/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.java
...a/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.java
+0
-2
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
...es/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
+3
-4
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/ItemMapper.xml
...o/src/main/resources/com/wwdz/ch/db/mapper/ItemMapper.xml
+1
-1
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/dao/FavoritesItemsRelationDao.java
View file @
711d31cc
...
...
@@ -5,7 +5,6 @@ import com.wwdz.ch.db.domain.FavoritesItemsRelation;
import
com.wwdz.ch.db.dto.FavoritesItemsDto
;
import
java.util.List
;
import
java.util.Map
;
public
interface
FavoritesItemsRelationDao
{
/**
...
...
@@ -131,13 +130,6 @@ public interface FavoritesItemsRelationDao {
*/
long
countByUserId
(
Long
userId
);
/**
* 通过藏品id分组统计记录数量最多的20条记录
*
* @return
*/
List
<
Map
<
String
,
Object
>>
findItemIdByCount
();
/**
* 连表查询获取藏品的图片
*
...
...
ch-dao/src/main/java/com/wwdz/ch/db/impl/FavoritesItemsRelationDaoImpl.java
View file @
711d31cc
...
...
@@ -150,11 +150,6 @@ public class FavoritesItemsRelationDaoImpl implements FavoritesItemsRelationDao
return
favoritesItemsRelationMapper
.
countByExample
(
example
);
}
@Override
public
List
<
Map
<
String
,
Object
>>
findItemIdByCount
()
{
return
favoritesItemsRelationMapper
.
selectItemIdByCount
();
}
@Override
public
List
<
FavoritesItemsDto
>
queryItemImages
(
Long
favoritesId
,
List
<
Long
>
onlyOneselfItemIds
)
{
FavoritesRequestDto
favoritesRequestDto
=
new
FavoritesRequestDto
();
...
...
ch-dao/src/main/java/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.java
View file @
711d31cc
...
...
@@ -54,7 +54,5 @@ public interface FavoritesItemsRelationMapper {
int
updateByExample
(
@Param
(
"record"
)
FavoritesItemsRelation
record
,
@Param
(
"example"
)
FavoritesItemsRelationExample
example
);
List
<
Map
<
String
,
Object
>>
selectItemIdByCount
();
List
<
FavoritesItemsDto
>
selectItemImages
(
FavoritesRequestDto
dto
);
}
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/FavoritesItemsRelationMapper.xml
View file @
711d31cc
...
...
@@ -262,18 +262,17 @@
</if>
limit 1
</select>
<select
id=
"selectItemIdByCount"
resultType=
"java.util.Map"
>
select item_id,count(*) from favorites_items_relation group by item_id order by count(*) limit 20
</select>
<select
id=
"selectItemImages"
parameterType=
"com.wwdz.ch.db.dto.request.FavoritesRequestDto"
resultMap=
"ItemResultMap"
>
select a.item_id,a.add_time,b.images,b.top_image
from favorites_items_relation a left join item b on a.item_id = b.id
where a.favorites_id = ${id}
where a.favorites_id = #{id}
<if
test=
"itemIds != null and itemIds.size() > 0"
>
and a.item_id not in
<foreach
item=
"item"
index=
"index"
collection=
"itemIds"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
order by a.add_time desc
</select>
</mapper>
\ No newline at end of file
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/ItemMapper.xml
View file @
711d31cc
...
...
@@ -719,6 +719,6 @@
limit 1
</select>
<select
id=
"selectOnlyOneselfItems"
parameterType=
"java.lang.Long"
resultType=
"java.lang.Long"
>
select a.id from item a join user_items_relation b on a.id = b.item_id where a.source_type = 2 and a.view_permission = 1 and b.user_id !=
$
{userId}
select a.id from item a join user_items_relation b on a.id = b.item_id where a.source_type = 2 and a.view_permission = 1 and b.user_id !=
#
{userId}
</select>
</mapper>
\ No newline at end of file
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