|
@ -735,7 +735,7 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getDoctorPrescription(Integer teamCode, String state, String diseases, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size) {
|
|
|
public List<Map<String, Object>> getDoctorPrescription(Integer teamCode, String state, String diseases, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size,String isPcim) {
|
|
|
StringBuffer pre_sql = new StringBuffer("SELECT " +
|
|
|
" p.`name`, " +
|
|
|
" TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
|
|
@ -758,11 +758,11 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
" WHERE s.prescription_code = pr.code " +
|
|
|
" AND s.health_problem = ?");
|
|
|
params.add(diseases);
|
|
|
setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size);
|
|
|
setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size, isPcim);
|
|
|
} else {
|
|
|
//查询所有疾病类型表
|
|
|
pre_sql.append(" WHERE 1=1 ");
|
|
|
setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size);
|
|
|
setSQL(pre_sql, params, teamCode, state, startDate, endDate, nameKeyword, patient, page, size, isPcim);
|
|
|
}
|
|
|
List<Map<String, Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(), params.toArray());
|
|
|
|
|
@ -775,14 +775,29 @@ public class PrescriptionInfoService extends BaseService {
|
|
|
return rs;
|
|
|
}
|
|
|
|
|
|
public void setSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size) {
|
|
|
public void setSQL(StringBuffer pre_sql, List<Object> params, Integer teamCode, String state, String startDate, String endDate, String nameKeyword, String patient, Integer page, Integer size, String isPcim) {
|
|
|
if (teamCode != null && teamCode > 0) {
|
|
|
pre_sql.append(" AND pr.admin_team_id =?");
|
|
|
params.add(teamCode);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotBlank(state)) {
|
|
|
pre_sql.append(" AND pr.status IN (" + state + ") ");
|
|
|
//不是pcim新改的用原来的接口-2018.03.09
|
|
|
if (StringUtils.isNotBlank(isPcim) && "0".equals(isPcim)){
|
|
|
pre_sql.append(" AND pr.status IN (" + state + ") ");
|
|
|
}else if (StringUtils.isNotBlank(isPcim) && "1".equals(isPcim)){
|
|
|
//如果是pcim新改的则状态搜索改变
|
|
|
//待审核和已完成
|
|
|
if ("0".equals(state) || "100".equals(state)){
|
|
|
pre_sql.append(" AND pr.status IN (" + state + ") ");
|
|
|
}else if ("-1".equals(state)){
|
|
|
//已取消
|
|
|
pre_sql.append(" AND pr.status < (-1) ");
|
|
|
}else if ("1".equals(state)){
|
|
|
//已完成
|
|
|
pre_sql.append(" AND pr.status > 0 AND pr.status <100 ");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(startDate)) {
|
|
|
pre_sql.append(" AND pr.create_time >= ? ");
|