Browse Source

tijiao

recovery
wang0018 4 years ago
parent
commit
b203d76e80
  1. 7
      tcm/src/main/java/com/ccsens/tcm/api/BiologicalSamplesController.java
  2. 14
      tcm/src/main/java/com/ccsens/tcm/bean/dto/BiologicalSamplesDto.java
  3. 8
      tcm/src/main/java/com/ccsens/tcm/bean/dto/StatisticDto.java
  4. 12
      tcm/src/main/java/com/ccsens/tcm/bean/vo/BiologicalSamplesVo.java
  5. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  6. 2
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  7. 7
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  8. 35
      tcm/src/main/resources/mapper_dao/PatientDao.xml

7
tcm/src/main/java/com/ccsens/tcm/api/BiologicalSamplesController.java

@ -58,5 +58,12 @@ public class BiologicalSamplesController {
List<BiologicalSamplesVo.SelBiologNums> selBiologNumsList=patientService.selAllYBS();
return JsonResponse.newInstance().ok(selBiologNumsList);
}
@MustLogin
@ApiOperation(value = "统计某医院下得生物样本数量", notes = "w:统计某个医院的生物样本的数量")
@RequestMapping(value = "/selByHosAllYBS", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<BiologicalSamplesVo.selByHosAllYBS>> selByHosAllYBS(@ApiParam @Validated @RequestBody QueryDto<BiologicalSamplesDto.SelHosId> params){
BiologicalSamplesVo.selByHosAllYBS selBiologNumsList=patientService.selByHosAllYBS(params.getParam().getHospitalId());
return JsonResponse.newInstance().ok(selBiologNumsList);
}
}

14
tcm/src/main/java/com/ccsens/tcm/bean/dto/BiologicalSamplesDto.java

@ -24,6 +24,7 @@ public class BiologicalSamplesDto {
@ApiModelProperty("采集时间")
private Integer collectTime;
}
@Data
@ApiModel("查询生物样本-1007")
public static class SelBiolog {
@ -32,15 +33,22 @@ public class BiologicalSamplesDto {
@ApiModelProperty("样本类型 0:抗血凝10ml 1:促凝血5ml 2:晨尿10ml 3:24小时尿10ml")
private Byte sampleType;
@ApiModelProperty("患者住院号")
private String hospitalization;
private String hospitalization;
@ApiModelProperty("采集时间")
private Integer collectTime;
@Min(1)
@ApiModelProperty("当前页")
private Integer pageNum=1;
private Integer pageNum = 1;
@Min(1)
@Max(20)
@ApiModelProperty("每页数量")
private Integer pageSize=10;
private Integer pageSize = 10;
}
@Data
@ApiModel("根据医院id查询生物样本得数量统计")
public static class SelHosId {
@NotNull
@ApiModelProperty("医院id")
private Long hospitalId;
}
}

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

@ -31,16 +31,8 @@ public class StatisticDto {
@Data
@ApiModel("每日病例统计传参")
public static class SelCount{
@ApiModelProperty("主治大夫id")
private Long userId;
@ApiModelProperty("医院id")
private Long hospitalId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("开始时间")
private Date startDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("结束时间")
private Date endDate;
}
@Data
@ApiModel("病例分析传参")

12
tcm/src/main/java/com/ccsens/tcm/bean/vo/BiologicalSamplesVo.java

@ -28,4 +28,16 @@ public class BiologicalSamplesVo {
@ApiModelProperty("生物样本数量")
private Integer nums;
}
@Data
@ApiModel("统计某医院医院生物样本数量")
public static class selByHosAllYBS{
@ApiModelProperty("抗血凝10ml")
private Integer kxn;
@ApiModelProperty("促凝血5ml")
private Integer cxn;
@ApiModelProperty("晨尿10ml")
private Integer cn;
@ApiModelProperty("24小时尿10ml")
private Integer xsn;
}
}

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

@ -68,4 +68,6 @@ public interface PatientDao {
List<StatisticVo.PatientProgressVo> selPatientProgress(Long userId);
List<String> stringLists(Long testQuestionsId);
BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(@Param("id") Long id);
}

2
tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java

@ -78,4 +78,6 @@ public interface IPatientService {
List<StatisticVo.PatientProgressVo> selPatientProgress(Long userId);
List<String> stringLists(Long testQuestionsId);
BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(Long id);
}

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

@ -263,7 +263,7 @@ public class PatientService implements IPatientService {
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)0));
selCountS.setOverNums(patientDao.countCase(param,(byte)2));
return selCountS;
}
@ -414,5 +414,10 @@ public class PatientService implements IPatientService {
return stringList;
}
@Override
public BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(Long id) {
return patientDao.selByHosAllYBS(id);
}
}

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

@ -110,6 +110,7 @@
) t
)
</if>
order by tpi.update_at desc
</select>
<select id="selPatientInformationList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient">
SELECT
@ -138,25 +139,17 @@
and tpi.input_status= #{inputStatus}
</if>
</if>
order by tpi.update_at desc
</select>
<select id="countCase" resultType="com.ccsens.tcm.bean.vo.StatisticVo$Shuliang">
select DATE_FORMAT(tpi.update_at,'%Y-%d-%m') as shijian,count(*) as nums from t_patient_information tpi
select DATE_FORMAT(tpi.update_at,'%Y-%m-%d') as shijian,count(*) as nums from t_patient_information tpi
where tpi.rec_status=0
<if test="param.userId!=null and param.userId!=0 ">
and tpi.user_id=#{param.userId}
</if>
<if test="param.hospitalId!=null and param.hospitalId!=0 ">
and tpi.hospital_id=#{param.hospitalId}
</if>
<if test="inputStatus!=null and inputStatus!=0 ">
and tpi.input_status=#{inputStatus}
</if>
<if test="param.startDate!=null">
and tpi.update_at &gt; #{param.startDate}
</if>
<if test="param.endDate!=null">
and tpi.update_at &lt; #{param.endDate}
</if>
GROUP BY shijian
</select>
<select id="countAnalysis" resultType="com.ccsens.tcm.bean.vo.StatisticVo$SelGroupList">
@ -272,9 +265,6 @@
<if test="hospitalId != null and hospitalId != 0">
and hospital_id = #{hospitalId}
</if>
<if test="userId != null and userId != 0">
and user_id = #{userId}
</if>
GROUP BY
input_status
) t
@ -434,4 +424,23 @@
where tpr.rec_status=0
and tpr.test_questions_id=#{testQuestionsId}
</select>
<select id="selByHosAllYBS" resultType="com.ccsens.tcm.bean.vo.BiologicalSamplesVo$selByHosAllYBS" parameterType="java.lang.Long">
select
MAX(CASE t.sampleType WHEN 0 THEN nums ELSE 0 END ) kxn,
MAX(CASE t.sampleType WHEN 1 THEN nums ELSE 0 END ) cxn,
MAX(CASE t.sampleType WHEN 2 THEN nums ELSE 0 END ) cn,
MAX(CASE t.sampleType WHEN 3 THEN nums ELSE 0 END ) xsn
from(
SELECT
tbs.sample_type AS sampleType,
count( * ) AS nums
FROM
t_biological_samples tbs
, t_patient_information tpi where
tpi.rec_status = 0
AND tbs.patient_information_id = tpi.id
and tbs.rec_status=0
and tpi.hospital_id=#{id}
GROUP BY tbs.sample_type) t
</select>
</mapper>
Loading…
Cancel
Save