b1748fcf 康伟

kangwei: 电耗分析:药剂浓度、药剂去除率使用平均值计算

          修改通用方法:法律法规等的导出,
1 个父辈 87af3e9e
......@@ -77,7 +77,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){
List<WaterTreatmentVO> dateList = null;
DateVO dateVO = new DateVO(startDate);//转换后的时间参数
long differenceDay = DateUtils.differenceDay(startDate, endDate);
String departIdssss = BaseUtil.quoteEach(departIds , ",");
//String factorySql = "select fi.depart_id ,d.depart_name, fi.pro_scale*10000 'pro_scale' from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
String factorySql = "select group_concat(fi.depart_id) from sys_factory_info fi , sys_depart d where fi.depart_id = d.id and d.depart_type =1 and d.id in("+departIdssss+")";
......@@ -87,11 +86,16 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
//月产水量
Map<String,String> cslMap = commonQueryCsl(departIds, startDate, endDate);
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";
String dataViewName2119 = ReportViewUtil.buildView(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";
sql += " order by aaa.CSL desc ";
sql += " order by aaa.CSL desc ";*/
String sql = " select d.depart_name , bbb.* , f.pro_scale *10000 'pro_scale', ROUND( 100 * bbb.CSL/( f.pro_scale *10000 ) , 2 ) AS fhl from ( ";
sql += " select sum(aaa.CSL) CSL, avg(aaa.CSL) dayCsl ,aaa.depart_id from "+dataViewName2119+ " aaa group by aaa.depart_id";
sql += " ) bbb LEFT JOIN sys_factory_info f ON f.depart_id = bbb.depart_id ";
sql += " left join sys_depart d on d.id = bbb.depart_id ";
sql += " order by bbb.CSL desc ";
dateList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<WaterTreatmentVO>(WaterTreatmentVO.class));
......@@ -104,9 +108,7 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
if(dateList != null ){
for(WaterTreatmentVO waterTreatmentVO : dateList){
waterTreatmentVO.setRank(index++);//设置排名
waterTreatmentVO.setMonthDayNum(differenceDay);
if(waterTreatmentVO.getCSL() != null ){
waterTreatmentVO.setDayCsl(Double.parseDouble(JSUtils.divide( waterTreatmentVO.getCSL() ,differenceDay )) );
waterTreatmentVO.setCSL(Double.parseDouble(JSUtils.format(waterTreatmentVO.getCSL()) ));//格式化
}
/* waterTreatmentVO.setRank( index++);//设置排名
......
......@@ -36,14 +36,8 @@ public class WaterTreatmentVO {
@ApiModelProperty(value = "排名")
private Integer rank;
private long monthDayNum = 30;
// private long monthDayNum = 30;
public String getFhl() {
if(this.getCSL() != null && this.getProScale() != null && this.getProScale().doubleValue() > 0 ){
fhl = JSUtils.format( this.getCSL()*100 / (this.getProScale() * this.getMonthDayNum() ) );
}
return fhl;
}
public String getHbcslbl() {
if(this.getCSL() != null && this.getHbcsl() != null && this.getHbcsl().doubleValue() > 0){
......
......@@ -22,6 +22,7 @@ import com.skua.tool.util.JoinSqlUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
......@@ -179,7 +180,9 @@ public class UserPaperController {
*/
Page<Paper> page = new Page<Paper>(pageNo, pageSize);
paper.setUserId(BaseContextHandler.getUserId());//获取当前用户编号
if(StringUtils.isEmpty(paper.getUserId())){
paper.setUserId(BaseContextHandler.getUserId());//获取当前用户编号
}
IPage<Paper> paperList = paperService.queryMyPaperRecoredByList(page,paper);
result.setResult(paperList);
......
......@@ -9,6 +9,7 @@ import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.context.SpringContextUtils;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.erp.entity.ErpSettlement;
import com.skua.modules.erp.vo.PurchaseContractVO;
......@@ -114,13 +115,13 @@ public class MaterialInfoController {
queryWrapper.like("fac_information_name",materialInfo.getFacInformationName());
}
if(StringUtils.isNotEmpty(materialInfo.getRulesType())){
queryWrapper.eq("rules_type",materialInfo.getRulesType());
queryWrapper.like("rules_type",materialInfo.getRulesType());
}
if(StringUtils.isNotEmpty(materialInfo.getLawsType())){
queryWrapper.like("laws_type",materialInfo.getLawsType());
}
if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){
queryWrapper.eq("standards_type",materialInfo.getStandardsType());
queryWrapper.like("standards_type",materialInfo.getStandardsType());
}
queryWrapper.eq("status","3");
IPage<MaterialInfo> pageList = materialInfoService.page(page, queryWrapper);
......@@ -178,6 +179,10 @@ public class MaterialInfoController {
queryWrapper.eq("del_flag","0");
// queryWrapper.eq("depart_id",materialInfo.getDepartId());
//queryWrapper.in("depart_id", JSUtils.quoteEach(departIds,","));
if(StringUtils.isNotEmpty(materialInfo.getStatus())){
queryWrapper.eq("status",materialInfo.getStatus());
}
if(StringUtils.isNotEmpty(materialInfo.getFacInformationtype())){
queryWrapper.eq("fac_informationtype",materialInfo.getFacInformationtype());
}
......@@ -186,13 +191,13 @@ public class MaterialInfoController {
queryWrapper.like("fac_information_name",materialInfo.getFacInformationName());
}
if(StringUtils.isNotEmpty(materialInfo.getRulesType())){
queryWrapper.eq("rules_type",materialInfo.getRulesType());
queryWrapper.like("rules_type",materialInfo.getRulesType());
}
if(StringUtils.isNotEmpty(materialInfo.getLawsType())){
queryWrapper.like("laws_type",materialInfo.getLawsType());
}
if(StringUtils.isNotEmpty(materialInfo.getStandardsType())){
queryWrapper.eq("standards_type",materialInfo.getStandardsType());
queryWrapper.like("standards_type",materialInfo.getStandardsType());
}
queryWrapper.orderByDesc("create_time");
return queryWrapper;
......@@ -377,14 +382,14 @@ public class MaterialInfoController {
/**
* 导出excel
*
* @param request
* @param response
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
public ModelAndView exportXls(MaterialInfo materialInfo) {
// Step.1 组装查询条件
QueryWrapper<MaterialInfo> queryWrapper = null;
try {
/*
QueryWrapper<MaterialInfo> queryWrapper = null;
try {
String paramsStr = request.getParameter("paramsStr");
if (StringUtils.isNotEmpty(paramsStr)) {
String deString = URLDecoder.decode(paramsStr, "UTF-8");
......@@ -393,15 +398,20 @@ public class MaterialInfoController {
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}*/
QueryWrapper<MaterialInfo> queryWrapper = getMaterialInfoQueryWrapper(materialInfo);
//Step.2 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
List<MaterialInfo> pageList = materialInfoService.list(queryWrapper);
//导出文件名称
mv.addObject(NormalExcelConstants.FILE_NAME, "厂区资料管理列表");
mv.addObject(NormalExcelConstants.CLASS, MaterialInformation.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("厂区资料管理列表数据", "导出人:Jeecg", "导出信息"));
Map<String,String> nameMap = new HashMap<>();
nameMap.put("bzgf","标准规范");nameMap.put("flfg","法律法规");nameMap.put("gzzd","公司制度章程");
String fileName = ConvertUtils.getString( nameMap.get( materialInfo.getFacInformationtype() ) , "厂区资料管理列表数据");
mv.addObject(NormalExcelConstants.FILE_NAME,fileName );
mv.addObject(NormalExcelConstants.CLASS, MaterialInfo.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams(fileName, "导出人:", "导出信息"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
......@@ -500,14 +510,14 @@ public class MaterialInfoController {
@AutoLog(value = "厂区资料管理-流量统计")
@ApiOperation(value = "厂区资料管理-流量统计", notes = "厂区资料管理-流量统计")
@GetMapping(value = "/flowStatistics")
public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype) {
public Result<List<Map<String, Object>>> flowStatistics(String departId,String startTime,String endTime,String facInformationtype,String status) {
Result<List<Map<String, Object>>> result = new Result<>();
if (StringUtils.isBlank(departId)&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
departId = departService.getChildDepartId(BaseContextHandler.getDeparts());
}else{
departId = departService.getChildDepartId(departId);
}
List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype);
List<Map<String, Object>> pageList = materialInfoService.flowStatistics(departId,startTime,endTime,facInformationtype,status);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -30,12 +30,12 @@ public class MaterialInfo {
@ApiModelProperty(value = "id")
private String id;
/**厂区资料文件名*/
@Excel(name = "厂区资料文件名", width = 15 , orderNum = "3")
@ApiModelProperty(value = "厂区资料文件名")
@Excel(name = "文件标题", width = 15 , orderNum = "1")
@ApiModelProperty(value = "文件标题")
private String facInformationName;
/**厂区资料文件名类型*/
@Excel(name = "厂区资料文件名类型", width = 15,dicCode = "fac_information_type",orderNum = "4")
@ApiModelProperty(value = "厂区资料文件名类型")
//@Excel(name = "文件类型", width = 15,dicCode = "fac_information_type",orderNum = "2")
@ApiModelProperty(value = "文件类型")
@Dict(dicCode = "fac_information_type")
private String facInformationtype;
/**删除状态(0,正常,1已删除)*/
......@@ -45,12 +45,11 @@ public class MaterialInfo {
@ApiModelProperty(value = "用户编号")
private String userId;
/**创建人*/
@Excel(name = "创建人", width = 15,dictTable = "sys_user",dicCode = "username",dicText = "realname" ,orderNum = "6")
//@Excel(name = "创建人", width = 15,dictTable = "sys_user",dicCode = "username",dicText = "realname" ,orderNum = "6")
@ApiModelProperty(value = "创建人" )
@Dict(dictTable = "sys_user",dicCode = "username",dicText = "realname")
private String createBy;
/**创建时间*/
@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间")
......@@ -67,7 +66,7 @@ public class MaterialInfo {
@ApiModelProperty(value = "附件地址")
private String docuAddr;
/**所属厂区*/
@Excel(name = "所属厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name" ,orderNum = "1")
@Excel(name = "所属厂区", width = 15,dictTable = "sys_depart", dicCode="id", dicText = "depart_name" ,orderNum = "3")
@ApiModelProperty(value = "所属厂区")
@Dict(dictTable = "sys_depart", dicCode="id", dicText = "depart_name")
private String departId;
......@@ -87,12 +86,12 @@ public class MaterialInfo {
private String rulesType;
/**法律法规类型*/
@Dict(dicCode = "laws_type")
@Excel(name = "法律法规类型", width = 15,dicCode = "laws_type" ,orderNum = "2")
@ApiModelProperty(value = "法律法规类型")
@Excel(name = "文件类型", width = 15,dicCode = "laws_type" ,orderNum = "2")
@ApiModelProperty(value = "文件类型")
private String lawsType;
/**法律法规归属*/
@Dict(dicCode = "laws_source")
@ApiModelProperty(value = "法律法规归属")
@ApiModelProperty(value = "文件归属")
private String lawsSource;
/**标准规范类型*/
@Dict(dicCode = "standards_type")
......@@ -103,24 +102,20 @@ public class MaterialInfo {
@ApiModelProperty(value = "标准规范来源")
private String standardsSource;
/**发布时间*/
@Excel(name = "发布时间", width = 15)
@Excel(name = "发布时间", width = 15 ,orderNum = "4")
@ApiModelProperty(value = "发布时间")
private String releaseTime;
/**有效时间*/
@Excel(name = "有效时间", width = 15)
@Excel(name = "有效时间", width = 15 ,orderNum = "6")
@ApiModelProperty(value = "有效时间")
private String effectiveTime;
/**版本号*/
@Excel(name = "版本号", width = 15)
@ApiModelProperty(value = "版本号")
private String fileVersion;
/**所属部门*/
@Excel(name = "所属部门", width = 15)
@ApiModelProperty(value = "所属部门")
private String fileDepart;
/**修订过程*/
@Excel(name = "修订过程", width = 15)
@ApiModelProperty(value = "修订过程")
private String updateHistory;
@ApiModelProperty(value = "文件号")
......
......@@ -27,7 +27,7 @@ public interface MaterialInfoMapper extends BaseMapper<MaterialInfo> {
* @author Li Yuanyuan, 2022年6月22日 下午3:10:31
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype);
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype,String status);
List<MaterialInfo> getList(@Param("materialInfo") MaterialInfo materialInfo, @Param("departIds") String departIds);
}
......
......@@ -30,7 +30,8 @@
material_info a
INNER JOIN material_info_handle_record b ON a.id = b.info_id
WHERE
b.create_time &gt;= #{startTime}
del_flag = 0
AND b.create_time &gt;= #{startTime}
AND b.create_time &lt;= #{endTime}
<if test="departId!=null and departId!=''">
and a.depart_id in
......@@ -41,6 +42,9 @@
<if test="facInformationtype!=null and facInformationtype!=''">
AND a.fac_informationtype = #{facInformationtype}
</if>
<if test="status!=null and status!=''">
and a.status = #{status}
</if>
GROUP BY
b.create_time,b.handle_type
</select>
......@@ -53,6 +57,9 @@
'${item}'
</foreach>
</if>
<if test="materialInfo.status!=null and materialInfo.status!=''">
and status = #{materialInfo.status}
</if>
<if test="materialInfo.facInformationtype!=null and materialInfo.facInformationtype!=''">
and fac_informationtype = #{materialInfo.facInformationtype}
</if>
......
......@@ -41,7 +41,7 @@ public interface IMaterialInfoService extends IService<MaterialInfo> {
* @author Li Yuanyuan, 2022年6月22日 下午3:00:25
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype);
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime,String facInformationtype,String status);
IPage<MaterialInfo> getList(Page<MaterialInfo> page, MaterialInfo materialInfo, String departIds);
}
......
......@@ -83,12 +83,12 @@ public class MaterialInfoServiceImpl extends ServiceImpl<MaterialInfoMapper, Mat
}
@Override
public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype) {
public List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime, String facInformationtype,String status) {
//日期切片
List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
List<String> timeList = DateUtils.sliceUpDateRange(startTime,endTime,"month");
//获取统计结果
List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype);
List<Map<String,Object>> dataList = baseMapper.flowStatistics(departId,startTime,endTime,facInformationtype,status);
Map<String,Map<String,Object>> resultMap = new HashMap<String,Map<String,Object>>();
for(Map<String,Object> map : dataList) {
resultMap.put(ConvertUtils.getString(map.get("create_time"))+"_"+ConvertUtils.getString(map.get("handle_type")), map);
......
......@@ -32,7 +32,7 @@ public class PowerConsumptionAnalysisController {
@RequestMapping(value = "/data/display", method = RequestMethod.GET)
public Result<Map<String, Object>> dataDisplay(AnysisParamsVO anysisParamsVO) {
Result<Map<String, Object>> result = new Result<>();
anysisParamsVO.setFactoryId(BaseContextHandler.getDeparts());
//anysisParamsVO.setFactoryId(BaseContextHandler.getDeparts());
Map<String, Object> data = powerConsumptionAnalysisService.dataDisplay(anysisParamsVO);
result.setResult(data);
result.setSuccess(true);
......
......@@ -14,6 +14,7 @@ import com.skua.modules.equipment.vo.AnysisParamsVO;
import com.skua.modules.equipment.vo.MetricVo;
import com.skua.tool.util.JSUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.dao.DataAccessException;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
......@@ -280,7 +281,7 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
//吨水电耗数据
List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false);
//查询数据:水质水量报表
List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime);
List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime,"avg");
//吨水电耗
List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>();
......@@ -356,7 +357,8 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
//吨水电耗数据
List<ReportItemVO> dsdhTrendListList =queryDSDHTrendList( factoryId, startTime, endTime,false);
//查询数据:水质水量报表
List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime);
List<DataViewVO> dataViewVO2119List = queryDataView2119( factoryId, startTime, endTime,"avg");
//吨水电耗
List<TonOfWaterTrendDto> trend_dsdh = new ArrayList<>();
......@@ -413,12 +415,13 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
/**************************************/
// 水质水量报表
private List<DataViewVO> queryDataView2119(String departIds, String startTime, String endTime) {
private List<DataViewVO> queryDataView2119(String departIds, String startTime, String endTime,String singOperator) {
//ReportConstant.fieldSz = JSZL,CSZL,JSCOD,CSCOD,JSAD,CSAD,JSZD,CSTN,JSPH,JSSS,CSPH,CSSS";
if(StringUtils.isNotEmpty(singOperator)) singOperator = "sum";
String dataViewName2119 = ReportViewUtil.buildView(ReportConstant.view2119, ReportConstant.fieldSz, departIds, startTime, endTime);
String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' , ROUND( SUM( IFNULL(aaa.JSCOD,0) ), 2 ) AS JSCOD, ROUND( SUM( IFNULL(aaa.CSCOD,0) ), 2 ) AS CSCOD,";
sql += " ROUND( SUM( IFNULL(aaa.JSZL,0) ), 2 ) AS JSZL, ROUND( SUM( IFNULL(aaa.CSZL,0) ), 2 ) AS CSZL,";
sql += "ROUND( SUM( IFNULL(aaa.JSAD,0) ), 2 ) AS JSAD, ROUND( SUM( IFNULL(aaa.CSAD,0) ), 2 ) AS CSAD ";
String sql = " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' , ROUND( "+singOperator+"( IFNULL(aaa.JSCOD,0) ), 2 ) AS JSCOD, ROUND( "+singOperator+"( IFNULL(aaa.CSCOD,0) ), 2 ) AS CSCOD,";
sql += " ROUND( "+singOperator+"( IFNULL(aaa.JSZL,0) ), 2 ) AS JSZL, ROUND( "+singOperator+"( IFNULL(aaa.CSZL,0) ), 2 ) AS CSZL,";
sql += "ROUND( "+singOperator+"( IFNULL(aaa.JSAD,0) ), 2 ) AS JSAD, ROUND( "+singOperator+"( IFNULL(aaa.CSAD,0) ), 2 ) AS CSAD ";
sql += "from "+ dataViewName2119 +" aaa ";
sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') ";
......@@ -429,11 +432,20 @@ public class PowerConsumptionAnalusisServiceImpl implements IPowerConsumptionAna
// 负荷率
private List<ReportItemVO> queryFhlTrendList(String departIds, String startTime, String endTime) {
String dataViewName3a24 = ReportViewUtil.buildView(ReportConstant.view2119,ReportConstant.field_CSL, departIds, startTime, endTime);
String sql = " select bbb.time,ROUND(avg(bbb.wsfhl),2) 'value' from ( ";
sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , sum(aaa.CSL) CSL, ROUND( IFNULL( 100 * ( sum(aaa.CSL)/( f.pro_scale * 31*10000 ) ),0), 2 ) AS wsfhl from "+ dataViewName3a24 +" aaa ";
/*String sql = " select bbb.time,ROUND(avg(bbb.wsfhl),2) 'value' from ( ";
sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , sum(aaa.CSL) CSL, ROUND( IFNULL( 100 * ( avg(aaa.CSL)/( f.pro_scale *10000 ) ),0), 2 ) AS wsfhl from "+ dataViewName3a24 +" aaa ";
sql += " LEFT JOIN sys_factory_info f ON f.depart_id = aaa.depart_id " ;
sql += " group by DATE_FORMAT(aaa.time,'%Y-%m') , aaa.depart_id ";
sql += ")bbb group by bbb.time ";
sql += ")bbb group by bbb.time ";*/
String sql = "select bbb.* , f.pro_scale *10000 , ROUND( 100 * bbb.CSL/( f.pro_scale *10000 ) , 2 ) AS 'value' from (";
sql += " select DATE_FORMAT(aaa.time,'%Y-%m') 'time' ,aaa.depart_id , avg(aaa.CSL) CSL from " +dataViewName3a24+" aaa group by DATE_FORMAT(aaa.time,'%Y-%m') , aaa.depart_id " ;
sql += " )bbb ";
sql += " LEFT JOIN sys_factory_info f ON f.depart_id = bbb.depart_id ";
//查询数据
List<ReportItemVO> trendVOList = getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportItemVO>(ReportItemVO.class));
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!