Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Evan Liu
hms
提交
031be710
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 搜索 >>
提交
031be710
编写于
8月 15, 2021
作者:
N
nrd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增客户住宿状态功能
上级
bc1a8fc2
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
63 addition
and
0 deletion
+63
-0
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
...in/java/com/hqyj/seven/controller/CustomerController.java
+15
-0
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
+3
-0
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
...src/main/java/com/hqyj/seven/service/CustomerService.java
+4
-0
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
...java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
+6
-0
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
+35
-0
未找到文件。
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
浏览文件 @
031be710
...
...
@@ -123,4 +123,19 @@ public class CustomerController {
}
return
customerMap
;
}
//删除客户
@RequestMapping
(
"/queryOneState"
)
@ResponseBody
public
Map
<
String
,
Object
>
queryOneState
(
int
customer_id
){
Map
<
String
,
Object
>
customerMap
=
new
HashMap
<>();
List
<
House
>
houseList
=
customerService
.
queryState
(
customer_id
);
if
(
houseList
==
null
){
customerMap
.
put
(
"code"
,-
1
);
customerMap
.
put
(
"message"
,
"没有相关住宿信息"
);
}
else
{
customerMap
.
put
(
"code"
,
1
);
customerMap
.
put
(
"message"
,
houseList
);
}
return
customerMap
;
}
}
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
浏览文件 @
031be710
package
com.hqyj.seven.dao
;
import
com.hqyj.seven.pojo.Customer
;
import
com.hqyj.seven.pojo.House
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -20,4 +21,6 @@ public interface CustomerDao {
int
insertOneCus
(
Customer
customer
);
//删除单个客户的信息
int
deleteOneCus
(
int
customer_id
);
// 查找用户的住宿情况
List
<
House
>
queryState
(
int
customer_id
);
}
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
浏览文件 @
031be710
package
com.hqyj.seven.service
;
import
com.hqyj.seven.pojo.Customer
;
import
com.hqyj.seven.pojo.House
;
import
com.hqyj.seven.pojo.PageData
;
import
java.util.List
;
...
...
@@ -23,6 +24,8 @@ public interface CustomerService {
int
insertOneCus
(
Customer
customer
);
//删除单个客户的信息
int
deleteOneCus
(
int
customer_id
);
// 查询客户住宿情况
List
<
House
>
queryState
(
int
customer_id
);
}
...
...
@@ -1018,5 +1021,6 @@ public interface CustomerService {
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
浏览文件 @
031be710
...
...
@@ -4,6 +4,7 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.hqyj.seven.dao.CustomerDao
;
import
com.hqyj.seven.pojo.Customer
;
import
com.hqyj.seven.pojo.House
;
import
com.hqyj.seven.pojo.PageData
;
import
com.hqyj.seven.service.CustomerService
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -78,5 +79,10 @@ public class CustomerServiceImpl implements CustomerService {
int
num
=
customerDao
.
deleteOneCus
(
customer_id
);
return
num
;
}
@Override
public
List
<
House
>
queryState
(
int
customer_id
)
{
List
<
House
>
houseList
=
customerDao
.
queryState
(
customer_id
);
return
houseList
;
}
}
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
浏览文件 @
031be710
...
...
@@ -34,4 +34,39 @@
<delete
id=
"deleteOneCus"
parameterType=
"com.hqyj.seven.pojo.Customer"
>
delete from customer where customer_id = #{customer_id}
</delete>
<!--功能待定-->
<resultMap
id=
"queryOneState"
type=
"com.hqyj.seven.pojo.House"
>
<id
column=
"customer_id"
property=
"customerId"
/>
<result
column=
"house_id"
property=
"houseId"
/>
<collection
property=
"enters"
ofType=
"com.hqyj.seven.pojo.Enter"
>
<id
column=
"enter_id"
property=
"enter_id"
/>
<result
column=
"house_id"
property=
"house_id"
/>
<result
column=
"customer_id"
property=
"customer_id"
/>
<result
column=
"customer_info"
property=
"customer_info"
/>
<result
column=
"start_time"
property=
"start_time"
/>
<result
column=
"end_time_estimate"
property=
"end_time_estimate"
/>
<result
column=
"end_time_actual"
property=
"end_time_actual"
/>
<result
column=
"fee_total"
property=
"fee_total"
/>
<result
column=
"fee_info"
property=
"fee_info"
/>
<result
column=
"user_id"
property=
"user_id"
/>
<result
column=
"state"
property=
"state"
/>
<result
column=
"price"
property=
"price"
/>
</collection>
</resultMap>
<select
id=
"queryOneStateI"
resultMap=
"queryOneState"
>
select e.customer_id,h.house_id,
e.customer_info,
e.enter_id,e.house_id,
e.start_time,e.end_time_estimate,e.end_time_actual
,e.fee_total,e.fee_info,
e.user_id,e.state,e.price
from house h
LEFT JOIN enter e on h.house_id = e.house_id
where e.customer_id = #{customer_id} and e.house_id = h.house_id
</select>
<!-- 查询用户住宿状态-->
<select
id=
"queryState"
resultType=
"com.hqyj.seven.pojo.House"
>
select house_id houseId ,name houseName,amount,price,floor_id floorId,state,customer_id customerId from house where customer_id = #{customer_id}
</select>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录