Sfoglia il codice sorgente

统计报表代码移动

hefeng 5 anni fa
parent
commit
b492e88215

+ 160 - 0
src/main/java/com/chinaitop/depot/statisticalReport/controller/StatisticalReportController.java

@@ -0,0 +1,160 @@
1
+package com.chinaitop.depot.statisticalReport.controller;
2
+
3
+import com.chinaitop.depot.statisticalReport.service.StatisticalReportService;
4
+import com.chinaitop.depot.unissoft.model.ResponseEntity;
5
+import com.github.pagehelper.PageHelper;
6
+import com.github.pagehelper.PageInfo;
7
+import io.swagger.annotations.Api;
8
+import io.swagger.annotations.ApiImplicitParam;
9
+import io.swagger.annotations.ApiImplicitParams;
10
+import io.swagger.annotations.ApiOperation;
11
+
12
+import org.apache.commons.lang3.StringUtils;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RequestMethod;
15
+import org.springframework.web.bind.annotation.RestController;
16
+
17
+import javax.annotation.Resource;
18
+
19
+import java.util.HashMap;
20
+import java.util.List;
21
+import java.util.Map;
22
+
23
+/**
24
+ * @author hf
25
+ * @description: 统计报表
26
+ * @create 2019-01-21
27
+ */
28
+@RestController
29
+@RequestMapping(value = "/storage/statisticalReport")
30
+@Api(value = "StatisticalReportController", description = "统计报表控制类")
31
+@SuppressWarnings("all")
32
+public class StatisticalReportController {
33
+
34
+    @Resource
35
+    private StatisticalReportService statisticalReportService;
36
+
37
+    /**
38
+     * 汇总报表
39
+     * @param pageNum
40
+     * @param pageSize
41
+     * @param orgId
42
+     * @param startDate
43
+     * @param endDate
44
+     * @return
45
+     */
46
+    @RequestMapping(value = "/getSummaryReportInfo", method = RequestMethod.GET)
47
+    @ApiOperation(value = "汇总报表列表", notes = "查询汇总报表列表,支持分页")
48
+    @ApiImplicitParams({
49
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
50
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
51
+            @ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query"),
52
+            @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query"),
53
+            @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query")
54
+    })
55
+    public ResponseEntity<PageInfo<Map<String,Object>>> getSummaryReportInfo(Integer pageNum, Integer pageSize, Integer orgId, 
56
+    		String startDate, String endDate) {
57
+        List<Map<String,Object>> list = null;
58
+        try {
59
+            if (null != pageNum && null != pageSize) {
60
+                PageHelper.startPage(pageNum, pageSize);
61
+            }
62
+            Map<String,Object> map = new HashMap<String, Object>();
63
+            if (orgId != null) {
64
+            	map.put("orgId", orgId);
65
+            }
66
+            if (StringUtils.isNotBlank(startDate)) {
67
+            	map.put("startDate", startDate);
68
+            }
69
+            if (StringUtils.isNotBlank(endDate)) {
70
+            	map.put("endDate", endDate);
71
+            }
72
+            list = statisticalReportService.getSummaryReportInfo(map);
73
+        } catch (Exception e) {
74
+            e.printStackTrace();
75
+            ResponseEntity.failed(e.getMessage());
76
+        }
77
+        PageInfo<Map<String,Object>> pageInfo = new PageInfo<Map<String,Object>>(list);
78
+        return ResponseEntity.ok(pageInfo);
79
+    }
80
+    
81
+    /**
82
+     * 详情报表
83
+     * @param orgId
84
+     * @param storehouseCode
85
+     * @param startDate
86
+     * @return
87
+     */
88
+    @RequestMapping(value = "/getDetailsReportInfo", method = RequestMethod.GET)
89
+    @ApiOperation(value = "详情报表列表", notes = "查询详情报表列表")
90
+    @ApiImplicitParams({
91
+    	@ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query"),
92
+    	@ApiImplicitParam(name = "storehouseCode", value = "仓房code", paramType = "query"),
93
+    	@ApiImplicitParam(name = "startDate", value = "检测日期", paramType = "query")
94
+    })
95
+    public ResponseEntity<Map<String,Object>> getDetailsReportInfo(Integer orgId, String storehouseCode,
96
+    		String startDate) {
97
+    	Map<String,Object> mapDetails = new HashMap<String,Object>();
98
+    	try {
99
+    		Map<String,Object> map = new HashMap<String, Object>();
100
+    		if (orgId != null) {
101
+    			map.put("orgId", orgId);
102
+    		}
103
+    		if (StringUtils.isNotBlank(storehouseCode)) {
104
+    			map.put("storehouseCode", storehouseCode);
105
+    		}
106
+    		if (StringUtils.isNotBlank(startDate)) {
107
+    			map.put("startDate", startDate);
108
+    		}
109
+    		List<Map<String,Object>> list = statisticalReportService.getDetailsReportInfo(map);
110
+    		if(list.size() > 0) {
111
+    			mapDetails = list.get(0);
112
+    		}
113
+    	} catch (Exception e) {
114
+    		e.printStackTrace();
115
+    		ResponseEntity.failed(e.getMessage());
116
+    	}
117
+    	return ResponseEntity.ok(mapDetails);
118
+    }
119
+    
120
+
121
+    /**
122
+     * 上报报表
123
+     * @param pageNum
124
+     * @param pageSize
125
+     * @param orgId
126
+     * @param startDate
127
+     * @return
128
+     */
129
+    @RequestMapping(value = "/getSubmitReportInfo", method = RequestMethod.GET)
130
+    @ApiOperation(value = "上报报表列表", notes = "查询上报报表列表,支持分页")
131
+    @ApiImplicitParams({
132
+            @ApiImplicitParam(name = "pageNum", value = "页码", paramType = "query"),
133
+            @ApiImplicitParam(name = "pageSize", value = "每页条数", paramType = "query"),
134
+            @ApiImplicitParam(name = "orgId", value = "机构id", paramType = "query"),
135
+            @ApiImplicitParam(name = "startDate", value = "检测日期", paramType = "query")
136
+    })
137
+    public ResponseEntity<PageInfo<Map<String,Object>>> getSubmitReportInfo(Integer pageNum, Integer pageSize, Integer orgId, 
138
+    		String startDate) {
139
+        List<Map<String,Object>> list = null;
140
+        try {
141
+            if (null != pageNum && null != pageSize) {
142
+                PageHelper.startPage(pageNum, pageSize);
143
+            }
144
+            Map<String,Object> map = new HashMap<String, Object>();
145
+            if (orgId != null) {
146
+            	map.put("orgId", orgId);
147
+            }
148
+            if (StringUtils.isNotBlank(startDate)) {
149
+            	map.put("startDate", startDate);
150
+            }
151
+            list = statisticalReportService.getSubmitReportInfo(map);
152
+        } catch (Exception e) {
153
+            e.printStackTrace();
154
+            ResponseEntity.failed(e.getMessage());
155
+        }
156
+        PageInfo<Map<String,Object>> pageInfo = new PageInfo<Map<String,Object>>(list);
157
+        return ResponseEntity.ok(pageInfo);
158
+    }
159
+    
160
+}

