Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Evan Liu
hms
提交
b425b7dc
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 搜索 >>
提交
b425b7dc
编写于
8月 15, 2021
作者:
N
nrd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加了customer控制层修改了获取全部的功能
上级
472b7170
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
59 addition
and
1 deletion
+59
-1
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
...in/java/com/hqyj/seven/controller/CustomerController.java
+40
-0
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
+3
-1
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
...src/main/java/com/hqyj/seven/service/CustomerService.java
+5
-0
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
...java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
+7
-0
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
+4
-0
未找到文件。
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
0 → 100644
浏览文件 @
b425b7dc
package
com.hqyj.seven.controller
;
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.apache.shiro.SecurityUtils
;
import
org.apache.shiro.session.Session
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Controller
@RequestMapping
(
"/customer"
)
public
class
CustomerController
{
@Autowired
CustomerService
customerService
;
@RequestMapping
(
"/getallcus"
)
@ResponseBody
public
Map
<
String
,
Object
>
getAllcus
(){
List
<
Customer
>
customerList
=
customerService
.
queryAll
();
Map
<
String
,
Object
>
customer
=
new
HashMap
<>();
if
(
customerList
==
null
){
customer
.
put
(
"code"
,-
1
);
customer
.
put
(
"msg"
,
"没有客房信息"
);
}
else
{
customer
.
put
(
"code"
,
0
);
customer
.
put
(
"data"
,
customerList
);
customer
.
put
(
"msg"
,
"获取数据成功!"
);
}
Session
session
=
SecurityUtils
.
getSubject
().
getSession
();
session
.
setAttribute
(
"customerList"
,
customerList
);
return
customer
;
}
}
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
浏览文件 @
b425b7dc
...
...
@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param;
import
java.util.List
;
public
interface
CustomerDao
{
List
<
Customer
>
queryAll
();
int
updataByCustomerIdToremainder
(
@Param
(
"money"
)
double
money
,
@Param
(
"id"
)
int
id
);
Customer
queryByCustomer
(
int
CustomerId
);
//获取全部客户信息
List
<
Customer
>
queryAll
();
}
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
浏览文件 @
b425b7dc
...
...
@@ -2,9 +2,14 @@ package com.hqyj.seven.service;
import
com.hqyj.seven.pojo.Customer
;
import
java.util.List
;
public
interface
CustomerService
{
//住房更新金额
int
updateByNameToRemainder
(
double
money
,
int
id
);
//按id查找用户
Customer
queryById
(
int
customerId
);
//查询所有客户信息
List
<
Customer
>
queryAll
();
}
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
浏览文件 @
b425b7dc
...
...
@@ -6,6 +6,8 @@ import com.hqyj.seven.service.CustomerService;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
public
class
CustomerServiceImpl
implements
CustomerService
{
@Autowired
...
...
@@ -19,4 +21,9 @@ public class CustomerServiceImpl implements CustomerService {
public
Customer
queryById
(
int
customerId
)
{
return
customerDao
.
queryByCustomer
(
customerId
);
}
@Override
public
List
<
Customer
>
queryAll
()
{
return
customerDao
.
queryAll
();
}
}
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
浏览文件 @
b425b7dc
...
...
@@ -37,5 +37,9 @@
<!-- <select id="queryAll" resultMap="customerBaseResultMap">-->
<!-- <include refid="customerBaseQuerySql" />-->
<!-- </select>-->
<select
id=
"queryAll"
resultType=
"com.hqyj.seven.pojo.Customer"
>
select * from customer
</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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录