Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Team6-Digital Insight for Health
Manage
Activity
Members
Labels
Plan
Issues
12
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chen Liang
Team6-Digital Insight for Health
Commits
dd7df5b4
Commit
dd7df5b4
authored
4 months ago
by
Mingyuan Chen
Browse files
Options
Downloads
Patches
Plain Diff
Delete CommonAdminHospitalMapper.java
parent
cc4ce96f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/com/cardiff/client_project/mapper/CommonAdminHospitalMapper.java
+0
-40
0 additions, 40 deletions
...diff/client_project/mapper/CommonAdminHospitalMapper.java
with
0 additions
and
40 deletions
src/main/java/com/cardiff/client_project/mapper/CommonAdminHospitalMapper.java
deleted
100644 → 0
+
0
−
40
View file @
cc4ce96f
package
com.cardiff.client_project.mapper
;
import
com.cardiff.client_project.pojo.dto.HospitalDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.BeanPropertyRowMapper
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
public
class
CommonAdminHospitalMapper
{
@Autowired
JdbcTemplate
jdbcTemplate
;
// 查询所有医院信息
public
List
<
HospitalDTO
>
findAll
()
{
String
sql
=
"SELECT * FROM hospital"
;
return
jdbcTemplate
.
query
(
sql
,
new
BeanPropertyRowMapper
<>(
HospitalDTO
.
class
));
}
// 添加医院信息
public
int
save
(
HospitalDTO
hospital
)
{
String
sql
=
"INSERT INTO hospital (name, location, phone, totalBeds, availableBeds, occupancyRate) VALUES (?, ?, ?, ?, ?, ?)"
;
return
jdbcTemplate
.
update
(
sql
,
hospital
.
getName
(),
hospital
.
getLocation
(),
hospital
.
getPhone
(),
hospital
.
getTotalBeds
(),
hospital
.
getAvailableBeds
(),
hospital
.
getOccupancyRate
());
}
// 更新医院信息
public
int
update
(
HospitalDTO
hospital
)
{
String
sql
=
"UPDATE hospital SET name=?, location=?, phone=?, totalBeds=?, availableBeds=?, occupancyRate=? WHERE id=?"
;
return
jdbcTemplate
.
update
(
sql
,
hospital
.
getName
(),
hospital
.
getLocation
(),
hospital
.
getPhone
(),
hospital
.
getTotalBeds
(),
hospital
.
getAvailableBeds
(),
hospital
.
getOccupancyRate
(),
hospital
.
getId
());
}
// 根据 ID 删除医院信息
public
int
deleteById
(
int
id
)
{
String
sql
=
"DELETE FROM hospital WHERE id=?"
;
return
jdbcTemplate
.
update
(
sql
,
id
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment