549362dd 康伟

kangwei:指挥中心,费用公式修改

1 个父辈 47f70105
...@@ -258,25 +258,26 @@ public class ReportItemvService { ...@@ -258,25 +258,26 @@ public class ReportItemvService {
258 258
259 public List<ReportDateTrendVO> getDateFieldList(String reportId, String field, String departId , String startTime , String endTime){ 259 public List<ReportDateTrendVO> getDateFieldList(String reportId, String field, String departId , String startTime , String endTime){
260 String dataViewName2119 = ReportViewUtil.buildView(reportId,field, departId, startTime,endTime); 260 String dataViewName2119 = ReportViewUtil.buildView(reportId,field, departId, startTime,endTime);
261 String sql = "select aaa.time, sum(aaa."+field+") 'value' from " + dataViewName2119+ "aaa group by aaa.time"; 261
262 String sql = "select DATE_FORMAT( aaa.time, '%Y-%m' ) time , ROUND(SUM(IFNULL(aaa."+field+",0)),2) AS 'value' from " + dataViewName2119+ "aaa group by DATE_FORMAT( aaa.time, '%Y-%m' ) ";
262 return getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportDateTrendVO>(ReportDateTrendVO.class)); 263 return getJdbcTemplate().query(sql,new BeanPropertyRowMapper<ReportDateTrendVO>(ReportDateTrendVO.class));
263 } 264 }
264 public String getSumCSL(String departId ,String startTime ,String endTime){ 265 public String getSumCSL(String departId ,String startTime ,String endTime){
265 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime); 266 String dataViewName2119 = ReportViewUtil.buildViewLike(ReportConstant.view2119,"CSL", departId, startTime,endTime);
266 String sql = "select sum(aaa.CSL) from " + dataViewName2119+ "aaa"; 267 String sql = "select ROUND( sum( IFNULL( aaa.CSL,0) ),2) from " + dataViewName2119+ "aaa";
267 String csl = getJdbcTemplate().queryForObject(sql,String.class); 268 String csl = getJdbcTemplate().queryForObject(sql,String.class);
268 return ConvertUtils.getString(csl,"0.00"); 269 return ConvertUtils.getString(csl,"0.00");
269 } 270 }
270 271
271 public String getSumDLHJ(String departId ,String startTime ,String endTime){ 272 public String getSumDLHJ(String departId ,String startTime ,String endTime){
272 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime); 273 String dataViewName3a24 = ReportViewUtil.buildViewLike(ReportConstant.view3a24,"DLHJ", departId, startTime,endTime);
273 String sql = "select sum(aaa.DLHJ) from " + dataViewName3a24+ "aaa"; 274 String sql = "select ROUND( sum( IFNULL( aaa.DLHJ,0) ),2) from " + dataViewName3a24+ "aaa";
274 String dlhj = getJdbcTemplate().queryForObject(sql,String.class); 275 String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
275 return ConvertUtils.getString(dlhj,"0.00"); 276 return ConvertUtils.getString(dlhj,"0.00");
276 } 277 }
277 public String getSumValue(String viewName,String fileds,String departId ,String startTime ,String endTime){ 278 public String getSumValue(String viewName,String fileds,String departId ,String startTime ,String endTime){
278 String dataViewName3a24 = ReportViewUtil.buildViewLike(viewName,fileds, departId, startTime,endTime); 279 String dataViewName3a24 = ReportViewUtil.buildViewLike(viewName,fileds, departId, startTime,endTime);
279 String sql = "select sum(aaa."+fileds+") from " + dataViewName3a24+ "aaa"; 280 String sql = "select ROUND(sum( IFNULL( aaa."+fileds+",0)),2) from " + dataViewName3a24+ "aaa";
280 String dlhj = getJdbcTemplate().queryForObject(sql,String.class); 281 String dlhj = getJdbcTemplate().queryForObject(sql,String.class);
281 return ConvertUtils.getString(dlhj,"0.00"); 282 return ConvertUtils.getString(dlhj,"0.00");
282 } 283 }
......
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
143 report_electric_cost t 143 report_electric_cost t
144 WHERE 144 WHERE
145 t.depart_id in(${departIds}) 145 t.depart_id in(${departIds})
146 and t.month BETWEEN #{startDate} AND ${endDate} 146 and t.month &gt;= #{startDate} AND t.month &lt;= #{endDate}
147 GROUP BY t.month 147 GROUP BY t.month
148 </select> 148 </select>
149 149
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!