Commit 5b27621f4b651080ff894517dc569ffcd1453d44
1 parent
45d75f99c1
Exists in
master
and in
1 other branch
患者统计待使用和总量问诊卡信息
Showing 4 changed files with 32 additions and 3 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java
View file @
5b27621
| ... | ... | @@ -567,11 +567,11 @@ |
| 567 | 567 | /** |
| 568 | 568 | * 更新患者待用卡数量---小程序端使用 |
| 569 | 569 | * |
| 570 | - * @param patient | |
| 570 | + * @param patient 患者ID | |
| 571 | 571 | * @return |
| 572 | 572 | */ |
| 573 | - @PostMapping("updateCcnt") | |
| 574 | - public BaseResponse updateCcnt(@RequestBody LymsPatient patient){ | |
| 573 | + @GetMapping("updateCcnt") | |
| 574 | + public BaseResponse updateCcnt(LymsPatient patient){ | |
| 575 | 575 | BaseResponse baseResponse=new BaseResponse(); |
| 576 | 576 | boolean f=false; |
| 577 | 577 | LymsPatient patient2=lymsPatientService.getById(patient.getId()); |
| ... | ... | @@ -590,6 +590,18 @@ |
| 590 | 590 | f=lymsPatientService.saveOrUpdate(patient); |
| 591 | 591 | } |
| 592 | 592 | baseResponse.setErrorcode(f==true?0:1); |
| 593 | + return baseResponse; | |
| 594 | + } | |
| 595 | + | |
| 596 | + /** | |
| 597 | + * 患者统计待使用和总量问诊卡信息 | |
| 598 | + * @return | |
| 599 | + */ | |
| 600 | + @GetMapping("cardStat") | |
| 601 | + public BaseResponse cardStat(){ | |
| 602 | + BaseResponse baseResponse = new BaseResponse(); | |
| 603 | + Map<String,Object> rs= lymsTcardService.cardStat(); | |
| 604 | + baseResponse.setObject(rs); | |
| 593 | 605 | return baseResponse; |
| 594 | 606 | } |
| 595 | 607 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java
View file @
5b27621
| ... | ... | @@ -2,11 +2,16 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.talkonlineweb.domain.LymsTcard; |
| 4 | 4 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 5 | +import org.apache.ibatis.annotations.Select; | |
| 5 | 6 | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 6 | 9 | /** |
| 7 | 10 | * @Entity com.lyms.talkonlineweb.domain.LymsTcard |
| 8 | 11 | */ |
| 9 | 12 | public interface LymsTcardMapper extends BaseMapper<LymsTcard> { |
| 10 | 13 | |
| 14 | + @Select("SELECT a.ccnt,b.cnt FROM (SELECT SUM(ccnt) ccnt FROM lyms_patient) a,(SELECT SUM(cnt) cnt FROM lyms_tcard ) b") | |
| 15 | + Map<String, Object> cardStat(); | |
| 11 | 16 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java
View file @
5b27621
| ... | ... | @@ -3,10 +3,13 @@ |
| 3 | 3 | import com.lyms.talkonlineweb.domain.LymsTcard; |
| 4 | 4 | import com.baomidou.mybatisplus.extension.service.IService; |
| 5 | 5 | |
| 6 | +import java.util.Map; | |
| 7 | + | |
| 6 | 8 | /** |
| 7 | 9 | * |
| 8 | 10 | */ |
| 9 | 11 | public interface LymsTcardService extends IService<LymsTcard> { |
| 10 | 12 | |
| 13 | + Map<String, Object> cardStat(); | |
| 11 | 14 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java
View file @
5b27621
| ... | ... | @@ -4,14 +4,23 @@ |
| 4 | 4 | import com.lyms.talkonlineweb.domain.LymsTcard; |
| 5 | 5 | import com.lyms.talkonlineweb.service.LymsTcardService; |
| 6 | 6 | import com.lyms.talkonlineweb.mapper.LymsTcardMapper; |
| 7 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | 8 | import org.springframework.stereotype.Service; |
| 8 | 9 | |
| 10 | +import java.util.Map; | |
| 11 | + | |
| 9 | 12 | /** |
| 10 | 13 | * |
| 11 | 14 | */ |
| 12 | 15 | @Service |
| 13 | 16 | public class LymsTcardServiceImpl extends ServiceImpl<LymsTcardMapper, LymsTcard> |
| 14 | 17 | implements LymsTcardService{ |
| 18 | + @Autowired | |
| 19 | + private LymsTcardMapper lymsTcardMapper; | |
| 15 | 20 | |
| 21 | + @Override | |
| 22 | + public Map<String, Object> cardStat() { | |
| 23 | + return lymsTcardMapper.cardStat(); | |
| 24 | + } | |
| 16 | 25 | } |