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
7b11519b
Commit
7b11519b
authored
Apr 13, 2018
by
jichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
energy_count_m表更改字段
parent
e0d5f18b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
153 additions
and
24 deletions
+153
-24
OverViewController.java
...soft/business/overview/controller/OverViewController.java
+18
-1
BusProjectAreaRepository.java
...isoft/business/overview/dao/BusProjectAreaRepository.java
+27
-0
EnergyCountMRepository.java
...rcisoft/business/overview/dao/EnergyCountMRepository.java
+3
-3
BusProjectArea.java
.../org/rcisoft/business/overview/entity/BusProjectArea.java
+41
-0
EnergyCountM.java
...va/org/rcisoft/business/overview/entity/EnergyCountM.java
+1
-1
OverViewService.java
...rg/rcisoft/business/overview/service/OverViewService.java
+7
-0
OverViewServiceImpl.java
...t/business/overview/service/impl/OverViewServiceImpl.java
+39
-17
BusProjectAreaMapper.xml
...urces/mapper/sys/overview.mapper/BusProjectAreaMapper.xml
+15
-0
EnergyCountMMapper.xml
...sources/mapper/sys/overview.mapper/EnergyCountMMapper.xml
+2
-2
No files found.
src/main/java/org/rcisoft/business/overview/controller/OverViewController.java
View file @
7b11519b
...
...
@@ -94,6 +94,23 @@ public class OverViewController {
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
overViewServiceImpl
.
getPriceRank
(
proId
,
type
,
date
));
}
/** ------------------------------------ */
/** -------------用能比较--------------- */
@ApiOperation
(
value
=
"建筑单位面积用量标准"
,
notes
=
"水电气的行业标准、建议标准、国家标准"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"proId"
,
value
=
"项目类型主键"
,
required
=
true
,
dataType
=
"字符串"
)})
@RequestMapping
(
"/getStandard"
)
public
Result
getStandard
(
@RequestParam
String
proId
)
{
return
Result
.
builder
(
new
PersistModel
(
1
),
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
overViewServiceImpl
.
getStandard
(
proId
));
}
/**
* @param proId 项目主键
* @return
*/
@ApiOperation
(
value
=
"建筑单位面积用量年度"
,
notes
=
"建筑单位面积用量"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"proId"
,
value
=
"项目类型主键"
,
required
=
true
,
dataType
=
"字符串"
)})
@RequestMapping
(
"/getUnitArea"
)
public
Result
getUnitArea
(
@RequestParam
String
proId
)
{
return
null
;
}
}
src/main/java/org/rcisoft/business/overview/dao/BusProjectAreaRepository.java
0 → 100644
View file @
7b11519b
package
org
.
rcisoft
.
business
.
overview
.
dao
;
import
org.rcisoft.business.overview.entity.BusProjectArea
;
import
org.rcisoft.core.base.BaseMapper
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* Created with on 2018-4-13 13:51:00.
*/
@Repository
public
interface
BusProjectAreaRepository
extends
BaseMapper
<
BusProjectArea
>
{
/**
* 查询水电气的用量标准信息、建筑面积
* @param busProjectArea
* @return
*/
@Select
(
"<script>select * from bus_project_area b where b.PRO_ID=#{proId}</script>"
)
@ResultMap
(
value
=
"BaseResultMap"
)
List
<
BusProjectArea
>
queryBusProjectAreas
(
BusProjectArea
busProjectArea
);
}
src/main/java/org/rcisoft/business/overview/dao/EnergyCountMRepository.java
View file @
7b11519b
...
...
@@ -38,12 +38,12 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
* @param energyCountMVo
* @return
*/
@Select
(
"<script>select e.
MIN
,"
+
@Select
(
"<script>select e.
HOUR
,"
+
"<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} and e.`DAY`=#{day} group by e.
MIN
</script>"
)
" where e.PRO_ID=#{proId} and e.`YEAR`=#{year} and e.MON=#{mon} and e.`DAY`=#{day} group by e.
HOUR
</script>"
)
@ResultMap
(
"resultMapVo"
)
List
<
EnergyCountMVo
>
countDailyPrice
(
EnergyCountMVo
energyCountMVo
);
...
...
@@ -72,7 +72,7 @@ public interface EnergyCountMRepository extends BaseMapper<EnergyCountM> {
"<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}"
+
"<if test=\"
min != null\"> and e.MIN <= #{min
}</if>"
+
"<if test=\"
hour != null\"> and e.HOUR <= #{hour
}</if>"
+
" group by e.`DAY`) a order by a.MONEY desc</script>"
)
@ResultMap
(
"resultMapVo"
)
List
<
EnergyCountMVo
>
getPriceRank
(
EnergyCountMVo
energyCountMVo
);
...
...
src/main/java/org/rcisoft/business/overview/entity/BusProjectArea.java
0 → 100644
View file @
7b11519b
package
org
.
rcisoft
.
business
.
overview
.
entity
;
import
lombok.*
;
import
org.rcisoft.core.entity.IdNotDataEntity
;
import
javax.persistence.*
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
/**
* Created with on 2018-4-13 13:51:00.
* 建筑单位面积用量标准及面积
*/
@Entity
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"bus_project_area"
)
public
class
BusProjectArea
implements
Serializable
{
@Id
private
String
id
;
private
String
proId
;
private
Float
area
;
private
String
type
;
private
Float
industryStd
;
private
Float
suggestStd
;
private
Float
countryStd
;
}
src/main/java/org/rcisoft/business/overview/entity/EnergyCountM.java
View file @
7b11519b
...
...
@@ -35,7 +35,7 @@ public class EnergyCountM implements Serializable {
private
Float
gas
;
private
String
min
;
private
String
hour
;
private
String
day
;
...
...
src/main/java/org/rcisoft/business/overview/service/OverViewService.java
View file @
7b11519b
...
...
@@ -50,4 +50,11 @@ public interface OverViewService {
*/
Integer
getPriceRank
(
String
proId
,
Integer
type
,
Integer
date
);
/**
* 建筑单位面积用量标准
* @param proId
* @return
*/
Map
<
String
,
Object
>
getStandard
(
String
proId
);
}
src/main/java/org/rcisoft/business/overview/service/impl/OverViewServiceImpl.java
View file @
7b11519b
...
...
@@ -2,8 +2,10 @@ package org.rcisoft.business.overview.service.impl;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.business.overview.dao.BusProjectAreaRepository
;
import
org.rcisoft.business.overview.dao.EnergyCountMRepository
;
import
org.rcisoft.business.overview.dao.EnergyPriceRepository
;
import
org.rcisoft.business.overview.entity.BusProjectArea
;
import
org.rcisoft.business.overview.entity.EnergyCountM
;
import
org.rcisoft.business.overview.entity.EnergyPrice
;
import
org.rcisoft.business.overview.service.OverViewService
;
...
...
@@ -24,6 +26,8 @@ public class OverViewServiceImpl implements OverViewService {
private
EnergyPriceRepository
overViewRepository
;
@Autowired
private
EnergyCountMRepository
energyCountMRepository
;
@Autowired
private
BusProjectAreaRepository
busProjectAreaRepository
;
private
Calendar
getBeforeDay
(
Calendar
cl
,
int
time
){
int
day
=
cl
.
get
(
Calendar
.
DATE
);
...
...
@@ -42,16 +46,8 @@ public class OverViewServiceImpl implements OverViewService {
return
result
;
}
@Override
public
Map
<
String
,
Object
>
getPrice
(
String
proId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
List
<
EnergyPrice
>
list
=
overViewRepository
.
getPrice
(
proId
);
Iterator
<
EnergyPrice
>
it
=
list
.
iterator
();
//定义一个变量
String
type
=
""
;
while
(
it
.
hasNext
())
{
EnergyPrice
energyPrice
=
it
.
next
();
switch
(
energyPrice
.
getPTp
())
{
private
String
getType
(
String
type
)
{
switch
(
type
)
{
case
"1"
:
//水
type
=
"water"
;
break
;
...
...
@@ -62,9 +58,19 @@ public class OverViewServiceImpl implements OverViewService {
type
=
"gas"
;
break
;
default
:
type
=
""
;
break
;
}
return
type
;
}
@Override
public
Map
<
String
,
Object
>
getPrice
(
String
proId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
List
<
EnergyPrice
>
list
=
overViewRepository
.
getPrice
(
proId
);
Iterator
<
EnergyPrice
>
it
=
list
.
iterator
();
while
(
it
.
hasNext
())
{
EnergyPrice
energyPrice
=
it
.
next
();
String
type
=
this
.
getType
(
energyPrice
.
getPTp
());
if
(
StringUtils
.
isNotEmpty
(
type
))
map
.
put
(
type
,
energyPrice
);
}
return
map
;
...
...
@@ -124,7 +130,7 @@ public class OverViewServiceImpl implements OverViewService {
e
.
setYear
(
cal
.
get
(
"year"
));
e
.
setMon
(
cal
.
get
(
"month"
));
e
.
setDay
(
day
);
if
(
date
!=
0
)
e
.
set
Min
(
cal
.
get
(
"hour"
));
if
(
date
!=
0
)
e
.
set
Hour
(
cal
.
get
(
"hour"
));
List
<
EnergyCountMVo
>
list
=
energyCountMRepository
.
getPriceRank
(
e
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
EnergyCountMVo
energyCountMVo
=
list
.
get
(
i
);
...
...
@@ -134,4 +140,20 @@ public class OverViewServiceImpl implements OverViewService {
}
return
1
;
}
@Override
public
Map
<
String
,
Object
>
getStandard
(
String
proId
)
{
BusProjectArea
b
=
new
BusProjectArea
();
b
.
setProId
(
proId
);
List
<
BusProjectArea
>
list
=
busProjectAreaRepository
.
queryBusProjectAreas
(
b
);
//返回值
Map
<
String
,
Object
>
result
=
new
HashMap
<
String
,
Object
>();
Iterator
<
BusProjectArea
>
it
=
list
.
iterator
();
while
(
it
.
hasNext
())
{
BusProjectArea
busProjectArea
=
it
.
next
();
String
type
=
this
.
getType
(
busProjectArea
.
getType
());
if
(
StringUtils
.
isNotEmpty
(
type
))
result
.
put
(
type
,
busProjectArea
);
}
return
result
;
}
}
src/main/resources/mapper/sys/overview.mapper/BusProjectAreaMapper.xml
0 → 100644
View file @
7b11519b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.overview.dao.BusProjectAreaRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.overview.entity.BusProjectArea"
>
<id
column=
"ID"
jdbcType=
"VARCHAR"
property=
"id"
/>
<result
column=
"PRO_ID"
jdbcType=
"VARCHAR"
property=
"proId"
/>
<result
column=
"AREA"
jdbcType=
"FLOAT"
property=
"area"
/>
<result
column=
"TYPE"
jdbcType=
"CHAR"
property=
"type"
/>
<result
column=
"INDUSTRY_STD"
jdbcType=
"FLOAT"
property=
"industryStd"
/>
<result
column=
"SUGGEST_STD"
jdbcType=
"FLOAT"
property=
"suggestStd"
/>
<result
column=
"COUNTRY_STD"
jdbcType=
"FLOAT"
property=
"countryStd"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
\ No newline at end of file
src/main/resources/mapper/sys/overview.mapper/EnergyCountMMapper.xml
View file @
7b11519b
...
...
@@ -8,7 +8,7 @@
<result
column=
"WATER"
jdbcType=
"FLOAT"
property=
"water"
/>
<result
column=
"ELEC"
jdbcType=
"FLOAT"
property=
"elec"
/>
<result
column=
"GAS"
jdbcType=
"FLOAT"
property=
"gas"
/>
<result
column=
"
MIN"
jdbcType=
"VARCHAR"
property=
"min
"
/>
<result
column=
"
HOUR"
jdbcType=
"VARCHAR"
property=
"hour
"
/>
<result
column=
"DAY"
jdbcType=
"VARCHAR"
property=
"day"
/>
<result
column=
"MON"
jdbcType=
"VARCHAR"
property=
"mon"
/>
<result
column=
"YEAR"
jdbcType=
"VARCHAR"
property=
"year"
/>
...
...
@@ -20,7 +20,7 @@
<resultMap
id=
"resultMapVo"
type=
"org.rcisoft.business.overview.vo.EnergyCountMVo"
>
<result
column=
"DEV_ID"
jdbcType=
"VARCHAR"
property=
"devId"
/>
<result
column=
"
MIN"
jdbcType=
"VARCHAR"
property=
"min
"
/>
<result
column=
"
HOUR"
jdbcType=
"VARCHAR"
property=
"hour
"
/>
<result
column=
"MONEY"
jdbcType=
"DECIMAL"
property=
"money"
/>
<result
column=
"ENERGY"
jdbcType=
"DECIMAL"
property=
"energy"
/>
</resultMap>
...
...
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