Browse Source

代码修改

suqinyi 3 tháng trước cách đây
mục cha
commit
d82d265a70

+ 23 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/dao/FollowUpDao.java

@ -90,6 +90,18 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
            "where a.doctorCode = d.id AND a.id = q.relationCode  and q.planId=p.id and a.creater = c.id and a.patientCode = ?1 and a.doctorCode=?2  and a.status > '0'")
    Page<Object> findByPatient(String patient,String doctor, PageRequest pageable);
    /**
     * 查找所有的随访数据
     */
    @Query("select d.id,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus," +
            "c.id,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo,a.prescriptionCode ," +
            " p.disease,p.diseaseName,q.planId,q.id " +
            "from Followup a, BaseDoctorDO d, BaseDoctorDO c ,ServiceItemPlanDO q ,PatientRehabilitationPlanDO p " +
            "where a.doctorCode = d.id AND a.id = q.relationCode  and q.planId=p.id and a.creater = c.id and a.patientCode = ?1  and a.status > '0'")
    Page<Object> findByPatient(String patient, PageRequest pageable);
    /**
     * 查找所有的随访计划(未开始的归类为计划)
     */
@ -100,6 +112,17 @@ public interface FollowUpDao extends PagingAndSortingRepository<Followup, Long>,
            "where a.doctorCode = d.id AND a.id = q.relationCode  and q.planId=p.id  and a.creater = c.id and a.patientCode = ?1  and a.doctorCode=?2 and a.status = '2' ")
    Page<Object> findPlanByPatient(String patient,String doctor, PageRequest pageable);
    /**
     * 查找所有的随访计划(未开始的归类为计划)
     */
    @Query("select d.id,d.name,d.photo,a.followupType,a.followupClass,a.status,a.createTime,a.updateTime,a.followupManagerStatus," +
            "c.id,c.name,c.photo" + ",a.followupDate,a.followupPlanDate,a.followupNextDate,a.id,a.followupNo,a.prescriptionCode ," +
            " p.disease,p.diseaseName,q.planId,q.id  " +
            "from Followup a, BaseDoctorDO d, BaseDoctorDO c,ServiceItemPlanDO q ,PatientRehabilitationPlanDO p  " +
            "where a.doctorCode = d.id AND a.id = q.relationCode  and q.planId=p.id  and a.creater = c.id and a.patientCode = ?1  and a.status = '2' ")
    Page<Object> findPlanByPatient(String patient, PageRequest pageable);
    /**
     * 查找所有的随访记录(进行中的,已完整的的归类为计划)
     * @param patient

+ 12 - 3
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/followup/service/FollowUpService.java

@ -369,15 +369,24 @@ public class FollowUpService {
        Page<Object> result = null;
        if (StringUtils.isBlank(type)) {
            result = followupDao.findByPatient(patient,doctorCode, pageRequest);
            if (StringUtils.isNotBlank(doctorCode)){
                result = followupDao.findByPatient(patient,doctorCode, pageRequest);
            }else {
                result = followupDao.findByPatient(patient, pageRequest);
            }
        } else if ("1".equals(type)) {
            //已经开始的就是记录
            result = followupDao.findPlanByPatient(patient,doctorCode, pageRequest);
            if (StringUtils.isNotBlank(doctorCode)){
                result = followupDao.findPlanByPatient(patient,doctorCode, pageRequest);
            }else {
                result = followupDao.findPlanByPatient(patient, pageRequest);
            }
        } else if ("2".equals(type)) {
            //未开始的就是计划
            result = followupDao.findRecordByPatient(patient,doctorCode, pageRequest);
        } else {
            result = followupDao.findByPatient(patient,doctorCode, pageRequest);
            result = followupDao.findByPatient(patient, pageRequest);
        }