f8405f1a 张雷

能耗分析问题修改

1 个父辈 6a8a31c0
......@@ -77,17 +77,17 @@ public class MaterialInformationController {
@AutoLog(value = "厂区资料管理-分页列表查询")
@ApiOperation(value = "厂区资料管理-分页列表查询", notes = "厂区资料管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<MaterialInformation>> queryPageList(MaterialInformation MaterialInformation,
public Result<IPage<MaterialInformation>> queryPageList(MaterialInformation materialInformation,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<MaterialInformation>> result = new Result<IPage<MaterialInformation>>();
QueryWrapper<MaterialInformation> queryWrapper = QueryGenerator.initQueryWrapper(MaterialInformation, req.getParameterMap());
// QueryWrapper<MaterialInformation> queryWrapper = QueryGenerator.initQueryWrapper(MaterialInformation, req.getParameterMap());
Page<MaterialInformation> page = new Page<MaterialInformation>(pageNo, pageSize);
if (StringUtils.isBlank(MaterialInformation.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
}
IPage<MaterialInformation> pageList = MaterialInformationService.page(page, queryWrapper);
// if (StringUtils.isBlank(MaterialInformation.getDepartId())&&StringUtils.isNotBlank(BaseContextHandler.getDeparts())) {
// queryWrapper.in("depart_id", BaseContextHandler.getDeparts().split(","));
// }
IPage<MaterialInformation> pageList = MaterialInformationService.getPage(page, materialInformation);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -3,6 +3,7 @@ package com.skua.modules.material.mapper;
import java.util.List;
import java.util.Map;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -28,4 +29,7 @@ public interface MaterialInformationMapper extends BaseMapper<MaterialInformatio
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
@Anonymous
List<MaterialInformation> getListByType(@Param("facInformationtype") String facInformationtype);
}
......
......@@ -53,5 +53,11 @@
GROUP BY
b.create_time,b.handle_type
</select>
<select id="getListByType" resultType="com.skua.modules.material.entity.MaterialInformation">
select * from material_information where 1=1
<if test="facInformationtype!=null and facInformationtype!=''">
AND fac_informationtype = #{facInformationtype}
</if>
</select>
</mapper>
......
......@@ -3,6 +3,8 @@ package com.skua.modules.material.service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skua.modules.material.entity.MaterialInformation;
......@@ -12,6 +14,13 @@ import com.skua.modules.material.entity.MaterialInformation;
public interface IMaterialInformationService extends IService<MaterialInformation> {
/**
* 分页列表
* @param page
* @param materialInformation
* @return
*/
IPage<MaterialInformation> getPage(Page<MaterialInformation> page, MaterialInformation materialInformation);
/**
*
* @Description 根据用户id查询所属厂区 只要第一个
* @Date 2021-07-27 15:03
......@@ -40,4 +49,5 @@ public interface IMaterialInformationService extends IService<MaterialInformatio
* @Description: TODO(这里描述这个方法的需求变更情况)
*/
List<Map<String, Object>> flowStatistics(String departId, String startTime, String endTime);
}
......
......@@ -5,6 +5,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.edu.entity.QuestionOption;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......@@ -26,6 +30,14 @@ public class MaterialInformationServiceImpl extends ServiceImpl<MaterialInformat
}
@Override
public IPage<MaterialInformation> getPage(Page<MaterialInformation> page, MaterialInformation materialInformation) {
List<MaterialInformation> list = baseMapper.getListByType(materialInformation.getFacInformationtype());
page.setRecords(list);
page.setTotal(list.size());
return page;
}
@Override
public String queryFacByUserId(String userCode) {
return baseMapper.queryFacByUserId(userCode);
}
......
......@@ -74,7 +74,8 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
* @return
* @author Li Yuanyuan, 2020年9月27日 上午11:19:41
*/
List<Map<String, Object>> queryReportValue(@Param(value="dataViewName") String dataViewName,@Param(value="startTime") String startTime,@Param(value="endTime") String endTime,@Param(value="departId") String departId);
List<Map<String, Object>> queryReportValue(@Param(value="dataViewName") String dataViewName,
@Param(value="startTime") String startTime,@Param(value="endTime") String endTime,@Param(value="departId") String departId);
/**
* <pre>
* 通过填报报表id删除
......
......@@ -93,14 +93,15 @@
report_id = #{datasetId}
</select>
<select id="queryReportValue" parameterType="java.lang.String" resultType="java.util.HashMap">
select b.depart_name as depart_name,a.* from ${dataViewName} a left join view_sys_depart b on a.depart_id=b.id
select b.depart_name as depart_name,a.*
from view_sys_depart b
left join ${dataViewName} a on b.id = a.depart_id
where 1=1
<if test="departId!=null and departId!=''">
and a.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
#{item}
</foreach>
</if>
order by b.area_order,b.depart_order,a.time
</select>
......
......@@ -22,39 +22,52 @@ public interface PowerAnalysisNewMapper {
void deleteOperationMonth(@Param("factoryId") String factoryId, @Param("time") String time);
Map totalPowerConsumptionAnalysis(@Param(value="thisDataViewName") String thisDataViewName,@Param(value="lastDataViewName") String lastDataViewName,@Param("thisMonth") String thisMonth, @Param("lastMonth") String lastMonth, @Param("factoryIds") String factoryIds);
Map totalPowerConsumptionAnalysis(@Param(value="thisDataViewName3a24") String thisDataViewName3a24,@Param(value="thisDataViewName2119") String thisDataViewName2119,
@Param(value="lastDataViewName3a24") String lastDataViewName3a24,@Param(value="lastDataViewName2119") String lastDataViewName2119,
@Param("thisMonth") String thisMonth, @Param("lastMonth") String lastMonth, @Param("factoryIds") String factoryIds);
List<Map> querySixMonthPowerConsumption(@Param(value="dataViewName") String dataViewName,@Param("thisMonth") String thisMonth, @Param("endTime") String endTime, @Param("factoryIds") String factoryIds);
List<Map> querySixMonthPowerConsumption(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> powerConsumptionDistribution(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> powerConsumptionDistribution(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryCraftDSDH(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryCraftDSDH(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryStandardDSDH(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryStandardDSDH(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryScaleDSDH(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryScaleDSDH(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryCraftDSDHCurve(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("id") String id, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryCraftDSDHCurve(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("id") String id, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryStandardDSDHCurve(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("id") String id, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryStandardDSDHCurve(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("id") String id, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryScaleDSDHCurve(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("start") String start, @Param("end") String end, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryScaleDSDHCurve(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("start") String start, @Param("end") String end, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryDataByCodeAndtime(@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("factoryId")String factoryId, @Param("code") String code);
List<Map<String, Object>> queryHDLAndSL(@Param(value="dataViewName") String dataViewName,@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("factoryId")String factoryId);
List<Map<String, Object>> queryHDLAndSL(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("startTime") String startTime, @Param("endTime") String endTime,@Param("factoryId")String factoryId);
List<Map<String, Object>> powerConsumptionDistributionList(@Param(value="dataViewName") String dataViewName,@Param("time") String time, @Param("start") String start, @Param("end") String end, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> powerConsumptionDistributionList(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("time") String time, @Param("start") String start, @Param("end") String end, @Param("factoryIds") String factoryIds);
List<Map<String, Object>> queryDataByCodeAndtimeFac(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("factoryId") String factoryId ,@Param("code") String code);
List<Map> queryHDLAndSLByFac(@Param(value="dataViewName") String dataViewName,@Param("startTime") String startTime, @Param("endTime") String endTime ,@Param("factoryId")String factoryId);
List<Map> queryHDLAndSLByFac(@Param(value="dataViewName3a24") String dataViewName3a24,@Param(value="dataViewName2119") String dataViewName2119,
@Param("startTime") String startTime, @Param("endTime") String endTime ,@Param("factoryId")String factoryId);
List<Map<String, Object>> queryView3771(@Param("time") String time);
List<Map<String, Object>> queryMonthHDLData(@Param("dataViewName3a24") String dataViewName3a24,@Param("parentId") String parentId);
List<Map<String, Object>> queryMonthHDLData(@Param("dataViewName") String dataViewName,@Param("parentId") String parentId);
List<Map<String, String>> queryHDLByYear(@Param("dataViewName3a24") String dataViewName3a24,@Param("dataViewName2119") String dataViewName2119,
@Param("factoryId") String factoryId);
List<Map<String, String>> queryHDLByYear(@Param("dataViewName") String dataViewName,@Param("factoryId") String factoryId);
List<Map<String, Object>> queryHDLDetails(@Param("dataViewName") String dataViewName,@Param("parentId") String parentId);
List<Map<String, Object>> queryHDLDetails(@Param("dataViewName3a24") String dataViewName3a24,@Param("dataViewName2119") String dataViewName2119,
@Param("parentId") String parentId);
}
......
......@@ -41,7 +41,7 @@ public interface IPowerAnalysisNewService {
* @Param [startTime, endTime, factoryId]
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
Map<String, Object> powerCutDownByFac(String startTime, String endTime, String factoryId);
Map<String, Object> powerCutDownByFac(String startTime, String endTime, String departId);
/**
*
......@@ -59,7 +59,7 @@ public interface IPowerAnalysisNewService {
* @Param [startTime, endTime, factoryId]
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
Map<String, Object> powerCutDownAllListByFac(String startTime, String endTime, String factoryId);
Map<String, Object> powerCutDownAllListByFac(String startTime, String endTime, String departId);
/**
*
......@@ -68,7 +68,7 @@ public interface IPowerAnalysisNewService {
* @Param [startTime, endTime]
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
Map<String, Object> powerConsumptionList(String startTime, String endTime,String factoryId);
Map<String, Object> powerConsumptionList(String startTime, String endTime,String departId);
/**
*
......@@ -77,7 +77,7 @@ public interface IPowerAnalysisNewService {
* @Param [startTime, endTime, factoryId]
* @return java.util.Map<java.lang.String, java.lang.Object>
**/
Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String factoryId);
Map<String, Object> powerCutDownListByFac(String startTime, String endTime, String departId);
/**
* <pre>
......
......@@ -519,51 +519,90 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
String time = DateUtils.date2Str(new Date(Long.parseLong(map1.get("time").toString()) * 1000), datetimeFormat);
xlist.add(time);
String jscod;
if (!org.apache.commons.lang3.StringUtils.isEmpty(jscod = fieldsMap.get("JSCOD"))) {
if (!StringUtils.isEmpty(jscod = fieldsMap.get("JSCOD"))) {
if(map1.get(jscod)!=null){
jscodList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(jscod).toString()),2));
}else{
jscodList.add(0.00);
}
}
String jsnh3n;
if (!org.apache.commons.lang3.StringUtils.isEmpty(jsnh3n = fieldsMap.get("JSNH3N"))) {
if (!StringUtils.isEmpty(jsnh3n = fieldsMap.get("JSNH3N"))) {
if(map1.get(jsnh3n)!=null){
jsadList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(jsnh3n).toString()),2));
}else{
jsadList.add(0.00);
}
}
String jstn;
if (!org.apache.commons.lang3.StringUtils.isEmpty(jstn = fieldsMap.get("JSTN"))) {
if (!StringUtils.isEmpty(jstn = fieldsMap.get("JSTN"))) {
if(map1.get(jstn)!=null){
jstnList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(jstn).toString()),2));
}else{
jstnList.add(0.00);
}
}
String jstp;
if (!org.apache.commons.lang3.StringUtils.isEmpty(jstp = fieldsMap.get("JSTP"))) {
if (!StringUtils.isEmpty(jstp = fieldsMap.get("JSTP"))) {
if(map1.get(jstp)!=null){
jstpList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(jstp).toString()),2));
}else{
jstpList.add(0.00);
}
}
String jsph;
if (!org.apache.commons.lang3.StringUtils.isEmpty(jsph = fieldsMap.get("JSPH"))) {
if (!StringUtils.isEmpty(jsph = fieldsMap.get("JSPH"))) {
if(map1.get(jsph)!=null){
jsphList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(jsph).toString()),2));
}else{
jsphList.add(0.00);
}
}
String cscod;
if (!org.apache.commons.lang3.StringUtils.isEmpty(cscod = fieldsMap.get("CSCOD"))) {
if (!StringUtils.isEmpty(cscod = fieldsMap.get("CSCOD"))) {
if(map1.get(cscod)!=null){
cscodList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(cscod).toString()),2));
}else{
cscodList.add(0.00);
}
}
String csnh3n;
if (!org.apache.commons.lang3.StringUtils.isEmpty(csnh3n = fieldsMap.get("CSNH3N"))) {
if (!StringUtils.isEmpty(csnh3n = fieldsMap.get("CSNH3N"))) {
if(map1.get(csnh3n)!=null){
csadList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(csnh3n).toString()),2));
}else{
csadList.add(0.00);
}
}
String cstn;
if (!org.apache.commons.lang3.StringUtils.isEmpty(cstn = fieldsMap.get("CSTN"))) {
if (!StringUtils.isEmpty(cstn = fieldsMap.get("CSTN"))) {
if(map1.get(cstn)!=null){
cstnList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(cstn).toString()),2));
}else{
cstnList.add(0.00);
}
}
String cstp;
if (!org.apache.commons.lang3.StringUtils.isEmpty(cstp = fieldsMap.get("CSTP"))) {
if (!StringUtils.isEmpty(cstp = fieldsMap.get("CSTP"))) {
if(map1.get(cstp)!=null){
cstpList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(cstp).toString()),2));
}else{
cstpList.add(0.00);
}
}
String csph;
if (!StringUtils.isEmpty(csph = fieldsMap.get("CSPH"))) {
if(map1.get(csph)!=null){
csphList.add(DoubleOperaUtils.bigDecimalRound(Double.parseDouble(map1.get(csph).toString()),2));
}else{
csphList.add(0.00);
}
}
}
}
......
......@@ -17,7 +17,7 @@ public interface IInspectionTaskFillContentService extends IService<InspectionTa
List<Map<String, Object>> getInspectionPointHistoryByTaskId(String taskId);
Map<String,List<Map<String, Object>>> getInspectionHistoryFillGroupByInspectionPointId(String taskId, String inspectionPointId);
List<Map<String, Object>> getInspectionHistoryFillGroupByInspectionPointId(String taskId, String inspectionPointId);
List<Map<String, Object>> getInspectionHistoryByTaskId(String taskId);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!