Browse Source

tijiadaima

recovery
wang0018 4 years ago
parent
commit
4f732b36cb
  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:统计某个医院的生物样本的数量") @ApiOperation(value = "统计某医院下得生物样本数量", notes = "w:统计某个医院的生物样本的数量")
@RequestMapping(value = "/selByHosAllYBS", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"}) @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){ 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); 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 @Data
@ApiModel("统计某医院医院生物样本数量") @ApiModel("统计某医院医院生物样本数量")
public static class selByHosAllYBS{ public static class selByHosAllYBS{
@ApiModelProperty("抗血凝10ml") @ApiModelProperty("数量")
private Integer kxn; private Integer nums;
@ApiModelProperty("促凝血5ml") @ApiModelProperty("样本名称")
private Integer cxn; private String name;
@ApiModelProperty("晨尿10ml") @ApiModelProperty("样本类型")
private Integer cn; private Byte sampleType;
@ApiModelProperty("24小时尿10ml")
private Integer xsn;
} }
} }

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

@ -69,5 +69,5 @@ public interface PatientDao {
List<String> stringLists(Long testQuestionsId); 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); 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 @Override
public PageInfo<PatientVo.SelPatient> selPatientMesList(PatientDto.SelPatlenConditionList param, long l) { 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); List<PatientVo.SelPatient> selPatientLists=patientDao.selPatientMesList(param);
return new PageInfo<>(selPatientLists); return new PageInfo<>(selPatientLists);
} }
@ -415,7 +415,7 @@ public class PatientService implements IPatientService {
} }
@Override @Override
public BiologicalSamplesVo.selByHosAllYBS selByHosAllYBS(Long id) { public List<BiologicalSamplesVo.selByHosAllYBS> selByHosAllYBS(Long id) {
return patientDao.selByHosAllYBS(id); return patientDao.selByHosAllYBS(id);
} }

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

@ -110,7 +110,6 @@
) t ) t
) )
</if> </if>
order by tpi.update_at desc
</select> </select>
<select id="selPatientInformationList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient"> <select id="selPatientInformationList" resultType="com.ccsens.tcm.bean.vo.PatientVo$SelPatient">
SELECT SELECT
@ -425,22 +424,24 @@
and tpr.test_questions_id=#{testQuestionsId} and tpr.test_questions_id=#{testQuestionsId}
</select> </select>
<select id="selByHosAllYBS" resultType="com.ccsens.tcm.bean.vo.BiologicalSamplesVo$selByHosAllYBS" parameterType="java.lang.Long"> <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 SELECT
tbs.sample_type AS sampleType, 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 count( * ) AS nums
FROM FROM
t_biological_samples tbs t_biological_samples tbs
, t_patient_information tpi where , t_patient_information tpi where tpi.rec_status = 0
tpi.rec_status = 0
AND tbs.patient_information_id = tpi.id AND tbs.patient_information_id = tpi.id
and tbs.rec_status=0 AND tpi.hospital_id =#{id}
and tpi.hospital_id=#{id} and
GROUP BY tbs.sample_type) t tbs.rec_status = 0
GROUP BY
tbs.sample_type
</select> </select>
</mapper> </mapper>

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

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

Loading…
Cancel
Save