|
@ -307,36 +307,33 @@ public class DoctorInfoService extends BaseService {
|
|
|
* 根据医院信息获取医生列表
|
|
|
*
|
|
|
* @param query 查询条件 :医生名称
|
|
|
* @param id
|
|
|
* @param page
|
|
|
* @param hospital 医院标识
|
|
|
* 页数
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
public Page<Doctor> getDoctorListByHospital(String query, String hospital,
|
|
|
long id, int pageSize) {
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Direction.DESC, "evaluateScore","id");
|
|
|
// 分页信息
|
|
|
PageRequest pageRequest = new PageRequest(0, pageSize, sort);
|
|
|
// 查询全部
|
|
|
Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
|
|
|
if (StringUtils.isNotEmpty(query)) {
|
|
|
filters.put("name", new SearchFilter("name", Operator.LIKE, query));
|
|
|
}
|
|
|
if (StringUtils.isNotEmpty(hospital)) {
|
|
|
hospital = hospital.substring(0, 8);
|
|
|
filters.put("hospital", new SearchFilter("hospital", Operator.LIKE,
|
|
|
hospital));
|
|
|
}
|
|
|
if (id > 0) {
|
|
|
filters.put("id", new SearchFilter("id", Operator.LT, id));
|
|
|
}
|
|
|
filters.put("level", new SearchFilter("level", Operator.EQ, 2));
|
|
|
Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(
|
|
|
filters.values(), Doctor.class);
|
|
|
return doctorDao.findAll(spec, pageRequest);
|
|
|
}
|
|
|
// @Transactional
|
|
|
// public Page<Doctor> getDoctorListByHospital(String query, String hospital,
|
|
|
// int page, int pageSize) {
|
|
|
// page = page <= 0 ? 0 : page - 1;
|
|
|
// // 排序
|
|
|
// Sort sort = new Sort(Direction.DESC, "evaluateScore","id");
|
|
|
// // 分页信息
|
|
|
// PageRequest pageRequest = new PageRequest(page, pageSize);
|
|
|
// // 查询全部
|
|
|
// Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
|
|
|
// if (StringUtils.isNotEmpty(query)) {
|
|
|
// query="%"+query+"%";
|
|
|
// }else{
|
|
|
// query="%";
|
|
|
// }
|
|
|
// if (StringUtils.isNotEmpty(hospital)) {
|
|
|
// hospital = "%"+hospital.substring(0, 8)+"%";
|
|
|
// }
|
|
|
//
|
|
|
// filters.put("level", new SearchFilter("level", Operator.EQ, 2));
|
|
|
// return doctorDao.getDoctorListByHospital(query,hospital,2, pageRequest);
|
|
|
// }
|
|
|
|
|
|
@Transactional
|
|
|
public List<Doctor> getDoctorCombobxByHospital(String type, String hospital) {
|
|
@ -358,7 +355,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
}
|
|
|
|
|
|
@Transactional
|
|
|
public Page<Doctor> getDoctorListByHospital(String name, String paitentCode, Integer page, Integer pageSize) {
|
|
|
public Page<Doctor> getDoctorListByHospital(String name, String hospital, Integer page, Integer pageSize,Integer level) {
|
|
|
if (pageSize == null | pageSize <= 0) {
|
|
|
pageSize = 10;
|
|
|
}
|
|
@ -366,7 +363,7 @@ public class DoctorInfoService extends BaseService {
|
|
|
page = 1;
|
|
|
}
|
|
|
// 排序
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "name");
|
|
|
Sort sort = new Sort(Sort.Direction.DESC, "evaluateScore");
|
|
|
// 分页信息
|
|
|
PageRequest pageRequest = new PageRequest(page - 1, pageSize, sort);
|
|
|
// 查询全部
|
|
@ -374,9 +371,10 @@ public class DoctorInfoService extends BaseService {
|
|
|
if (StringUtils.isNotEmpty(name)) {
|
|
|
filters.put("name", new SearchFilter("name", SearchFilter.Operator.LIKE, name));
|
|
|
}
|
|
|
filters.put("status", new SearchFilter("status", SearchFilter.Operator.EQ, 1));
|
|
|
filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, 1));
|
|
|
filters.put("iscertified", new SearchFilter("iscertified", SearchFilter.Operator.EQ, 1));
|
|
|
filters.put("hospital", new SearchFilter("hospital", SearchFilter.Operator.EQ, hospital));
|
|
|
|
|
|
filters.put("level", new SearchFilter("level", SearchFilter.Operator.EQ, level));
|
|
|
|
|
|
Specification<Doctor> spec = DynamicSpecifications.bySearchFilter(filters.values(), Doctor.class);
|
|
|
|
|
|
return doctorDao.findAll(spec, pageRequest);
|