瀏覽代碼

实验室看板修改

cyy 2 年之前
父節點
當前提交
b7f87e2a3d

+ 2 - 2
src/views/statistics/index.vue

@@ -106,9 +106,9 @@
         <div class="congxiebox7" style="display: flex;justify-content: space-between;padding: 1.5% 0.2%;">
           <div style="width:16.4%">
             <div class="gongshiAll">
-              <div class="touwidth">检测任务完成率=</div>
+              <div class="touwidth">检测任务完成及时率=</div>
               <div style="margin: 0 0.2%;">
-                <div class="gongshiXian">完成检测项目数量</div>
+                <div class="gongshiXian">及时完成检测项目数量</div>
                 <div style="text-align:center;font-size:12px;padding-top: 6%;">有效检测任务总数</div>
               </div>
               <div>×100%</div>

+ 14 - 162
src/views/statistics/js/selectDB.js

@@ -7,11 +7,11 @@ export const getConfig = (begin,end)=>{
 }
 export const getJiaoYanObj = (end)=>{
   // return "select a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,b.t_mjsbjdxzjhzbS FROM (select she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb where YEAR(create_time_)='2022' GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= '2022' AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
-  return "select a.t_mjsbjdxzjhzbZhName, a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,ifnull(b.t_mjsbjdxzjhzbS,0) as t_mjsbjdxzjhzbS FROM (select t_sbdj.she_bei_shi_bie_h as t_mjsbjdxzjhzbZhName, t_mjsbjdxzjhzb.she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(t_mjsbjdxzjhzb.she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb LEFT JOIN t_sbdj on t_mjsbjdxzjhzb.she_bei_bian_hao_ = t_sbdj.id_ where YEAR(t_mjsbjdxzjhzb.create_time_)="+end+" GROUP BY t_mjsbjdxzjhzb.she_bei_ming_chen HAVING COUNT(t_mjsbjdxzjhzb.she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= "+end+" AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
+  return "select a.she_bei_bian_hao_,a.t_mjsbjdxzjhzbZhName, a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,ifnull(b.t_mjsbjdxzjhzbS,0) as t_mjsbjdxzjhzbS FROM (select t_sbdj.she_bei_shi_bie_h as t_mjsbjdxzjhzbZhName, t_mjsbjdxzjhzb.she_bei_ming_chen as t_mjsbjdxzjhzbName,t_mjsbjdxzjhzb.she_bei_bian_hao_, COUNT(t_mjsbjdxzjhzb.she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb LEFT JOIN t_sbdj on t_mjsbjdxzjhzb.she_bei_bian_hao_ = t_sbdj.id_ where YEAR(t_mjsbjdxzjhzb.create_time_)="+end+" GROUP BY t_mjsbjdxzjhzb.she_bei_ming_chen HAVING COUNT(t_mjsbjdxzjhzb.she_bei_ming_chen)>=1) as a left join  (select yi_qi_bian_hao_, COUNT(yi_qi_bian_hao_) as t_mjsbjdxzjhzbS from t_sbjdxzzx where YEAR(create_time_)= "+end+" AND DATE(you_xiao_qi_zhi_) >= DATE(xiao_zhun_ri_qi_) GROUP BY yi_qi_bian_hao_ HAVING COUNT(yi_qi_bian_hao_)>=1 )as b on a.she_bei_bian_hao_=b.yi_qi_bian_hao_"
 }
 export const gethechaObj = (end)=>{
   // return "select a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,b.t_mjsbjdxzjhzbS FROM (select she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb where YEAR(create_time_)='2022' GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= '2022' AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
-  return "select	a.t_sbhcjlbZhname,	a.t_sbhcjlbName,	a.t_sbhcjlb,	ifnull( b.t_sbhcjlbS, 0 ) AS t_sbhcjlbS FROM	(	SELECT	t_sbdj.she_bei_ming_cheng_ AS t_sbhcjlbZhname,	t_sbdj.she_bei_shi_bie_h AS t_sbhcjlbName,	COUNT( t_yqsbhcjh.yi_qi_she_bei_min ) AS t_sbhcjlb 	FROM	t_yqsbhcjh	LEFT JOIN t_sbdj ON t_yqsbhcjh.yi_qi_she_bei_min = t_sbdj.id_ 	WHERE	YEAR ( t_yqsbhcjh.he_cha_pin_lv_ )= "+end+"	GROUP BY	t_yqsbhcjh.yi_qi_she_bei_min 	HAVING	COUNT( t_yqsbhcjh.yi_qi_she_bei_min )>= 1 	) AS a	LEFT JOIN ( SELECT shi_bie_hao_, COUNT( shi_bie_hao_ ) AS t_sbhcjlbS FROM t_sbhcjlb WHERE YEAR ( he_cha_ri_qi_ )= "+end+" GROUP BY shi_bie_hao_ HAVING COUNT( shi_bie_hao_ )>= 1 ) AS b ON a.t_sbhcjlbName = b.shi_bie_hao_ UNION SELECT	t_sbdj.she_bei_ming_cheng_ AS t_sbhcjlbZhname,	t_sbhcjlb.shi_bie_hao_ AS t_sbhcjlbName,IF	( t_sbhcjlb.id_, 0, 1 ) AS t_sbhcjlb,IF	(	YEAR ( t_sbhcjlb.he_cha_ri_qi_ )= YEAR ( t_sbhcjlb.xia_ci_he_cha_ri_ ),	COUNT( t_sbhcjlb.shi_bie_hao_ )+ 1,	COUNT( t_sbhcjlb.shi_bie_hao_ )) AS t_sbhcjlbS FROM	t_sbhcjlb	LEFT JOIN t_sbdj ON t_sbhcjlb.shi_bie_hao_ = t_sbdj.she_bei_shi_bie_h WHERE	YEAR ( t_sbhcjlb.he_cha_ri_qi_ )= "+end+" GROUP BY	t_sbhcjlb.shi_bie_hao_ HAVING	COUNT( t_sbhcjlb.shi_bie_hao_ )>=1"
+  return "select	a.t_sbhcjlbZhname,	a.t_sbhcjlbName,	a.t_sbhcjlb,	ifnull( b.t_sbhcjlbS, 0 ) AS t_sbhcjlbS FROM	(	SELECT	t_sbdj.she_bei_ming_cheng_ AS t_sbhcjlbZhname,	t_sbdj.she_bei_shi_bie_h AS t_sbhcjlbName,	COUNT( t_yqsbhcjh.yi_qi_she_bei_min ) AS t_sbhcjlb 	FROM	t_yqsbhcjh	LEFT JOIN t_sbdj ON t_yqsbhcjh.yi_qi_she_bei_min = t_sbdj.id_ 	WHERE	YEAR ( t_yqsbhcjh.he_cha_pin_lv_ )= "+end+"	GROUP BY	t_yqsbhcjh.yi_qi_she_bei_min 	HAVING	COUNT( t_yqsbhcjh.yi_qi_she_bei_min )>= 1 	) AS a	LEFT JOIN ( SELECT sheng_xiao_ri_qi_, COUNT( sheng_xiao_ri_qi_ ) AS t_sbhcjlbS FROM t_sbqjhcjlb WHERE YEAR ( he_cha_ri_qi_ )= "+end+" and (shi_fou_guo_shen_ = '1' or  shi_fou_guo_shen_ = '已审核') GROUP BY sheng_xiao_ri_qi_ HAVING COUNT( sheng_xiao_ri_qi_ )>= 1 ) AS b ON a.t_sbhcjlbName = b.sheng_xiao_ri_qi_ "
 }
 // export const getnengliObj = (end)=>{
 //   // return "select a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,b.t_mjsbjdxzjhzbS FROM (select she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb where YEAR(create_time_)='2022' GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= '2022' AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
