diff --git a/Sqlitedb/training.db b/Sqlitedb/training.db index a0fd03c..bb5e7cf 100644 Binary files a/Sqlitedb/training.db and b/Sqlitedb/training.db differ diff --git a/src/main/java/com/jingcheng/cms/model/EducationResume.java b/src/main/java/com/jingcheng/cms/model/EducationResume.java index cec36f5..64ccd5e 100644 --- a/src/main/java/com/jingcheng/cms/model/EducationResume.java +++ b/src/main/java/com/jingcheng/cms/model/EducationResume.java @@ -38,7 +38,7 @@ public class EducationResume { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "学历", orderNum = "2") + @Excel(name = "就业学历", orderNum = "2") private String education; /** @@ -47,7 +47,7 @@ public class EducationResume { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "学校", orderNum = "3") + @Excel(name = "最高学历学校", orderNum = "6") private String school; /** @@ -56,7 +56,7 @@ public class EducationResume { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "专业", orderNum = "4") + @Excel(name = "专业", orderNum = "7") private String speciality; /** @@ -65,7 +65,7 @@ public class EducationResume { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "入学时间", orderNum = "5") + @Excel(name = "入学时间", orderNum = "8") private String intake; /** @@ -74,9 +74,36 @@ public class EducationResume { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "毕业时间", orderNum = "6") + @Excel(name = "毕业时间", orderNum = "9") private String graduationTime; + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column education_resume.highest_education + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "最高学历", orderNum = "3") + private String highestEducation; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column education_resume.undergraduate_schools + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "本科学历学校", orderNum = "4") + private String undergraduateSchools; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column education_resume.undergraduate_major + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "本科学历专业", orderNum = "5") + private String undergraduateMajor; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column education_resume.create_date_time @@ -428,4 +455,77 @@ public class EducationResume { public void setState(Integer state) { this.state = state; } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column education_resume.highest_education + * + * @return the value of education_resume.highest_education + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getHighestEducation() { + return highestEducation; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column education_resume.highest_education + * + * @param highestEducation the value for education_resume.highest_education + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setHighestEducation(String highestEducation) { + this.highestEducation = highestEducation; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column education_resume.undergraduate_schools + * + * @return the value of education_resume.undergraduate_schools + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getUndergraduateSchools() { + return undergraduateSchools; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column education_resume.undergraduate_schools + * + * @param undergraduateSchools the value for education_resume.undergraduate_schools + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setUndergraduateSchools(String undergraduateSchools) { + this.undergraduateSchools = undergraduateSchools; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column education_resume.undergraduate_major + * + * @return the value of education_resume.undergraduate_major + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getUndergraduateMajor() { + return undergraduateMajor; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column education_resume.undergraduate_major + * + * @param undergraduateMajor the value for education_resume.undergraduate_major + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setUndergraduateMajor(String undergraduateMajor) { + this.undergraduateMajor = undergraduateMajor; + } + } \ No newline at end of file diff --git a/src/main/java/com/jingcheng/cms/model/Employee.java b/src/main/java/com/jingcheng/cms/model/Employee.java index f4ce17c..8e61536 100644 --- a/src/main/java/com/jingcheng/cms/model/Employee.java +++ b/src/main/java/com/jingcheng/cms/model/Employee.java @@ -152,6 +152,57 @@ public class Employee { */ private Long highestEducationId; + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.department + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "部门", orderNum = "10") + private String department; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.department_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + private Long departmentId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.age + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "年龄", orderNum = "11") + private String age; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.age_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + private Long ageId; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.sex + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + @Excel(name = "性别", replace = { "男_1", "女_2" }, orderNum = "12") + private Integer sex; + + /** + * This field was generated by MyBatis Generator. + * This field corresponds to the database column employee.photo + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + private String photo; + /** * This field was generated by MyBatis Generator. * This field corresponds to the database column employee.create_date_time @@ -719,4 +770,147 @@ public class Employee { public void setState(Integer state) { this.state = state; } + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.department + * + * @return the value of employee.department + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getDepartment() { + return department; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.department + * + * @param department the value for employee.department + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setDepartment(String department) { + this.department = department; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.department_id + * + * @return the value of employee.department_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public Long getDepartmentId() { + return departmentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.department_id + * + * @param departmentId the value for employee.department_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setDepartmentId(Long departmentId) { + this.departmentId = departmentId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.age + * + * @return the value of employee.age + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getAge() { + return age; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.age + * + * @param age the value for employee.age + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setAge(String age) { + this.age = age; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.age_id + * + * @return the value of employee.age_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public Long getAgeId() { + return ageId; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.age_id + * + * @param ageId the value for employee.age_id + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setAgeId(Long ageId) { + this.ageId = ageId; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.sex + * + * @return the value of employee.sex + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public Integer getSex() { + return sex; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.sex + * + * @param sex the value for employee.sex + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setSex(Integer sex) { + this.sex = sex; + } + + /** + * This method was generated by MyBatis Generator. + * This method returns the value of the database column employee.photo + * + * @return the value of employee.photo + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public String getPhoto() { + return photo; + } + + /** + * This method was generated by MyBatis Generator. + * This method sets the value of the database column employee.photo + * + * @param photo the value for employee.photo + * + * @mbggenerated Tue Jun 13 23:39:23 CST 2023 + */ + public void setPhoto(String photo) { + this.photo = photo; + } } \ No newline at end of file diff --git a/src/main/java/com/jingcheng/cms/model/Honor.java b/src/main/java/com/jingcheng/cms/model/Honor.java index 5c023dd..c2e36fd 100644 --- a/src/main/java/com/jingcheng/cms/model/Honor.java +++ b/src/main/java/com/jingcheng/cms/model/Honor.java @@ -38,7 +38,7 @@ public class Honor { * * @mbggenerated Wed May 03 18:26:57 CST 2023 */ - @Excel(name = "荣誉等级", orderNum = "2") + @Excel(name = "奖惩等级", orderNum = "2") private String honorLevel; /** diff --git a/src/main/java/com/jingcheng/cms/service/impl/EmployeeServiceImpl.java b/src/main/java/com/jingcheng/cms/service/impl/EmployeeServiceImpl.java index 1e44f05..f033d94 100644 --- a/src/main/java/com/jingcheng/cms/service/impl/EmployeeServiceImpl.java +++ b/src/main/java/com/jingcheng/cms/service/impl/EmployeeServiceImpl.java @@ -52,17 +52,34 @@ public class EmployeeServiceImpl implements EmployeeService { Employee employee = JSONObject.toJavaObject(jsonObject, Employee.class); Example.Criteria criteria = example.createCriteria(); criteria.andEqualTo("state",Constants.STATE_VALID); - String honorLevel = jsonObject.getString("honorLevel"); String honorDescription = jsonObject.getString("honorDescription"); - JSONArray jsonArray = jsonObject.getJSONArray("ptqIds"); - List ptqIds = jsonArray != null ? jsonArray.toJavaList(Long.class) : new ArrayList<>(); + JSONArray ptqIdsJson = jsonObject.getJSONArray("ptqIds"); + List ptqIds = ptqIdsJson != null ? ptqIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray postIdsJson = jsonObject.getJSONArray("postIds"); + List postIds = postIdsJson != null ? postIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray groupsIdsJson = jsonObject.getJSONArray("groupsIds"); + List groupsIds = groupsIdsJson != null ? groupsIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray skillLevelIdsJson = jsonObject.getJSONArray("skillLevelIds"); + List skillLevelIds = skillLevelIdsJson != null ? skillLevelIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray highestEducationIdsJson = jsonObject.getJSONArray("highestEducationIds"); + List highestEducationIds = highestEducationIdsJson != null ? highestEducationIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray unitIdsJson = jsonObject.getJSONArray("unitIds"); + List unitIds = unitIdsJson != null ? unitIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray honorLevelsJson = jsonObject.getJSONArray("honorLevels"); + List honorLevels = honorLevelsJson != null ? honorLevelsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray sexesJson = jsonObject.getJSONArray("sexes"); + List sexes = sexesJson != null ? sexesJson.toJavaList(Integer.class) : new ArrayList<>(); + JSONArray departmentIdsJson = jsonObject.getJSONArray("departmentIds"); + List departmentIds = departmentIdsJson != null ? departmentIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray ageIdsJson = jsonObject.getJSONArray("ageIds"); + List ageIds = ageIdsJson != null ? ageIdsJson.toJavaList(Long.class) : new ArrayList<>(); List honorEmployees = new ArrayList<>(); - if (StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) { + if ((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) { Example example1 = new Example(Honor.class); Example.Criteria criteria1 = example1.createCriteria(); criteria1.andEqualTo("state",Constants.STATE_VALID); - if (StringUtils.isNotEmpty(honorLevel)) { - criteria1.andEqualTo("honorLevel", honorLevel); + if (null != honorLevels && honorLevels.size() > 0) { + criteria1.andIn("honorLevel", honorLevels); } if (StringUtils.isNotEmpty(honorDescription)) { criteria1.andLike("honorDescription", "%"+honorDescription+"%"); @@ -76,13 +93,17 @@ public class EmployeeServiceImpl implements EmployeeService { if (honorEmployees.size() > 0) criteria.andIn("employeeNo", honorEmployees); if (StringUtils.isNotEmpty(employee.getEmployeeName())) criteria.andLike("employeeName", "%"+employee.getEmployeeName()+"%"); if (StringUtils.isNotEmpty(employee.getMobile())) criteria.andLike("mobile", "%"+employee.getMobile()+"%"); - if (null != employee.getPostId()) criteria.andEqualTo("postId", employee.getPostId()); - if (null != employee.getGroupsId()) criteria.andEqualTo("groupsId", employee.getGroupsId()); + if (null != sexes && sexes.size() > 0) criteria.andIn("sex", sexes); + if (null != departmentIds && departmentIds.size() > 0) criteria.andIn("departmentId", departmentIds); + if (null != ageIds && ageIds.size() > 0) criteria.andIn("ageId", ageIds); if (null != ptqIds && ptqIds.size() > 0) criteria.andIn("ptqId", ptqIds); - if (null != employee.getSkillLevelId()) criteria.andEqualTo("skillLevelId", employee.getSkillLevelId()); - if (null != employee.getHighestEducationId()) criteria.andEqualTo("highestEducationId", employee.getHighestEducationId()); + if (null != unitIds && unitIds.size() > 0) criteria.andIn("unitId", unitIds); + if (null != postIds && postIds.size() > 0) criteria.andIn("postId", postIds); + if (null != groupsIds && groupsIds.size() > 0) criteria.andIn("groupsId", groupsIds); + if (null != skillLevelIds && skillLevelIds.size() > 0) criteria.andIn("skillLevelId", skillLevelIds); + if (null != highestEducationIds && highestEducationIds.size() > 0) criteria.andIn("highestEducationId", highestEducationIds); List employeeList = employeeMapper.selectByExample(example); - if ((StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>(); + if (((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>(); JSONObject pageJson = PageUtils.page(employeeList,current,pageSize); return pageJson; } @@ -94,17 +115,34 @@ public class EmployeeServiceImpl implements EmployeeService { Employee employee = JSONObject.toJavaObject(jsonObject, Employee.class); Example.Criteria criteria = example.createCriteria(); criteria.andEqualTo("state",Constants.STATE_VALID); - String honorLevel = jsonObject.getString("honorLevel"); String honorDescription = jsonObject.getString("honorDescription"); - JSONArray jsonArray = jsonObject.getJSONArray("ptqIds"); - List ptqIds = jsonArray.toJavaList(Long.class); + JSONArray ptqIdsJson = jsonObject.getJSONArray("ptqIds"); + List ptqIds = ptqIdsJson != null ? ptqIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray postIdsJson = jsonObject.getJSONArray("postIds"); + List postIds = postIdsJson != null ? postIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray groupsIdsJson = jsonObject.getJSONArray("groupsIds"); + List groupsIds = groupsIdsJson != null ? groupsIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray skillLevelIdsJson = jsonObject.getJSONArray("skillLevelIds"); + List skillLevelIds = skillLevelIdsJson != null ? skillLevelIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray highestEducationIdsJson = jsonObject.getJSONArray("highestEducationIds"); + List highestEducationIds = highestEducationIdsJson != null ? highestEducationIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray unitIdsJson = jsonObject.getJSONArray("unitIds"); + List unitIds = unitIdsJson != null ? unitIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray honorLevelsJson = jsonObject.getJSONArray("honorLevels"); + List honorLevels = honorLevelsJson != null ? honorLevelsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray sexesJson = jsonObject.getJSONArray("sexes"); + List sexes = sexesJson != null ? sexesJson.toJavaList(Integer.class) : new ArrayList<>(); + JSONArray departmentIdsJson = jsonObject.getJSONArray("departmentIds"); + List departmentIds = departmentIdsJson != null ? departmentIdsJson.toJavaList(Long.class) : new ArrayList<>(); + JSONArray ageIdsJson = jsonObject.getJSONArray("ageIds"); + List ageIds = ageIdsJson != null ? ageIdsJson.toJavaList(Long.class) : new ArrayList<>(); List honorEmployees = new ArrayList<>(); - if (StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) { + if ((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) { Example example1 = new Example(Honor.class); Example.Criteria criteria1 = example1.createCriteria(); criteria1.andEqualTo("state",Constants.STATE_VALID); - if (StringUtils.isNotEmpty(honorLevel)) { - criteria1.andEqualTo("honorLevel", honorLevel); + if (null != honorLevels && honorLevels.size() > 0) { + criteria1.andIn("honorLevel", honorLevels); } if (StringUtils.isNotEmpty(honorDescription)) { criteria1.andLike("honorDescription", "%"+honorDescription+"%"); @@ -116,13 +154,17 @@ public class EmployeeServiceImpl implements EmployeeService { if (honorEmployees.size() > 0) criteria.andIn("employeeNo", honorEmployees); if (StringUtils.isNotEmpty(employee.getEmployeeName())) criteria.andLike("employeeName", "%"+employee.getEmployeeName()+"%"); if (StringUtils.isNotEmpty(employee.getMobile())) criteria.andLike("mobile", "%"+employee.getMobile()+"%"); - if (null != employee.getPostId()) criteria.andEqualTo("postId", employee.getPostId()); - if (null != employee.getGroupsId()) criteria.andEqualTo("groupsId", employee.getGroupsId()); if (null != ptqIds && ptqIds.size() > 0) criteria.andIn("ptqId", ptqIds); - if (null != employee.getSkillLevelId()) criteria.andEqualTo("skillLevelId", employee.getSkillLevelId()); - if (null != employee.getHighestEducationId()) criteria.andEqualTo("highestEducationId", employee.getHighestEducationId()); + if (null != sexes && sexes.size() > 0) criteria.andIn("sex", sexes); + if (null != departmentIds && departmentIds.size() > 0) criteria.andIn("departmentId", departmentIds); + if (null != ageIds && ageIds.size() > 0) criteria.andIn("ageId", ageIds); + if (null != unitIds && unitIds.size() > 0) criteria.andIn("unitId", unitIds); + if (null != postIds && postIds.size() > 0) criteria.andIn("postId", postIds); + if (null != groupsIds && groupsIds.size() > 0) criteria.andIn("groupsId", groupsIds); + if (null != skillLevelIds && skillLevelIds.size() > 0) criteria.andIn("skillLevelId", skillLevelIds); + if (null != highestEducationIds && highestEducationIds.size() > 0) criteria.andIn("highestEducationId", highestEducationIds); List employeeList = employeeMapper.selectByExample(example); - if ((StringUtils.isNotEmpty(honorLevel) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>(); + if (((null != honorLevels && honorLevels.size() > 0) || StringUtils.isNotEmpty(honorDescription)) && honorEmployees.size() == 0) employeeList = new ArrayList<>(); ExportParams exportParams = new ExportParams(); Workbook workbook = ExcelExportUtil.exportExcel(exportParams,Employee.class, employeeList); ExcelUtils.export(workbook, response, "员工导出"); @@ -205,6 +247,22 @@ public class EmployeeServiceImpl implements EmployeeService { employee.setHighestEducationId(infoSettingValuesFilter.get(0).getId()); } } + //年龄 + if (StringUtils.isNotEmpty(employee.getAge())) { + List infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("年龄"); + List infoSettingValuesFilter = infoSettingValues.stream().filter(item -> item.getSettingValue().equals(employee.getAge())).collect(Collectors.toList()); + if (infoSettingValuesFilter.size() > 0) { + employee.setAgeId(infoSettingValuesFilter.get(0).getId()); + } + } + //部门 + if (StringUtils.isNotEmpty(employee.getDepartment())) { + List infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("部门"); + List infoSettingValuesFilter = infoSettingValues.stream().filter(item -> item.getSettingValue().equals(employee.getDepartment())).collect(Collectors.toList()); + if (infoSettingValuesFilter.size() > 0) { + employee.setDepartmentId(infoSettingValuesFilter.get(0).getId()); + } + } Employee employeeSelect = new Employee(); employeeSelect.setEmployeeNo(employee.getEmployeeNo()); employeeSelect.setState(Constants.ENABLE); @@ -253,15 +311,21 @@ public class EmployeeServiceImpl implements EmployeeService { @Override public AjaxResult dataStatistics(JSONObject jsonObject) { AjaxResult ajaxResult = new AjaxResult(); - String postName = jsonObject.getString("postName"); + JSONArray postNamesJson = jsonObject.getJSONArray("postNames"); + List postNames = postNamesJson != null ? postNamesJson.toJavaList(String.class) : new ArrayList<>(); + JSONArray departmentsJson = jsonObject.getJSONArray("departments"); + List departments = departmentsJson != null ? departmentsJson.toJavaList(String.class) : new ArrayList<>(); // List postIdList = (List) Arrays.stream(postIds.split(",")).mapToLong(num -> Long.parseLong(num)); Integer isEdu = jsonObject.getInteger("isEdu"); Integer isSkill = jsonObject.getInteger("isSkill"); Integer isPtq = jsonObject.getInteger("isPtq"); + Integer isDepartment = jsonObject.getInteger("isDepartment"); + Integer isAge = jsonObject.getInteger("isAge"); + Integer isSex = jsonObject.getInteger("isSex"); List dataStatisticsVOS = new ArrayList<>(); List postNameList = new ArrayList<>(); - if (StringUtils.isNotEmpty(postName)) { - postNameList.add(postName); + if (postNames != null && postNames.size() > 0) { + postNameList = postNames; } else { List infoSettingValues = infoSettingValueService.getAllInfoSettingValueBySettingName("岗位"); postNameList = infoSettingValues.stream().map(item -> item.getSettingValue()).collect(Collectors.toList()); @@ -282,6 +346,27 @@ public class EmployeeServiceImpl implements EmployeeService { List dataAnalysisVOS = employeeMapper.dataStatistics(3, s); dataStatisticsVO.setSkillLevelList(dataAnalysisVOS); } + if (null != isSex && isSex == 1) { + List dataAnalysisVOS = employeeMapper.dataStatistics(4, s); + dataStatisticsVO.setSexList(dataAnalysisVOS); + } + if (null != isAge && isAge == 1) { + List dataAnalysisVOS = employeeMapper.dataStatistics(5, s); + dataStatisticsVO.setAgeList(dataAnalysisVOS); + } + if (null != isDepartment && isDepartment == 1) { + List dataAnalysisVOS = employeeMapper.dataStatistics(6, s); + if (departments != null && departments.size()>0) { + List dataAnalysisVOS1 = new ArrayList<>(); + for (DataAnalysisVO dataAnalysisVO : dataAnalysisVOS) { + if (departments.contains(dataAnalysisVO.getAnalysisName())) { + dataAnalysisVOS1.add(dataAnalysisVO); + } + } + dataAnalysisVOS = dataAnalysisVOS1; + } + dataStatisticsVO.setDepartmentList(dataAnalysisVOS); + } dataStatisticsVOS.add(dataStatisticsVO); } diff --git a/src/main/java/com/jingcheng/cms/vo/DataStatisticsVO.java b/src/main/java/com/jingcheng/cms/vo/DataStatisticsVO.java index bccaf97..3a3b030 100644 --- a/src/main/java/com/jingcheng/cms/vo/DataStatisticsVO.java +++ b/src/main/java/com/jingcheng/cms/vo/DataStatisticsVO.java @@ -12,4 +12,7 @@ public class DataStatisticsVO { private List educationList; private List ptqList; private List skillLevelList; + private List sexList; + private List departmentList; + private List ageList; } diff --git a/src/main/resources/generator/generatorConfig.xml b/src/main/resources/generator/generatorConfig.xml index bd760e4..15c6164 100644 --- a/src/main/resources/generator/generatorConfig.xml +++ b/src/main/resources/generator/generatorConfig.xml @@ -26,10 +26,10 @@ - + - + + diff --git a/src/main/resources/mapper/EmployeeMapper.xml b/src/main/resources/mapper/EmployeeMapper.xml index 09ce8b9..a6897f6 100644 --- a/src/main/resources/mapper/EmployeeMapper.xml +++ b/src/main/resources/mapper/EmployeeMapper.xml @@ -18,6 +18,18 @@ t1.skill_level as analysisName, COUNT( t1.skill_level ) as analysisCount + + t1.sex as analysisName, + COUNT( t1.sex ) as analysisCount + + + t1.age as analysisName, + COUNT( t1.age ) as analysisCount + + + t1.department as analysisName, + COUNT( t1.department ) as analysisCount + FROM employee t1 JOIN (SELECT post, COUNT(post) as postCount FROM employee GROUP BY post) t2 ON t1.post = t2.post @@ -36,6 +48,15 @@ t1.skill_level + + t1.sex + + + t1.age + + + t1.department + \ No newline at end of file