Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
a2cb28a7
Commit
a2cb28a7
authored
Feb 21, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新博客和问题里面的字查询
parent
f6d16496
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
55 deletions
+21
-55
src/main/java/cn/meteor/beyondclouds/modules/blog/mapper/xml/BlogMapper.xml
+10
-26
src/main/java/cn/meteor/beyondclouds/modules/question/mapper/xml/QuestionMapper.xml
+10
-28
src/main/resources/application.yml
+1
-1
No files found.
src/main/java/cn/meteor/beyondclouds/modules/blog/mapper/xml/BlogMapper.xml
View file @
a2cb28a7
...
@@ -20,27 +20,21 @@
...
@@ -20,27 +20,21 @@
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<collection
property=
"tags"
ofType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
>
<collection
property=
"tags"
ofType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
column=
"blog_id"
select=
"selectTags"
>
<id
property=
"tagId"
column=
"tag_id"
/>
<result
property=
"tagName"
column=
"tag_name"
/>
<result
property=
"tagType"
column=
"tag_type"
/>
<result
property=
"referenceCount"
column=
"reference_count"
/>
</collection>
</collection>
</resultMap>
</resultMap>
<select
id=
"selectTags"
resultType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
>
select t.*
from tag t, blog_tag bt
where bt.tag_id = t.tag_id
and bt.blog_id = #{blogId}
</select>
<select
id=
"selectPageWithTags"
resultMap=
"blogWithTagsResultMap"
>
<select
id=
"selectPageWithTags"
resultMap=
"blogWithTagsResultMap"
>
select
select
b.*,
b.*
t.tag_id,
t.tag_name,
t.tag_type,
t.create_time,
t.update_time
from blog b
from blog b
left join blog_tag bt
on b.blog_id = bt.blog_id
left join tag t
on t.tag_id = bt.tag_id
<if
test=
"ew != null and ew.customSqlSegment != null"
>
<if
test=
"ew != null and ew.customSqlSegment != null"
>
${ew.customSqlSegment}
${ew.customSqlSegment}
</if>
</if>
...
@@ -49,18 +43,8 @@
...
@@ -49,18 +43,8 @@
<select
id=
"listByIdsWithTags"
resultMap=
"blogWithTagsResultMap"
>
<select
id=
"listByIdsWithTags"
resultMap=
"blogWithTagsResultMap"
>
select
select
b.*,
b.*
t.tag_id,
t.tag_name,
t.tag_type,
t.reference_count,
t.create_time,
t.update_time
from blog b
from blog b
left join blog_tag bt
on b.blog_id = bt.blog_id
left join tag t
on t.tag_id = bt.tag_id
where b.blog_id in
where b.blog_id in
<foreach
collection=
"blogIds"
item=
"blogId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"blogIds"
item=
"blogId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{blogId}
#{blogId}
...
...
src/main/java/cn/meteor/beyondclouds/modules/question/mapper/xml/QuestionMapper.xml
View file @
a2cb28a7
...
@@ -16,28 +16,21 @@
...
@@ -16,28 +16,21 @@
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<collection
property=
"tags"
ofType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
>
<collection
property=
"tags"
ofType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
column=
"question_id"
select=
"selectTags"
>
<id
property=
"tagId"
column=
"tag_id"
/>
<result
property=
"tagName"
column=
"tag_name"
/>
<result
property=
"tagType"
column=
"tag_type"
/>
<result
property=
"referenceCount"
column=
"reference_count"
/>
</collection>
</collection>
</resultMap>
</resultMap>
<select
id=
"selectTags"
resultType=
"cn.meteor.beyondclouds.modules.tag.entity.Tag"
>
select t.*
from tag t, question_tag qt
where qt.tag_id = t.tag_id
and qt.question_id = #{questionId}
</select>
<select
id=
"selectPageWithTags"
resultMap=
"blogWithTagsResultMap"
>
<select
id=
"selectPageWithTags"
resultMap=
"blogWithTagsResultMap"
>
select
select
q.*,
q.*
t.tag_id,
t.tag_name,
t.tag_type,
t.reference_count,
t.create_time,
t.update_time
from question q
from question q
left join question_tag qt
on q.question_id = qt.question_id
left join tag t
on t.tag_id = qt.tag_id
<if
test=
"ew != null and ew.customSqlSegment != null"
>
<if
test=
"ew != null and ew.customSqlSegment != null"
>
${ew.customSqlSegment}
${ew.customSqlSegment}
</if>
</if>
...
@@ -45,18 +38,7 @@
...
@@ -45,18 +38,7 @@
<select
id=
"listByIdsWithTags"
resultMap=
"blogWithTagsResultMap"
>
<select
id=
"listByIdsWithTags"
resultMap=
"blogWithTagsResultMap"
>
select
select
q.*,
q.*
t.tag_id,
t.tag_name,
t.tag_type,
t.reference_count,
t.create_time,
t.update_time
from question q
left join question_tag qt
on q.question_id = qt.question_id
left join tag t
on t.tag_id = qt.tag_id
where q.question_id in
where q.question_id in
<foreach
collection=
"questionIds"
item=
"questionId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"questionIds"
item=
"questionId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{questionId}
#{questionId}
...
...
src/main/resources/application.yml
View file @
a2cb28a7
...
@@ -4,7 +4,7 @@ spring:
...
@@ -4,7 +4,7 @@ spring:
driver-class-name
:
com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://127.0.0.1:3306/beyond_clouds?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2B8
username
:
root
username
:
root
password
:
2018006709
password
:
100Centa30821%mysql
# 邮箱
# 邮箱
mail
:
mail
:
...
...
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