b4b75dce 张雷

禅道BUG修改

1 个父辈 6256fe9c
...@@ -99,9 +99,14 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData ...@@ -99,9 +99,14 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
99 * @return 99 * @return
100 */ 100 */
101 Map<String, Object> getWeekReport(@Param(value="dataTime") String dataTime, @Param(value="departId") String departId, 101 Map<String, Object> getWeekReport(@Param(value="dataTime") String dataTime, @Param(value="departId") String departId,
102 @Param(value="week") String week,@Param(value="startDate") String startDate,@Param(value="endDate") String endDate); 102 @Param(value="week") String week,@Param(value="startDate") String startDate,@Param(value="endDate") String endDate,
103 103 @Param(value="dataViewName3a24") String dataViewName3a24,
104 List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate); 104 @Param(value="dataViewName2119") String dataViewName2119,
105 @Param(value="dataViewName9bff") String dataViewName9bff);
106
107 List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate,
108 @Param(value="dataViewName3a24") String dataViewName3a24,
109 @Param(value="dataViewName2119") String dataViewName2119);
105 110
106 List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3, 111 List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3,
107 @Param(value="start") String start, @Param(value="end") String end, @Param(value="departIds") String departIds); 112 @Param(value="start") String start, @Param(value="end") String end, @Param(value="departIds") String departIds);
......
...@@ -208,23 +208,28 @@ ...@@ -208,23 +208,28 @@
208 sys_depart d 208 sys_depart d
209 LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id 209 LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id
210 LEFT JOIN (SELECT 210 LEFT JOIN (SELECT
211 ROUND(AVG(JSCOD),2) JSCOD,ROUND(AVG(JSAD),2) JSAD,ROUND(AVG(JSPH),2) JSPH,ROUND(AVG(JSZD),2) JSZD,ROUND(AVG(JSZL),2) JSZL,ROUND(AVG(JSSS),2) JSSS, 211 ROUND(AVG(v.JSCOD),2) JSCOD,ROUND(AVG(v.JSAD),2) JSAD,ROUND(AVG(v.JSPH),2) JSPH,
212 ROUND(AVG(CSCOD),2) CSCOD,ROUND(AVG(CSAD),2) CSAD,ROUND(AVG(CSPH),2) CSPH,ROUND(AVG(CSTN),2) CSTN,ROUND(AVG(CSZL),2) CSZL,ROUND(AVG(CSSS),2) CSSS, 212 ROUND(AVG(v.JSZD),2) JSZD,ROUND(AVG(v.JSZL),2) JSZL,ROUND(AVG(v.JSSS),2) JSSS,
213 depart_id 213 ROUND(AVG(v.CSCOD),2) CSCOD,ROUND(AVG(v.CSAD),2) CSAD,ROUND(AVG(v.CSPH),2) CSPH,
214 FROM view_9bff 214 ROUND(AVG(v.CSTN),2) CSTN,ROUND(AVG(v.CSZL),2) CSZL,ROUND(AVG(v.CSSS),2) CSSS,
215 WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v9 on v9.depart_id = d.id 215 v.depart_id
216 FROM ${dataViewName9bff} v
217 WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v9 on v9.depart_id = d.id
216 LEFT JOIN (SELECT 218 LEFT JOIN (SELECT
217 SUM(DLHJ) dlhj,(SUM( PAMRJ ) + SUM( SCLPAMZ ) + SUM( SCLPAMF ) + SUM( NACLO ) + SUM( PACGT ) + SUM( PACYT ) + SUM( PFS ) + SUM( FHTY ) + 219 SUM(IFNULL(v.DLHJ,0)) dlhj,(SUM( IFNULL(v.PAMRJ,0) ) + SUM( IFNULL(v.SCLPAMZ,0) ) +
218 SUM( RYXNJ ) + SUM( YWL ) + SUM( GXCLJ ) + SUM( CH3COONA ) + SUM( HXT ) + SUM( FECL3 ) + SUM( SH ) + SUM( CH3COOH ) + SUM( FESO4G ) + 220 SUM( IFNULL(v.SCLPAMF,0) ) + SUM( IFNULL(v.NACLO,0) ) + SUM( IFNULL(v.PACGT,0) ) +
219 SUM( FESO4Y ) + SUM( H2O2 )) yjhl,SUM(WNL) wnl,depart_id 221 SUM( IFNULL(v.PACYT,0) ) + SUM( IFNULL(v.PFS,0) ) + SUM( IFNULL(v.FHTY,0) ) +SUM( IFNULL(v.RYXNJ,0) ) +
220 FROM view_3a24 222 SUM( IFNULL(v.YWL,0) ) + SUM( IFNULL(v.GXCLJ,0) ) + SUM( IFNULL(v.CH3COONA,0) ) + SUM( IFNULL(v.HXT,0) ) +
221 WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v8 on v8.depart_id = d.id 223 SUM( IFNULL(v.FECL3,0) ) + SUM( IFNULL(v.SH,0) ) + SUM( IFNULL(v.CH3COOH,0) ) + SUM( IFNULL(v.FESO4G,0) ) +
224 SUM( IFNULL(v.FESO4Y,0) ) + SUM( IFNULL(v.H2O2,0) )) yjhl,SUM(IFNULL(v.WNL,0)) wnl,v.depart_id
225 FROM ${dataViewName3a24} v
226 WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v8 on v8.depart_id = d.id
222 LEFT JOIN (SELECT 227 LEFT JOIN (SELECT
223 SUM(CSL) zclsl, 228 SUM(v.CSL) zclsl,
224 ROUND(AVG(CSL),2) rjclsl, 229 ROUND(AVG(v.CSL),2) rjclsl,
225 depart_id 230 v.depart_id
226 FROM view_2119 231 FROM ${dataViewName2119} v
227 WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v2 on v2.depart_id = d.id 232 WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v2 on v2.depart_id = d.id
228 LEFT JOIN sys_factory_info f on f.depart_id = d.id 233 LEFT JOIN sys_factory_info f on f.depart_id = d.id
229 LEFT JOIN report_target_config t on t.depart_id = d.id 234 LEFT JOIN report_target_config t on t.depart_id = d.id
230 WHERE 235 WHERE
...@@ -242,12 +247,12 @@ ...@@ -242,12 +247,12 @@
242 FROM 247 FROM
243 sys_depart d 248 sys_depart d
244 left join sys_factory_info f on f.depart_id = d.id 249 left join sys_factory_info f on f.depart_id = d.id
245 left join (select depart_id,ROUND(SUM(WNL),2) wnl,ROUND(SUM(DLHJ),2) hdl 250 left join (select v.depart_id,ROUND(SUM(v.WNL),2) wnl,ROUND(SUM(v.DLHJ),2) hdl
246 from view_3a24 251 from ${dataViewName3a24} v
247 where time &gt;= #{startDate} AND time &lt;= #{endDate} GROUP BY depart_id) v3 on v3.depart_id = d.id 252 where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v3 on v3.depart_id = d.id
248 left join (select depart_id, ROUND(AVG(CSL)/10000,2) AS rjclsl, ROUND(SUM(CSL),2) AS zclsl 253 left join (select v.depart_id, ROUND(AVG(v.CSL)/10000,2) AS rjclsl, ROUND(SUM(v.CSL),2) AS zclsl
249 from view_2119 254 from ${dataViewName2119} v
250 where time &gt;= #{startDate} AND time &lt;= #{endDate} GROUP BY depart_id) v2 on v2.depart_id = d.id 255 where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v2 on v2.depart_id = d.id
251 WHERE 256 WHERE
252 d.depart_type = 1 257 d.depart_type = 1
253 ORDER BY 258 ORDER BY
......
...@@ -70,15 +70,8 @@ public class ReportElectricCostController { ...@@ -70,15 +70,8 @@ public class ReportElectricCostController {
70 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, 70 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
71 HttpServletRequest req) { 71 HttpServletRequest req) {
72 Result<IPage<ReportElectricCost>> result = new Result<IPage<ReportElectricCost>>(); 72 Result<IPage<ReportElectricCost>> result = new Result<IPage<ReportElectricCost>>();
73 QueryWrapper<ReportElectricCost> queryWrapper = QueryGenerator.initQueryWrapper(reportElectricCost, req.getParameterMap());
74 if(reportElectricCost.getDepartId()!=null){
75 queryWrapper.eq("depart_id",reportElectricCost.getDepartId());
76 }
77 if(reportElectricCost.getMonth()!=null){
78 queryWrapper.like("month",reportElectricCost.getMonth());
79 }
80 Page<ReportElectricCost> page = new Page<ReportElectricCost>(pageNo, pageSize); 73 Page<ReportElectricCost> page = new Page<ReportElectricCost>(pageNo, pageSize);
81 IPage<ReportElectricCost> pageList = reportElectricCostService.page(page, queryWrapper); 74 IPage<ReportElectricCost> pageList = reportElectricCostService.getPage(page, reportElectricCost);
82 result.setSuccess(true); 75 result.setSuccess(true);
83 result.setResult(pageList); 76 result.setResult(pageList);
84 return result; 77 return result;
......
...@@ -2,6 +2,7 @@ package com.skua.modules.report.mapper; ...@@ -2,6 +2,7 @@ package com.skua.modules.report.mapper;
2 2
3 import java.util.List; 3 import java.util.List;
4 4
5 import com.skua.tool.annotation.Anonymous;
5 import org.apache.ibatis.annotations.Param; 6 import org.apache.ibatis.annotations.Param;
6 import com.skua.modules.report.entity.ReportElectricCost; 7 import com.skua.modules.report.entity.ReportElectricCost;
7 import com.baomidou.mybatisplus.core.mapper.BaseMapper; 8 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...@@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
11 */ 12 */
12 public interface ReportElectricCostMapper extends BaseMapper<ReportElectricCost> { 13 public interface ReportElectricCostMapper extends BaseMapper<ReportElectricCost> {
13 14
15 @Anonymous
16 List<ReportElectricCost> getPage(@Param("reportElectricCost") ReportElectricCost reportElectricCost);
17
14 } 18 }
......
...@@ -2,4 +2,14 @@ ...@@ -2,4 +2,14 @@
2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> 2 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 <mapper namespace="com.skua.modules.report.mapper.ReportElectricCostMapper"> 3 <mapper namespace="com.skua.modules.report.mapper.ReportElectricCostMapper">
4 4
5 <select id="getPage" resultType="com.skua.modules.report.entity.ReportElectricCost" parameterType="com.skua.modules.report.entity.ReportElectricCost">
6 select * from report_electric_cost where 1=1
7 <if test="reportElectricCost.departId!=null and reportElectricCost.departId!=''">
8 AND depart_id = #{reportElectricCost.departId}
9 </if>
10 <if test="reportElectricCost.month!=null and reportElectricCost.month!=''">
11 AND month like CONCAT(#{reportElectricCost.month},'%')
12 </if>
13 </select>
14
5 </mapper> 15 </mapper>
......
1 package com.skua.modules.report.service; 1 package com.skua.modules.report.service;
2 2
3 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
4 import com.baomidou.mybatisplus.core.metadata.IPage;
5 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3 import com.skua.modules.report.entity.ReportElectricCost; 6 import com.skua.modules.report.entity.ReportElectricCost;
4 import com.baomidou.mybatisplus.extension.service.IService; 7 import com.baomidou.mybatisplus.extension.service.IService;
5 8
...@@ -8,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; ...@@ -8,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
8 */ 11 */
9 public interface IReportElectricCostService extends IService<ReportElectricCost> { 12 public interface IReportElectricCostService extends IService<ReportElectricCost> {
10 13
14 IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost);
15
11 } 16 }
......
1 package com.skua.modules.report.service.impl; 1 package com.skua.modules.report.service.impl;
2 2
3 import com.baomidou.mybatisplus.core.metadata.IPage;
4 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
3 import com.skua.modules.report.entity.ReportElectricCost; 5 import com.skua.modules.report.entity.ReportElectricCost;
4 import com.skua.modules.report.mapper.ReportElectricCostMapper; 6 import com.skua.modules.report.mapper.ReportElectricCostMapper;
5 import com.skua.modules.report.service.IReportElectricCostService; 7 import com.skua.modules.report.service.IReportElectricCostService;
8 import org.springframework.beans.factory.annotation.Autowired;
6 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
7 10
8 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 11 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
9 12
13 import java.util.ArrayList;
14 import java.util.List;
15
10 /** 16 /**
11 * 月度电费报表 17 * 月度电费报表
12 */ 18 */
13 @Service 19 @Service
14 public class ReportElectricCostServiceImpl extends ServiceImpl<ReportElectricCostMapper, ReportElectricCost> implements IReportElectricCostService { 20 public class ReportElectricCostServiceImpl extends ServiceImpl<ReportElectricCostMapper, ReportElectricCost> implements IReportElectricCostService {
15 21
22 @Autowired
23 private ReportElectricCostMapper reportElectricCostMapper;
24
25 @Override
26 public IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost) {
27 // if(reportElectricCost.getDepartId()!=null){
28 // queryWrapper.eq("depart_id",reportElectricCost.getDepartId());
29 // }
30 // if(reportElectricCost.getMonth()!=null){
31 // queryWrapper.like("month",reportElectricCost.getMonth());
32 // }
33 List<ReportElectricCost> list = new ArrayList<>();
34 list = reportElectricCostMapper.getPage(reportElectricCost);
35 page.setRecords(list);
36 return page;
37 }
16 } 38 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!