Browse Source

代码修改

yeshijie 7 years ago
parent
commit
41af4ece9c

+ 0 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/consult/ConsultDao.java

@ -38,17 +38,10 @@ public interface ConsultDao extends PagingAndSortingRepository<Consult, Long>, J
    @Query("select a from Consult a,ConsultTeam b where a.code = b.consult and a.code = ?1 ")
    Consult findTypeByCode(String code);
    // 按类型查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' and a.type=?3 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, long id,Integer type,Pageable pageRequest);
    // 按类型查询患者咨询记录
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode  from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient,Integer type, Pageable pageRequest);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.id < ?3 and a.del = '1' and a.type=?4 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, String title, long id,Integer type, Pageable pageRequest);
    @Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.evaluate,a.relationCode from Consult a,ConsultTeam b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type=?3 and a.symptoms like ?2 order by a.czrq desc")
    Page<Object> findByPatientAndType(String patient, String title,Integer type, Pageable pageRequest);
}

+ 3 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/consult/ConsultService.java

@ -127,20 +127,12 @@ public class ConsultService extends BaseService {
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		PageRequest pageRequest = new PageRequest((int)id, pagesize, sort);
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			if (id > 0) {
				return consultDao.findByPatientAndType(patient,title, id,type, pageRequest);
			} else {
				return consultDao.findByPatientAndType(patient,title,type, pageRequest);
			}
			return consultDao.findByPatientAndType(patient,title,type, pageRequest);
		}else{
			if (id > 0) {
				return consultDao.findByPatientAndType(patient, id,type, pageRequest);
			} else {
				return consultDao.findByPatientAndType(patient,type, pageRequest);
			}
			return consultDao.findByPatientAndType(patient,type, pageRequest);
		}
	}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/consult/DoctorConsultController.java

@ -1055,7 +1055,7 @@ public class DoctorConsultController extends WeixinBaseController {
     * @return
     */
    @ApiOperation("结束咨询接口")
    @RequestMapping(value = "finish_consult",method = RequestMethod.POST)
    @RequestMapping(value = "finish_consult",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    @ObserverRequired
    public String finishConsult(@RequestParam(required = false) String consult) {