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(); + } }