|
@ -4194,9 +4194,8 @@ public class ImService {
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Transactional(readOnly = true)
|
|
@Transactional(readOnly = true)
|
|
public List<Map<String, Object>> findConsultRecordByDoctorNew(String doctor, String id,
|
|
|
|
String type, Integer status,
|
|
|
|
int page, int pagesize,
|
|
|
|
|
|
public List<Map<String, Object>> findConsultRecordByDoctorNew(String doctor, String id,String type, Integer status,
|
|
|
|
int page, int pagesize,String dept,
|
|
String title, String start_time, String end_time, String patient) {
|
|
String title, String start_time, String end_time, String patient) {
|
|
String sql = "";
|
|
String sql = "";
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
@ -4268,6 +4267,9 @@ public class ImService {
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) {
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(patient)) {
|
|
sql += " AND (op.consumer='" + patient + "' or op.patient ='" + patient + "')";
|
|
sql += " AND (op.consumer='" + patient + "' or op.patient ='" + patient + "')";
|
|
}
|
|
}
|
|
|
|
if(!StringUtils.isEmpty(dept)){
|
|
|
|
sql += " AND op.dept='" + dept + "' ";
|
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(title)) {
|
|
if (!StringUtils.isEmpty(title)) {
|
|
title = "%" + title + "%";
|
|
title = "%" + title + "%";
|
|
@ -4417,7 +4419,8 @@ public class ImService {
|
|
*
|
|
*
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Long countConsultRecordByDoctor2(String doctor, String id, String type, Integer status, String title, String start_time, String end_time) {
|
|
|
|
|
|
public Long countConsultRecordByDoctor2(String doctor, String id, String type, Integer status, String title,
|
|
|
|
String start_time, String end_time,String dept) {
|
|
String sql = "";
|
|
String sql = "";
|
|
sql = "SELECT " +
|
|
sql = "SELECT " +
|
|
" COUNT(1) AS \"total\" " +
|
|
" COUNT(1) AS \"total\" " +
|
|
@ -4438,7 +4441,9 @@ public class ImService {
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
|
|
if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)) {
|
|
sql += " AND op.doctor='" + doctor + "' ";
|
|
sql += " AND op.doctor='" + doctor + "' ";
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if(!StringUtils.isEmpty(dept)){
|
|
|
|
sql += " AND op.dept='" + dept + "' ";
|
|
|
|
}
|
|
if (!StringUtils.isEmpty(title)) {
|
|
if (!StringUtils.isEmpty(title)) {
|
|
title = "%" + title + "%";
|
|
title = "%" + title + "%";
|
|
sql += " and (op.patient_name like '" + title + "' OR op.doctor_name like '" + title + "' OR op.dept_name like '" + title + "' )";
|
|
sql += " and (op.patient_name like '" + title + "' OR op.doctor_name like '" + title + "' OR op.dept_name like '" + title + "' )";
|
|
@ -4450,11 +4455,9 @@ public class ImService {
|
|
} else {
|
|
} else {
|
|
sql += " and op.create_time >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
sql += " and op.create_time >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
sql += " and op.create_time >= '" + start_time + "'";
|
|
sql += " and op.create_time >= '" + start_time + "'";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(end_time)) {
|
|
if (!StringUtils.isEmpty(end_time)) {
|
|
@ -4464,11 +4467,9 @@ public class ImService {
|
|
} else {
|
|
} else {
|
|
sql += " and op.create_time <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
sql += " and op.create_time <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
sql += " and op.create_time <= '" + end_time + "'";
|
|
sql += " and op.create_time <= '" + end_time + "'";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//咨询类型
|
|
//咨询类型
|
|
@ -4555,11 +4556,9 @@ public class ImService {
|
|
} else {
|
|
} else {
|
|
sql += " and a.create_time >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
sql += " and a.create_time >= to_date('" + start_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
sql += " and a.create_time >= '" + start_time + "'";
|
|
sql += " and a.create_time >= '" + start_time + "'";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(end_time)) {
|
|
if (!StringUtils.isEmpty(end_time)) {
|
|
@ -4569,11 +4568,9 @@ public class ImService {
|
|
} else {
|
|
} else {
|
|
sql += " and a.create_time <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
sql += " and a.create_time <= to_date('" + end_time + "','YYYY-MM-DD HH24:MI:SS')";
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
} else {
|
|
sql += " and a.create_time <= '" + end_time + "'";
|
|
sql += " and a.create_time <= '" + end_time + "'";
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//咨询类型
|
|
//咨询类型
|
|
@ -4599,7 +4596,6 @@ public class ImService {
|
|
}
|
|
}
|
|
sql = sql + "\tORDER BY a.create_time desc ";
|
|
sql = sql + "\tORDER BY a.create_time desc ";
|
|
|
|
|
|
|
|
|
|
List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql);
|
|
List<Map<String, Object>> mapList = hibenateUtils.createSQLQuery(sql);
|
|
for (Map<String, Object> map : mapList) {
|
|
for (Map<String, Object> map : mapList) {
|
|
if (map.get("patientIdcard") != null) {
|
|
if (map.get("patientIdcard") != null) {
|