|
|
@ -170,13 +170,13 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
if("org".equals(aggField)) {
|
|
|
selectSql += fromPart;
|
|
|
} else if("dept".equals(aggField)) {
|
|
|
selectSql += ",dh.dept_code AS \"deptCode\",dh.dept_name AS \"deptName\" ";
|
|
|
selectSql += ",dh.dept_code AS \"deptCode\",dh.dept_name AS \"deptName\",dh.org_code AS \"orgCode\",dh.org_name AS \"orgName\" ";
|
|
|
selectSql += fromPart;
|
|
|
if(StringUtils.isBlank(orgId)) {
|
|
|
throw new ServiceException("参数未传");
|
|
|
}
|
|
|
filterSql += " AND op.scbgjt_org_code = '" + orgId + "' ";
|
|
|
groupSql += " ,dh.dept_code, dh.dept_name ";
|
|
|
groupSql += " ,dh.dept_code, dh.dept_name,dh.org_code,dh.org_name ";
|
|
|
} else if("doctor".equals(aggField)) {
|
|
|
selectSql += ",dh.dept_code AS \"deptCode\"," +
|
|
|
"dh.dept_name AS \"deptName\"," +
|
|
|
@ -189,7 +189,14 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
if(StringUtils.isBlank(orgId) || StringUtils.isBlank(deptId)) {
|
|
|
throw new ServiceException("参数未传");
|
|
|
}
|
|
|
filterSql += " AND op.scbgjt_org_code ='"+orgId+"' AND dh.dept_code='" + deptId + "' ";
|
|
|
filterSql += " AND op.scbgjt_org_code ='"+orgId+"' ";
|
|
|
|
|
|
if("null".equals(deptId)) {
|
|
|
filterSql += " AND dh.dept_code IS NULL ";
|
|
|
} else {
|
|
|
filterSql += " AND dh.dept_code='" + deptId + "' ";
|
|
|
}
|
|
|
|
|
|
groupSql += ",dh.dept_code,dh.dept_name,op.doctor,op.doctor_name,dh.doctor_duty_name,dh.org_code,dh.org_name ";
|
|
|
}
|
|
|
|
|
|
@ -271,8 +278,6 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
String selectSql = "SELECT " +
|
|
|
"TO_CHAR(op.create_time, 'YYYY-MM-DD') AS \"statDate\"," +
|
|
|
"op.scbgjt_org_code AS \"scbgjtOrgCode\"," +
|
|
|
"op.scbgjt_org_name AS \"scbgjtOrgName\", " +
|
|
|
"COUNT(*) AS \"consultNum\", " +
|
|
|
"COUNT(CASE WHEN op.status >= 1 THEN 1 ELSE NULL END) AS \"haveReceiveNum\", " +
|
|
|
"COUNT(CASE WHEN op.status <= 0 THEN 1 ELSE NULL END) AS \"noReceiveNum\", " +
|
|
|
@ -287,20 +292,30 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
" AND TO_DATE('"+endTime+" 23:59:59', 'YYYY-MM-DD HH24:MI:SS') AND op.scbgjt_org_code IS NOT NULL ";
|
|
|
|
|
|
String groupSql = "GROUP BY " +
|
|
|
" TO_CHAR(op.create_time, 'YYYY-MM-DD'),op.scbgjt_org_code, op.scbgjt_org_name ";
|
|
|
" TO_CHAR(op.create_time, 'YYYY-MM-DD') ";
|
|
|
|
|
|
if("org".equals(aggField)) {
|
|
|
selectSql += ",op.scbgjt_org_code AS \"scbgjtOrgCode\",op.scbgjt_org_name AS \"scbgjtOrgName\" ";
|
|
|
selectSql += fromPart;
|
|
|
if(!StringUtils.isBlank(orgId)) {
|
|
|
filterSql += " AND op.scbgjt_org_code='"+orgId+"' ";
|
|
|
if(StringUtils.isBlank(orgId)) {
|
|
|
throw new ServiceException("参数未传");
|
|
|
}
|
|
|
filterSql += " AND op.scbgjt_org_code='"+orgId+"' ";
|
|
|
groupSql += " ,op.scbgjt_org_code, op.scbgjt_org_name ";
|
|
|
} else if("dept".equals(aggField)) {
|
|
|
selectSql += ",dh.dept_code AS \"deptCode\",dh.dept_name AS \"deptName\" ";
|
|
|
selectSql += fromPart;
|
|
|
if(StringUtils.isBlank(orgId) || StringUtils.isBlank(deptId)) {
|
|
|
throw new ServiceException("参数未传");
|
|
|
}
|
|
|
filterSql += " AND op.scbgjt_org_code ='"+orgId+"' AND dh.dept_code='" + deptId + "' ";
|
|
|
filterSql += " AND op.scbgjt_org_code ='"+orgId+"' ";
|
|
|
|
|
|
if("null".equals(deptId)) {
|
|
|
filterSql += " AND dh.dept_code IS NULL ";
|
|
|
} else {
|
|
|
filterSql += " AND dh.dept_code='" + deptId + "' ";
|
|
|
}
|
|
|
|
|
|
groupSql += " ,dh.dept_code, dh.dept_name ";
|
|
|
} else if("doctor".equals(aggField)) {
|
|
|
selectSql += ",dh.dept_code AS \"deptCode\"," +
|
|
|
@ -314,6 +329,8 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
filterSql += " AND op.scbgjt_org_code ='"+orgId+"' AND dh.dept_code='" + deptId + "' AND op.doctor='"+doctorId+"' ";
|
|
|
groupSql += ",dh.dept_code,dh.dept_name,op.doctor,op.doctor_name,dh.doctor_duty_name ";
|
|
|
} else {
|
|
|
selectSql += fromPart;
|
|
|
}
|
|
|
|
|
|
if(StringUtils.isNotBlank(mediaType)) {
|
|
|
@ -462,8 +479,8 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
addCell(ws, i, 2, Objects.toString(m.get("doctorName"),""));
|
|
|
addCell(ws, i, 3, Objects.toString(m.get("doctorDutyName"),""));
|
|
|
addCell(ws, i, 4, Objects.toString(m.get("consultNum"),""));
|
|
|
addCell(ws, i, 5, Objects.toString(m.get("haveReceiveNum"),""));
|
|
|
addCell(ws, i, 6, Objects.toString(m.get("noReceiveNum"),""));
|
|
|
addCell(ws, i, 5, Objects.toString(m.get("noReceiveNum"),""));
|
|
|
addCell(ws, i, 6, Objects.toString(m.get("haveReceiveNum"),""));
|
|
|
addCell(ws, i, 7, Objects.toString(m.get("cancelNum"),""));
|
|
|
i++;
|
|
|
}
|