suqinyi 1 rok temu
rodzic
commit
7e09858e43

+ 17 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/DoctorRehabilitaionInfoController.java

@ -186,7 +186,7 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
    public String getRehabilitationPatientPlan(
            @ApiParam(name = "doctorId", value = "医生id", required = false) @RequestParam(value = "doctorId", required = false) String doctorId,
            @ApiParam(name = "idcard", value = "身份证", required = false) @RequestParam(value = "idcard", required = false) String idcard,
            @ApiParam(name = "finishStatus", value = "完成状态", required = false) @RequestParam(value = "finishStatus", required = false) String finishStatus,
            @ApiParam(name = "finishStatus", value = "空全部 1未完成 2已完成", required = false) @RequestParam(value = "finishStatus", required = false) String finishStatus,
            @ApiParam(name = "page", value = "起始页", required = false) @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
            @ApiParam(name = "pagesize", value = "每页显示数据条数", required = false) @RequestParam(value = "pagesize", required = false, defaultValue = "10") Integer pagesize
    ) {
@ -224,6 +224,22 @@ public class DoctorRehabilitaionInfoController extends EnvelopRestEndpoint {
        }
    }
    /**
     * 查询居民的康复计划
     */
    @RequestMapping(value = "getPatientRehabilitationByPatientId", method = RequestMethod.GET)
    @ApiOperation("查询居民的康复计划")
    public String getPatientRehabilitationByPatientId(
            @ApiParam(name = "patientId", value = "居民", required = false) @RequestParam(value = "patientId", required = false) String patientId
    ) {
        try {
            List<Map<String, Object>> result = rehabilitationInfoService.getPatientRehabilitationByPatientId(patientId);
            return write(200, "请求成功", "data", result);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }
    }
    @RequestMapping(value = "getDeorsumvergenceCount", method = RequestMethod.GET)
    @ApiOperation("康复下转已下转顶头数据")

+ 34 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationInfoService.java

@ -1194,7 +1194,10 @@ public class RehabilitationInfoService {
                "		SELECT GROUP_CONCAT(q.`name`) FROM base_disease_hospital q  INNER JOIN wlyy_patient_rehabilitation_plan w ON q.id = w.disease \n" +
                "		 WHERE 1 = 1 AND w.patient=a.id  GROUP BY w.patient\n" +
                "	  ) 'diseaseListName',\n" +
                "	  (\n" +
                "      (\n" +
                "        SELECT GROUP_CONCAT(DISTINCT w.plan_doctor_name) FROM wlyy_patient_rehabilitation_plan w WHERE a.id = w.patient \n" +
                "      ) 'planDoctorListName',\n" +
                "	   (\n" +
                "			SELECT count(1) 	FROM wlyy_patient_rehabilitation_plan w \n" +
                "			INNER JOIN wlyy_rehabilitation_plan_detail q ON w.id = q.plan_id \n" +
                "			WHERE		1 = 1 	AND w.patient = a.id \n" +
@ -1290,4 +1293,34 @@ public class RehabilitationInfoService {
        map.put("finishCount", finishCount);
        return map;
    }
    public List<Map<String, Object>> getPatientRehabilitationByPatientId(String patientId) {
        String sql = "SELECT DISTINCT \n" +
                "	 a.id,a.`name`,a.birthday,a.phone,a.sex,a.mobile,c.age,\n" +
                "	 b.plan_doctor_name 'planDoctorName',d. `name` 'diseaseName',c.dept_name 'deptName',\n" +
                "	 b.`status` 'planStatus', \n" +
                "		(\n" +
                "			SELECT count(1) 	FROM wlyy_patient_rehabilitation_plan w \n" +
                "			INNER JOIN wlyy_rehabilitation_plan_detail q ON w.id = q.plan_id \n" +
                "			WHERE		1 = 1 	AND w.patient = a.id \n" +
                "		)'itemAllCount',\n" +
                "		(\n" +
                "			SELECT count(1) 	FROM wlyy_patient_rehabilitation_plan w \n" +
                "			INNER JOIN wlyy_rehabilitation_plan_detail q ON w.id = q.plan_id \n" +
                "			WHERE		1 = 1 	AND q.`status`='1'		AND w.patient = a.id \n" +
                "		)'finishCount'\n" +
                "FROM\n" +
                "	base_patient a\n" +
                "	INNER JOIN wlyy_patient_rehabilitation_plan b ON a.id = b.patient\n" +
                "	INNER JOIN wlyy_rehabilitation_patient_info c ON c.patient = b.patient \n" +
                "	INNER JOIN base_disease_hospital d ON  d.id=b.disease\n" +
                "WHERE\n" +
                "	1 = 1 \n" +
                "	AND a.del = '1'\n";
        if (StringUtils.isNotBlank(patientId)) {
            sql += "	AND a.id='" + patientId + "' ";
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list;
    }
}