Jelajahi Sumber

新增咨询查询

chenweida 8 tahun lalu
induk
melakukan
7d1a9e0b57

+ 16 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultTeamDao.java

@ -265,4 +265,20 @@ public interface ConsultTeamDao extends PagingAndSortingRepository<ConsultTeam,
	//名医咨询 -我咨询的全部 带symptoms
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorAllList(String uid, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms 根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2 and a.id < ?3 and a.symptoms like ?4 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, long id, String title, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms 根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.symptoms like ?3 and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, String title, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.id < ?3 and  a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, long id, Pageable pageRequest);
	//名医咨询 -我咨询的 带symptoms根据status
	@Query("select a from ConsultTeam a, ConsultTeamDoctor b where a.consult = b.consult and (a.type=6 or a.type=7 ) and a.patient = ?1 and a.status=?2  and a.del = '1' and b.del = '1'")
	Page<ConsultTeam> findMyFamousDoctorListByStatus(String uid, int status, Pageable pageRequest);
}

+ 26 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultTeamService.java

@ -135,10 +135,36 @@ public class ConsultTeamService extends ConsultService {
            case 10:
                //我咨询的
                return findByDoctorType10(uid, id, pagesize, title);
            case 11:
                //我咨询的 进行中
                return findByDoctorType11(uid,0, id, pagesize, title);
            case 12:
                //我咨询的 已结束中
                return findByDoctorType11(uid,1, id, pagesize, title);
        }
        return null;
    }
    private Page<ConsultTeam> findByDoctorType11(String uid, int status, long id, int pagesize, String title) {
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息
        PageRequest pageRequest = new PageRequest(0, pagesize, sort);
        if (StringUtils.isNoneEmpty(title)) {
            title = "%" + title + "%";
            if (id > 0) {
                return consultTeamDao.findMyFamousDoctorListByStatus(uid,status, id, title, pageRequest);
            } else {
                return consultTeamDao.findMyFamousDoctorListByStatus(uid,status, title, pageRequest);
            }
        } else {
            if (id > 0) {
                return consultTeamDao.findMyFamousDoctorListByStatus(uid,status, id, pageRequest);
            } else {
                return consultTeamDao.findMyFamousDoctorListByStatus(uid,status, pageRequest);
            }
        }
    }
    private Page<ConsultTeam> findByDoctorType10(String uid, long id, int pagesize,String title) {
        Sort sort = new Sort(Direction.DESC, "id");
        // 分页信息