|
@ -88,45 +88,46 @@ public class StatisticsService {
|
|
|
|
|
|
public JSONObject serviceResources(){
|
|
public JSONObject serviceResources(){
|
|
String orgFilter = "";
|
|
String orgFilter = "";
|
|
String helperFilter = "";
|
|
|
|
String teacherFilter = "";
|
|
|
|
String sqlOrg = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ";
|
|
String sqlOrg = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' ";
|
|
List<Map<String,Object>> listOrg = jdbcTemplate.queryForList(sqlOrg);
|
|
List<Map<String,Object>> listOrg = jdbcTemplate.queryForList(sqlOrg);
|
|
if(listOrg.size()>0){
|
|
if(listOrg.size()>0){
|
|
String orgCodes = String.valueOf(listOrg.get(0).get("orgCodes"));
|
|
String orgCodes = String.valueOf(listOrg.get(0).get("orgCodes"));
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
orgFilter = " and id not in ('"+orgCodes+"')";
|
|
|
|
}
|
|
|
|
|
|
|
|
String sqlHelper = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_helper' ";
|
|
|
|
List<Map<String,Object>> listHelper = jdbcTemplate.queryForList(sqlHelper);
|
|
|
|
if(listHelper.size()>0){
|
|
|
|
String orgCodes = String.valueOf(listHelper.get(0).get("orgCodes"));
|
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
|
helperFilter = " and id not in ('"+orgCodes+"')";
|
|
|
|
}
|
|
|
|
|
|
|
|
String sqltmp = "SELECT GROUP_CONCAT(dict_code) orgCodes from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_teacher' ";
|
|
|
|
List<Map<String,Object>> listtmp = jdbcTemplate.queryForList(sqltmp);
|
|
|
|
if(listtmp.size()>0){
|
|
|
|
String orgCodes = String.valueOf(listtmp.get(0).get("orgCodes"));
|
|
|
|
orgCodes = orgCodes.replaceAll(",","','");
|
|
|
|
teacherFilter = " and id not in ('"+orgCodes+"')";
|
|
|
|
|
|
orgFilter = " and code not in ('"+orgCodes+"')";
|
|
}
|
|
}
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
JSONObject res = new JSONObject();
|
|
String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 ";
|
|
String medicalInstitutionSql = "SELECT COUNT(1) FROM base_org WHERE (type = 1 OR type = 2) AND del = 1 ";
|
|
String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1"+orgFilter;
|
|
String elderlyCarServiceSql = "SELECT COUNT(1) FROM base_org WHERE type = 3 AND del = 1"+orgFilter;
|
|
String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1"+orgFilter;
|
|
String childcareInstitutionsssSql = "SELECT COUNT(1) FROM base_org WHERE type = 4 AND del = 1"+orgFilter;
|
|
String doctorSql = "SELECT COUNT(1) FROM base_doctor WHERE del = 1 AND doctor_level = 1";
|
|
|
|
String helperSql = "SELECT COUNT(1) FROM base_doctor WHERE del = 1 AND doctor_level = 2" +helperFilter;
|
|
|
|
String teacherSql = "SELECT COUNT(1) FROM base_doctor WHERE del = 1 AND doctor_level = 3"+teacherFilter;
|
|
|
|
|
|
|
|
|
|
//助老员和教师注册人数
|
|
|
|
Integer doctorNum = 0;
|
|
|
|
Integer helperNum = 0;
|
|
|
|
Integer teacherNum = 0;
|
|
|
|
String sql2 = "SELECT COUNT(a.id) c,a.doctor_level from base_doctor a,base_doctor_hospital h where a.id=h.doctor_code and a.del = '1' and h.del = '1' " +
|
|
|
|
"and a.doctor_level is not null and h.org_code not in ( " +
|
|
|
|
"SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_org' " +
|
|
|
|
") GROUP BY a.doctor_level";
|
|
|
|
List<Map<String,Object>> list2 = jdbcTemplate.queryForList(sql2);
|
|
|
|
for(Map<String,Object> map:list2){
|
|
|
|
String archive_type = map.get("doctor_level").toString();
|
|
|
|
Integer num = Integer.valueOf(map.get("c").toString());
|
|
|
|
if("1".equals(archive_type)){
|
|
|
|
doctorNum = num;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if("2".equals(archive_type)){
|
|
|
|
helperNum = num;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if("3".equals(archive_type)){
|
|
|
|
teacherNum = num;
|
|
|
|
}
|
|
|
|
}
|
|
Integer medicalInstitutionNum = jdbcTemplate.queryForObject(medicalInstitutionSql,Integer.class);
|
|
Integer medicalInstitutionNum = jdbcTemplate.queryForObject(medicalInstitutionSql,Integer.class);
|
|
Integer elderlyCarServiceNum = jdbcTemplate.queryForObject(elderlyCarServiceSql,Integer.class);
|
|
Integer elderlyCarServiceNum = jdbcTemplate.queryForObject(elderlyCarServiceSql,Integer.class);
|
|
Integer childcareInstitutionsssNum = jdbcTemplate.queryForObject(childcareInstitutionsssSql,Integer.class);
|
|
Integer childcareInstitutionsssNum = jdbcTemplate.queryForObject(childcareInstitutionsssSql,Integer.class);
|
|
Integer doctorNum = jdbcTemplate.queryForObject(doctorSql,Integer.class);
|
|
|
|
Integer helperNum = jdbcTemplate.queryForObject(helperSql,Integer.class);
|
|
|
|
Integer teacherNum = jdbcTemplate.queryForObject(teacherSql,Integer.class);
|
|
|
|
res.put("medicalInstitutionNum",medicalInstitutionNum); //医疗结构
|
|
res.put("medicalInstitutionNum",medicalInstitutionNum); //医疗结构
|
|
res.put("elderlyCarServiceNum",elderlyCarServiceNum); //养老机构
|
|
res.put("elderlyCarServiceNum",elderlyCarServiceNum); //养老机构
|
|
res.put("childcareInstitutionsssNum",childcareInstitutionsssNum); //托育机构
|
|
res.put("childcareInstitutionsssNum",childcareInstitutionsssNum); //托育机构
|