From 5b27621f4b651080ff894517dc569ffcd1453d44 Mon Sep 17 00:00:00 2001 From: changpengfei Date: Wed, 22 Sep 2021 10:22:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=85=E7=BB=9F=E8=AE=A1=E5=BE=85?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E5=92=8C=E6=80=BB=E9=87=8F=E9=97=AE=E8=AF=8A?= =?UTF-8?q?=E5=8D=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../talkonlineweb/controller/PatientController.java | 18 +++++++++++++++--- .../com/lyms/talkonlineweb/mapper/LymsTcardMapper.java | 5 +++++ .../lyms/talkonlineweb/service/LymsTcardService.java | 3 +++ .../service/impl/LymsTcardServiceImpl.java | 9 +++++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index 5b97043..8526768 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -567,11 +567,11 @@ public class PatientController { /** * 更新患者待用卡数量---小程序端使用 * - * @param patient + * @param patient 患者ID * @return */ - @PostMapping("updateCcnt") - public BaseResponse updateCcnt(@RequestBody LymsPatient patient){ + @GetMapping("updateCcnt") + public BaseResponse updateCcnt(LymsPatient patient){ BaseResponse baseResponse=new BaseResponse(); boolean f=false; LymsPatient patient2=lymsPatientService.getById(patient.getId()); @@ -592,4 +592,16 @@ public class PatientController { baseResponse.setErrorcode(f==true?0:1); return baseResponse; } + + /** + * 患者统计待使用和总量问诊卡信息 + * @return + */ + @GetMapping("cardStat") + public BaseResponse cardStat(){ + BaseResponse baseResponse = new BaseResponse(); + Map rs= lymsTcardService.cardStat(); + baseResponse.setObject(rs); + return baseResponse; + } } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java index 08ce409..711ed17 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java @@ -2,12 +2,17 @@ package com.lyms.talkonlineweb.mapper; import com.lyms.talkonlineweb.domain.LymsTcard; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Select; + +import java.util.Map; /** * @Entity com.lyms.talkonlineweb.domain.LymsTcard */ public interface LymsTcardMapper extends BaseMapper { + @Select("SELECT a.ccnt,b.cnt FROM (SELECT SUM(ccnt) ccnt FROM lyms_patient) a,(SELECT SUM(cnt) cnt FROM lyms_tcard ) b") + Map cardStat(); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java index 41be4e0..6375548 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java @@ -3,9 +3,12 @@ package com.lyms.talkonlineweb.service; import com.lyms.talkonlineweb.domain.LymsTcard; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.Map; + /** * */ public interface LymsTcardService extends IService { + Map cardStat(); } diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java index cb7719e..6752052 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java @@ -4,15 +4,24 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lyms.talkonlineweb.domain.LymsTcard; import com.lyms.talkonlineweb.service.LymsTcardService; import com.lyms.talkonlineweb.mapper.LymsTcardMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Map; + /** * */ @Service public class LymsTcardServiceImpl extends ServiceImpl implements LymsTcardService{ + @Autowired + private LymsTcardMapper lymsTcardMapper; + @Override + public Map cardStat() { + return lymsTcardMapper.cardStat(); + } } -- 1.8.3.1