b4b75dce 张雷

禅道BUG修改

1 个父辈 6256fe9c
......@@ -99,9 +99,14 @@ public interface FCustomReportDatasetMapper extends BaseMapper<FCustomReportData
* @return
*/
Map<String, Object> getWeekReport(@Param(value="dataTime") String dataTime, @Param(value="departId") String departId,
@Param(value="week") String week,@Param(value="startDate") String startDate,@Param(value="endDate") String endDate);
List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate);
@Param(value="week") String week,@Param(value="startDate") String startDate,@Param(value="endDate") String endDate,
@Param(value="dataViewName3a24") String dataViewName3a24,
@Param(value="dataViewName2119") String dataViewName2119,
@Param(value="dataViewName9bff") String dataViewName9bff);
List<DepartWeekReportVO> getWeekReportData(@Param(value="startDate") String startDate, @Param(value="endDate") String endDate,
@Param(value="dataViewName3a24") String dataViewName3a24,
@Param(value="dataViewName2119") String dataViewName2119);
List<JnhbReportData> getJnhbReport(@Param(value="dataViewName2") String dataViewName2, @Param(value="dataViewName3") String dataViewName3,
@Param(value="start") String start, @Param(value="end") String end, @Param(value="departIds") String departIds);
......
......@@ -208,23 +208,28 @@
sys_depart d
LEFT JOIN (SELECT * FROM view_30a8 WHERE depart_id = #{departId} AND time = #{dataTime} AND zs = #{week}) v3 on v3.depart_id = d.id
LEFT JOIN (SELECT
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,
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,
depart_id
FROM view_9bff
WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v9 on v9.depart_id = d.id
ROUND(AVG(v.JSCOD),2) JSCOD,ROUND(AVG(v.JSAD),2) JSAD,ROUND(AVG(v.JSPH),2) JSPH,
ROUND(AVG(v.JSZD),2) JSZD,ROUND(AVG(v.JSZL),2) JSZL,ROUND(AVG(v.JSSS),2) JSSS,
ROUND(AVG(v.CSCOD),2) CSCOD,ROUND(AVG(v.CSAD),2) CSAD,ROUND(AVG(v.CSPH),2) CSPH,
ROUND(AVG(v.CSTN),2) CSTN,ROUND(AVG(v.CSZL),2) CSZL,ROUND(AVG(v.CSSS),2) CSSS,
v.depart_id
FROM ${dataViewName9bff} v
WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v9 on v9.depart_id = d.id
LEFT JOIN (SELECT
SUM(DLHJ) dlhj,(SUM( PAMRJ ) + SUM( SCLPAMZ ) + SUM( SCLPAMF ) + SUM( NACLO ) + SUM( PACGT ) + SUM( PACYT ) + SUM( PFS ) + SUM( FHTY ) +
SUM( RYXNJ ) + SUM( YWL ) + SUM( GXCLJ ) + SUM( CH3COONA ) + SUM( HXT ) + SUM( FECL3 ) + SUM( SH ) + SUM( CH3COOH ) + SUM( FESO4G ) +
SUM( FESO4Y ) + SUM( H2O2 )) yjhl,SUM(WNL) wnl,depart_id
FROM view_3a24
WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v8 on v8.depart_id = d.id
SUM(IFNULL(v.DLHJ,0)) dlhj,(SUM( IFNULL(v.PAMRJ,0) ) + SUM( IFNULL(v.SCLPAMZ,0) ) +
SUM( IFNULL(v.SCLPAMF,0) ) + SUM( IFNULL(v.NACLO,0) ) + SUM( IFNULL(v.PACGT,0) ) +
SUM( IFNULL(v.PACYT,0) ) + SUM( IFNULL(v.PFS,0) ) + SUM( IFNULL(v.FHTY,0) ) +SUM( IFNULL(v.RYXNJ,0) ) +
SUM( IFNULL(v.YWL,0) ) + SUM( IFNULL(v.GXCLJ,0) ) + SUM( IFNULL(v.CH3COONA,0) ) + SUM( IFNULL(v.HXT,0) ) +
SUM( IFNULL(v.FECL3,0) ) + SUM( IFNULL(v.SH,0) ) + SUM( IFNULL(v.CH3COOH,0) ) + SUM( IFNULL(v.FESO4G,0) ) +
SUM( IFNULL(v.FESO4Y,0) ) + SUM( IFNULL(v.H2O2,0) )) yjhl,SUM(IFNULL(v.WNL,0)) wnl,v.depart_id
FROM ${dataViewName3a24} v
WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v8 on v8.depart_id = d.id
LEFT JOIN (SELECT
SUM(CSL) zclsl,
ROUND(AVG(CSL),2) rjclsl,
depart_id
FROM view_2119
WHERE depart_id = #{departId} AND time &gt;= #{startDate} AND time &lt;= #{endDate} ) v2 on v2.depart_id = d.id
SUM(v.CSL) zclsl,
ROUND(AVG(v.CSL),2) rjclsl,
v.depart_id
FROM ${dataViewName2119} v
WHERE v.depart_id = #{departId} AND v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} ) v2 on v2.depart_id = d.id
LEFT JOIN sys_factory_info f on f.depart_id = d.id
LEFT JOIN report_target_config t on t.depart_id = d.id
WHERE
......@@ -242,12 +247,12 @@
FROM
sys_depart d
left join sys_factory_info f on f.depart_id = d.id
left join (select depart_id,ROUND(SUM(WNL),2) wnl,ROUND(SUM(DLHJ),2) hdl
from view_3a24
where time &gt;= #{startDate} AND time &lt;= #{endDate} GROUP BY depart_id) v3 on v3.depart_id = d.id
left join (select depart_id, ROUND(AVG(CSL)/10000,2) AS rjclsl, ROUND(SUM(CSL),2) AS zclsl
from view_2119
where time &gt;= #{startDate} AND time &lt;= #{endDate} GROUP BY depart_id) v2 on v2.depart_id = d.id
left join (select v.depart_id,ROUND(SUM(v.WNL),2) wnl,ROUND(SUM(v.DLHJ),2) hdl
from ${dataViewName3a24} v
where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v3 on v3.depart_id = d.id
left join (select v.depart_id, ROUND(AVG(v.CSL)/10000,2) AS rjclsl, ROUND(SUM(v.CSL),2) AS zclsl
from ${dataViewName2119} v
where v.time &gt;= #{startDate} AND v.time &lt;= #{endDate} GROUP BY v.depart_id) v2 on v2.depart_id = d.id
WHERE
d.depart_type = 1
ORDER BY
......
......@@ -70,15 +70,8 @@ public class ReportElectricCostController {
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<ReportElectricCost>> result = new Result<IPage<ReportElectricCost>>();
QueryWrapper<ReportElectricCost> queryWrapper = QueryGenerator.initQueryWrapper(reportElectricCost, req.getParameterMap());
if(reportElectricCost.getDepartId()!=null){
queryWrapper.eq("depart_id",reportElectricCost.getDepartId());
}
if(reportElectricCost.getMonth()!=null){
queryWrapper.like("month",reportElectricCost.getMonth());
}
Page<ReportElectricCost> page = new Page<ReportElectricCost>(pageNo, pageSize);
IPage<ReportElectricCost> pageList = reportElectricCostService.page(page, queryWrapper);
IPage<ReportElectricCost> pageList = reportElectricCostService.getPage(page, reportElectricCost);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -2,6 +2,7 @@ package com.skua.modules.report.mapper;
import java.util.List;
import com.skua.tool.annotation.Anonymous;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.ReportElectricCost;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
......@@ -11,4 +12,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface ReportElectricCostMapper extends BaseMapper<ReportElectricCost> {
@Anonymous
List<ReportElectricCost> getPage(@Param("reportElectricCost") ReportElectricCost reportElectricCost);
}
......
......@@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.skua.modules.report.mapper.ReportElectricCostMapper">
</mapper>
\ No newline at end of file
<select id="getPage" resultType="com.skua.modules.report.entity.ReportElectricCost" parameterType="com.skua.modules.report.entity.ReportElectricCost">
select * from report_electric_cost where 1=1
<if test="reportElectricCost.departId!=null and reportElectricCost.departId!=''">
AND depart_id = #{reportElectricCost.departId}
</if>
<if test="reportElectricCost.month!=null and reportElectricCost.month!=''">
AND month like CONCAT(#{reportElectricCost.month},'%')
</if>
</select>
</mapper>
......
package com.skua.modules.report.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.report.entity.ReportElectricCost;
import com.baomidou.mybatisplus.extension.service.IService;
......@@ -8,4 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IReportElectricCostService extends IService<ReportElectricCost> {
IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost);
}
......
package com.skua.modules.report.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.report.entity.ReportElectricCost;
import com.skua.modules.report.mapper.ReportElectricCostMapper;
import com.skua.modules.report.service.IReportElectricCostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
* 月度电费报表
*/
@Service
public class ReportElectricCostServiceImpl extends ServiceImpl<ReportElectricCostMapper, ReportElectricCost> implements IReportElectricCostService {
@Autowired
private ReportElectricCostMapper reportElectricCostMapper;
@Override
public IPage<ReportElectricCost> getPage(Page<ReportElectricCost> page, ReportElectricCost reportElectricCost) {
// if(reportElectricCost.getDepartId()!=null){
// queryWrapper.eq("depart_id",reportElectricCost.getDepartId());
// }
// if(reportElectricCost.getMonth()!=null){
// queryWrapper.like("month",reportElectricCost.getMonth());
// }
List<ReportElectricCost> list = new ArrayList<>();
list = reportElectricCostMapper.getPage(reportElectricCost);
page.setRecords(list);
return page;
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!