|
@ -7562,19 +7562,19 @@ public class StatisticsEsService {
|
|
|
List<Map<String, Object>> list = null;
|
|
|
if ("1".equals(qvo.getType())) {
|
|
|
//查询所有科室
|
|
|
String sql = "SELECT dept_code 'deptCode',dept_name 'deptName' FROM base_doctor_hospital WHERE del='1'";
|
|
|
String sql = "SELECT distinct dept_code 'deptCode',dept_name 'deptName' FROM base_doctor_hospital WHERE del='1'";
|
|
|
if (StringUtils.isNotBlank(qvo.getDeptName())) {
|
|
|
sql += " and like '%" + qvo.getDeptName() + "%'";
|
|
|
sql += " and dept_name like '%" + qvo.getDeptName() + "%'";
|
|
|
}
|
|
|
list = jdbcTemplate.queryForList(sql);
|
|
|
}
|
|
|
//根据科室或者名称查医生
|
|
|
if ("2".equals(qvo.getType())) {
|
|
|
String sql = "SELECT b.id 'doctorId',b.`name` 'doctorName' FROM base_doctor_hospital a \n" +
|
|
|
String sql = "SELECT distinct b.id 'doctorId',b.`name` 'doctorName' FROM base_doctor_hospital a \n" +
|
|
|
"INNER JOIN base_doctor b ON a.doctor_code=b.id \n" +
|
|
|
"WHERE 1=1 ";
|
|
|
if (StringUtils.isNotBlank(qvo.getDeptCode())) {
|
|
|
sql += " and b.dept_code = '" + qvo.getDeptCode() + "' ";
|
|
|
sql += " and a.dept_code = '" + qvo.getDeptCode() + "' ";
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(qvo.getDoctorName())) {
|
|
|
sql += " and b.`name` LIKE '%" + qvo.getDoctorName() + "%'";
|