Browse Source

修改状态相关的统计

recovery
zhizhi wu 5 years ago
parent
commit
9f505648c9
  1. 2
      tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java
  2. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  3. 4
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  4. 25
      tcm/src/main/resources/mapper_dao/PatientDao.xml

2
tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java

@ -78,4 +78,6 @@ public class StatisticDto {
@ApiModelProperty("医院id")
private Long hospitalId;
}
}

2
tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java

@ -30,7 +30,7 @@ public interface PatientDao {
*/
List<PatientVo.SelPatient> selPatientInformationList(@Param("param") PatientDto.SelPatientList param, @Param("userId") Long userId);
List<StatisticVo.Shuliang> countCase(@Param("param") StatisticDto.SelCount param,@Param("inputStatus") byte inputStatus);
List<StatisticVo.Shuliang> countCase(@Param("param") StatisticDto.SelCount param,@Param("inputStatus") byte... inputStatus);
/**
*

4
tcm/src/main/java/com/ccsens/tcm/service/PatientService.java

@ -291,8 +291,10 @@ public class PatientService implements IPatientService {
@Override
public StatisticVo.SelCountS countCase(StatisticDto.SelCount param, Long userId) {
StatisticVo.SelCountS selCountS=new StatisticVo.SelCountS();
selCountS.setNewNums(patientDao.countCase(param,(byte)0));
selCountS.setOverNums(patientDao.countCase(param,(byte)2));
selCountS.setOverNums(patientDao.countCase(param,(byte)2,(byte)5,(byte)6));
return selCountS;
}

25
tcm/src/main/resources/mapper_dao/PatientDao.xml

@ -230,8 +230,12 @@
<if test="param.hospitalId!=null and param.hospitalId!=0 ">
and tpi.hospital_id=#{param.hospitalId}
</if>
<if test="inputStatus!=null">
and tpi.input_status=#{inputStatus}
<if test="inputStatus!=null and inputStatus.size()>0">
and tpi.input_status in
<foreach collection="inputStatus" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
GROUP BY shijian
</select>
@ -364,11 +368,17 @@
<select id="statisticsComplete" resultType="com.ccsens.tcm.bean.vo.StatisticVo$StatisticsComplete">
SELECT
input_status as id,
(case input_status
when 5 THEN 2
when 6 then 2
else input_status end
) as id,
(case input_status
when 0 THEN '新建'
when 1 then '数据搜集中'
when 2 then '数据搜集完成'
when 5 then '数据搜集完成'
when 6 then '数据搜集完成'
when 3 then '数据搜集超时'
when 4 then '废弃'
END) as name,
@ -381,7 +391,10 @@
and hospital_id = #{hospitalId}
</if>
GROUP BY
input_status
(case input_status
when 5 THEN 2
when 6 then 2
else input_status end)
</select>
<select id="completeHospital" resultType="com.ccsens.tcm.bean.vo.StatisticVo$CompleteHospital">
@ -390,7 +403,7 @@
t.`name` as hospitalName,
MAX(CASE t.input_status WHEN 0 THEN nums ELSE 0 END ) unfinished,
MAX(CASE t.input_status WHEN 1 THEN nums ELSE 0 END ) underway,
MAX(CASE t.input_status WHEN 2 THEN nums ELSE 0 END ) completed,
MAX(CASE t.input_status WHEN 2 THEN nums when 5 THEN nums WHEN 6 THEN nums ELSE 0 END ) completed,
MAX(CASE t.input_status WHEN 3 THEN nums ELSE 0 END ) overtime,
MAX(CASE t.input_status WHEN 4 THEN nums ELSE 0 END ) discarded
FROM(
@ -418,7 +431,7 @@
t.`name` as doctorName,
MAX(CASE t.input_status WHEN 0 THEN nums ELSE 0 END ) unfinished,
MAX(CASE t.input_status WHEN 1 THEN nums ELSE 0 END ) underway,
MAX(CASE t.input_status WHEN 2 THEN nums ELSE 0 END ) completed,
MAX(CASE t.input_status WHEN 2 THEN nums when 5 THEN nums WHEN 6 THEN nums ELSE 0 END ) completed,
MAX(CASE t.input_status WHEN 3 THEN nums ELSE 0 END ) overtime,
MAX(CASE t.input_status WHEN 4 THEN nums ELSE 0 END ) discarded
FROM(

Loading…
Cancel
Save