Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
base
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gyy
base
Commits
d3a585c2
Commit
d3a585c2
authored
Apr 21, 2022
by
HanChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加 数据库连接 示例
parent
83ce353d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
14 deletions
+55
-14
client-resume-server/pom.xml
+8
-7
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/dao/ResumeMapper.java
+7
-0
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/entity/ResumePO.java
+12
-0
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/service/impl/ResumeServiceImpl.java
+6
-1
client-resume-server/src/main/resources/application-dev.yml
+11
-6
client-resume-server/src/main/resources/mapper/ResumeMapper.xml
+11
-0
No files found.
client-resume-server/pom.xml
View file @
d3a585c2
...
...
@@ -32,16 +32,16 @@
<!-- MyBatis-Plus -->
<dependency>
<groupId>
com.baomidou
</groupId>
<artifactId>
mybatis-plus-
extension
</artifactId>
<artifactId>
mybatis-plus-
boot-starter
</artifactId>
<version>
${mybatis-plus.version}
</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>--
>
<!-- <artifactId>mysql-connector-java</artifactId>--
>
<!-- <scope>runtime</scope>--
>
<!-- </dependency>--
>
<!-- --
>
<dependency
>
<groupId>
mysql
</groupId
>
<artifactId>
mysql-connector-java
</artifactId
>
<scope>
runtime
</scope
>
</dependency
>
</dependencies>
</project>
\ No newline at end of file
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/dao/ResumeMapper.java
View file @
d3a585c2
package
com
.
gzicloud
.
industry
.
client
.
resume
.
dao
;
import
com.gzicloud.industry.client.resume.entity.ResumePO
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
ResumeMapper
{
ResumePO
getCountry
(
Long
id
);
}
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/entity/ResumePO.java
0 → 100644
View file @
d3a585c2
package
com
.
gzicloud
.
industry
.
client
.
resume
.
entity
;
import
lombok.Data
;
@Data
public
class
ResumePO
{
private
Long
id
;
private
String
country
;
}
client-resume-server/src/main/java/com/gzicloud/industry/client/resume/service/impl/ResumeServiceImpl.java
View file @
d3a585c2
package
com
.
gzicloud
.
industry
.
client
.
resume
.
service
.
impl
;
import
com.gzicloud.industry.client.resume.dao.ResumeMapper
;
import
com.gzicloud.industry.client.resume.service.IResumeService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
@Service
public
class
ResumeServiceImpl
implements
IResumeService
{
@Resource
private
ResumeMapper
resumeMapper
;
@Override
public
String
getName
(
Long
id
)
{
return
"spring bean 类中返回的:"
+
id
;
return
"spring bean 类中返回的:"
+
resumeMapper
.
getCountry
(
id
).
getCountry
()
;
}
}
client-resume-server/src/main/resources/application-dev.yml
View file @
d3a585c2
...
...
@@ -12,14 +12,19 @@ spring:
group
:
DEFAULT_GROUP
# 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
file-extension
:
yml
#默认properties
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
username
:
hanchao
password
:
123123
url
:
jdbc:mysql://localhost:3306/db2020?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
hikari
:
jdbc-url
:
jdbc:mysql://localhost:3306/db2020?useUnicode=true&characterEncoding=utf-8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true
username
:
hanchao
password
:
123123
driver-class-name
:
com.mysql.cj.jdbc.Driver
minimum-idle
:
10
maximum-pool-size
:
20
connection-timeout
:
2000
maximum-pool-size
:
15
connection-timeout
:
1000
mybatis-plus
:
configuration
:
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
mapper-locations
:
classpath:/mapper/*Mapper.xml
dubbo
:
scan
:
...
...
client-resume-server/src/main/resources/mapper/ResumeMapper.xml
0 → 100644
View file @
d3a585c2
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.gzicloud.industry.client.resume.dao.ResumeMapper"
>
<select
id=
"getCountry"
parameterType=
"java.lang.Long"
resultType=
"com.gzicloud.industry.client.resume.entity.ResumePO"
>
select id, country from t_country where id = #{id}
</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