d708ef16 康伟

kangwei:工作进度模块

3、日报填写增加及时率统计(及时率判断报表填写时间在24小时内,比如17日的数据,需要在18日23:59分之前填写完成)(及时率不影响面板的红色状态)
6、如果是查询当月,应填报表数应该是当月当天的日期减1
1 个父辈 f668fe6a
......@@ -81,9 +81,9 @@ public class ReportViewUtil {
if(!StringUtils.isEmpty(itemIds)) {
itemIds = itemIds.substring(1);
}
sb.append(" `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append(" `a`.`create_time` , `a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
sb.append(" SELECT data_id,reit_id,item_value,data_time,depart_id,create_time FROM f_report_itemv v WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append(" and depart_id in ("+inSqlPart+") ");
}
......
......@@ -105,8 +105,9 @@ public class WorkAnalysisController {
if(currentDate.toString().equals(endTime)){
index = 0 ;
}
String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +1) 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+"+index+" ) month_num,";
sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' ";
String sql = "select count(d.id) 'departNum', (DATEDIFF('"+endTime+"', '"+startTime+"') +"+index+") 'day_num' , (month('"+endTime+"') - month('"+startTime+"')+1 ) month_num,";
sql += " ifnull(sum(aaa.count),0) 'nh_num' ,ifnull(sum(bbb.count),0) 'szsl_num' ,ifnull(sum(ccc.count),0) 'hy_num' ,ifnull(sum(ddd.count),0) 'yy_month_num',ifnull(sum(fff.count),0) 'df_month_num' ,ifnull(sum(ggg.count),0) 'year_target_num' ,";
sql += " ifnull(sum(aaaHH.count),0) 'nhJsNum',ifnull(sum(bbbHH.count),0) 'szslJsNum',ifnull(sum(cccHH.count),0) 'hyJsNum' ";
sql += " from sys_depart d ";
sql += getWorkProgressSql(departIds, startTime, endTime, month);
sql += " where d.depart_type =1 ";
......@@ -213,21 +214,29 @@ public class WorkAnalysisController {
//能耗日报: 污泥量、电量合计,用水量
String view3a24Sql = ReportViewUtil.buildView(ReportConstant.view3a24,"WNL,DLHJ,YSL",departIds,startTime,endTime);
sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' group by aa.depart_id )aaa on aaa.depart_id = d.id ";
// 能耗日报 及时天数
sql += " left join (select aa.depart_id ,count(1) 'count' from "+view3a24Sql+ " aa where aa.WNL is not null and aa.WNL <> '' and aa.DLHJ is not null and aa.DLHJ <> '' and aa.YSL is not null and aa.YSL <> '' and DATEDIFF(aa.create_time , aa.time) < 2 group by aa.depart_id )aaaHH on aaaHH.depart_id = d.id ";
//水质水量日报表:进水量、出水量、PH进水、PH出水、COD进水、COD出水,TP进水、TP出水、NH4-N进水、出水; TN进水、出水
String view2119Sql = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSAD,CSAD,JSZD,CSTN,JSZL,CSZL,JSCOD,CSCOD,JSPH,CSPH",departIds,startTime,endTime);
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb ";
sql += " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' ";
sql += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
sql += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' ";
sql += " group by bb.depart_id )bbb on bbb.depart_id = d.id ";
String view2119Sql_where = " where bb.JSL is not null and bb.JSL <> '' and bb.CSL is not null and bb.CSL <> '' and bb.JSAD is not null and bb.JSAD <> '' and bb.CSAD is not null and bb.CSAD <> '' ";
view2119Sql_where += " and bb.JSZD is not null and bb.JSZD <> '' and bb.CSTN is not null and bb.CSTN <> '' and bb.JSZL is not null and bb.JSZL <> '' and bb.CSZL is not null and bb.CSZL <> '' ";
view2119Sql_where += " and bb.JSCOD is not null and bb.JSCOD <> '' and bb.CSCOD is not null and bb.CSCOD <> '' and bb.JSPH is not null and bb.JSPH <> '' and bb.CSPH is not null and bb.CSPH <> '' ";
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " group by bb.depart_id )bbb on bbb.depart_id = d.id";
//水质水量日报 及时天数
sql += " left join ( select bb.depart_id ,count(1) 'count' from "+view2119Sql+ " bb " +view2119Sql_where+ " and DATEDIFF(bb.create_time , bb.time) < 2 group by bb.depart_id )bbbHH on bbbHH.depart_id = d.id";
//化验日报 ==化验数据:PH进水、PH出水、COD进水、COD出水、TP进水、TP出水、NH4-N进水、出水; TN进水、出水
String viewbffaSql = ReportViewUtil.buildView(ReportConstant.view9bff,"JSPHHY,CSPHHY,JSCODHY,CSCODHY,JSZLHY,CSZLHY,CSTNHY,JSZDHY,JSADHY,CSADHY",departIds,startTime,endTime);
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc ";
sql += " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' ";
sql += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' ";
sql += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
sql += " group by cc.depart_id )ccc on ccc.depart_id = d.id ";
String viewbffaSql_where = " where cc.JSPHHY is not null and cc.JSPHHY <> '' and cc.CSPHHY is not null and cc.CSPHHY <> '' and cc.JSCODHY is not null and cc.JSCODHY <> '' and cc.CSCODHY is not null and cc.CSCODHY <> '' ";
viewbffaSql_where += " and cc.JSZLHY is not null and cc.JSZLHY <> '' and cc.CSZLHY is not null and cc.CSZLHY <> '' and cc.CSTNHY is not null and cc.CSTNHY <> '' and cc.JSZDHY is not null and cc.JSZDHY <> '' ";
viewbffaSql_where += " and cc.JSADHY is not null and cc.JSADHY <> '' and cc.CSADHY is not null and cc.CSADHY <> '' ";
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" group by cc.depart_id )ccc on ccc.depart_id = d.id ";
sql += " left join (select cc.depart_id ,count(1) 'count' from "+viewbffaSql+ " cc "+ viewbffaSql_where +" and DATEDIFF(cc.create_time , cc.time) < 2 group by cc.depart_id )cccHH on cccHH.depart_id = d.id ";
//电费月报
sql += " left join( select ec.depart_id , count(1) 'count' from report_electric_cost ec where ec.month = '"+month+"' and ec.cost is not null and ec.cost <> '' group by ec.depart_id ) ddd on ddd.depart_id = d.id ";
......
......@@ -34,6 +34,14 @@ public class WorkProgressVO {
private Integer szslNum;
@ApiModelProperty(value = "化验报表-填报天数")
private Integer hyNum;
@ApiModelProperty(value = "能耗-及时天数")
private Integer nhJsNum;
@ApiModelProperty(value = "水质水量-及时天数")
private Integer szslJsNum;
@ApiModelProperty(value = "化验报表-及时天数")
private Integer hyJsNum;
@ApiModelProperty(value = "运营月报-填报月数")
private Integer yyMonthNum;
@ApiModelProperty(value = "电费月报-填报月数")
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!