@@ -19,7 +19,7 @@ export const gethechaObj = (end)=>{
 // }
 export const getnengliObj = (end)=>{
   // return "select a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,b.t_mjsbjdxzjhzbS FROM (select she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb where YEAR(create_time_)='2022' GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= '2022' AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
-  return "select COUNT(id_) as num from t_ndnlyzsysjbdjhb WHERE shi_fou_guo_shen_ = '1' and  YEAR(create_time_)= "+end+"  UNION all select COUNT(id_) as snum from t_ndnlyzsysjbdjhb where  YEAR(create_time_)= "+end
+  return "select COUNT(t_ndnlyzsysjbdjhzb.id_) as num from t_ndnlyzsysjbdjhzb LEFT JOIN t_nlyzsysjbdhdsyxhcb on t_ndnlyzsysjbdjhzb.id_=t_nlyzsysjbdhdsyxhcb.xiang_mu_ming_che WHERE t_nlyzsysjbdhdsyxhcb.shi_fou_guo_shen_ = '1' and  YEAR(t_ndnlyzsysjbdjhzb.create_time_)= "+end+" UNION all select COUNT(id_) as snum from t_ndnlyzsysjbdjhzb where  YEAR(create_time_)="+end
 }
 export const getbiaozhunObj = (end)=>{
   // return "select a.t_mjsbjdxzjhzbName,a.t_mjsbjdxzjhzb,b.t_mjsbjdxzjhzbS FROM (select she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb from t_mjsbjdxzjhzb where YEAR(create_time_)='2022' GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1) as a left join  (select she_bei_ming_chen, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS from t_mjsbjdxzjhzb where YEAR(create_time_)= '2022' AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 )as b on a.t_mjsbjdxzjhzbName=b.she_bei_ming_chen"
@@ -97,7 +97,6 @@ function PAT_TASK(val,choose){
 }
 function PAT_CHOOSE(val,choose){
   return choose + " AND YEAR( create_time_ ) = '"+val+"'"
-  // return "zhuang_tai_ = '已完成' AND YEAR ( create_time_ ) = '" + val+"'"
 
 }
 /* 工具函数参数
@@ -146,102 +145,27 @@ function toolSame(val,tableName,where,join){
 }
 /* 任务完成 */
 function s1renwu(begin,end,scope){
-  return "( SELECT COUNT( id_ ) AS t_lhjczb"+end+" FROM t_lhjczb "+ "WHERE zhuang_tai_ = '已完成' AND YEAR( create_time_ ) = "+end+") s1renwu1  JOIN"+
+  return "( SELECT COUNT( id_ ) AS t_lhjczb"+end+" FROM t_lhjczb "+ "WHERE zhuang_tai_ = '已完成' and shi_fou_ji_shi_ = '是' AND YEAR( create_time_ ) = "+end+") s1renwu1  JOIN"+
   "( SELECT COUNT( id_ ) AS t_lhjczbS"+end+" FROM t_lhjczb WHERE YEAR ( create_time_ ) = "+end+" ) s1renwu2  "
  
   }
 /* 检测 */
 function s1jianCe(begin,end){
-  // //v3
-  // return "( SELECT COUNT( id_ ) AS t_mjjcbg"+end+" FROM t_mjjcbg "+ "WHERE shi_fou_guo_shen_ = '已退回' AND YEAR( create_time_ ) = "+end+" ) s1jianCe1 JOIN"+
-  // "( SELECT COUNT( id_ ) AS t_mjjcbgS"+end+" FROM t_mjjcbg WHERE  YEAR ( create_time_ ) = "+end+" ) s1jianCe2 "
   // 委托检测数
   return "SELECT *  FROM (select COUNT( id_ ) AS t_gdyrqcwt"+end+" from t_gdyrgpjc WHERE YEAR( create_time_ ) = "+end+" union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = "+end+") s1jianCe1  JOIN "+
-  // "(SELECT COUNT( id_ ) AS t_gdyrqcwt"+end+" FROM (select id_ from t_gdyrgpjc WHERE YEAR( create_time_ ) = '"+end+"' union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = '"+end+"') a0) s1jianCe2 on 1=1 join "+
-  // //按期完成检测件数
-  // "(select count(id_) as t_gdyrqcwt2"+begin+" from(select id_   from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe3 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt2"+end+" from(select id_  from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe4 on 1=1 join "+
-  // //出具报告数
-  // "(select count(id_) as t_gdyrqcwt3"+begin+" from(select id_   from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe5 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt3"+end+" from(select id_  from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe6 on 1=1 join "+
-  // //逾期未完成数
-  // "(select count(id_) as t_gdyrqcwt4"+begin+" from(select id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe7 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt4"+end+" from(select id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe8 on 1=1 JOIN " +
-  // //检测结果准确率
-  // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+begin+" from(select wei_tuo_id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")  group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe9 on 1=1 JOIN "+
-  // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+end+" from(select wei_tuo_id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+"  ) group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe10 on 1=1 "
-  // // 按时完成率
-  // "( select select count(id_) AS t_gdyrqcwt6"+begin+" from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+"))) s1jianCe11 on 1=1 JOIN "+
   "( select count(id_) AS t_gdyrqcwt6"+end+" from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = '"+end+"')  ) s1jianCe12 on 1=1"
   }
   /* 检测 */
 function s2jianCe(begin,end){
   //v3
-  return "( SELECT COUNT( id_ ) AS t_mjjcbg"+end+" FROM t_lhjcbgb "+ "WHERE trim(tui_hui_ci_shu_) != '' AND YEAR( create_time_ ) = "+end+" ) s2jianCe1 JOIN"+
-  "( SELECT COUNT( id_ ) AS t_mjjcbgS"+end+" FROM t_lhjcbgb WHERE  YEAR ( create_time_ ) = "+end+" ) s2jianCe2 "
-  //委托检测数
-  // return "SELECT *  FROM (select COUNT( id_ ) AS t_gdyrqcwt"+begin+" from t_gdyrgpjc WHERE YEAR( create_time_ ) = "+begin+" union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = "+begin+") s1jianCe1  JOIN "+
-  // "(SELECT COUNT( id_ ) AS t_gdyrqcwt"+end+" FROM (select id_ from t_gdyrgpjc WHERE YEAR( create_time_ ) = '"+end+"' union all select id_ from t_gdyrqcjc WHERE YEAR( create_time_ ) = '"+end+"') a0) s1jianCe2 on 1=1 join "+
-  // //按期完成检测件数
-  // "(select count(id_) as t_gdyrqcwt2"+begin+" from(select id_   from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe3 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt2"+end+" from(select id_  from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe4 on 1=1 join "+
-  // //出具报告数
-  // "(select count(id_) as t_gdyrqcwt3"+begin+" from(select id_   from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe5 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt3"+end+" from(select id_  from t_gdyrgpjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where fa_fang_biao_zhi_ is not null and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe6 on 1=1 join "+
-  // //逾期未完成数
-  // "(select count(id_) as t_gdyrqcwt4"+begin+" from(select id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")) a) s1jianCe7 on 1=1 JOIN "+
-  // "(select count(id_) as t_gdyrqcwt4"+end+" from(select id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+") union all select id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+")) a) s1jianCe8 on 1=1 JOIN " +
-  // //检测结果准确率
-  // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+begin+" from(select wei_tuo_id_   from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+")  group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe9 on 1=1 JOIN "+
-  // "(select count(wei_tuo_id_) as t_gdyrqcwt50"+end+" from(select wei_tuo_id_  from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+" ) group by wei_tuo_id_ having count(1)=1 union all select wei_tuo_id_ from t_gdyrqcjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+end+"  ) group by wei_tuo_id_ having count(1)=1 ) a) s1jianCe10 on 1=1 "
-  //按时完成率
-  //"( select select count(id_) AS t_gdyrqcwt6"+begin+" from t_gdyrgpjc where (qi_wang_wan_cheng<fa_fang_biao_zhi_ or fa_fang_biao_zhi_ is null) and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = "+begin+"))) s1jianCe11 on 1=1 JOIN "+
-  //"( select count(id_) AS t_gdyrqcwt6"+end+" from t_gdyrgpjc where qi_wang_wan_cheng>fa_fang_biao_zhi_ and wei_tuo_id_ in (select id_ from t_gdyrqcwt where YEAR( create_time_ ) = '"+end+"')  ) s1jianCe12 on 1=1"
+  return "( SELECT COUNT( id_ ) AS t_mjjcbg"+end+" FROM t_bgffdjb "+ "WHERE bao_gao_xiu_gai_j = '有' AND YEAR( create_time_ ) = "+end+" ) s2jianCe1 JOIN"+
+  "( SELECT COUNT( id_ ) AS t_mjjcbgS"+end+" FROM t_bgffdjb WHERE  YEAR ( create_time_ ) = "+end+" ) s2jianCe2 "
+
   }
  /* 满意度 */
  function s2manYiDu(begin,end,scope){
-  // let sql = "( SELECT COUNT( id_ ) AS t_khmydtjb"+begin+" FROM t_khmydtjb "+ "WHERE man_yi_du_ = '满意' AND YEAR( create_time_ ) = "+begin+" ) s2manYiDu1  JOIN"
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql = sql + tool(scope[i],"t_khmydtjb",PAT_SATISFACTION(scope[i]),1)
-  //   }else{
-  //     sql = sql + tool(scope[i],"t_khmydtjb",PAT_SATISFACTION(scope[i]),0)
-  //   }
-  // }
-  // let sql1 = " JOIN ( SELECT COUNT( id_ ) AS t_khmydtjbS"+begin+" FROM t_khmydtjb WHERE  YEAR ( create_time_ ) = "+begin+" ) s2manYiDu2  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql1 = sql1 + toolSame(scope[i],"t_khmydtjb",PAT_YEAR(scope[i]),1)
-  //   }else{
-  //     sql1 = sql1 + toolSame(scope[i],"t_khmydtjb",PAT_YEAR(scope[i]),0)
-  //   }
-  // }
-  // let sqlAll = sql + sql1
-  // return sqlAll
   return "( SELECT COUNT(id_) as t_khmydtjbnum"+end+",sum(ping_fen_1_)+sum(ping_fen_2_)+sum(ping_fen_3_)+sum(ping_fen_4_)+sum(ping_fen_5_)  AS t_khmydtjb"+end+" FROM t_khmyddcb WHERE YEAR( create_time_ ) = "+end+" ) s2manYiDu1  JOIN"+
   "( SELECT COUNT( id_ ) AS t_khmydtjbS"+end+" FROM t_khmydtjb WHERE  YEAR ( create_time_ ) = "+end+" ) s2manYiDu2 "
-   //调查表总数
-  // return "( SELECT COUNT( id_ ) AS t_myddc"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = "+begin+" ) s2manYiDu1  JOIN "+
-  //   "( SELECT COUNT( id_ ) AS t_myddc"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu2 on 1=1 JOIN "+
-  //   //技术水平
-  //   "( SELECT sum(case when dang_nin_dui_jian='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc1"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu3 on 1=1 JOIN "+
-  //   "( SELECT sum(case when dang_nin_dui_jian='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc1"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu4 on 1=1 JOIN "+
-  //   //检测效率满意度
-  //   "( SELECT sum(case when nin_dui_jian_yan_='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc2"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu5 on 1=1 JOIN "+
-  //   "( SELECT sum(case when nin_dui_jian_yan_='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc2"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu6 on 1=1 JOIN "+
-  //   //工作态度
-  //   "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc3"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu7 on 1=1 JOIN "+
-  //   "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end)/sum(1)+0.01 AS t_myddc3"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu8 on 1=1 "
-    //检测准确性,参照s1的准确率
-    // "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end) AS t_myddc4"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu9 on 1=1 JOIN "+
-    // "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end) AS t_myddc4"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu10 on 1=1 "
-    //报告完成率,外层汇总,此处不计算
-    // "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end) AS t_myddc5"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu11 on 1=1 JOIN "+
-    // "( SELECT sum(case when nin_dui_jian_ce_r='满意' then 1 else 0 end) AS t_myddc5"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu12 on 1=1 JOIN"
-    //检测效率,外层汇总,此处不计算
-    // "( SELECT sum(case when nin_dui_jian_yan_='满意' then 1 else 0 end) AS t_myddc6"+begin+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+begin+"' ) s2manYiDu13 on 1=1 JOIN "+
-    // "( SELECT sum(case when nin_dui_jian_yan_='满意' then 1 else 0 end) AS t_myddc6"+end+" FROM t_myddc "+ "WHERE YEAR( create_time_ ) = '"+end+"' ) s2manYiDu14 on 1=1 "
-
 }
 /* 投诉 */
 function s3tousu(begin,end,scope){
@@ -249,83 +173,16 @@ function s3tousu(begin,end,scope){
   "( SELECT COUNT( id_ ) AS t_complaintS"+end+" FROM t_complaint WHERE you_wu_you_xiao_ = '有效投诉' and chu_li_shi_jian_='<48h' and shi_fou_tong_yi_='同意' and YEAR ( create_time_ ) = "+end+" ) s3tousu2  JOIN "+
   "( SELECT COUNT( id_ ) AS t_complainS"+end+" FROM t_complaint WHERE you_wu_you_xiao_ = '有效投诉' and chu_li_jie_guo_sh='已通知' and YEAR ( create_time_ ) = "+end+" ) s3tousu3  JOIN "+
   "( SELECT COUNT( id_ ) AS t_mjwtsqb"+end+" FROM t_lhjczb WHERE  YEAR ( create_time_ ) = "+end+" ) s3weituo1"
-  // let sql = "( SELECT COUNT( id_ ) AS t_complaint"+begin+" FROM t_complaint WHERE YEAR ( create_time_ ) = "+begin+" ) s3tousu1  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql = sql + tool(scope[i],"t_complaint",PAT_YEAR(scope[i]),1)
-  //   }else{
-  //     sql = sql + tool(scope[i],"t_complaint",PAT_YEAR(scope[i]),0)
-  //   }
-  // }
-  // let sql1 = " JOIN ( SELECT COUNT( id_ ) AS t_mjwtsqb"+begin+" FROM t_mjwtsqb WHERE  YEAR ( create_time_ ) = "+begin+" ) s3weituo1  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql1 = sql1 + tool(scope[i],"t_mjwtsqb",PAT_YEAR(scope[i]),1)
-  //   }else{
-  //     sql1 = sql1 + tool(scope[i],"t_mjwtsqb",PAT_YEAR(scope[i]),0)
-  //   }
-  // }
-  // let sqlAll = sql + sql1
-  // return sqlAll
-  // return "( SELECT COUNT( id_ ) AS t_complaint"+begin+" FROM t_complaint WHERE YEAR ( create_time_ ) = "+begin+" ) s3tousu1  JOIN "+
-  //  tool(end,"t_complaint",PAT_YEAR(end),1)+" JOIN "+
-  //  "( SELECT COUNT( id_ ) AS t_mjwtsqb"+begin+" FROM t_mjwtsqb WHERE  YEAR ( create_time_ ) = "+begin+" ) s3weituo1  JOIN "+
-  //  tool(end,"t_mjwtsqb",PAT(end),1)
-  // return "( SELECT COUNT( id_ ) AS t_complaint"+begin+" FROM t_complaint WHERE  YEAR ( create_time_ ) BETWEEN "+begin+" and "+end+") s3tousu1 on 1=1" 
  }
  /* 人员培训 */
 function s4renYuanPeiXun(begin,end,scope){
-  return "( SELECT COUNT( id_ ) AS t_ryywpxjl"+end+" FROM t_lhrypxjlb WHERE shi_fou_guo_shen_ = '1' AND YEAR ( create_time_ ) = "+end+" ) s4renYuanPeiXun1  JOIN "+
-  "( SELECT COUNT( id_ ) AS t_ryywpxjlS"+end+" FROM t_lhrypxjlb WHERE  YEAR ( create_time_ ) = "+end+" ) s4renYuanPeiXun2"
-  // let sql = "( SELECT COUNT( id_ ) AS t_ryywpxjl"+begin+" FROM t_ryywpxjl WHERE zhuang_tai_ = '已完成' AND YEAR ( create_time_ ) = "+begin+" ) s4renYuanPeiXun1  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql = sql + tool(scope[i],"t_ryywpxjl",PAT_CHOOSE(scope[i],"zhuang_tai_ = '已完成'"),1)
-  //   }else{
-  //     sql = sql + tool(scope[i],"t_ryywpxjl",PAT_CHOOSE(scope[i],"zhuang_tai_ = '已完成'"),0)
-  //   }
-  // }
-  // let sql1 = " JOIN ( SELECT COUNT( id_ ) AS t_ryywpxjlS"+begin+" FROM t_ryywpxjl WHERE  YEAR ( create_time_ ) = "+begin+" ) s4renYuanPeiXun2  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql1 = sql1 + toolSame(scope[i],"t_ryywpxjl",PAT_YEAR(scope[i]),1)
-  //   }else{
-  //     sql1 = sql1 + toolSame(scope[i],"t_ryywpxjl",PAT_YEAR(scope[i]),0)
-  //   }
-  // }
-  // let sqlAll = sql + sql1
-  // return sqlAll
-  // return "( SELECT COUNT( id_ ) AS t_ryndpxjh"+begin+" FROM t_ryndpxjh WHERE shi_fou_guo_shen_ = '1' and YEAR( create_time_ ) = "+begin+" ) s4renYuanPeiXun1  JOIN "+
-  //  tool(end,"t_ryndpxjh",PAT(end),1)+" JOIN "+
-  //  "( SELECT COUNT( id_ ) AS t_rypxjlnk"+begin+" FROM t_rypxjlnk WHERE shi_fou_guo_shen_ = '1' and  YEAR ( create_time_ ) = "+begin+" ) s4renYuanPeiXun2  JOIN "+
-  //  tool(end,"t_rypxjlnk",PAT(end),1)
+  return "( SELECT COUNT( id_ ) AS t_ryywpxjl"+end+" FROM t_lhrypxjlb WHERE pei_xun_lei_xing_!='' and shi_fou_guo_shen_ = '1' AND YEAR ( bian_zhi_shi_jian ) = "+end+" ) s4renYuanPeiXun1  JOIN "+
+  "( SELECT COUNT( id_ ) AS t_ryywpxjlS"+end+" FROM t_lhrypxjlb WHERE pei_xun_lei_xing_!='' and YEAR ( bian_zhi_shi_jian ) = "+end+" ) s4renYuanPeiXun2"
  }
  /* 人员监督 */
 function s5renYuanJianDu(begin,end, scope){
-  return "( SELECT COUNT( id_ ) AS t_zljd"+end+" FROM t_lhryjdjlb WHERE shi_fou_guo_shen_= '1' AND YEAR ( create_time_ ) = "+end+" ) s5renYuanJianDu1  JOIN "+
-  "( SELECT COUNT( id_ ) AS t_zljdS"+end+" FROM t_lhryjdjlb WHERE  YEAR ( create_time_ ) = "+end+" ) s5renYuanJianDu2"
-  // let sql = "( SELECT COUNT( id_ ) AS t_zljd"+begin+" FROM t_zljd WHERE shi_fou_guo_shen_= '1' AND YEAR ( create_time_ ) = "+begin+" ) s5renYuanJianDu1  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql = sql + tool(scope[i],"t_zljd",PAT_CHOOSE(scope[i],"shi_fou_guo_shen_= '1'"),1)
-  //   }else{
-  //     sql = sql + tool(scope[i],"t_zljd",PAT_CHOOSE(scope[i],"shi_fou_guo_shen_= '1'"),0)
-  //   }
-  // }
-  // let sql1 = " JOIN ( SELECT COUNT( id_ ) AS t_zljdS"+begin+" FROM t_zljd WHERE  YEAR ( create_time_ ) = "+begin+" ) s5renYuanJianDu2  JOIN "
-  // for (let i = 1; i < scope.length; i++) {
-  //   if(i === scope.length - 1){
-  //     sql1 = sql1 + toolSame(scope[i],"t_zljd",PAT_YEAR(scope[i]),1)
-  //   }else{
-  //     sql1 = sql1 + toolSame(scope[i],"t_zljd",PAT_YEAR(scope[i]),0)
-  //   }
-  // }
-  // let sqlAll = sql + sql1
-  // return sqlAll
-  // return "( SELECT COUNT( id_ ) AS t_zljd"+begin+" FROM t_zljd WHERE shi_fou_guo_shen_ = '1' and YEAR( create_time_ ) = "+begin+" ) s5renYuanJianDu1  JOIN "+
-  //  tool(end,"t_zljd",PAT(end),1)+" JOIN "+
-  //  "( SELECT COUNT( id_ ) AS t_zljdss"+begin+" FROM t_zljdss WHERE shi_fou_guo_shen_ = '1' and  YEAR ( create_time_ ) = "+begin+" ) s5renYuanJianDu2  JOIN "+
-  //  tool(end,"t_zljdss",PAT(end),1)
+  return "( SELECT COUNT( id_ ) AS t_zljd"+end+" FROM t_lhryjdjlb WHERE shi_fou_guo_shen_= '1' AND YEAR ( bian_zhi_shi_jian ) = "+end+" ) s5renYuanJianDu1  JOIN "+
+  "( SELECT COUNT( id_ ) AS t_zljdS"+end+" FROM t_lhryjdjlb WHERE  YEAR ( bian_zhi_shi_jian ) = "+end+" ) s5renYuanJianDu2"
  }
 /* 设备维护 */
 function s6sheBeiWeiHu(begin,end){
@@ -351,11 +208,6 @@ function s7sheBeiJiaoZhun(begin,end){
   //v3
   return "(SELECT she_bei_ming_chen as t_mjsbjdxzjhzbName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzb"+end+" FROM t_mjsbjdxzjhzb WHERE YEAR( create_time_ ) = "+end+" GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 ORDER BY she_bei_ming_chen) s7sheBeiJiaoZhun1  JOIN " +
   "(SELECT she_bei_ming_chen as t_mjsbjdxzjhzbSName, COUNT(she_bei_ming_chen) as t_mjsbjdxzjhzbS"+end+" FROM t_mjsbjdxzjhzb WHERE YEAR( create_time_ ) = "+end+" AND DATE(yi_jian_xiao_ri_q) >= DATE(ji_hua_ri_qi_) GROUP BY she_bei_ming_chen HAVING COUNT(she_bei_ming_chen)>=1 ORDER BY she_bei_ming_chen) s7sheBeiJiaoZhun12 "
-  //v1
-  // return "( SELECT COUNT( id_ ) AS t_ndsbxzjdjh"+begin+" FROM t_ndsbxzjdjh WHERE shi_fou_guo_shen_ = '1' and YEAR( create_time_ ) = "+begin+" ) s7sheBeiJiaoZhun1  JOIN "+
-  //  tool(end,"t_ndsbxzjdjh",PAT(end),1)+" JOIN "+
-  //  "( SELECT COUNT( id_ ) AS t_yqsbxzjg"+begin+" FROM t_yqsbxzjg WHERE shi_fou_guo_shen_ = '1' and  YEAR ( create_time_ ) = "+begin+" ) s7sheBeiJiaoZhun2  JOIN "+
-  //  tool(end,"t_yqsbxzjg",PAT(end),1)
  }
  /* 设备核查 */
 function s8sheBeiHeCha(begin,end){
@@ -367,19 +219,19 @@ function s8sheBeiHeCha(begin,end){
  /* 内部质量控制 */
 function s9neiBu(begin,end,scope){
   return "( SELECT COUNT( id_ ) AS t_mjzlkzxb"+end+" FROM t_mjzlkzxb WHERE YEAR ( create_time_ ) = "+end+" ) s9neibu1  JOIN "+
-  "( SELECT COUNT( t_mjzlkzxb.id_ ) AS t_mjzlkzxbS"+end+" FROM t_mjzlkzxb left join t_mjzlkzjhb on t_mjzlkzxb.parent_id_ = t_mjzlkzjhb.id_ WHERE t_mjzlkzjhb.shi_fou_guo_shen_='1' AND YEAR ( t_mjzlkzxb.create_time_ ) = "+end+"   ) s9neibu2 join"+
+  "(SELECT COUNT( t_mjzlkzxb.id_ ) AS t_mjzlkzxbS"+end+" FROM t_mjzlkzxb , t_zlkzjlb WHERE t_mjzlkzxb.xiang_mu_=t_zlkzjlb.zhi_kong_xiang_mu AND t_mjzlkzxb.shi_shi_shi_jian_ = t_zlkzjlb.ji_hua_ri_qi_  and t_zlkzjlb.shi_fou_guo_shen_='1' AND YEAR ( t_mjzlkzxb.create_time_ ) = "+end+" ) s9neibu2 join"+
   "( SELECT COUNT( id_ ) AS t_mjzlkzjlb"+end+" FROM t_mjzlkzjlb WHERE length(shi_fou_guo_shen_) >0 AND YEAR ( create_time_ ) = "+end+" ) s9neibu3 join" +
   "( SELECT COUNT( id_ ) AS t_mjzlkzjlbS"+end+" FROM t_mjzlkzjlb WHERE shi_fou_guo_shen_=1 AND YEAR ( create_time_ ) = "+end+" ) s9neibu4"
 
  }
  function s12fengXian(begin,end,scope){
   return "(select COUNT(t_mjsyshdfxsbykzjhxb.id_) as t_mjsyshdfxsbykzjhxb"+end+" from t_mjsyshdfxsbykzjhxb INNER JOIN t_mjsyshdfxsbykzjhb on t_mjsyshdfxsbykzjhxb.parent_id_ = t_mjsyshdfxsbykzjhb.id_  where YEAR(t_mjsyshdfxsbykzjhxb.shi_shi_ri_qi_)="+end+") s12fengxian1  JOIN " +
-  "(select COUNT(t_mjsyshdfxsbykzjhxb.id_) as t_mjsyshdfxsbykzjhxbS"+end+" from t_mjsyshdfxsbykzjhxb INNER JOIN t_mjsyshdfxsbykzjhb on t_mjsyshdfxsbykzjhxb.parent_id_ = t_mjsyshdfxsbykzjhb.id_  where YEAR(t_mjsyshdfxsbykzjhxb.shi_shi_ri_qi_)="+end+" and t_mjsyshdfxsbykzjhb.shi_fou_guo_shen_ = '1') s12fengxian2 "
+  "(select COUNT(id_) as t_mjsyshdfxsbykzjhxbS"+end+" from t_mjsyshdfxkzypjjlb where shi_fou_guo_shen_ = '1' and YEAR ( create_time_ ) = "+end+") s12fengxian2 "
 
  }
  function s14bufuhexiang(begin,end,scope){
   return "(select COUNT(t_bfhxbgyjzcsjlbx.id_) as t_bfhxbgyjzcsjlbx"+end+" from t_bfhxbgyjzcsjlbx where YEAR(t_bfhxbgyjzcsjlbx.create_time_)="+end+") s14bufuhexiang1  JOIN " +
-  "(select COUNT(t_bfhxbgyjzcsjlbx.id_) as t_bfhxbgyjzcsjlbxS"+end+" from t_bfhxbgyjzcsjlbx where t_bfhxbgyjzcsjlbx.zhuang_tai_ = '已完成' and YEAR(t_bfhxbgyjzcsjlbx.create_time_)="+end+") s14buhexiang2 "
+  "(select COUNT(t_bfhxbgyjzcsjlbx.id_) as t_bfhxbgyjzcsjlbxS"+end+" from t_bfhxbgyjzcsjlbx where t_bfhxbgyjzcsjlbx.shi_fou_guo_shen_ = '1' and YEAR(t_bfhxbgyjzcsjlbx.create_time_)="+end+") s14buhexiang2 "
 
  }
 

+ 4 - 1
src/views/statistics/properties/s11biaoZhunWuPro.vue

@@ -95,7 +95,10 @@
            this.$options.components.s11biaoZhunWuItem = () => import('../item/s11biaoZhunWu.vue')
            this.$options.components.s11biaoZhunWuCItem = () => import('../item/s11biaoZhunWuCol.vue')
            this.$options.components.s11biaoZhunWuC2Item = () => import('../item/s11biaoZhunWuCol2.vue')
-          },
+      },
+      mounted(){
+        console.log(this.data.Num)
+      },
 
     watch:{
      dialogOff: {

+ 3 - 3
src/views/statistics/properties/s13shengWuPro.vue

@@ -37,11 +37,11 @@
         <el-aside style="border:0px;width: 30%;">
            <div class="dataCont" style="font-size: 14px;">
             <el-divider content-position="left">{{data.t_complaintNum.date}} 年度</el-divider>
-              投诉回复已完成数 :<el-tag>{{data.t_complaintNum.number[0]}} 次</el-tag>
+              投诉回复已完成数 :<el-tag>{{data.t_complaintNum.num48[0]}} 次</el-tag>
               <br>
-              有效投诉总次数 :<el-tag>{{data.t_complaintNum.numberAll[0]}} 次</el-tag>
+              有效投诉总次数 :<el-tag>{{data.t_complaintNum.number[0]}} 次</el-tag>
               <br>
-              投诉回复及时率 :<el-tag>{{data.t_complaintNum.res[0]}} %</el-tag>
+              投诉回复及时率 :<el-tag>{{data.t_complaintNum.res1[0]}} %</el-tag>
               <br>
               当前目标值 :<el-tag>{{mubiao}}</el-tag>
               <br>

+ 2 - 2
src/views/statistics/properties/s8sheBeiHeChaPro.vue

@@ -48,9 +48,9 @@
 
           <div v-for="(item,i) in data.t_sbhcjlbNum.name" :key="i">
               <el-divider content-position="left">{{data.t_sbhcjlbNum.name[i]}}</el-divider>
-              计划外核查 :<el-tag>{{data.t_sbhcjlbNum.number[i]}} 次</el-tag>
+              核查 :<el-tag>{{data.t_sbhcjlbNum.number[i]}} 次</el-tag>
               <br>
-              年度核查 :<el-tag>{{data.t_sbhcjlbNum.numberAll[i]}} 次</el-tag>
+              计划核查 :<el-tag>{{data.t_sbhcjlbNum.numberAll[i]}} 次</el-tag>
               <br>
             </div>
            <!-- <div class="dataCont" style="font-size: 14px;">

+ 1 - 1
src/views/statistics/properties/s9neiBuZhiLiangPro.vue

@@ -41,7 +41,7 @@
               <br>
               计划内质量控制总数 :<el-tag>{{data.t_mjzlkzxbNum.number[2]}} 次</el-tag>
               <br>
-              计划内质量控制完成率 :<el-tag>{{data.t_mjzlkzxbNum.number[1]==null||data.t_mjzlkzxbNum.number[1]==0?"0.00":(data.t_mjzlkzxbNum.number[2]/data.t_mjzlkzxbNum.number[1]*100).toFixed(2)}} %</el-tag>
+              计划内质量控制完成率 :<el-tag>{{data.t_mjzlkzxbNum.valna}} %</el-tag>
               <br>
               <!-- <br>
               计划外质量控制计划完成数量 :<el-tag>{{data.t_mjzlkzxbNum.numberAll[1]}} 次</el-tag>

+ 10 - 8
src/views/statistics/sendDatas.js

@@ -202,7 +202,7 @@ export default {
                         if(b===0){
                                 c=0
                         }else{
-                                c= Math.floor(b/a * 10000) / 100
+                                c= Math.floor(a/b * 10000) / 100
                         }
                         return {
                                 "Num" :{"date": this.endDate,"number": val, "name": name,"numberAll":valAll,"valnum":a,"valAll":b,"valna":c},
@@ -242,6 +242,7 @@ export default {
                         }
                         val.forEach( function(item){
                                 a += item ;
+                                console.log(item,a)
                         });
                         valAll.forEach( function(item){
                                 b += item ;
@@ -251,7 +252,7 @@ export default {
                         } else {
                                 numm = Math.floor((12-that.biaozhunTObj[0].time)/3) + 1
                         }
-                        a=a*numm
+                        // a=a*numm
                         // console.log(numm,'numm')
                         if(b===0){
                                 c=0
@@ -305,7 +306,7 @@ export default {
                         } else {
                                 numm = Math.floor((12-that.bzJunZhuTObj[0].time)/3) + 1
                         }
-                        a=a*numm
+                        // a=a*numm
                         // console.log(numm,'numm')
                         if(b===0){
                                 c=0
@@ -359,7 +360,7 @@ export default {
                         } else {
                                 numm = Math.floor((12-that.bzXiBaoTObj[0].time)/3) + 1
                         }
-                        a=a*numm
+                        // a=a*numm
                         // console.log(numm,'numm')
                         if(b===0){
                                 c=0
@@ -594,9 +595,9 @@ export default {
                 },
                 getS9neiBuZhiLiang(){
                         //年度总
-                        let mjzlkzxbNum = this.getMatchingData('t_mjzlkzxb')
+                        let mjzlkzxbNum = this.getMatchingDataSame('t_mjzlkzxb')
                         //年度条件
-                        let mjzlkzxbSNum = this.getMatchingDataSame('t_mjzlkzxb')
+                        let mjzlkzxbSNum = this.getMatchingData('t_mjzlkzxb')
                         //部门总
                         let mjzlkzjlbNum = this.getMatchingData('t_mjzlkzjlb')
                         //部门条件
@@ -624,10 +625,11 @@ export default {
                         barData.push(numAData)
                         a=mjzlkzxbSNum[0]+mjzlkzjlbSNum[0]
                         b=mjzlkzxbNum[0]+mjzlkzjlbNum[0]
-                        if(b===0){
+                        if(mjzlkzxbSNum[0]===0){
                                 c=0
                         }else{
-                                c= Math.floor(a/b * 10000) / 100
+                                console.log(mjzlkzxbNum[0],mjzlkzxbSNum[0],mjzlkzxbNum[0]/mjzlkzxbSNum[0],mjzlkzxbNum[0]/mjzlkzxbSNum[0] * 10000,Math.floor(mjzlkzxbNum[0]/mjzlkzxbSNum[0] * 10000))
+                                c= Math.floor(mjzlkzxbNum[0]/mjzlkzxbSNum[0] * 10000) / 100
                         }
                         // }
                         return {