|
@@ -11,7 +11,7 @@ export const getJiaoYanObj = (end)=>{
|
|
|
}
|
|
}
|
|
|
export const gethechaObj = (end)=>{
|
|
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_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_yqsbhcjh.shi_bie_hao_ as t_sbhcjlbName, COUNT(t_yqsbhcjh.shi_bie_hao_) as t_sbhcjlb from t_yqsbhcjh LEFT JOIN t_sbdj on t_yqsbhcjh.shi_bie_hao_=t_sbdj.she_bei_shi_bie_h where YEAR(t_yqsbhcjh.he_cha_pin_lv_)="+end+" GROUP BY t_yqsbhcjh.shi_bie_hao_ HAVING COUNT(t_yqsbhcjh.shi_bie_hao_)>=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 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"
|
|
|
}
|
|
}
|
|
|
export const getnengliObj = (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 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"
|
|
@@ -51,6 +51,7 @@ export const DBData = (begin,end,scope)=>{
|
|
|
" join "+s5renYuanJianDu(begin,end,scope)+
|
|
" join "+s5renYuanJianDu(begin,end,scope)+
|
|
|
" join "+s9neiBu(begin,end,scope)+
|
|
" join "+s9neiBu(begin,end,scope)+
|
|
|
" join "+s12fengXian(begin,end,scope)+
|
|
" join "+s12fengXian(begin,end,scope)+
|
|
|
|
|
+ " join "+s14bufuhexiang(begin,end,scope)+
|
|
|
// " join "+s6sheBeiWeiHu(begin,end)+
|
|
// " join "+s6sheBeiWeiHu(begin,end)+
|
|
|
" join "+s7sheBeiJiaoZhun(begin,end)+
|
|
" join "+s7sheBeiJiaoZhun(begin,end)+
|
|
|
// " join "+s8sheBeiHeCha(begin,end)+
|
|
// " join "+s8sheBeiHeCha(begin,end)+
|
|
@@ -222,6 +223,7 @@ function s2jianCe(begin,end){
|
|
|
function s3tousu(begin,end,scope){
|
|
function s3tousu(begin,end,scope){
|
|
|
return "( SELECT COUNT( id_ ) AS t_complaint"+end+" FROM t_complaint WHERE you_wu_you_xiao_ = '有效投诉' and YEAR ( create_time_ ) = "+end+" ) s3tousu1 JOIN "+
|
|
return "( SELECT COUNT( id_ ) AS t_complaint"+end+" FROM t_complaint WHERE you_wu_you_xiao_ = '有效投诉' and YEAR ( create_time_ ) = "+end+" ) s3tousu1 JOIN "+
|
|
|
"( 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_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"
|
|
"( 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 "
|
|
// 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++) {
|
|
// for (let i = 1; i < scope.length; i++) {
|
|
@@ -351,4 +353,9 @@ function s9neiBu(begin,end,scope){
|
|
|
"(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(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 "
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ 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 "
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
|