+ 16 - 0
src/main/java/com/chinaitop/depot/statisticalReport/mapper/StatisticalReportMapper.java

@@ -0,0 +1,16 @@
1
+package com.chinaitop.depot.statisticalReport.mapper;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+import org.springframework.stereotype.Repository;
7
+
8
+@Repository
9
+public interface StatisticalReportMapper {
10
+	
11
+	List<Map<String, Object>> getSummaryReportInfo(Map<String,Object> map);
12
+	
13
+	List<Map<String, Object>> getDetailsReportInfo(Map<String,Object> map);
14
+	
15
+	List<Map<String, Object>> getSubmitReportInfo(Map<String,Object> map);
16
+}

+ 279 - 0
src/main/java/com/chinaitop/depot/statisticalReport/mapper/StatisticalReportMapper.xml

@@ -0,0 +1,279 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
+<mapper namespace="com.chinaitop.depot.statisticalReport.mapper.StatisticalReportMapper">
4
+  
5
+  <select id="getSummaryReportInfo" resultType="java.util.Map" parameterType="map">
6
+    <!-- SELECT bs.storehouse_code storeHouse, td.inTemp, td.inH, td.outTemp, td.outH, td.t_max maxTemp, td.t_min minTemp, 
7
+    	td.t_avg avgTemp, IFNULL(tq.co2avg,0) AS "co2avg", IFNULL(tq.ph3avg,0) AS "ph3avg", IFNULL(tq.o2avg,0) AS "o2avg",
8
+		ccmax.iValue maxvalues, ccmin.iValue minvalues, bs.dutyStoreman, bs.remark
9
+	FROM basic_storehouse bs
10
+	LEFT JOIN t_testdata td on td.storehouse = bs.storehouse_code and td.iLq_yq = '0' and td.org_id = bs.org_id
11
+	<if test="startDate != null and startDate != ''">
12
+          and td.t_time >= #{startDate,jdbcType=TIMESTAMP}
13
+    </if>
14
+    LEFT JOIN(
15
+		SELECT MAX(CASE tq.v_dev_kind_code WHEN "6964" THEN tq.cpo_avg ELSE 0 END ) AS "co2avg",
16
+  		MAX(CASE tq.v_dev_kind_code WHEN "6965" THEN tq.cpo_avg ELSE 0 END ) AS "ph3avg",
17
+  		MAX(CASE tq.v_dev_kind_code WHEN "6962" THEN tq.cpo_avg ELSE 0 END ) AS "o2avg",tq.v_cf_code
18
+		FROM t_qtdevinfo_value tq
19
+		<where>
20
+			<if test="orgId!=null">
21
+	            and tq.org_id = ${orgId}   
22
+	        </if>
23
+	        <if test="startDate != null and startDate != ''">
24
+		          and tq.v_value_time >= #{startDate,jdbcType=TIMESTAMP}
25
+		    </if>
26
+		</where>
27
+		GROUP BY tq.v_cf_code
28
+	) tq on tq.v_cf_code = bs.storehouse_code
29
+	LEFT JOIN (
30
+		SELECT DISTINCT ti.vcfcode AS vCfCode, MAX(td.i_value) AS iValue, td.v_update_time AS vUpdateTime
31
+	  	FROM  t_ccinfo ti
32
+		INNER JOIN t_ccdata td ON ti.vdevcode = td.v_cc_code AND td.org_id = ti.org_id
33
+		<where>
34
+	        <if test="startDate != null and startDate != ''">
35
+	           and td.v_update_time >= #{startDate,jdbcType=TIMESTAMP}
36
+		    </if>
37
+		</where>
38
+		GROUP BY ti.vcfcode
39
+	) ccmax ON td.storehouse = ccmax.vCfCode
40
+	LEFT JOIN (
41
+		SELECT DISTINCT ti.vcfcode AS vCfCode, min(td.i_value) AS iValue, td.v_update_time AS vUpdateTime
42
+	  	FROM  t_ccinfo ti
43
+		INNER JOIN t_ccdata td ON ti.vdevcode = td.v_cc_code  AND td.org_id = ti.org_id
44
+		<where>
45
+	        <if test="startDate != null and startDate != ''">
46
+	           and td.v_update_time >= #{startDate,jdbcType=TIMESTAMP}
47
+		    </if>
48
+		    <if test="endDate != null and endDate != ''">
49
+		        and #{endDate,jdbcType=TIMESTAMP} >= td.v_update_time
50
+		    </if>
51
+		</where>
52
+		GROUP BY ti.vcfcode
53
+	) ccmin ON td.storehouse = ccmin.vCfCode
54
+	<where>
55
+		bs.del_flag = 1
56
+		<if test="orgId!=null">
57
+            and bs.org_id = ${orgId}   
58
+        </if>
59
+	</where>
60
+	GROUP BY bs.storehouse_code -->
61
+	
62
+	SELECT bs.storehouse_code storeHouse, td.inTemp, td.inH, td.outTemp, td.outH, td.t_max maxTemp, 
63
+		td.t_min minTemp, td.t_avg avgTemp, bs.dutyStoreman, bs.remark
64
+	FROM basic_storehouse bs
65
+	LEFT JOIN (
66
+		  select a.* from t_testdata a inner join (
67
+		    select storehouse,max(t_time) t_time from t_testdata where org_id = 49 and iLq_yq = '0' 
68
+		    <if test="startDate != null and startDate != ''">
69
+		          and to_date(t_time, 'yyyy-mm-dd') = #{startDate,jdbcType=TIMESTAMP}
70
+		    </if>
71
+		    GROUP BY storehouse
72
+		  ) b on a.storehouse = b.storehouse and a.t_time = b.t_time 
73
+		  <if test="orgId!=null">
74
+	    	 and a.org_id = ${orgId}   
75
+	  	  </if>
76
+		) td on td.storehouse = bs.storehouse_code
77
+	 and td.t_time >= #{startDate,jdbcType=TIMESTAMP}
78
+    where bs.del_flag = 1 
79
+    <if test="orgId!=null">
80
+    	 and bs.org_id = ${orgId}   
81
+  	</if>
82
+	
83
+  </select>
84
+  
85
+  <select id="getDetailsReportInfo" resultType="java.util.Map" parameterType="map">
86
+    <!-- SELECT bs.storehouse_code storeHouse, bs.storehouse_type storehouseType, bs.keeping_way keepingWay, 
87
+    	bs.storehouse_name storehouseName, td.t_time, td.inTemp, td.inH, td.outTemp, 
88
+    	td.outH, td.t_max maxTemp, td.t_min minTemp, td.t_avg avgTemp, tq.v_value_time valueTime,
89
+    	MAX(CASE v_dev_kind_code WHEN "6964" THEN cpo_avg ELSE 0 END ) AS "co2avg",
90
+  		MAX(CASE v_dev_kind_code WHEN "6965" THEN cpo_avg ELSE 0 END ) AS "ph3avg",
91
+  		MAX(CASE v_dev_kind_code WHEN "6962" THEN cpo_avg ELSE 0 END ) AS "o2avg",
92
+		ccmax.iValue maxvalues, ccmin.iValue minvalues, ccavg.iValue avgvalues, ccavg.vUpdateTime,
93
+		bs.dutyStoreman, bs.remark, sq.water, sq.location
94
+	FROM basic_storehouse bs
95
+	LEFT JOIN storage_qualitycheck sq on bs.storehouse_code = sq.house_id AND sq.org_id = bs.org_id and sq.type = 0
96
+	LEFT JOIN t_testdata td on bs.storehouse_code = td.storehouse and td.iLq_yq = '0' AND td.org_id = bs.org_id
97
+	<if test="startDate != null and startDate != ''">
98
+          and DATE_FORMAT(td.t_time, '%Y-%m-%d') = #{startDate}
99
+    </if>
100
+	LEFT JOIN t_qtdevinfo_value tq on bs.storehouse_code = tq.v_cf_code AND tq.org_id = bs.org_id
101
+	<if test="startDate != null and startDate != ''">
102
+          and DATE_FORMAT(tq.v_value_time, '%Y-%m-%d') = #{startDate}
103
+    </if>
104
+	LEFT JOIN (
105
+		SELECT DISTINCT ti.vcfcode AS vCfCode, MAX(td.i_value) AS iValue, td.v_update_time AS vUpdateTime
106
+	  	FROM  t_ccinfo ti
107
+		INNER JOIN t_ccdata td ON ti.vdevcode = td.v_cc_code
108
+		<where>
109
+	        <if test="startDate != null and startDate != ''">
110
+	           and DATE_FORMAT(td.v_update_time, '%Y-%m-%d') = #{startDate}
111
+		    </if>
112
+		</where>
113
+		GROUP BY ti.vcfcode
114
+	) ccmax ON bs.storehouse_code = ccmax.vCfCode
115
+	LEFT JOIN (
116
+		SELECT DISTINCT ti.vcfcode AS vCfCode, min(td.i_value) AS iValue, td.v_update_time AS vUpdateTime
117
+	  	FROM  t_ccinfo ti
118
+		INNER JOIN t_ccdata td ON ti.vdevcode = td.v_cc_code
119
+		<where>
120
+	        <if test="startDate != null and startDate != ''">
121
+	           and DATE_FORMAT(td.v_update_time, '%Y-%m-%d') = #{startDate}
122
+		    </if>
123
+		</where>
124
+		GROUP BY ti.vcfcode
125
+	) ccmin ON bs.storehouse_code = ccmin.vCfCode
126
+	LEFT JOIN (
127
+		SELECT DISTINCT ti.vcfcode AS vCfCode, avg(td.i_value) AS iValue,
128
+			td.v_update_time AS vUpdateTime
129
+		FROM t_ccinfo ti
130
+		INNER JOIN t_ccdata td ON ti.vdevcode = td.v_cc_code
131
+		<where>
132
+	        <if test="startDate != null and startDate != ''">
133
+	           and DATE_FORMAT(td.v_update_time, '%Y-%m-%d') = #{startDate}
134
+		    </if>
135
+		</where>
136
+		GROUP BY ti.vcfcode
137
+	) ccavg ON bs.storehouse_code = ccavg.vCfCode
138
+	<where>
139
+		<if test="orgId!=null">
140
+            and bs.org_id = ${orgId}   
141
+        </if>
142
+        <if test="storehouseCode != null and storehouseCode != ''">
143
+           and bs.storehouse_code = #{storehouseCode}
144
+	    </if>
145
+	</where>
146
+	GROUP BY bs.storehouse_code -->
147
+	
148
+	SELECT bs.storehouse_code storehouse, bs.storehouse_type storehousetype, bs.keeping_way keepingway, 
149
+    	bs.storehouse_name storehousename, td.t_time, td.intemp, td.inh, td.outtemp, 
150
+    	td.outh, td.t_max maxtemp, td.t_min mintemp, td.t_avg avgtemp, bs.remark, sq.water, sq.location
151
+	FROM basic_storehouse bs
152
+	LEFT JOIN storage_qualitycheck sq on bs.storehouse_id = sq.house_id AND sq.org_id = bs.org_id and sq.type = 0
153
+	LEFT join(
154
+	  select a.* from t_testdata a inner join (
155
+		    select storehouse,max(t_time) t_time from t_testdata where iLq_yq = '0' 
156
+		    <if test="orgId!=null">
157
+	            and org_id = ${orgId}   
158
+	        </if>
159
+		    <if test="startDate != null and startDate != ''">
160
+			    and to_date(t_time, 'yyyy-mm-dd') = #{startDate}
161
+		    </if>
162
+		    GROUP BY storehouse
163
+		  ) b on a.storehouse = b.storehouse and a.t_time = b.t_time and a.org_id = 49
164
+	) td on bs.storehouse_code = td.storehouse
165
+	<where>
166
+		<if test="orgId!=null">
167
+            and bs.org_id = ${orgId}   
168
+        </if>
169
+        <if test="storehouseCode != null and storehouseCode != ''">
170
+           and bs.storehouse_code = #{storehouseCode}
171
+	    </if>
172
+	</where>
173
+  </select>
174
+  
175
+  <select id="getSubmitReportInfo" resultType="java.util.Map" parameterType="map">
176
+  	SELECT bs.*, tdl1.lAvg firstfloor, tdl2.lAvg secondfloor, tdl3.lAvg threefloor, tdl4.lAvg fourfloor FROM (
177
+	    SELECT bs.storehouse_code storehouse, bs.storehouse_type storehousetype, bs.keeping_way keepingway, 
178
+	    	bs.storehouse_name storehousename, td.intemp, td.inh, td.t_max maxtemp, td.t_min mintemp, 
179
+	    	td.t_avg avgtemp,sq.grain_annual harvesttime
180
+	    	<!-- , sq.water -->
181
+		FROM basic_storehouse bs
182
+		LEFT JOIN (
183
+		  select grain_annual,house_id from business_store_ware_detail where id = (
184
+		    select max(id) id from business_store_ware_detail 
185
+		    where type= 'notice' 
186
+		    <if test="orgId!=null">
187
+		    	  and org_id = ${orgId}   
188
+			</if>
189
+			group by house_id
190
+		  )
191
+		) sq on bs.storehouse_id = sq.house_id
192
+		LEFT JOIN (
193
+		  select a.* from t_testdata a inner join (
194
+		    select storehouse,max(t_time) t_time from t_testdata 
195
+		    where iLq_yq = '0'
196
+		    <if test="orgId!=null">
197
+		    	  and org_id = ${orgId}   
198
+			</if> 
199
+			<if test="startDate != null and startDate != ''">
200
+		          and to_date(t_time, 'yyyy-mm-dd') = #{startDate}
201
+		    </if>  
202
+		    GROUP BY storehouse
203
+		  ) b on a.storehouse = b.storehouse and a.t_time = b.t_time 
204
+		  <if test="orgId!=null">
205
+		    	  and a.org_id = ${orgId}   
206
+		  </if>
207
+		) td on td.storehouse = bs.storehouse_code
208
+        where bs.del_flag = 1 
209
+        <if test="orgId!=null">
210
+		    	  and bs.org_id = ${orgId}   
211
+		</if>  
212
+	) bs 
213
+	LEFT join (
214
+	      select a.* from t_testdata_layer a inner join (
215
+		    select lHouse,max(ltime) ltime from t_testdata_layer 
216
+		    where 
217
+		    <if test="orgId!=null">
218
+		    	  org_id = ${orgId}   
219
+			</if>
220
+			<if test="startDate != null and startDate != ''">
221
+		          and to_date(ltime, 'yyyy-mm-dd') = #{startDate}
222
+		    </if> 
223
+		    GROUP BY lHouse
224
+		  ) b on a.lHouse = b.lHouse and a.ltime = b.ltime and layerNumber = 1 
225
+		  <if test="orgId!=null">
226
+		    	 and a.org_id = ${orgId}   
227
+		  </if> 
228
+	) tdl1 ON tdl1.lHouse = bs.storeHouse
229
+	LEFT join (
230
+	      select a.* from t_testdata_layer a inner join (
231
+		    select lHouse,max(ltime) ltime from t_testdata_layer 
232
+		    where 
233
+		    <if test="orgId!=null">
234
+		    	  org_id = ${orgId}   
235
+			</if>
236
+			<if test="startDate != null and startDate != ''">
237
+		          and to_date(ltime, 'yyyy-mm-dd') = #{startDate}
238
+		    </if> 
239
+		    GROUP BY lHouse
240
+		  ) b on a.lHouse = b.lHouse and a.ltime = b.ltime and layerNumber = 2 
241
+		  <if test="orgId!=null">
242
+		    	 and a.org_id = ${orgId}   
243
+		  </if>
244
+	) tdl2 ON tdl2.lHouse = bs.storeHouse
245
+	LEFT join (
246
+	      select a.* from t_testdata_layer a inner join (
247
+		    select lHouse,max(ltime) ltime from t_testdata_layer 
248
+		    where 
249
+		    <if test="orgId!=null">
250
+		    	  org_id = ${orgId}   
251
+			</if>
252
+			<if test="startDate != null and startDate != ''">
253
+		          and to_date(ltime, 'yyyy-mm-dd') = #{startDate}
254
+		    </if> 
255
+		    GROUP BY lHouse
256
+		  ) b on a.lHouse = b.lHouse and a.ltime = b.ltime and layerNumber = 3
257
+		  <if test="orgId!=null">
258
+		    	 and a.org_id = ${orgId}   
259
+		  </if>
260
+	) tdl3 ON tdl3.lHouse = bs.storeHouse
261
+	LEFT join (
262
+	      select a.* from t_testdata_layer a inner join (
263
+		    select lHouse,max(ltime) ltime from t_testdata_layer 
264
+		    where 
265
+		    <if test="orgId!=null">
266
+		    	  org_id = ${orgId}   
267
+			</if>
268
+			<if test="startDate != null and startDate != ''">
269
+		          and to_date(ltime, 'yyyy-mm-dd') = #{startDate}
270
+		    </if> 
271
+		    GROUP BY lHouse
272
+		  ) b on a.lHouse = b.lHouse and a.ltime = b.ltime and layerNumber = 4
273
+		  <if test="orgId!=null">
274
+		    	 and a.org_id = ${orgId}   
275
+		  </if>
276
+	) tdl4 ON tdl4.lHouse = bs.storeHouse
277
+  </select>
278
+  
279
+</mapper>

