Commit 79374222aa362e48ca8b301551dd120c4785a239
1 parent
3c2d9d0029
Exists in
master
统计医生信息 接口修改
Showing 4 changed files with 14 additions and 7 deletions
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java
- talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java
talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/DoctorController.java
View file @
7937422
... | ... | @@ -181,9 +181,9 @@ |
181 | 181 | * @return |
182 | 182 | */ |
183 | 183 | @GetMapping("statDoctor") |
184 | - public BaseResponse statDoctor(){ | |
184 | + public BaseResponse statDoctor(Integer hid){ | |
185 | 185 | BaseResponse baseResponse=new BaseResponse(); |
186 | - Map<String,Object> stat=lymsDoctorService.statDoctor(); | |
186 | + Map<String,Object> stat=lymsDoctorService.statDoctor(hid); | |
187 | 187 | baseResponse.setObject(stat); |
188 | 188 | return baseResponse; |
189 | 189 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/mapper/LymsDoctorMapper.java
View file @
7937422
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | |
3 | 3 | import com.lyms.talkonlineweb.domain.LymsDoctor; |
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,13 @@ |
11 | 12 | */ |
12 | 13 | public interface LymsDoctorMapper extends BaseMapper<LymsDoctor> { |
13 | 14 | |
14 | - @Select("SELECT COUNT(1) dall,SUM(d.`stat`) dsum,(COUNT(1)-SUM(d.`stat`)) rcnt FROM lyms_doctor d ") | |
15 | - Map<String, Object> statDoctor(); | |
15 | + @Select({"<script>", | |
16 | + "SELECT COUNT(1) dall,SUM(d.`stat`) dsum,(COUNT(1)-SUM(d.`stat`)) rcnt FROM lyms_doctor d", | |
17 | + "where 1=1", | |
18 | + "<when test='hid!=null' >", | |
19 | + "and hid=#{hid}", | |
20 | + "</when>", | |
21 | + "</script>"}) | |
22 | + Map<String, Object> statDoctor(@Param("hid") Integer hid); | |
16 | 23 | } |
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/LymsDoctorService.java
View file @
7937422
talkonlineweb/src/main/java/com/lyms/talkonlineweb/service/impl/LymsDoctorServiceImpl.java
View file @
7937422
... | ... | @@ -20,8 +20,8 @@ |
20 | 20 | private LymsDoctorMapper lymsDoctorMapper; |
21 | 21 | |
22 | 22 | @Override |
23 | - public Map<String, Object> statDoctor() { | |
24 | - return lymsDoctorMapper.statDoctor(); | |
23 | + public Map<String, Object> statDoctor(Integer hid) { | |
24 | + return lymsDoctorMapper.statDoctor(hid); | |
25 | 25 | } |
26 | 26 | } |