From 031be710260fcdd19e8dd627ca736f929b5cfc71 Mon Sep 17 00:00:00 2001 From: nrd <1059938559@qq.com> Date: Sun, 15 Aug 2021 17:26:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7=E4=BD=8F?= =?UTF-8?q?=E5=AE=BF=E7=8A=B6=E6=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seven/controller/CustomerController.java | 15 ++++++++ .../java/com/hqyj/seven/dao/CustomerDao.java | 3 ++ .../hqyj/seven/service/CustomerService.java | 4 +++ .../service/impl/CustomerServiceImpl.java | 6 ++++ .../resources/mapper/CustomerDaoMapper.xml | 35 +++++++++++++++++++ 5 files changed, 63 insertions(+) diff --git a/HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java b/HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java index b1845a7..601538c 100644 --- a/HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java +++ b/HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java @@ -123,4 +123,19 @@ public class CustomerController { } return customerMap; } + //删除客户 + @RequestMapping("/queryOneState") + @ResponseBody + public Map queryOneState(int customer_id){ + Map customerMap = new HashMap<>(); + List 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; + } } diff --git a/HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java b/HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java index 0c44511..dcf8246 100644 --- a/HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java +++ b/HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java @@ -1,6 +1,7 @@ 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 queryState(int customer_id); } diff --git a/HMS/src/main/java/com/hqyj/seven/service/CustomerService.java b/HMS/src/main/java/com/hqyj/seven/service/CustomerService.java index 9efc4dd..83e758e 100644 --- a/HMS/src/main/java/com/hqyj/seven/service/CustomerService.java +++ b/HMS/src/main/java/com/hqyj/seven/service/CustomerService.java @@ -1,6 +1,7 @@ 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 queryState(int customer_id); } @@ -1018,5 +1021,6 @@ public interface CustomerService { + diff --git a/HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java b/HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java index 7b4e0ab..0f146bc 100644 --- a/HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java +++ b/HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java @@ -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 queryState(int customer_id) { + List houseList = customerDao.queryState(customer_id); + return houseList; + } } diff --git a/HMS/src/main/resources/mapper/CustomerDaoMapper.xml b/HMS/src/main/resources/mapper/CustomerDaoMapper.xml index ae119a2..ee524c8 100644 --- a/HMS/src/main/resources/mapper/CustomerDaoMapper.xml +++ b/HMS/src/main/resources/mapper/CustomerDaoMapper.xml @@ -34,4 +34,39 @@ delete from customer where customer_id = #{customer_id} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- GitLab