+ 34 - 0
src/main/java/com/chinaitop/depot/statisticalReport/service/StatisticalReportService.java

@@ -0,0 +1,34 @@
1
+package com.chinaitop.depot.statisticalReport.service;
2
+
3
+import java.util.List;
4
+import java.util.Map;
5
+
6
+/**
7
+ * @author hf
8
+ * @description: 统计报表
9
+ * @create 2019-01-21
10
+ */
11
+public interface StatisticalReportService {
12
+    
13
+    /**
14
+     * 汇总报表
15
+     * @param map
16
+     * @return
17
+     */
18
+    List<Map<String, Object>> getSummaryReportInfo(Map<String,Object> map);
19
+    
20
+    /**
21
+     * 详情报表
22
+     * @param map
23
+     * @return
24
+     */
25
+    List<Map<String, Object>> getDetailsReportInfo(Map<String,Object> map);
26
+
27
+    /**
28
+     * 上报报表
29
+     * @param map
30
+     * @return
31
+     */
32
+    List<Map<String, Object>> getSubmitReportInfo(Map<String,Object> map);
33
+    
34
+}

+ 39 - 0
src/main/java/com/chinaitop/depot/statisticalReport/service/impl/StatisticalReportServiceImpl.java

@@ -0,0 +1,39 @@
1
+package com.chinaitop.depot.statisticalReport.service.impl;
2
+
3
+import com.chinaitop.depot.statisticalReport.mapper.StatisticalReportMapper;
4
+import com.chinaitop.depot.statisticalReport.service.StatisticalReportService;
5
+
6
+import org.springframework.stereotype.Service;
7
+
8
+import javax.annotation.Resource;
9
+
10
+import java.util.List;
11
+import java.util.Map;
12
+
13
+/**
14
+ * @author qingsong.han
15
+ * @description: 能耗检测
16
+ * @create 2018-12-11 11:00
17
+ */
18
+@Service
19
+public class StatisticalReportServiceImpl implements StatisticalReportService {
20
+
21
+    @Resource
22
+    private StatisticalReportMapper statisticalReportMapper;
23
+
24
+	@Override
25
+	public List<Map<String, Object>> getSummaryReportInfo(Map<String, Object> map) {
26
+		return statisticalReportMapper.getSummaryReportInfo(map);
27
+	}
28
+
29
+	@Override
30
+	public List<Map<String, Object>> getDetailsReportInfo(Map<String, Object> map) {
31
+		return statisticalReportMapper.getDetailsReportInfo(map);
32
+	}
33
+
34
+	@Override
35
+	public List<Map<String, Object>> getSubmitReportInfo(Map<String, Object> map) {
36
+		return statisticalReportMapper.getSubmitReportInfo(map);
37
+	}
38
+
39
+}

