Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王夏晖
zhny
Commits
29057a6f
Commit
29057a6f
authored
May 18, 2018
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
能耗管理--运行费用排名 修改接口
parent
191c9498
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
11 deletions
+8
-11
OverViewController.java
...soft/business/overview/controller/OverViewController.java
+4
-3
EnergyCountMRepository.java
...rcisoft/business/overview/dao/EnergyCountMRepository.java
+2
-4
OverViewService.java
...rg/rcisoft/business/overview/service/OverViewService.java
+1
-2
OverViewServiceImpl.java
...t/business/overview/service/impl/OverViewServiceImpl.java
+1
-2
No files found.
src/main/java/org/rcisoft/business/overview/controller/OverViewController.java
View file @
29057a6f
package
org
.
rcisoft
.
business
.
overview
.
controller
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
* Created by JiChao on 2018/4/11.
* 概览接口
*/
@Api
(
tags
=
"能耗管理"
)
@RestController
@RequestMapping
(
"overview"
)
public
class
OverViewController
{
...
...
@@ -61,12 +63,11 @@ public class OverViewController {
@ApiOperation
(
value
=
"运行费用排名"
,
notes
=
"运行费用排名"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"proId"
,
value
=
"项目类型主键"
,
required
=
true
,
dataType
=
"字符串"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"水电气类型,1:水,2:电,3:气"
,
required
=
true
,
dataType
=
"数字"
),
@ApiImplicitParam
(
name
=
"date"
,
value
=
"0:今日,-1:昨日,1:明日"
,
required
=
true
,
dataType
=
"数字"
)
})
@RequestMapping
(
"/getPriceRank"
)
public
Result
getPriceRank
(
@RequestParam
String
proId
,
@RequestParam
Integer
type
,
@RequestParam
Integer
date
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
overViewServiceImpl
.
getPriceRank
(
proId
,
type
,
date
));
public
Result
getPriceRank
(
@RequestParam
String
proId
,
@RequestParam
Integer
date
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
overViewServiceImpl
.
getPriceRank
(
proId
,
date
));
}
/** -------------用能比较--------------- */
...
...
src/main/java/org/rcisoft/business/overview/dao/EnergyCountMRepository.java
View file @
29057a6f
...
...
@@ -79,10 +79,8 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
*/
@Select
(
"<script>select a.* from ("
+
"select e.`DAY`,"
+
"<if test=\"type == 1\">sum(e.WATER_MONEY)</if>"
+
"<if test=\"type == 2\">sum(e.ELEC_MONEY)</if>"
+
"<if test=\"type == 3\">sum(e.GAS_MONEY)</if>"
+
" as MONEY from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon}"
+
"sum(e.WATER_MONEY)+sum(e.ELEC_MONEY)+sum(e.GAS_MONEY) MONEY"
+
" from energy_count_m e where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=${mon}"
+
"<if test=\"hour != null\"> and e.HOUR <= #{hour}</if>"
+
" group by e.`DAY`+0 asc) a order by a.MONEY desc</script>"
)
@ResultMap
(
"resultMapVo"
)
...
...
src/main/java/org/rcisoft/business/overview/service/OverViewService.java
View file @
29057a6f
...
...
@@ -48,11 +48,10 @@ public interface OverViewService {
/**
* 运行费用排名
* @param proId
* @param type
* @param date
* @return
*/
Integer
getPriceRank
(
String
proId
,
Integer
type
,
Integer
date
);
Integer
getPriceRank
(
String
proId
,
Integer
date
);
/**
* 建筑单位面积用量标准
...
...
src/main/java/org/rcisoft/business/overview/service/impl/OverViewServiceImpl.java
View file @
29057a6f
...
...
@@ -368,12 +368,11 @@ public class OverViewServiceImpl implements OverViewService {
}
@Override
public
Integer
getPriceRank
(
String
proId
,
Integer
type
,
Integer
date
)
{
public
Integer
getPriceRank
(
String
proId
,
Integer
date
)
{
Map
<
String
,
String
>
cal
=
this
.
getTime
(
date
);
String
day
=
cal
.
get
(
"day"
);
EnergyCountMVo
e
=
new
EnergyCountMVo
();
e
.
setProId
(
proId
);
e
.
setType
(
type
);
e
.
setYear
(
cal
.
get
(
"year"
));
e
.
setMon
(
cal
.
get
(
"month"
));
e
.
setDay
(
day
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment