43b36965 康伟

kangwei:删除作废的代码

1 个父辈 7078edcb
package com.skua.modules.algorithm.service;
import com.skua.modules.algorithm.vo.WaterTreatmentVO;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.vo.*;
import java.util.List;
import java.util.Map;
/**
* <pre>
* 指挥中心实现逻辑
......@@ -16,53 +12,6 @@ import java.util.Map;
*/
public interface ICommandCentreService {
/**
* 指挥中心---运行负荷率分析
* @param reportItemvParam
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam);
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(int loadRateType,String reitId,String startDate, String endDate);
/**
* 根据reitId与时间查询
* @param reportId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate);
/**
* 根据reitId查询近几天数据
* @param reportItemvParam
* @return
*/
public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam);
/***
* 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam);
/***
* 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam);
/**
* 查询费用
* @param reportItemvParam
......@@ -71,19 +20,11 @@ public interface ICommandCentreService {
public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam);
/**
* 查询月度水量
* @param reportItemvParam
* @return
*/
List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam);
/**
* 获取药剂
* @param month
* @return
*/
DepartDrugResult getYhTotal(String month);
/***
* 指挥中心----运行负荷率分析----处理水量详情
* @param
......
......@@ -8,9 +8,6 @@ import com.skua.modules.algorithm.service.ICommandCentreService;
import com.skua.modules.algorithm.vo.WaterTreatmentVO;
import com.skua.modules.common.vo.DateVO;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.report.entity.FReportItem;
import com.skua.modules.report.entity.FReportItemv;
import com.skua.modules.report.mapper.FReportItemMapper;
import com.skua.modules.report.vo.*;
import com.skua.modules.report.mapper.FReportItemvMapper;
import com.skua.tool.util.DateUtils;
......@@ -37,83 +34,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
@Resource
private FReportItemvMapper fReportItemvMapper;
@Resource
private FReportItemMapper reportItemMapper;
/**
* 指挥中心---运行负荷率分析
* @param reportItemvParam
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam){
return fReportItemvMapper.statisticsByLoadRate(reportItemvParam.getLoadRateType(),reportItemvParam.getReitId(),reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
}
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(int loadRateType, String reitId, String startDate, String endDate){
return fReportItemvMapper.statisticsByLoadRateNum(loadRateType ,reitId ,startDate, endDate );
}
/**
* 根据reitId与时间查询
* @param reportId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){
//根据reportId 与reportItemCode 查询reitId;
//String reitId = reportItemMapper.getReportItemId(reportId,reportItemCode);
FReportItemv reportItemv = null;
List<FReportItem> reportItemList = reportItemMapper.getItemInfoByItemCode(reportItemCode,reportId);
if(reportItemList != null && !reportItemList.isEmpty() ){
reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reportItemList.get(0).getId() , startDate , endDate);
}
return reportItemv;
}
/**
* 根据reitId查询近7天数据
* @param reportItemvParam
* @return
*/
public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam){
List<ReportDateTrendVO> dataList = null;
dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reportItemvParam);
return dataList;
}
/***
* 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam){
FRportlCommandCenterVO fRportlCommandCenterVO = null;
fRportlCommandCenterVO = fReportItemvMapper.getReportItemvMonthDataByReitId(reportItemvParam);
return fRportlCommandCenterVO;
}
/***
* 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam){
FRportlCommandCenterVO fRportlCommandCenterVO = null;
//根据reportId 与reportItemCode 查询reitId;
fRportlCommandCenterVO = fReportItemvMapper.getReportItemvDayDataByReitId(reportItemvParam);
return fRportlCommandCenterVO;
}
@Override
public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam) {
List<ReportDateTrendVO> dataList = null;
......@@ -122,13 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
}
@Override
public List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam) {
List<ReportDateTrendVO> dataList = null;
dataList = fReportItemvMapper.getClslData(reportItemvParam);
return dataList;
}
@Override
public DepartDrugResult getYhTotal(String month) {
String monthTb = DateUtils.getTbMonth(month);//同比时间
String monthHb = DateUtils.getHbMonth(month);//环比时间
......@@ -156,19 +69,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
return masterDB;
}
/***
* 指挥中心----运行负荷率分析----处理水量详情
* @param time
* @param
* @return
*/
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+")";
......@@ -229,10 +137,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
}
return cslMap;
}
/**
* 同比
* @param month
......
......@@ -4,11 +4,9 @@ import com.skua.modules.report.vo.*;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.FReportItemv;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 报表数据项值
*/
......@@ -22,7 +20,6 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
@Param("dataTime") String dataTime,@Param("departId") String departId,@Param("createTime") Date createTime);
List<FReportItemv> getBean(@Param("dataId") String dataId, @Param("reitId") String reitId);
List<Map<String,Object>> getListByTime(@Param("sql") String sql);
/**
* <pre>
......@@ -33,75 +30,18 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
* @author Li Yuanyuan, 2021年5月25日 上午10:34:37
*/
List<FReportItemv> getReportItemvByDataId(String dataId);
/**
* 据reit_id 查询视图表数据 返回总数,平均数
* @param reportItemvParam
* @return
*/
List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
/**
* 根据reitId与时间查询
* @param reitId
* @param startDate
* @param endDate
* @return
*/
public FReportItemv getReportItemvByReitIdAndDate(@Param("reitId") String reitId, @Param("startDate") String startDate,@Param("endDate") String endDate);
/**
* 根据类型查询:指挥中心---运行负荷率分析
* @param loadRateType
* @return
*/
public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType, @Param("reitId") String reitId ,@Param("startDate") String startDate,@Param("endDate") String endDate);
/**
* 指挥中心---运行负荷率分析 总数查询
* @param loadRateType
* @return
*/
public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType, @Param("reitId") String reitId , @Param("startDate") String startDate,@Param("endDate") String endDate);
/**
* 根据reitId查询近7天数据
* @param reportItemvParam
* @return
*/
public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam);
/***
* 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvMonthDataByReitId( ReportItemvParam reportItemvParam);
/***
* 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
* @param reportItemvParam
* @return
*/
public FRportlCommandCenterVO getReportItemvDayDataByReitId(ReportItemvParam reportItemvParam);
/**
* 查询费用
* @param reportItemvParam
* @return
*/
List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam);
/**
* 查询水量信息
* @param reportItemvParam
* @return
*/
List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam);
/**
* 药量信息
* @param month
......
......@@ -51,90 +51,6 @@
</select>
<!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
<select id="getReportItemvByReitIdAndDate" resultType="com.skua.modules.report.entity.FReportItemv">
SELECT sum(item_value) 'sum_value' , avg(item_value) 'avg_value' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
</select>
<!-- 根据类型查询:指挥中心-运行负荷率分析 -->
<select id="statisticsByLoadRate" resultType="com.skua.modules.report.vo.DepartLoadRateVO">
SELECT ri.depart_id ,d.depart_name as 'departName',
fi.pro_scale ,
avg(ri.item_value)/(100*fi.pro_scale) as 'loadRate' ,
sum( ri.item_value ) as 'waterYieldMonth'
FROM f_report_itemv ri
left join sys_factory_info fi on ri.depart_id = fi.depart_id
left join sys_depart d on d.id = ri.depart_id
where ri.reit_id=#{reitId} and ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate}
group by ri.depart_id
<trim prefix="having" prefixOverrides="and">
<if test="loadRateType != null and loadRateType == 1">
avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == 3">
avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == 2">
avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
</if>
</trim>
</select>
<!-- 根据类型查询:指挥中心-运行负荷率分析 -->
<select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
select count(1) from (
SELECT ri.depart_id , fi.pro_scale
FROM f_report_itemv ri
left join sys_factory_info fi on ri.depart_id = fi.depart_id
where ri.reit_id=#{reitId} and ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate}
group by ri.depart_id
<trim prefix="having" prefixOverrides="and">
<if test="loadRateType != null and loadRateType == 1">
avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
</if>
<if test="loadRateType != null and loadRateType == 3">
avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
</if>
<if test="loadRateType != null and loadRateType == 2">
avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
</if>
</trim>
) aaa
</select>
<!-- 根据reitId查询近7天数据-->
<select id="getReportItemvByReitIdAndDate7Day" resultType="com.skua.modules.report.vo.ReportDateTrendVO">
SELECT sum(item_value) as 'value' , data_time as 'date' FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
group by data_time
</select>
<!--查询报表数据,当前月统计、上个月统计、去年当月统计(求和) -->
<select id="getReportItemvMonthDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO">
select
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}),0) as 'value',
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastMonthStartDate} and data_time &lt;= #{lastMonthEndDate}),0) as 'valueTb',
IFNULL(( SELECT sum(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastYearStartDate} and data_time &lt;= #{lastYearEndDate} ),0) as 'valueHb'
from dual
</select>
<!--查询报表数据,当日平均、上月同期、去年同期统计(求均值) -->
<select id="getReportItemvDayDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO">
select
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}),0) as 'value',
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastMonthStartDate} and data_time &lt;= #{lastMonthEndDate}),0) as 'valueTb',
IFNULL(( SELECT avg(item_value) FROM f_report_itemv where reit_id=#{reitId} and data_time &gt;= #{lastYearStartDate} and data_time &lt;= #{lastYearEndDate} ),0) as 'valueHb'
from dual
</select>
<select id="getFyData" resultType="com.skua.modules.report.vo.ReportDateTrendVO">
SELECT
t.month AS time,
......@@ -147,11 +63,7 @@
GROUP BY t.month
</select>
<select id="getClslData" resultType="com.skua.modules.report.vo.ReportDateTrendVO">
SELECT sum(item_value) as 'value' , left(data_time,7) as 'date' FROM f_report_itemv
where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
group by left(data_time,7)
</select>
<select id="getYhList" resultType="com.skua.modules.report.vo.DepartDrugDataVO">
SELECT
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!