Commit 3b9744ee57c1352e9bfa6bffe197d7c1925650fa
1 parent
5fa33e6a9a
Exists in
master
and in
1 other branch
PC患者问诊卡统计
Showing 4 changed files with 14 additions and 7 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 @
3b9744e
| ... | ... | @@ -622,9 +622,15 @@ |
| 622 | 622 | * @return |
| 623 | 623 | */ |
| 624 | 624 | @GetMapping("cardStat") |
| 625 | - public BaseResponse cardStat(){ | |
| 625 | + public BaseResponse cardStat(Integer type){ | |
| 626 | 626 | BaseResponse baseResponse = new BaseResponse(); |
| 627 | - Map<String,Object> rs= lymsTcardService.cardStat(); | |
| 627 | + String pSql=""; | |
| 628 | + String cSql=""; | |
| 629 | + if (type != null) { | |
| 630 | + pSql="WHERE id IN (SELECT c.`pid` FROM lyms_tcard c WHERE c.`fid`="+type+")"; | |
| 631 | + cSql="WHERE fid="+type; | |
| 632 | + } | |
| 633 | + Map<String,Object> rs= lymsTcardService.cardStat(pSql,cSql); | |
| 628 | 634 | baseResponse.setObject(rs); |
| 629 | 635 | return baseResponse; |
| 630 | 636 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsTcardMapper.java
View file @
3b9744e
| ... | ... | @@ -2,6 +2,7 @@ |
| 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.Param; | |
| 5 | 6 | import org.apache.ibatis.annotations.Select; |
| 6 | 7 | |
| 7 | 8 | import java.util.Map; |
| ... | ... | @@ -11,7 +12,7 @@ |
| 11 | 12 | */ |
| 12 | 13 | public interface LymsTcardMapper extends BaseMapper<LymsTcard> { |
| 13 | 14 | |
| 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(); | |
| 15 | + @Select("SELECT IFNULL(a.ccnt,0) ccnt,IFNULL(b.cnt,0) cnt FROM (SELECT SUM(ccnt) ccnt FROM lyms_patient ${pSql} ) a,(SELECT SUM(cnt) cnt FROM lyms_tcard ${cSql} ) b") | |
| 16 | + Map<String, Object> cardStat(@Param("pSql") String pSql,@Param("cSql") String cSql); | |
| 16 | 17 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsTcardService.java
View file @
3b9744e
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsTcardServiceImpl.java
View file @
3b9744e
| ... | ... | @@ -19,8 +19,8 @@ |
| 19 | 19 | private LymsTcardMapper lymsTcardMapper; |
| 20 | 20 | |
| 21 | 21 | @Override |
| 22 | - public Map<String, Object> cardStat() { | |
| 23 | - return lymsTcardMapper.cardStat(); | |
| 22 | + public Map<String, Object> cardStat(String pSql, String cSql) { | |
| 23 | + return lymsTcardMapper.cardStat(pSql,cSql); | |
| 24 | 24 | } |
| 25 | 25 | } |