+ 96 - 0
src/main/java/com/chinaitop/depot/unissoft/model/ResponseEntity.java

@@ -0,0 +1,96 @@
1
+package com.chinaitop.depot.unissoft.model;
2
+
3
+import java.io.Serializable;
4
+
5
+//返回基类
6
+public class ResponseEntity<T> implements Serializable {
7
+
8
+    private static final long serialVersionUID = -2825436079063723409L;
9
+
10
+    //成功
11
+    private static final String OK = "200";
12
+    //失败
13
+    private static final String FAILED = "600";
14
+    private static final String BUSSINESS_FAILED = "550";
15
+    private static final String UNAUTHENTICATION = "401";
16
+
17
+    private String retCode;
18
+    private String message;
19
+    private T data;
20
+
21
+    public String getRetCode() {
22
+        return retCode;
23
+    }
24
+
25
+    public void setRetCode(String retCode) {
26
+        this.retCode = retCode;
27
+    }
28
+
29
+    public String getMessage() {
30
+        return message;
31
+    }
32
+
33
+    public void setMessage(String message) {
34
+        this.message = message;
35
+    }
36
+
37
+    public T getData() {
38
+        return data;
39
+    }
40
+
41
+    public void setData(T data) {
42
+        this.data = data;
43
+    }
44
+
45
+    private static <T> ResponseEntity<T> buildResponse(String retCode, String message, T data){
46
+        ResponseEntity<T> responseEntity = new ResponseEntity<T>();
47
+        responseEntity.retCode = retCode;
48
+        responseEntity.message = message;
49
+        responseEntity.data = data;
50
+        return responseEntity;
51
+    }
52
+
53
+    public static <T> ResponseEntity<T> ok(){
54
+        return buildResponse(ResponseEntity.OK,"success",null);
55
+    }
56
+    public static <T> ResponseEntity<T> ok(T data){
57
+        return buildResponse(ResponseEntity.OK,"success",data);
58
+
59
+    }
60
+    public static <T> ResponseEntity<T> ok(String message, T data){
61
+        return buildResponse(ResponseEntity.OK,message,data);
62
+    }
63
+
64
+
65
+    public static <T> ResponseEntity<T> failed(String message){
66
+        return buildResponse(ResponseEntity.FAILED,message,null);
67
+    }
68
+
69
+    public static <T> ResponseEntity<T> businessFailed(String message){
70
+        return buildResponse(ResponseEntity.BUSSINESS_FAILED,message,null);
71
+    }
72
+
73
+    public static <T> ResponseEntity<T> unauthentication(String message){
74
+        return buildResponse(ResponseEntity.UNAUTHENTICATION,message,null);
75
+    }
76
+
77
+    private String state;
78
+    private String msg;
79
+
80
+    public String getState() {
81
+        return state;
82
+    }
83
+
84
+    public void setState(String state) {
85
+        this.state = state;
86
+    }
87
+
88
+    public String getMsg() {
89
+        return msg;
90
+    }
91
+
92
+    public void setMsg(String msg) {
93
+        this.msg = msg;
94
+    }
95
+}
96
+