477750b3 张雷

报表常量修改

1 个父辈 ea8f9ea7
正在显示 18 个修改的文件 包含 120 行增加178 行删除
......@@ -17,4 +17,23 @@ public interface ReportConstant {
//化验日报
public static final String view9bff = "9bffaf9187093d6e6a4390e8c56acca8";
//供水日报
public static final String view6643 = "6643ef559d863f57de5fd33220c773c4";
//药剂字段
public static final String fieldYj = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
//水量字段
public static final String fieldClsl = "CSL,JSL";
//电字段
public static final String fieldDl = "DLHJ";
//污泥字段
public static final String fieldWnl = "WNL";
//水质字段
public static final String fieldSz = "JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS";
}
......
......@@ -16,9 +16,6 @@ import com.skua.core.context.SpringContextUtils;
*/
public class ReportViewUtil {
public static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
public static String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
public static String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
/**
* <pre>
* 构造填报报表视图
......
......@@ -175,18 +175,12 @@ public class SysCommandCentreController {
@ApiOperation(value="指挥中心-水量电耗趋势", notes="指挥中心-水量电耗趋势")
@GetMapping(value = "/statisticsBySewage")
public Result<StackedAreaChartDataVO> statisticsBySewage(ReportItemvParam reportItemvParam) throws Exception {
// SysAlgorithmStatisticsLibraryVO sysAlgorithmLibraryVO = JSONObject.toJavaObject(jsonObject, SysAlgorithmStatisticsLibraryVO.class);
// String reportId = "3a243d5715b9e1a3753c180872ca0df9";//报表编号
// String reportItemCode = "DLHJ";//查询字段
//报表数据项值
String reitId = sysConfigService.queryValueByKey("REIT_ID_DLHJ");
//reportItemvParam.setReportId(reportId);
reportItemvParam.setReitId( reitId );
//电
List<ReportDateTrendVO> electricityMapList = commandCentreService.getReportItemvByReitIdAndDate7Day(reportItemvParam );
//reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";//报表编号
//reportItemCode = "CSL";//查询字段
reitId = sysConfigService.queryValueByKey("REIT_ID_CSL");
//水集合
......
......@@ -132,14 +132,12 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
public DepartDrugResult getYhTotal(String month) {
String monthTb = DateUtils.getTbMonth(month);//同比时间
String monthHb = DateUtils.getHbMonth(month);//环比时间
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", month);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthTb);
String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", "", monthHb);
String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", month);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthTb);
String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, "", monthHb);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", month);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", monthTb);
String dataViewName2119hb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, "", monthHb);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", month);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", monthTb);
String dataViewName3a24hb = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, "", monthHb);
DepartDrugResult departDrugResult = fReportItemvMapper.getYhData(month,monthTb,monthHb,
dataViewName3a24,dataViewName3a24tb,dataViewName3a24hb);
if(departDrugResult == null){
......
package com.skua.modules.algorithm.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
......@@ -29,8 +30,6 @@ import java.util.Map;
*/
@Service("reportItemvService")
public class ReportItemvService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
private JdbcTemplate getJdbcTemplate(){
//主库数据源
......@@ -42,12 +41,12 @@ public class ReportItemvService {
List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>();
DateVO dateVO = new DateVO(startTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"WNL", departIds, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"WNL", departIds, startTime,endTime);
String sql = "select sum(aaa.WNL) from " + dataViewName3a24+ "aaa";
String nowMonthValue = getSumValue(view3a24,"WNL",departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String lastMonthValue = getSumValue(view3a24,"WNL",departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
String lastYearValue = getSumValue(view3a24,"WNL",departIds, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
String nowMonthValue = getSumValue(ReportConstant.view3a24,"WNL",departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String lastMonthValue = getSumValue(ReportConstant.view3a24,"WNL",departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
String lastYearValue = getSumValue(ReportConstant.view3a24,"WNL",departIds, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
String nowMonthCSL = getSumCSL(departIds,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String lastMonthCSL = getSumCSL(departIds, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
......@@ -72,7 +71,7 @@ public class ReportItemvService {
}
//指挥中心-泥量统计
public List<ReportItemVO> statisticsByCementList(String departIds, String startTime, String endTime) {
List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,view3a24,"WNL");
List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,ReportConstant.view3a24,"WNL");
return dateList;
}
......@@ -83,7 +82,7 @@ public class ReportItemvService {
public List<FRportlCommandCenterVO> statisticsByElectricity(String departId, String startTime, String endTime) {
List<FRportlCommandCenterVO> fRportlCommandCenterVOList = new ArrayList<>();
DateVO dateVO = new DateVO(startTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime);
String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
String nowMonthValue = getSumDLHJ(departId,dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
......@@ -115,7 +114,7 @@ public class ReportItemvService {
* @param endTime
*/
public List<ReportItemVO> statisticsByElectricityList(String departIds, String startTime, String endTime) {
List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,view3a24,"DLHJ");
List<ReportItemVO> dateList = statisticsByField(departIds,startTime,endTime,ReportConstant.view3a24,"DLHJ");
return dateList;
}
/***
......@@ -137,7 +136,7 @@ public class ReportItemvService {
departIds =getJdbcTemplate().queryForObject(factorySql,String.class);
//月产水量
Map<String,String> cslMap = commonQueryCsl(departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String sql = "select aaa.CSL 'csl' ,aaa.depart_id , d.depart_name, fi.pro_scale*10000 'pro_scale' from "+ dataViewName2119 +" aaa";
sql += " left join sys_factory_info fi on fi.depart_id = aaa.depart_id";
sql += " left join sys_depart d on d.id = aaa.depart_id";
......@@ -225,7 +224,7 @@ public class ReportItemvService {
//通用csl查询,返回Map<部门编号,CSL出水量>
private Map<String,String> commonQueryCsl(String departIds ,String startTime ,String endTime){
Map<String,String> cslMap = new HashMap<>();
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, startTime,endTime);
// System.out.println("dataViewName2119 ="+dataViewName2119 );
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null){
......@@ -256,14 +255,14 @@ public class ReportItemvService {
* @return
*/
public String getSumCSL(String departId ,String startTime ,String endTime){
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportViewUtil.view2119,"CSL", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime);
String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa";
String csl = getJdbcTemplate().queryForObject(sql,String.class);
return ConvertUtils.getString(csl,"0.00");
}
public String getSumDLHJ(String departId ,String startTime ,String endTime){
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportViewUtil.view3a24,"DLHJ", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime);
String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa";
String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
return ConvertUtils.getString(dlhj,"0.00");
......@@ -278,7 +277,7 @@ public class ReportItemvService {
public DepartLoadRateResultVO statisticsByLoadRate(String departIds,String startTime, String endTime, Integer loadRateType) {
DepartLoadRateResultVO departLoadRateResultVO = new DepartLoadRateResultVO();
//int loadRateType = 1;
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime,endTime);// 部门、时间
//列表数据
List<DepartLoadRateVO> dataList = statisticsByLoadRateList(departIds, startTime,endTime,loadRateType);
long differenceDay = DateUtils.differenceDay(startTime, endTime);
......@@ -295,7 +294,7 @@ public class ReportItemvService {
}
//指挥中心-运行负荷率分析---列表详情
public List<DepartLoadRateVO> statisticsByLoadRateList(String departIds, String startTime, String endTime ,Integer loadRateType) {
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL", departIds, startTime,endTime);// 部门、时间
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime,endTime);// 部门、时间
long differenceDay = DateUtils.differenceDay(startTime, endTime);
// 运行负荷率分析 = CSL/规模
......@@ -326,11 +325,6 @@ public class ReportItemvService {
}
sql += " ) bbb ";
//System.out.println("sql = "+sql);
return sql ;
}
/* public List<Map<String,Object>> getDeptDLHJ(String departId , String startTime , String endTime){
}*/
}
......
......@@ -39,8 +39,6 @@ public class TestReportSqlController {
HttpServletRequest req) {
Result<String> result = new Result();
String dataViewName2 = ReportViewUtil.buildViewLike(reportId,fields,departIds, startTime, endTime);
//String dataViewName3 = ReportViewUtil.buildViewByStatistics("3a243d5715b9e1a3753c180872ca0df9","DLHJ,GFFDL,QY,WNL,WNHSL,GFCZL,WFCSL,WFCZL", startTime, endTime);
result.setSuccess(true);
result.setResult(dataViewName2);
return result;
......
package com.skua.modules.threedimensional.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
......@@ -10,7 +11,6 @@ import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.threedimensional.service.IJTDisplayScreenService;
import com.skua.modules.threedimensional.vo.*;
import com.skua.tool.util.DigitalUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -25,11 +25,6 @@ import java.util.*;
@Service
public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
private JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
return masterDB;
......@@ -63,7 +58,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String departIds = masterDB.queryForObject( departIdSql,String.class);
//昨天处理水量(m³)
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, lastDay, lastDay);//depart_id CSL
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, lastDay, lastDay);//depart_id CSL
dataList = masterDB.queryForList(dataViewName2119);
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
......@@ -71,7 +66,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
//本月处理水量(m³)
dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowMonthStartDate(), dateVO.getNowMonthEndDate());
dataList = masterDB.queryForList(dataViewName2119);
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
......@@ -79,7 +74,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
// resultMap.put(ConvertUtils.getString(dataMap.get("id")), ConvertUtils.getString(dataMap.get("create_by"))+""+ConvertUtils.getString(dataMap.get("title")));
}
//本年处理水量(万m³)
dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", departIds, dateVO.getNowYearStartDate(), currentDate);
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, dateVO.getNowYearStartDate(), currentDate);
dataList = masterDB.queryForList(dataViewName2119);
for(Map<String, Object> dataMap : dataList) {
factoryInfoVO = factoryInfoMap.get(dataMap.get("depart_id").toString());
......@@ -115,7 +110,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
ProjectOperationInfoVO projectOperationInfoVO = projectOperationInfoVOList.get(0);
//DateVO dateVO = new DateVO(DateUtil.dateformat("2024-07-01","yyyy-MM-dd"));
//月产水量
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL", null, startTime,endTime,"sum");
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", null, startTime,endTime,"sum");
//System.out.println("dataViewName2119 = "+dataViewName2119);
String ycslSql = "select round(sum(aaa.CSL),2) 'CSL' from "+ dataViewName2119+" aaa";
String ycsl = getJdbcTemplate().queryForObject(ycslSql, String.class);
......@@ -141,7 +136,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
overproofDay = getJdbcTemplate().queryForObject(overProofSql,Long.class);
projectOperationInfoVO.setSzzhdbl( (dayNum - overproofDay) * 100/dayNum +"");//格式化两位小数
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"WNHSL", null, startTime,endTime,"sum");
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"WNHSL", null, startTime,endTime,"sum");
//System.out.println("dataViewName3a24 = "+dataViewName3a24);
String WNHSLSql = "select round(sum(aaa.WNHSL),2) 'WNHSL' from "+ dataViewName3a24+" aaa";
// System.out.println(" WNHSLSql = "+WNHSLSql);
......@@ -165,7 +160,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String startTime= BaseUtil.getMonthBytime(-6,time)+"-01";
String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
//月产水量
String dataViewName2119 = ReportViewUtil.buildView(view2119,"CSL,JSL", null, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL,JSL", null, startTime,endTime);
//System.out.println("dataViewName2119 ="+dataViewName2119);
StringBuffer sql = new StringBuffer("select date_format(bbb.time,'%Y-%m') 'time' ,round(sum(bbb.JSL),2) 'jsl',round(sum(bbb.CSL),2) 'csl' from ");
sql.append( dataViewName2119 );
......@@ -186,7 +181,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
*/
public EcologyBenefitVO ecologyBenefit(String departId, String startTime, String endTime){
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN", departId, startTime,endTime);
String sql = "select round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn' from "+dataViewName2119 +" aaa";
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
EcologyBenefitVO ecologyBenefitVO = new EcologyBenefitVO(0d,0d,0d);
......@@ -213,7 +208,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
String startTime= BaseUtil.getMonthBytime(-12,time)+"-01";
String endTime=BaseUtil.getMonthBytime(-1,time)+"-31";
//CSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD
String dataViewName2119 = ReportViewUtil.buildView(view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,JSCOD,CSCOD,JSZL,CSZL,JSZD,CSTN,JSAD,CSAD", departId, startTime,endTime);
System.out.println("dataViewName2119 ="+dataViewName2119);
StringBuffer sql = new StringBuffer("select date_format(aaa.time, '%Y-%m') 'time' , round(sum(aaa.JSL),2) 'jsl',round(sum( aaa.JSCOD -aaa.CSCOD ),2) 'cod', ");
sql.append(" round(sum( aaa.JSZL -aaa.CSZL ),2) 'tp', round(sum( aaa.JSZD -aaa.CSTN ),2) 'tn',round(sum( aaa.JSAD -aaa.CSAD ),2) 'nh3n' from ");
......@@ -233,7 +228,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
public WaterQualityVO queryWaterQuality(String departId, String startTime, String endTime){
WaterQualityVO waterQualityVO = null;
//出水 cod,
String dataViewName2119 = ReportViewUtil.buildViewLike(view2119,"CSL,JSCOD,CSCOD,JSAD,CSAD", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSCOD,CSCOD,JSAD,CSAD", departId, startTime,endTime);
StringBuffer sql = new StringBuffer("select round(aaa.CSL,2) 'csl',round(( aaa.JSCOD - aaa.CSCOD ),2) 'codxjl', round(( aaa.JSAD -aaa.CSAD ),2) 'adxjl' from ");
sql.append(" "+dataViewName2119 +" aaa ");
System.out.println(sql.toString());
......@@ -251,7 +246,7 @@ public class JTDisplayScreenServiceImpl implements IJTDisplayScreenService {
waterQualityVO.setYxfhl( yxfhl );
//吨水电耗,吨水药耗
String dataViewName3a24 = ReportViewUtil.buildViewLike(view3a24,"DLHJ,WNL,PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime,"sum");
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldDl+","+ ReportConstant.fieldWnl+","+ ReportConstant.fieldYj, departId, startTime,endTime,"sum");
System.out.println("dataViewName3a24 = "+dataViewName3a24);
StringBuffer sql2 = new StringBuffer("select aaa.WNL as 'tnl' ,round((aaa.DLHJ /"+waterQualityVO.getCsl()+"),2) 'dsdh' , ");
sql2.append(" round(((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY)/ "+waterQualityVO.getCsl()+"),2) 'dsyh' from ");
......
......@@ -218,8 +218,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
String departIds = statisticsParams.getDepartIds();
Map<String, Object> valueMap = new HashMap<>();
List<String> monthList = getMonthsBetween(startDate,endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, "DLHJ", departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldDl, departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departIds, startDate, endDate);
List<Map<String, Object>> dataList = screenMapper.getYhdlqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
if(dataList.size()>0){
for (Map<String, Object> vMap : dataList) {
......@@ -261,10 +261,8 @@ public class ScreenDataServiceImpl implements IScreenDataService {
String departIds = statisticsParams.getDepartIds();
Map<String, Object> valueMap = new HashMap<>();
List<String> monthList = getMonthsBetween(startDate,endDate);
String field3a24 = "PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startDate, endDate);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departIds, startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departIds, startDate, endDate);
List<Map<String, Object>> dataList = screenMapper.getYhylqs(startDate,endDate,departIds,dataViewName3a24,dataViewName2119);
if(dataList.size()>0){
for (Map<String, Object> vMap : dataList) {
......
......@@ -84,11 +84,10 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
public List<Map<String, Object>> getDataFromHY(String dataTime, String departId) {
List<Map<String, Object>> valueMapList = new ArrayList<>();
String tbYear = String.valueOf(Integer.parseInt(dataTime) - 1);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dataTime);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear);
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, dataTime);
String dataViewName2119tb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, tbYear);
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj;
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, dataTime);
String dataViewName3a24tb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
......@@ -179,10 +178,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
Map<String,String> weekMap = getWeekDate(dataTime,week);
String startDate = weekMap.get("start");
String endDate = weekMap.get("end");
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj+ "," + ReportConstant.fieldWnl;
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
String field2119 = "CSL,JSCOD,JSAD,JSPH,JSZD,JSZL,JSSS,CSCOD,CSAD,CSPH,CSTN,CSZL,CSSS";
String field2119 = ReportConstant.fieldClsl + "," + ReportConstant.fieldSz;
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,field2119, "", startDate, endDate);
valueMap = mapper.getWeekReport(dataTime, departId, week, startDate, endDate, dataViewName3a24, dataViewName2119);
if(valueMap==null){
......@@ -230,8 +228,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
String end = month + "-31";
int dayCount = (int)DateUtils.differenceDay(start,end);
String departIds = commonSqlMapper.getChildDepartId(departId);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, start, end);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldDl+",GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, start, end);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, start, end, departIds, dayCount);
return list;
}
......@@ -244,7 +242,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
List<JnhbReportDetailsJs> jsList = new ArrayList<>();
List<JnhbReportDetailsHj> hjList = new ArrayList<>();
String year = month.substring(0,4);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL,JSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departId, year);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl+","+ReportConstant.fieldSz, departId, year);
String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"", departId, year);
dyList = mapper.getDyList(dataViewName2, dataViewName3, departId, year);
jsList = mapper.getJsList(dataViewName2, dataViewName3, departId, year);
......@@ -287,8 +285,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
//节能环保报表数据-部门+月数据
private List<JnhbReportData> jnhbReportShowDepaetMonthDate(String departIds, String startTime, String endTime){
int dayCount = (int)DateUtils.differenceDay(startTime,endTime);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,"DLHJ,GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
String dataViewName2 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
String dataViewName3 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldDl+",GFFDL,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
List<JnhbReportData> list = mapper.getJnhbReport(dataViewName2, dataViewName3, startTime, endTime, departIds, dayCount);
return list;
}
......@@ -439,8 +437,8 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
private JnhbReportData getJnhbReportSumData(String departIds, String startTime ,String endTime){
//头部统计数据
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime);
String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ,QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
String dataViewName3 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldDl+",QY,YSL,WNL,WNHSL,GFCZL,WFCSL,WFCZL", departIds, startTime, endTime);
//System.out.println("dataViewName3 = "+dataViewName3);
if(StringUtils.isNotEmpty(departIds)){
departIds = JSUtils.quoteEach(departIds,",");
......@@ -467,7 +465,7 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
}
private JnhbReportData getJnhbReportSumDataByResultNumber(String departIds, String startTime ,String endTime){
//头部统计数据
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL,JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN", departIds, startTime, endTime);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl + "," + ReportConstant.fieldSz, departIds, startTime, endTime);
String sql = "select ";
sql += " ROUND(SUM( IFNULL(aaa.JSCOD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSCOD*aaa.CSL,0)/1000000 ),2) AS codxjl,";
sql += " ROUND(SUM( IFNULL(aaa.JSAD*aaa.JSL,0)/1000000 ) - SUM( IFNULL(aaa.CSAD*aaa.CSL,0)/1000000 ),2) AS adxjl,";
......@@ -533,10 +531,9 @@ public class FCustomReportDatasetServiceImpl extends ServiceImpl<FCustomReportDa
Map<String,String> weekMap = getWeekDate(dataTime,week);
String startDate = weekMap.get("start");
String endDate = weekMap.get("end");
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2,WNL";
String field3a24 = ReportConstant.fieldDl + "," + ReportConstant.fieldYj + "," + ReportConstant.fieldWnl;
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, field3a24, "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", "", startDate, endDate);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, "", startDate, endDate);
list = mapper.getWeekReportData(startDate, endDate, dataViewName3a24, dataViewName2119);
map.put("start", startDate);//开始时间
map.put("end", endDate);//结束时间
......
......@@ -76,13 +76,12 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
yearTbYjhjMb = Double.parseDouble(target.getTargetDrug());
}
}
String dataViewName2119Year = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, year);
String dataViewName2119YearTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbYear);
String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month);
String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbMonth);
String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, hbMonth);
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ," +
"YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String dataViewName2119Year = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, year);
String dataViewName2119YearTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, tbYear);
String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, month);
String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, tbMonth);
String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, hbMonth);
String field3a24 = ReportConstant.fieldDl+","+ ReportConstant.fieldYj;
String dataViewName3a24Year = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, year);
String dataViewName3a24YearTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbYear);
String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
......@@ -236,20 +235,19 @@ public class FactoryOperateCenterServiceImpl implements IFactoryOperateCenterSer
}
if(target == null ) target = new ReportTargetConfig();
String field3a24 = "DLHJ,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,PFS,FHTY,RYXNJ,YWL,GXCLJ,CH3COONA,HXT,FECL3,SH,CH3COOH,FESO4G,FESO4Y,H2O2";
String field3a24 = ReportConstant.fieldDl+","+ ReportConstant.fieldYj;
String dataViewName3a24Month = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, month);
String dataViewName3a24MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, tbMonth);
String dataViewName3a24MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view3a24,field3a24, departId, hbMonth);
List<YJMonthDataVO> monthDataVOList = new ArrayList<>();
String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, month);
String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, tbMonth);
String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, hbMonth);
String dataViewName2119Month = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, month);
String dataViewName2119MonthTb = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldClsl, departId, tbMonth);
String dataViewName2119MonthHb = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, hbMonth);
Map<String,Object> monthMap = factoryOperateCenterMapper.getSdyData(dataViewName2119Month, dataViewName3a24Month, departId, month);
Map<String,Object> monthHbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthHb, dataViewName3a24MonthHb, departId, hbMonth);
Map<String,Object> monthTbMap = factoryOperateCenterMapper.getSdyData(dataViewName2119MonthTb, dataViewName3a24MonthTb, departId, tbMonth);
//String yjName, String yjCode, String yearTarge, String monthTarge, String value, String valueHB, String valueTB
monthDataVOList.add( new YJMonthDataVO("PAC(液)","PACYT" ,ConvertUtils.getString(target.getTargetPacyt(),"0"),ConvertUtils.getString(monthMap.get("PACYT"),"0"),
ConvertUtils.getString(monthHbMap.get("PACYT"),"0") ,ConvertUtils.getString(monthTbMap.get("PACYT") ,"0") ) );
monthDataVOList.add( new YJMonthDataVO("PAC(固)","PACGT" ,ConvertUtils.getString(target.getTargetPacgt(),"0"),ConvertUtils.getString(monthMap.get("PACGT"),"0"),
......
......@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.DictModel;
import com.skua.core.context.BaseContextHandler;
......@@ -16,7 +17,6 @@ import java.util.concurrent.atomic.AtomicReference;
@Service
public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
private static String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Autowired
private WaterAnalysisNewMapper waterAnalysisNewMapper;
@Override
......@@ -65,8 +65,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
public List<Map<String, Object>> queryFacListWaterQCL(String time) {
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> result = Lists.newArrayList();
String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD";
String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldSz, departIds, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName);
if (list != null) {
for (Map<String, Object> map : list) {
......@@ -108,8 +107,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
public Map<String, Object> queryWaterQCL(String time) {
Map<String, Object> result = Maps.newHashMap();
String departIds = BaseContextHandler.getDeparts();
String fields = "CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD";
String dataViewName = ReportViewUtil.buildViewLike(view2119,fields, departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119, ReportConstant.fieldSz, departIds, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds);
if(result==null){
result = new HashMap<>();
......@@ -122,7 +120,6 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryCSAnalysis(String time) {
String reportId = "2119ecbf53a1d2d0708258ff67cfd9e1";
String departIds = BaseContextHandler.getDeparts();
//获取负荷比例
List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion");
......@@ -142,7 +139,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
Double finalUp = up;
data.forEach(v -> {
String code = (String) v.get("id");
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds, reportId);
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds, ReportConstant.view2119);
if (datan != null && datan.size() > 0) {
DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics();
//取最大值
......
......@@ -2,6 +2,7 @@ package com.skua.modules.dataAnalysis.service.impl;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.DictModel;
import com.skua.core.context.BaseContextHandler;
......@@ -19,11 +20,8 @@ import java.util.Map;
@Service
public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService {
private static String REPOART_ID_SL = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Autowired
private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
@Autowired
private ISysMonitorMetricInfoService sysMonitorMetricInfoService;
@Override
public Map<String, Object> querySLDeatailList(String startTime, String endTime) {
String departIds = BaseContextHandler.getDeparts();
......@@ -31,7 +29,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
Map<String, Object> result = Maps.newHashMap();
Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year");
String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", departIds, startTime, endTime);
String dataViewName = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departIds, startTime, endTime);
//查询年度水量数据
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, departIds);
......@@ -84,7 +82,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public List<Map<String, Object>> queryZLSAnalysis(String time) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"JSL,CSL", departIds, time);
List<Map<String, Object>> list = new ArrayList<>();
list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
return list;
......@@ -93,7 +91,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public Map<String, Object> querySLFHLAnalysis(String time) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, departIds);
List<Map<String, Object>> upList = Lists.newArrayList();
......@@ -154,8 +152,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public Map<String, Object> querySLAnalysis(String time) {
String departIds = BaseContextHandler.getDeparts();
String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, DateUtils.getLastMonthOfMonth(time));
String thisDataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
String lastDataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, DateUtils.getLastMonthOfMonth(time));
Map<String, Object> result = Maps.newHashMap();
//增长率
List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
......@@ -168,7 +166,7 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public Map<String, Object> queryTotalSLList(String time) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
String nowYear = DateUtils.getDate("yyyy");
......@@ -216,14 +214,14 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public Map<String, Object> queryTotalSLData(String time) {
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
String dataViewName = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
StringBuilder stringBuilder = new StringBuilder();
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, departIds);
String time2 = String.valueOf(Integer.parseInt(time) - 1);
String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time2);
String dataViewName2 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departIds, time2);
List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, departIds);
for (int i =0 ;i<data.size();i++){
......
package com.skua.modules.job;
import com.skua.common.constant.ReportConstant;
import com.skua.core.util.DateUtils;
import com.skua.modules.alarmtmp.entity.SysFactoryDevice;
import com.skua.modules.alarmtmp.service.ISysFactoryDeviceService;
......@@ -33,8 +34,6 @@ public class DayDataSyncJob implements Job {
private ISysFactoryDeviceService sysFactoryDeviceService;
@Autowired
private IReportDataService reportDataService;
//水质水量报表ID
private static final String REPORT_ID = "2119ecbf53a1d2d0708258ff67cfd9e1";
@Override
public void execute(JobExecutionContext jobExecutionContext) {
......@@ -189,9 +188,9 @@ public class DayDataSyncJob implements Job {
data.put("JSZL", "");
}
data.put("departId", departId);
data.put("reportId", REPORT_ID);
data.put("reportId", ReportConstant.view2119);
data.put("time",yesterday);
reportDataService.insertOrUpdateReportData(departId, yesterday, data, REPORT_ID);
reportDataService.insertOrUpdateReportData(departId, yesterday, data, ReportConstant.view2119);
}
}
}
......
package com.skua.modules.report.controller;
import com.google.common.collect.Maps;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
......@@ -75,7 +76,7 @@ public class ReportDataController {
String dataViewName = ReportViewUtil.buildViewLike(reportId, "", departId, dataTime);
List<Map<String, Object>> valueMapList = new ArrayList<>();
if("year".equals(timeType)){
if("4411ed3d78634bcdcd700f6e33724025".equals(reportId)){
if(ReportConstant.view4411.equals(reportId)){
valueMapList = fCustomReportDatasetService.getDataFromHY(dataTime, departId);
}else{
String start = dataTime + "-01-01";
......
package com.skua.modules.report.service.impl;
import com.skua.common.constant.ReportConstant;
import com.skua.common.report.ReportViewUtil;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.util.ConvertUtils;
......@@ -32,10 +33,6 @@ public class OperationReportServiceImpl implements IOperationReportService {
@Resource
private OperationReportMapper operationReportMapper;
String view2119 = "2119ecbf53a1d2d0708258ff67cfd9e1";// 水 COD TP TN NH3H
String view3a24 = "3a243d5715b9e1a3753c180872ca0df9";//能耗报表
String view4411 = "4411ed3d78634bcdcd700f6e33724025";//生产运营周报
private JdbcTemplate getJdbcTemplate(){
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
return masterDB;
......@@ -62,7 +59,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
String departId = null;
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
String dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
String dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water', sum(tc.target_drug ) 'target_drug' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year = '"+year+"')";
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql);
......@@ -93,7 +90,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
}
// 去年水数据:月收费水量、月实际水量
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime());
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysfsl,ysjsl", departId, lastSeasonTimeVO.getStartTime(),lastSeasonTimeVO.getEndTime());
sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' from "+dataViewName4411+" aaa";
if(mapList != null ){
......@@ -113,7 +110,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
//tqysjsl 同期月实际水量
//ysjsl 月实际水量
// fields = "ysjsl,tqysjsl,ysjsldyqntqyy";
dataViewName4411 = ReportViewUtil.buildView(view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysjsl,tqysjsl,ysjsldyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
// sql = "select sum( aaa.ysfsl ) 'ysfsl' , sum( aaa.ysjsl ) 'ysjsl' , sum(tc.target_water ) 'target_water' , sum(tc.target_power) 'target_power' ,round((sum( aaa.ysfsl ) *100 / sum(tc.target_water )),2) as 'completeRatio' from "+dataViewName4411+" aaa";
sql = "select round( (aaa.tqysjsl - aaa.ysjsl ) / aaa.tqysjsl ,2 ) 'ratio' , aaa.tqysjsl , aaa.ysjsl , aaa.ysjsldyqntqyy 'causeAnalysis' , d.depart_name from "+dataViewName4411 +" aaa";
sql += " left join sys_depart d on d.id = aaa.depart_id where aaa.tqysjsl > aaa.ysjsl";
......@@ -121,7 +118,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setWaterDeptartList(waterMonthDataList);
//水电耗高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ydh,qntqdh,dhgyqntqyy", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
sql = "select aaa.dhgyqntqyy 'causeAnalysis' , aaa.qntqdh ,aaa.ydh 'realConsume' ,d.depart_name 'deptartName' , IFNULL(tc.target_power,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
sql += " left join sys_depart d on d.id = aaa.depart_id ";
......@@ -131,7 +128,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
/** ysjsl:月实际水量 ; 月药耗 yyh; 去年同期药耗 qntqyh; 月药费 yyf;药耗高于去年同期原因 yhgyqntqyy;药耗超预期原因 yhcyqyy; 本年实际药耗 bnsjyh; 本年药耗目标 bnyhmb*/
//药剂成本高于控制目标--水务公司列表
dataViewName4411 = ReportViewUtil.buildViewLike(view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
dataViewName4411 = ReportViewUtil.buildViewLike(ReportConstant.view4411,"ysjsl,yyh,qntqyh,qntqyh,yhgyqntqyy,bnsjyh,bnyhmb", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime(),"max");
// sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.ysjsl,aaa.qntqyh,aaa.qntqyh,aaa.yhgyqntqyy '',aaa.bnsjyh,aaa.bnyhmb,aaa.depart_id ,d.depart_name ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql = "select round((aaa.yyh/aaa.ysjsl),2) 'realConsume',aaa.yhgyqntqyy 'causeAnalysis',d.depart_name 'deptartName' ,IFNULL(tc.target_drug,'-') 'targetConsume' from " + dataViewName4411 + " aaa ";
sql += " left join report_target_config tc on (tc.depart_id = aaa.depart_id and tc.target_year ="+year+")";
......
......@@ -54,9 +54,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
displayVO = new DrugConsumptionDisplayVO( CSL, tbqnCsl, tbsyCsl, zyh, hbsyzyh, tbqnzyh);
//历史最低吨水药耗???
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, null,null);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.fieldClsl, departId, null,null);
//System.out.println("dataViewName2119 "+dataViewName2119);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, null,null);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,ReportConstant.fieldYj, departId, null,null);
//System.out.println("dataViewName3a24 "+dataViewName3a24);
StringBuffer sql = new StringBuffer();
sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round(( ddd.YH /ccc.CSL ),2) as 'dsyh' ") ;
......@@ -103,40 +103,6 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
chartVOList.add( chartVO ) ;
}
return chartVOList;
/* String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
StringBuffer sql2 = new StringBuffer("select DATE_FORMAT(aaa.time,'%Y-%m') 'time', ");
sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'zyh' from ");
sql2.append( " "+dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m')");
System.out.println("统计药耗 ="+sql2.toString());
List<DrugConsumptionTrendChartVO> chartVOList = getJdbcTemplate().query(sql2.toString(),new BeanPropertyRowMapper<DrugConsumptionTrendChartVO>(DrugConsumptionTrendChartVO.class));
Map<String,DrugConsumptionTrendChartVO> chartVOMap = new HashMap<>();
if( chartVOList != null ){
for(DrugConsumptionTrendChartVO consumptionTrendChartVO : chartVOList){
chartVOMap.put(consumptionTrendChartVO.getTime(),consumptionTrendChartVO);
}
}
List<DrugConsumptionTrendChartVO> chartVOList1 = new ArrayList<>();
DrugConsumptionTrendChartVO chartVOTemp = null;
//查询当前时间往前推12个月的数据
List<String> months=this.getTwelve(time);
for (String month : months) {
String yesmonth=this.getMonthBytime(-12,month);
chartVOTemp = chartVOMap.get(month);
if(chartVOTemp == null ){
chartVOTemp = new DrugConsumptionTrendChartVO();
chartVOTemp.setTime( month);
chartVOTemp.setZyh(0.0d);
}
if(chartVOMap.get(yesmonth)!= null ){
chartVOTemp.setTbzyh( chartVOMap.get(yesmonth).getZyh() );
}
chartVOList1.add( chartVOTemp) ;
}
return chartVOList1;*/
}
//吨水药耗趋势
......@@ -146,9 +112,9 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
String startTime=this.getMonthBytime(-12,time)+"-01";
String endTime=this.getMonthBytime(-1,time)+"-31";
//历史最低吨水药耗???
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119,"CSL", departId, startTime,endTime);
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldClsl, departId, startTime,endTime);
//System.out.println("dataViewName2119 "+dataViewName2119);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view3a24, ReportConstant.fieldYj, departId, startTime,endTime);
//System.out.println("dataViewName3a24 "+dataViewName3a24);
StringBuffer sql = new StringBuffer();
sql.append(" select ccc.CSL,ccc.depart_id,ccc.time,ddd.YH ,round((ddd.YH /ccc.CSL ),2) as 'dsyh' ") ;
......@@ -189,7 +155,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
public List<DrugConsumptionDisplayVO> proportionStatistics(String time,String departId){
DateVO dateVO = new DateVO(time);//转换后的时间参数
//本月处理水量
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
Double nowMonthCSL = null;//getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
List<Map<String, Object>> dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null ){
......@@ -199,7 +165,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
//环比:上月处理水量
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,ReportConstant.fieldClsl, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
Double hbsyCsl = null;// getJdbcTemplate().queryForObject(dataViewName2119,Double.class);
dataMapList = getJdbcTemplate().queryForList(dataViewName2119);
if(dataMapList != null ){
......@@ -217,17 +183,14 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
}
}
String fileds = "PAMZ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY";
//本月药剂 总药耗
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getNowMonthStartDate(),dateVO.getNowMonthEndDate());
Map<String, Object> nowMonthDataMap =queryForMap(dataViewName3a24);// getJdbcTemplate().queryForMap(dataViewName3a24);
//环比:上月药剂 总药耗
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getLastMonthStartTime(),dateVO.getLastMonthEndTime());
Map<String, Object> lastMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
//同比:去年本月药剂: 总药耗
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,fileds, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24, ReportConstant.fieldYj, departId, dateVO.getLastYearMonthStartTime(),dateVO.getLastYearMonthEndTime());
Map<String, Object> lastYearMonthDataMap = queryForMap(dataViewName3a24);//getJdbcTemplate().queryForMap(dataViewName3a24);
String filedsSql = "select item_code ,item_alias from f_report_item where item_code in ('PAMZ','PAMF','PAMRJ','SCLPAMZ','SCLPAMF','NACLO','PACGT','PACYT','FESO4G','FESO4Y','H2O2','CH3COOH','SH','FECL3','HXT','PFS','CH3COONA','GXCLJ','YWL','RYXNJ','FHTY') ";
......@@ -297,12 +260,7 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
CorrelationAnalysisVO correlationAnalysisVO = null;
if(dataList != null){
for(Map<String,Object> map : dataList){
//String time, String zyh, String dnhl, String wnl, String wnhsl
correlationAnalysisVO = new CorrelationAnalysisVO(ConvertUtils.getString(map.get("time")),ConvertUtils.getString(map.get("zyh")),ConvertUtils.getString(map.get("wnl")),ConvertUtils.getString(map.get("wnhsl")));
/* if(map.get("time") != null ) correlationAnalysisVO.setTime(map.get("time") +"");
if(map.get("zyh") != null ) correlationAnalysisVO.setZyh(map.get("zyh") +"");
if(map.get("wnl") != null ) correlationAnalysisVO.setWnl(map.get("wnl") +"");
if(map.get("wnhsl") != null ) correlationAnalysisVO.setWnhsl(map.get("wnhsl") +"");*/
zyhMap.put(map.get("time").toString(),correlationAnalysisVO);
}
}
......@@ -328,12 +286,11 @@ public class DrugConsumptionAnalusisServiceImpl implements IDrugConsumptionAnaly
* @return
*/
private Double countDSYH(String departId ,String startTime ,String endTime ){
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"PAMZ ,PAMF,PAMRJ,SCLPAMZ,SCLPAMF,NACLO,PACGT,PACYT,FESO4G,FESO4Y,H2O2,CH3COOH,SH,FECL3,HXT,PFS,CH3COONA,GXCLJ,YWL,RYXNJ,FHTY", departId, startTime,endTime);
String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,ReportConstant.fieldYj, departId, startTime,endTime);
StringBuffer sql2 = new StringBuffer("select ");
sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from ");
sql2.append(" round((aaa.PAMZ + aaa.PAMF+ aaa.PAMRJ+ aaa.SCLPAMZ+ aaa.SCLPAMF+ aaa.NACLO+ aaa.PACGT+ aaa.PACYT+ aaa.FESO4G+ aaa.FESO4Y+ " +
"aaa.H2O2+ aaa.CH3COOH+ aaa.SH+ aaa.FECL3+ aaa.HXT+ aaa.PFS+ aaa.CH3COONA+ aaa.GXCLJ+ aaa.YWL+ aaa.RYXNJ+ aaa.FHTY),2) 'YH' from ");
sql2.append( " "+dataViewName3a24+" aaa ");
// System.out.println("sql2 = "+sql2.toString());
// return getJdbcTemplate().queryForObject(sql2.toString(),Double.class);
List<Map<String, Object>> mapList = getJdbcTemplate().queryForList(sql2.toString());
String YH = null;
for(Map<String,Object> map : mapList ){
......
......@@ -351,6 +351,11 @@
'${item}'
</foreach>
)
OR parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN ( SELECT id FROM sys_depart WHERE parent_id IN
<foreach item="item" index="index" collection="departIds.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
))
</select>
<select id="queryDepartsByIds" resultType="com.skua.modules.system.entity.SysDepart">
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!