Forráskód Böngészése

[task-4175]培训统计看板功能调整

gaozl 1 éve
szülő
commit
69c430ef15

+ 17 - 17
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/business/service/impl/StatisticServiceImpl.java

@@ -823,8 +823,8 @@ public class StatisticServiceImpl implements StatisticService {
     public TrainGuardAutoPlanDto getPlanRate(String dept,String dateCondition){
         TrainGuardAutoPlanDto planDto = new TrainGuardAutoPlanDto();
         String planSql = "select count(*) as auto from t_rypxcjb where ji_hua_wai_jian_ in(select id_ from t_ndrypxjhzb " +
-                "where di_dian_='"+getDiDian()+"') and ji_hua_lei_xing_='在岗培训' %s";
-        String sumSql = "select count(*) as total from t_rypxcjb where ji_hua_lei_xing_='在岗培训' %s ";
+                "where di_dian_='"+getDiDian()+"') %s";
+        String sumSql = "select count(*) as total from t_rypxcjb where 1=1 %s ";
         String condition = String.format(" AND di_dian_ = '%s' and shi_fou_guo_shen_='已结束' ", getDiDian());
         if (BeanUtils.isNotEmpty(dept)){
             condition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
@@ -850,7 +850,7 @@ public class StatisticServiceImpl implements StatisticService {
             TrainWeekDto weekDto = new TrainWeekDto();
             weekDto.setDate(dateStr);
             weekDto.setDayName(getDayName(dateStr));
-            String sql = "select count(*) value from t_rypxcjb where ji_hua_lei_xing_='在岗培训' and shi_fou_guo_shen_='未发布' " +
+            String sql = "select count(*) value from t_rypxcjb where  shi_fou_guo_shen_='未发布' " +
                     " and di_dian_='%s' and date_format(pei_xun_shi_jian_,'%%Y-%%m-%%d')='%s' ";
             if (BeanUtils.isNotEmpty(dept)){
                 sql = sql+" and bian_zhi_bu_men_ = '%s'";
@@ -882,9 +882,9 @@ public class StatisticServiceImpl implements StatisticService {
         TrainObjectDto objectDto = new TrainObjectDto();
         objectDto.setRemark("在岗培训对象占比");
         List<TrainRateDto> rateDtoList = new ArrayList<>();
-        String sql = "select pei_xun_lei_xing_,count(pei_xun_lei_xing_)as nums from t_rypxcjb where ji_hua_lei_xing_='在岗培训' " +
-                "and shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_xing_";
-        String talSql = "SELECT COUNT(*) as total_num from t_rypxcjb where ji_hua_lei_xing_='在岗培训' and shi_fou_guo_shen_='已结束' %s ";
+        String sql = "select pei_xun_lei_xing_,count(pei_xun_lei_xing_)as nums from t_rypxcjb where " +
+                " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_xing_";
+        String talSql = "SELECT COUNT(*) as total_num from t_rypxcjb where  shi_fou_guo_shen_='已结束' %s ";
         dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
         if (BeanUtils.isNotEmpty(dept)){
             dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
@@ -912,9 +912,9 @@ public class StatisticServiceImpl implements StatisticService {
         TrainTypeDto typeDto = new TrainTypeDto();
         typeDto.setRemark("在岗培训类别占比");
         List<TrainRateDto> rateDtoList = new ArrayList<>();
-        String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where ji_hua_lei_xing_='在岗培训' " +
-                " and shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
-        String talSql = "select COUNT(*) AS total_num from t_rypxcjb where ji_hua_lei_xing_='在岗培训' and shi_fou_guo_shen_='已结束' %s ";
+        String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where " +
+                " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
+        String talSql = "select COUNT(*) AS total_num from t_rypxcjb where  shi_fou_guo_shen_='已结束' %s ";
         dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
         if (BeanUtils.isNotEmpty(dept)){
             dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
@@ -942,9 +942,9 @@ public class StatisticServiceImpl implements StatisticService {
         TrainYearPreWorkDto preWorkDto = new TrainYearPreWorkDto();
         preWorkDto.setRemark("本年度岗前培训类别占比");
         List<TrainRateDto> rateDtoList = new ArrayList<>();
-        String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where ji_hua_lei_xing_='岗前培训' " +
-                "and shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
-        String talSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE ji_hua_lei_xing_ = '岗前培训' AND shi_fou_guo_shen_ = '已结束' %s ";
+        String sql = "select pei_xun_lei_bie_,count(pei_xun_lei_bie_)as nums from t_rypxcjb where " +
+                " shi_fou_guo_shen_='已结束' %s group by pei_xun_lei_bie_";
+        String talSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE shi_fou_guo_shen_ = '已结束' %s ";
         String dateCondition = String.format(" AND di_dian_ = '%s' ", getDiDian());
         if (BeanUtils.isNotEmpty(dept)){
             dateCondition += String.format(" AND bian_zhi_bu_men_ = '%s' ", dept);
@@ -971,7 +971,7 @@ public class StatisticServiceImpl implements StatisticService {
     }
 
     public List<Map<String, Object>> getCurrentYearData(List<String> dateStr, String dept,String year) {
-        String baseSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE ji_hua_lei_xing_ = '岗前培训' AND shi_fou_guo_shen_ = '已结束' and di_dian_='%s'";
+        String baseSql = "SELECT count(*) AS total FROM t_rypxcjb WHERE shi_fou_guo_shen_ = '已结束' and di_dian_='%s'";
         baseSql = String.format(baseSql,getDiDian());
         List<Map<String, Object>> list = new ArrayList<>();
         for (String date : dateStr) {
@@ -993,7 +993,7 @@ public class StatisticServiceImpl implements StatisticService {
 
     public List<TrainRankDto> getUserTrainRank(String dept,String dateCondition){
         String sql = "SELECT a.ren_yuan_id_ userId,e.NAME_ userName,a.rank as count from (select ren_yuan_id_,COUNT(ren_yuan_id_)as rank  from t_qdxxb " +
-                "where guan_lian_id_ in(select id_ from t_rypxcjb where ji_hua_lei_xing_='在岗培训' and shi_fou_guo_shen_='已结束' %s) " +
+                "where guan_lian_id_ in(select id_ from t_rypxcjb where  shi_fou_guo_shen_='已结束' %s) " +
                 "GROUP BY ren_yuan_id_) a ,ibps_party_employee e WHERE e.id_=a.ren_yuan_id_ ";
         dateCondition += String.format(" AND di_dian_ = '%s' ", getDiDian());
         if (BeanUtils.isNotEmpty(dept)){
@@ -1022,16 +1022,16 @@ public class StatisticServiceImpl implements StatisticService {
         String countSqlTemplate = "SELECT COALESCE(SUM(num), 0) AS total_num FROM (" +
                 "SELECT LENGTH(pei_xun_ren_yuan_) - LENGTH(REPLACE(pei_xun_ren_yuan_, ',', '')) + 1 AS num " +
                 "FROM t_rypxcjb " +
-                "WHERE ji_hua_lei_xing_ = '在岗培训' AND shi_fou_guo_shen_ = '已结束' %s) AS subquery";
+                "WHERE shi_fou_guo_shen_ = '已结束' %s) AS subquery";
 
         String signSqlTemplate = "SELECT count(DISTINCT b.ren_yuan_id_) total_num from t_rypxcjb a,t_qdxxb b " +
                 " WHERE a.id_ =b.guan_lian_id_ and FIND_IN_SET(b.ren_yuan_id_,a.pei_xun_ren_yuan_) " +
-                " and a.ji_hua_lei_xing_ = '在岗培训' AND a.shi_fou_guo_shen_ = '已结束' %s ";
+                " and a.shi_fou_guo_shen_ = '已结束' %s ";
 
         String sumRealSqlTemplate = "SELECT COALESCE(SUM(num),0) AS realNum FROM (" +
                 "SELECT count(id_) as num FROM t_qdxxb " +
                 "WHERE guan_lian_id_ IN (SELECT id_ FROM t_rypxcjb " +
-                "WHERE ji_hua_lei_xing_ = '在岗培训' AND shi_fou_guo_shen_ = '已结束' %s) " +
+                "WHERE shi_fou_guo_shen_ = '已结束' %s) " +
                 "GROUP BY guan_lian_id_, ren_yuan_id_) AS re";
 
         for (String date : dateStr) {