|
|
@ -221,6 +221,7 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
|
|
|
// selectSql = selectSql + " limit " + (pageNum-1)*pageSize +","+ pageSize;
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(selectSql, pageNum, pageSize);
|
|
|
System.out.println(selectSql);
|
|
|
// List<Map<String, Object>> list = jdbcTemplate.queryForList(selectSql);
|
|
|
Integer total = jdbcTemplate.queryForObject(countSql, Integer.class);
|
|
|
|
|
|
@ -253,7 +254,13 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
@ApiParam(name = "deptId", value = "科室id")
|
|
|
@RequestParam(value = "deptId",required = false) String deptId,
|
|
|
@ApiParam(name = "doctorId", value = "医生的id")
|
|
|
@RequestParam(value = "doctorId",required = false) String doctorId) {
|
|
|
@RequestParam(value = "doctorId",required = false) String doctorId,
|
|
|
@ApiParam(name = "roleType", value = "1专科医生 2管理员")
|
|
|
@RequestParam(value = "roleType",required = true) String roleType,
|
|
|
@ApiParam(name = "userOrgId", value = "医生所属机构id")
|
|
|
@RequestParam(value = "userOrgId",required = true) String userOrgId,
|
|
|
@ApiParam(name = "userId", value = "医生id(当前登录用户)")
|
|
|
@RequestParam(value = "userId",required = true) String userId) {
|
|
|
try {
|
|
|
|
|
|
String selectSql = "SELECT " +
|
|
|
@ -313,12 +320,21 @@ public class DoctorConsultStatisticsEndpoint extends EnvelopRestEndpoint {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if("1".equals(roleType)) { // 专科医生
|
|
|
filterSql += " AND op.doctor = '" + userId + "' ";
|
|
|
} else if("2".equals(roleType)) { // 管理员
|
|
|
filterSql += " AND dh.org_code = '" + userOrgId + "' ";
|
|
|
} else {
|
|
|
throw new ServiceException("角色类型有误");
|
|
|
}
|
|
|
|
|
|
selectSql += filterSql;
|
|
|
selectSql += groupSql;
|
|
|
|
|
|
selectSql += " ORDER BY TO_CHAR(op.create_time, 'YYYY-MM-DD') ASC ";
|
|
|
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(selectSql);
|
|
|
System.out.println(selectSql);
|
|
|
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("list",list);
|