43b36965 康伟

kangwei:删除作废的代码

1 个父辈 7078edcb
1 package com.skua.modules.algorithm.service; 1 package com.skua.modules.algorithm.service;
2 2
3 import com.skua.modules.algorithm.vo.WaterTreatmentVO; 3 import com.skua.modules.algorithm.vo.WaterTreatmentVO;
4 import com.skua.modules.report.entity.FReportItemv;
5 import com.skua.modules.report.vo.*; 4 import com.skua.modules.report.vo.*;
6
7 import java.util.List; 5 import java.util.List;
8 import java.util.Map;
9
10 /** 6 /**
11 * <pre> 7 * <pre>
12 * 指挥中心实现逻辑 8 * 指挥中心实现逻辑
...@@ -16,53 +12,6 @@ import java.util.Map; ...@@ -16,53 +12,6 @@ import java.util.Map;
16 */ 12 */
17 public interface ICommandCentreService { 13 public interface ICommandCentreService {
18 14
19
20 /**
21 * 指挥中心---运行负荷率分析
22 * @param reportItemvParam
23 * @return
24 */
25 public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam);
26
27 /**
28 * 指挥中心---运行负荷率分析 总数查询
29 * @param loadRateType
30 * @return
31 */
32 public int statisticsByLoadRateNum(int loadRateType,String reitId,String startDate, String endDate);
33
34
35 /**
36 * 根据reitId与时间查询
37 * @param reportId
38 * @param startDate
39 * @param endDate
40 * @return
41 */
42 public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate);
43
44 /**
45 * 根据reitId查询近几天数据
46 * @param reportItemvParam
47 * @return
48 */
49 public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam);
50
51
52 /***
53 * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
54 * @param reportItemvParam
55 * @return
56 */
57 public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam);
58
59 /***
60 * 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
61 * @param reportItemvParam
62 * @return
63 */
64 public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam);
65
66 /** 15 /**
67 * 查询费用 16 * 查询费用
68 * @param reportItemvParam 17 * @param reportItemvParam
...@@ -71,19 +20,11 @@ public interface ICommandCentreService { ...@@ -71,19 +20,11 @@ public interface ICommandCentreService {
71 public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam); 20 public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam);
72 21
73 /** 22 /**
74 * 查询月度水量
75 * @param reportItemvParam
76 * @return
77 */
78 List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam);
79
80 /**
81 * 获取药剂 23 * 获取药剂
82 * @param month 24 * @param month
83 * @return 25 * @return
84 */ 26 */
85 DepartDrugResult getYhTotal(String month); 27 DepartDrugResult getYhTotal(String month);
86
87 /*** 28 /***
88 * 指挥中心----运行负荷率分析----处理水量详情 29 * 指挥中心----运行负荷率分析----处理水量详情
89 * @param 30 * @param
......
...@@ -8,9 +8,6 @@ import com.skua.modules.algorithm.service.ICommandCentreService; ...@@ -8,9 +8,6 @@ import com.skua.modules.algorithm.service.ICommandCentreService;
8 import com.skua.modules.algorithm.vo.WaterTreatmentVO; 8 import com.skua.modules.algorithm.vo.WaterTreatmentVO;
9 import com.skua.modules.common.vo.DateVO; 9 import com.skua.modules.common.vo.DateVO;
10 import com.skua.modules.quartz.util.BaseUtil; 10 import com.skua.modules.quartz.util.BaseUtil;
11 import com.skua.modules.report.entity.FReportItem;
12 import com.skua.modules.report.entity.FReportItemv;
13 import com.skua.modules.report.mapper.FReportItemMapper;
14 import com.skua.modules.report.vo.*; 11 import com.skua.modules.report.vo.*;
15 import com.skua.modules.report.mapper.FReportItemvMapper; 12 import com.skua.modules.report.mapper.FReportItemvMapper;
16 import com.skua.tool.util.DateUtils; 13 import com.skua.tool.util.DateUtils;
...@@ -37,83 +34,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { ...@@ -37,83 +34,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
37 @Resource 34 @Resource
38 private FReportItemvMapper fReportItemvMapper; 35 private FReportItemvMapper fReportItemvMapper;
39 36
40 @Resource
41 private FReportItemMapper reportItemMapper;
42
43 /**
44 * 指挥中心---运行负荷率分析
45 * @param reportItemvParam
46 * @return
47 */
48 public List<DepartLoadRateVO> statisticsByLoadRate(ReportItemvParam reportItemvParam){
49 return fReportItemvMapper.statisticsByLoadRate(reportItemvParam.getLoadRateType(),reportItemvParam.getReitId(),reportItemvParam.getStartDate(),reportItemvParam.getEndDate());
50 }
51
52 /**
53 * 指挥中心---运行负荷率分析 总数查询
54 * @param loadRateType
55 * @return
56 */
57 public int statisticsByLoadRateNum(int loadRateType, String reitId, String startDate, String endDate){
58 return fReportItemvMapper.statisticsByLoadRateNum(loadRateType ,reitId ,startDate, endDate );
59 }
60
61 /**
62 * 根据reitId与时间查询
63 * @param reportId
64 * @param startDate
65 * @param endDate
66 * @return
67 */
68 public FReportItemv getReportItemvByReitIdAndDate(String reportId, String reportItemCode, String startDate, String endDate){
69
70 //根据reportId 与reportItemCode 查询reitId;
71 //String reitId = reportItemMapper.getReportItemId(reportId,reportItemCode);
72 FReportItemv reportItemv = null;
73 List<FReportItem> reportItemList = reportItemMapper.getItemInfoByItemCode(reportItemCode,reportId);
74 if(reportItemList != null && !reportItemList.isEmpty() ){
75 reportItemv = fReportItemvMapper.getReportItemvByReitIdAndDate(reportItemList.get(0).getId() , startDate , endDate);
76 }
77 return reportItemv;
78 }
79
80 /**
81 * 根据reitId查询近7天数据
82 * @param reportItemvParam
83 * @return
84 */
85 public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam){
86 List<ReportDateTrendVO> dataList = null;
87 dataList = fReportItemvMapper.getReportItemvByReitIdAndDate7Day(reportItemvParam);
88 return dataList;
89 }
90
91
92 /***
93 * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
94 * @param reportItemvParam
95 * @return
96 */
97 public FRportlCommandCenterVO getReportItemvMonthDataByReitId(ReportItemvParam reportItemvParam){
98 FRportlCommandCenterVO fRportlCommandCenterVO = null;
99 fRportlCommandCenterVO = fReportItemvMapper.getReportItemvMonthDataByReitId(reportItemvParam);
100
101 return fRportlCommandCenterVO;
102
103 }
104
105 /***
106 * 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
107 * @param reportItemvParam
108 * @return
109 */
110 public FRportlCommandCenterVO getReportItemvDayDataByReitId( ReportItemvParam reportItemvParam){
111 FRportlCommandCenterVO fRportlCommandCenterVO = null;
112 //根据reportId 与reportItemCode 查询reitId;
113 fRportlCommandCenterVO = fReportItemvMapper.getReportItemvDayDataByReitId(reportItemvParam);
114 return fRportlCommandCenterVO;
115 }
116
117 @Override 37 @Override
118 public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam) { 38 public List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam) {
119 List<ReportDateTrendVO> dataList = null; 39 List<ReportDateTrendVO> dataList = null;
...@@ -122,13 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService { ...@@ -122,13 +42,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
122 } 42 }
123 43
124 @Override 44 @Override
125 public List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam) {
126 List<ReportDateTrendVO> dataList = null;
127 dataList = fReportItemvMapper.getClslData(reportItemvParam);
128 return dataList;
129 }
130
131 @Override
132 public DepartDrugResult getYhTotal(String month) { 45 public DepartDrugResult getYhTotal(String month) {
133 String monthTb = DateUtils.getTbMonth(month);//同比时间 46 String monthTb = DateUtils.getTbMonth(month);//同比时间
134 String monthHb = DateUtils.getHbMonth(month);//环比时间 47 String monthHb = DateUtils.getHbMonth(month);//环比时间
...@@ -156,19 +69,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService { ...@@ -156,19 +69,14 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
156 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master"); 69 JdbcTemplate masterDB = (JdbcTemplate) SpringContextUtils.getBean("master");
157 return masterDB; 70 return masterDB;
158 } 71 }
159
160
161
162 /*** 72 /***
163 * 指挥中心----运行负荷率分析----处理水量详情 73 * 指挥中心----运行负荷率分析----处理水量详情
164 * @param time 74 * @param
165 * @return 75 * @return
166 */ 76 */
167 public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){ 77 public List<WaterTreatmentVO> statisticsCLSLXQ(String startDate,String endDate, String departIds){
168 List<WaterTreatmentVO> dateList = null; 78 List<WaterTreatmentVO> dateList = null;
169 DateVO dateVO = new DateVO(startDate);//转换后的时间参数 79 DateVO dateVO = new DateVO(startDate);//转换后的时间参数
170
171
172 long differenceDay = DateUtils.differenceDay(startDate, endDate); 80 long differenceDay = DateUtils.differenceDay(startDate, endDate);
173 String departIdssss = BaseUtil.quoteEach(departIds , ","); 81 String departIdssss = BaseUtil.quoteEach(departIds , ",");
174 //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+")"; 82 //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 { ...@@ -229,10 +137,6 @@ public class CommandCentreServiceImpl implements ICommandCentreService {
229 } 137 }
230 return cslMap; 138 return cslMap;
231 } 139 }
232
233
234
235
236 /** 140 /**
237 * 同比 141 * 同比
238 * @param month 142 * @param month
......
...@@ -4,11 +4,9 @@ import com.skua.modules.report.vo.*; ...@@ -4,11 +4,9 @@ import com.skua.modules.report.vo.*;
4 import org.apache.ibatis.annotations.Param; 4 import org.apache.ibatis.annotations.Param;
5 import com.skua.modules.report.entity.FReportItemv; 5 import com.skua.modules.report.entity.FReportItemv;
6 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 6 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
7
8 import java.util.Date; 7 import java.util.Date;
9 import java.util.List; 8 import java.util.List;
10 import java.util.Map; 9 import java.util.Map;
11
12 /** 10 /**
13 * 报表数据项值 11 * 报表数据项值
14 */ 12 */
...@@ -22,7 +20,6 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> { ...@@ -22,7 +20,6 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
22 @Param("dataTime") String dataTime,@Param("departId") String departId,@Param("createTime") Date createTime); 20 @Param("dataTime") String dataTime,@Param("departId") String departId,@Param("createTime") Date createTime);
23 21
24 List<FReportItemv> getBean(@Param("dataId") String dataId, @Param("reitId") String reitId); 22 List<FReportItemv> getBean(@Param("dataId") String dataId, @Param("reitId") String reitId);
25
26 List<Map<String,Object>> getListByTime(@Param("sql") String sql); 23 List<Map<String,Object>> getListByTime(@Param("sql") String sql);
27 /** 24 /**
28 * <pre> 25 * <pre>
...@@ -33,75 +30,18 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> { ...@@ -33,75 +30,18 @@ public interface FReportItemvMapper extends BaseMapper<FReportItemv> {
33 * @author Li Yuanyuan, 2021年5月25日 上午10:34:37 30 * @author Li Yuanyuan, 2021年5月25日 上午10:34:37
34 */ 31 */
35 List<FReportItemv> getReportItemvByDataId(String dataId); 32 List<FReportItemv> getReportItemvByDataId(String dataId);
36
37
38 /** 33 /**
39 * 据reit_id 查询视图表数据 返回总数,平均数 34 * 据reit_id 查询视图表数据 返回总数,平均数
40 * @param reportItemvParam 35 * @param reportItemvParam
41 * @return 36 * @return
42 */ 37 */
43 List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam); 38 List<FReportItemv> getReportItemvByReitId(ReportItemvParam reportItemvParam);
44
45 /**
46 * 根据reitId与时间查询
47 * @param reitId
48 * @param startDate
49 * @param endDate
50 * @return
51 */
52 public FReportItemv getReportItemvByReitIdAndDate(@Param("reitId") String reitId, @Param("startDate") String startDate,@Param("endDate") String endDate);
53
54
55 /**
56 * 根据类型查询:指挥中心---运行负荷率分析
57 * @param loadRateType
58 * @return
59 */
60 public List<DepartLoadRateVO> statisticsByLoadRate(@Param("loadRateType") Integer loadRateType, @Param("reitId") String reitId ,@Param("startDate") String startDate,@Param("endDate") String endDate);
61
62 /**
63 * 指挥中心---运行负荷率分析 总数查询
64 * @param loadRateType
65 * @return
66 */
67 public int statisticsByLoadRateNum(@Param("loadRateType") Integer loadRateType, @Param("reitId") String reitId , @Param("startDate") String startDate,@Param("endDate") String endDate);
68
69 /**
70 * 根据reitId查询近7天数据
71 * @param reportItemvParam
72 * @return
73 */
74 public List<ReportDateTrendVO> getReportItemvByReitIdAndDate7Day(ReportItemvParam reportItemvParam);
75
76
77 /***
78 * 查询报表数据,当前月统计、上个月统计、去年当月统计(求和)
79 * @param reportItemvParam
80 * @return
81 */
82 public FRportlCommandCenterVO getReportItemvMonthDataByReitId( ReportItemvParam reportItemvParam);
83
84 /***
85 * 查询报表数据,当日平均、上月同期、去年同期统计(求均值)
86 * @param reportItemvParam
87 * @return
88 */
89 public FRportlCommandCenterVO getReportItemvDayDataByReitId(ReportItemvParam reportItemvParam);
90
91 /** 39 /**
92 * 查询费用 40 * 查询费用
93 * @param reportItemvParam 41 * @param reportItemvParam
94 * @return 42 * @return
95 */ 43 */
96 List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam); 44 List<ReportDateTrendVO> getFyData(ReportItemvParam reportItemvParam);
97
98 /**
99 * 查询水量信息
100 * @param reportItemvParam
101 * @return
102 */
103 List<ReportDateTrendVO> getClslData(ReportItemvParam reportItemvParam);
104
105 /** 45 /**
106 * 药量信息 46 * 药量信息
107 * @param month 47 * @param month
......
...@@ -51,90 +51,6 @@ ...@@ -51,90 +51,6 @@
51 51
52 </select> 52 </select>
53 53
54 <!-- 根据reit_id 查询视图表数据 返回总数,平均数 -->
55 <select id="getReportItemvByReitIdAndDate" resultType="com.skua.modules.report.entity.FReportItemv">
56 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}
57 </select>
58
59
60
61 <!-- 根据类型查询:指挥中心-运行负荷率分析 -->
62 <select id="statisticsByLoadRate" resultType="com.skua.modules.report.vo.DepartLoadRateVO">
63 SELECT ri.depart_id ,d.depart_name as 'departName',
64 fi.pro_scale ,
65 avg(ri.item_value)/(100*fi.pro_scale) as 'loadRate' ,
66 sum( ri.item_value ) as 'waterYieldMonth'
67 FROM f_report_itemv ri
68 left join sys_factory_info fi on ri.depart_id = fi.depart_id
69 left join sys_depart d on d.id = ri.depart_id
70
71 where ri.reit_id=#{reitId} and ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate}
72
73 group by ri.depart_id
74 <trim prefix="having" prefixOverrides="and">
75 <if test="loadRateType != null and loadRateType == 1">
76 avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
77 </if>
78 <if test="loadRateType != null and loadRateType == 3">
79 avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
80 </if>
81 <if test="loadRateType != null and loadRateType == 2">
82 avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
83 </if>
84 </trim>
85 </select>
86
87
88 <!-- 根据类型查询:指挥中心-运行负荷率分析 -->
89 <select id="statisticsByLoadRateNum" resultType="java.lang.Integer">
90 select count(1) from (
91 SELECT ri.depart_id , fi.pro_scale
92 FROM f_report_itemv ri
93 left join sys_factory_info fi on ri.depart_id = fi.depart_id
94
95 where ri.reit_id=#{reitId} and ri.data_time &gt;= #{startDate} and ri.data_time &lt;= #{endDate}
96
97 group by ri.depart_id
98 <trim prefix="having" prefixOverrides="and">
99 <if test="loadRateType != null and loadRateType == 1">
100 avg(ri.item_value)/(100*fi.pro_scale) &gt;= 60 and avg(ri.item_value)/(100*fi.pro_scale) &lt;= 120
101 </if>
102 <if test="loadRateType != null and loadRateType == 3">
103 avg(ri.item_value)/(100*fi.pro_scale) &lt; 60
104 </if>
105 <if test="loadRateType != null and loadRateType == 2">
106 avg(ri.item_value)/(100*fi.pro_scale) &gt; 120
107 </if>
108 </trim>
109 ) aaa
110 </select>
111
112 <!-- 根据reitId查询近7天数据-->
113 <select id="getReportItemvByReitIdAndDate7Day" resultType="com.skua.modules.report.vo.ReportDateTrendVO">
114 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}
115 group by data_time
116 </select>
117
118
119 <!--查询报表数据,当前月统计、上个月统计、去年当月统计(求和) -->
120 <select id="getReportItemvMonthDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO">
121 select
122 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',
123 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',
124 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'
125 from dual
126 </select>
127
128
129 <!--查询报表数据,当日平均、上月同期、去年同期统计(求均值) -->
130 <select id="getReportItemvDayDataByReitId" resultType="com.skua.modules.report.vo.FRportlCommandCenterVO">
131 select
132 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',
133 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',
134 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'
135 from dual
136 </select>
137
138 <select id="getFyData" resultType="com.skua.modules.report.vo.ReportDateTrendVO"> 54 <select id="getFyData" resultType="com.skua.modules.report.vo.ReportDateTrendVO">
139 SELECT 55 SELECT
140 t.month AS time, 56 t.month AS time,
...@@ -147,11 +63,7 @@ ...@@ -147,11 +63,7 @@
147 GROUP BY t.month 63 GROUP BY t.month
148 </select> 64 </select>
149 65
150 <select id="getClslData" resultType="com.skua.modules.report.vo.ReportDateTrendVO"> 66
151 SELECT sum(item_value) as 'value' , left(data_time,7) as 'date' FROM f_report_itemv
152 where reit_id=#{reitId} and data_time &gt;= #{startDate} and data_time &lt;= #{endDate}
153 group by left(data_time,7)
154 </select>
155 67
156 <select id="getYhList" resultType="com.skua.modules.report.vo.DepartDrugDataVO"> 68 <select id="getYhList" resultType="com.skua.modules.report.vo.DepartDrugDataVO">
157 SELECT 69 SELECT
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!