Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Evan Liu
hms
提交
4973a00b
H
hms
项目概览
Evan Liu
/
hms
通知
10
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4973a00b
编写于
8月 12, 2021
作者:
N
nrd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加了客房表的增删改查和查询住宿人员的基本信息
上级
075a8b2c
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
284 addition
and
2 deletion
+284
-2
HMS/src/main/java/com/hqyj/seven/controller/HouseController.java
.../main/java/com/hqyj/seven/controller/HouseController.java
+21
-0
HMS/src/main/java/com/hqyj/seven/dao/HouseDao.java
HMS/src/main/java/com/hqyj/seven/dao/HouseDao.java
+18
-0
HMS/src/main/java/com/hqyj/seven/pojo/Enter.java
HMS/src/main/java/com/hqyj/seven/pojo/Enter.java
+143
-0
HMS/src/main/java/com/hqyj/seven/service/HouseService.java
HMS/src/main/java/com/hqyj/seven/service/HouseService.java
+18
-0
HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java
...in/java/com/hqyj/seven/service/impl/HouseServiceImpl.java
+37
-1
HMS/src/main/resources/mapper/houseDaoMapper.xml
HMS/src/main/resources/mapper/houseDaoMapper.xml
+47
-1
未找到文件。
HMS/src/main/java/com/hqyj/seven/controller/HouseController.java
0 → 100644
浏览文件 @
4973a00b
package
com.hqyj.seven.controller
;
import
com.hqyj.seven.service.HouseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
@RequestMapping
(
"/house"
)
@Controller
public
class
HouseController
{
@Autowired
private
HouseService
houseService
;
@RequestMapping
(
"/deleteHouse"
)
public
int
deleteHousei
(){
return
0
;
}
}
HMS/src/main/java/com/hqyj/seven/dao/HouseDao.java
浏览文件 @
4973a00b
package
com.hqyj.seven.dao
;
import
com.hqyj.seven.pojo.Enter
;
import
com.hqyj.seven.pojo.House
;
import
com.hqyj.seven.pojo.User
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
HouseDao
{
int
updateByHouseName
(
@Param
(
"customerId"
)
int
customerId
,
@Param
(
"name"
)
String
name
);
House
queryByHousename
(
String
name
);
//获取全部客房信息
List
<
House
>
queryAllHouseI
();
//获取单个住房信息和住房人的信息
List
<
Enter
>
queryInter
(
int
house_id
);
//修改房屋信息
int
updateHouse
(
House
house
);
//增加住房
int
insertHouse
(
House
house
);
//删除客房
int
deleteHouse
(
int
house_id
);
}
HMS/src/main/java/com/hqyj/seven/pojo/Enter.java
0 → 100644
浏览文件 @
4973a00b
package
com.hqyj.seven.pojo
;
import
java.util.List
;
public
class
Enter
{
private
int
enter_id
;
private
String
house_id
;
private
int
customer_id
;
private
String
customer_info
;
private
String
start_time
;
private
String
end_time_estimate
;
private
String
end_time_actual
;
private
float
fee_total
;
private
int
fee_info
;
private
int
user_id
;
private
String
state
;
private
float
price
;
private
List
<
Customer
>
customers
;
public
List
<
Customer
>
getCustomers
()
{
return
customers
;
}
public
void
setCustomers
(
List
<
Customer
>
customers
)
{
this
.
customers
=
customers
;
}
public
int
getEnter_id
()
{
return
enter_id
;
}
public
void
setEnter_id
(
int
enter_id
)
{
this
.
enter_id
=
enter_id
;
}
public
String
getHouse_id
()
{
return
house_id
;
}
public
void
setHouse_id
(
String
house_id
)
{
this
.
house_id
=
house_id
;
}
public
int
getCustomer_id
()
{
return
customer_id
;
}
public
void
setCustomer_id
(
int
customer_id
)
{
this
.
customer_id
=
customer_id
;
}
public
String
getCustomer_info
()
{
return
customer_info
;
}
public
void
setCustomer_info
(
String
customer_info
)
{
this
.
customer_info
=
customer_info
;
}
public
String
getStart_time
()
{
return
start_time
;
}
public
void
setStart_time
(
String
start_time
)
{
this
.
start_time
=
start_time
;
}
public
String
getEnd_time_estimate
()
{
return
end_time_estimate
;
}
public
void
setEnd_time_estimate
(
String
end_time_estimate
)
{
this
.
end_time_estimate
=
end_time_estimate
;
}
public
String
getEnd_time_actual
()
{
return
end_time_actual
;
}
public
void
setEnd_time_actual
(
String
end_time_actual
)
{
this
.
end_time_actual
=
end_time_actual
;
}
public
float
getFee_total
()
{
return
fee_total
;
}
public
void
setFee_total
(
float
fee_total
)
{
this
.
fee_total
=
fee_total
;
}
public
int
getFee_info
()
{
return
fee_info
;
}
public
void
setFee_info
(
int
fee_info
)
{
this
.
fee_info
=
fee_info
;
}
public
int
getUser_id
()
{
return
user_id
;
}
public
void
setUser_id
(
int
user_id
)
{
this
.
user_id
=
user_id
;
}
public
String
getState
()
{
return
state
;
}
public
void
setState
(
String
state
)
{
this
.
state
=
state
;
}
public
float
getPrice
()
{
return
price
;
}
public
void
setPrice
(
float
price
)
{
this
.
price
=
price
;
}
@Override
public
String
toString
()
{
return
"Enter{"
+
"enter_id="
+
enter_id
+
", house_id='"
+
house_id
+
'\''
+
", customer_id="
+
customer_id
+
", customer_info='"
+
customer_info
+
'\''
+
", start_time='"
+
start_time
+
'\''
+
", end_time_estimate='"
+
end_time_estimate
+
'\''
+
", end_time_actual='"
+
end_time_actual
+
'\''
+
", fee_total="
+
fee_total
+
", fee_info="
+
fee_info
+
", user_id="
+
user_id
+
", state='"
+
state
+
'\''
+
", price="
+
price
+
", customers="
+
customers
+
'}'
;
}
}
HMS/src/main/java/com/hqyj/seven/service/HouseService.java
浏览文件 @
4973a00b
package
com.hqyj.seven.service
;
import
com.hqyj.seven.pojo.Enter
;
import
com.hqyj.seven.pojo.House
;
import
com.hqyj.seven.pojo.User
;
import
java.util.List
;
import
java.util.Map
;
public
interface
HouseService
{
Map
<
String
,
Object
>
reservation
(
int
customerId
,
String
name
);
House
getOneByHousename
(
String
name
);
//查询客房信息
List
<
House
>
getAllHouse
();
//查询入住人信息
List
<
Enter
>
queryInter
();
//更新客房信息
int
updateHouseI
();
//增加客房
int
insertIntoHouse
();
//删除客房
int
deleteHouseI
();
}
HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java
浏览文件 @
4973a00b
package
com.hqyj.seven.service.impl
;
import
com.hqyj.seven.dao.HouseDao
;
import
com.hqyj.seven.pojo.Enter
;
import
com.hqyj.seven.pojo.House
;
import
com.hqyj.seven.service.HouseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
HouseServiceImpl
implements
HouseService
{
@Autowired
@Autowired
private
HouseDao
houseDao
;
@Override
public
Map
<
String
,
Object
>
reservation
(
int
customerId
,
String
name
)
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
...
...
@@ -35,4 +38,37 @@ public class HouseServiceImpl implements HouseService {
}
@Override
public
List
<
House
>
getAllHouse
()
{
System
.
out
.
println
(
"获取全部客房信息"
);
List
<
House
>
house
=
houseDao
.
queryAllHouseI
();
return
house
;
}
@Override
public
List
<
Enter
>
queryInter
()
{
System
.
out
.
println
(
"获取入住人信息"
);
List
<
Enter
>
customers
=
houseDao
.
queryInter
(
1
);
return
customers
;
}
@Override
public
int
updateHouseI
()
{
House
house
=
new
House
(
3
,
"103"
,
2
,
500
,
1
,
"空闲"
,
null
);
return
houseDao
.
updateHouse
(
house
);
}
@Override
public
int
insertIntoHouse
()
{
House
house
=
new
House
(
27
,
"103"
,
2
,
500
,
1
,
"空闲"
,
null
);
return
houseDao
.
insertHouse
(
house
);
}
@Override
public
int
deleteHouseI
()
{
return
houseDao
.
deleteHouse
(
27
);
}
}
HMS/src/main/resources/mapper/houseDaoMapper.xml
浏览文件 @
4973a00b
...
...
@@ -8,8 +8,54 @@
<select
id=
"queryByHousename"
resultType=
"com.hqyj.seven.pojo.House"
>
select * from house where name=#{name}
</select>
<update
id=
"updateByHouseName"
parameterType=
"com.hqyj.seven.pojo.House"
>
<update
id=
"updateByHouseName"
parameterType=
"com.hqyj.seven.pojo.House"
>
update house set state='已定',customer_id=#{customerId} where name=#{name}
</update>
<resultMap
id=
"customerResultMap"
type=
"com.hqyj.seven.pojo.Enter"
>
<id
column=
"house_id"
property=
"house_id"
/>
<result
column=
"customer_info"
property=
"customer_info"
/>
<result
column=
"start_time"
property=
"start_time"
/>
<result
column=
"end_time_actual"
property=
"end_time_actual"
/>
<result
column=
"end_time_estimate"
property=
"end_time_estimate"
/>
<result
column=
"user_id"
property=
"user_id"
/>
<result
column=
"state"
property=
"state"
/>
<collection
property=
"customers"
ofType=
"com.hqyj.seven.pojo.Customer"
>
<id
column=
"customer_id"
property=
"customer_id"
/>
<result
column=
"name"
property=
"name"
/>
<result
column=
"mobile"
property=
"mobile"
/>
</collection>
</resultMap>
<select
id=
"queryInter"
resultMap=
"customerResultMap"
>
select e.house_id,e.customer_info,e.start_time,e.end_time_actual,
e.end_time_estimate,e.user_id,e.state,
c.name,c.mobile,c.customer_id
from enter e
LEFT JOIN customer c on e.customer_id = c.customer_id
where e.house_id = #{house_id}
</select>
<select
id=
"queryAllHouseI"
resultType=
"com.hqyj.seven.pojo.House"
>
select * from house
</select>
<update
id=
"updateHouse"
parameterType=
"com.hqyj.seven.pojo.House"
>
update house set house_id = #{house_id},name=#{hname},amount=#{amount},
price=#{price},floor_id=#{floor_id},state=#{state} where house_id = #{house_id}
</update>
<insert
id=
"insertHouse"
parameterType=
"com.hqyj.seven.pojo.House"
>
insert into house (house_id,name,amount,price,floor_id,state,customer_id) value
(#{house_id},#{hname},#{amount},#{price},#{floor_id},#{state},#{customer_id})
</insert>
<delete
id=
"deleteHouse"
>
delete from house where house_id = #{house_id}
</delete>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录