Browse Source

Merge branch 'pt' of dd.tall.wiki:ccsens_wiki/ccsenscloud into pt

recovery
zhizhi wu 4 years ago
parent
commit
8a007b8850
  1. 2
      tcm/src/main/java/com/ccsens/tcm/api/BiologicalSamplesController.java
  2. 14
      tcm/src/main/java/com/ccsens/tcm/bean/vo/BiologicalSamplesVo.java
  3. 2
      tcm/src/main/java/com/ccsens/tcm/persist/dao/PatientDao.java
  4. 2
      tcm/src/main/java/com/ccsens/tcm/service/IPatientService.java
  5. 4
      tcm/src/main/java/com/ccsens/tcm/service/PatientService.java
  6. 25
      tcm/src/main/resources/mapper_dao/PatientDao.xml
  7. 25
      tcm/src/main/resources/mapper_dao/ReportCodeDao.xml

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

@ -62,7 +62,7 @@ public class BiologicalSamplesController {
@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());
List<BiologicalSamplesVo.selByHosAllYBS> selBiologNumsList=patientService.selByHosAllYBS(params.getParam().getHospitalId());
return JsonResponse.newInstance().ok(selBiologNumsList);
}

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

@ -31,13 +31,11 @@ public class BiologicalSamplesVo {
@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;
@ApiModelProperty("数量")
private Integer nums;
@ApiModelProperty("样本名称")
private String name;
@ApiModelProperty("样本类型")
private Byte sampleType;
}
}

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

@ -70,5 +70,5 @@ public interface PatientDao {
List<String> stringLists(Long testQuestionsId);
BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(@Param("id") Long id);
List<BiologicalSamplesVo.selByHosAllYBS> selByHosAllYBS(@Param("id") Long id);
}

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

@ -79,5 +79,5 @@ public interface IPatientService {
List<String> stringLists(Long testQuestionsId);
BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(Long id);
List<BiologicalSamplesVo.selByHosAllYBS> selByHosAllYBS(Long id);
}

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

@ -223,7 +223,7 @@ public class PatientService implements IPatientService {
@Override
public PageInfo<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param, long l) {
PageHelper.startPage(param.getPageNum(),param.getPageSize());
PageHelper.startPage(param.getPageNum(),param.getPageSize(),"tpi.update_at desc");
List<PatientVo.SelPatient> selPatientLists=patientDao.selPatientMesList(param);
return new PageInfo<>(selPatientLists);
}
@ -415,7 +415,7 @@ public class PatientService implements IPatientService {
}
@Override
public BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(Long id) {
public List<BiologicalSamplesVo.selByHosAllYBS> selByHosAllYBS(Long id) {
return patientDao.selByHosAllYBS(id);
}

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

@ -141,7 +141,6 @@
) t
)
</if>
order by tpi.update_at desc
</select>
<select id="selPatientInformationList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient">
SELECT
@ -487,22 +486,24 @@
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,
(CASE tbs.sample_type
WHEN 0 THEN
'抗血凝10ml'
WHEN 1 THEN '促凝血5ml'
WHEN 2 THEN '晨尿10ml'
WHEN 3 THEN '24小时尿10ml'
end) name,
count( * ) AS nums
FROM
t_biological_samples tbs
, t_patient_information tpi where
tpi.rec_status = 0
, 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
AND tpi.hospital_id =#{id}
and
tbs.rec_status = 0
GROUP BY
tbs.sample_type
</select>
</mapper>

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

@ -134,38 +134,21 @@
`level` = 2
and rec_status = 0
) c2 on c1.`code` = c2.parent_code
<if test="code != null and code != ''">
<if test="nums == 0">
and (c2.`report_type`in (0))
</if>
<if test="nums == 14">
and (c2.`report_type`in (0,1))
</if>
<if test="nums == 90">
and (c2.`report_type`in (0,1))
</if>
<if test="nums == 180">
and (c2.`report_type`in (2))
</if>
<if test="nums == 365">
and (c2.`report_type`in (2))
</if>
</if>
WHERE
c1.`level` = 1
and c1.rec_status = 0
<if test="code != null and code != ''">
and (c1.`code` = #{code} or c2.`code` = #{code})
and (c1.`code` = #{code})
</if>
<if test="code==null or code==''">
<if test="nums == 0">
and (c1.`report_type`in (0))
and (c1.`report_type`in (0,1))
</if>
<if test="nums == 14">
and (c1.`report_type`in (0,1))
and (c1.`report_type`in (1))
</if>
<if test="nums == 90">
and (c1.`report_type`in (0,1))
and (c1.`report_type`in (1))
</if>
<if test="nums == 180">
and (c1.`report_type`in (2))

Loading…
Cancel
Save