Commit 6d84013c authored by ZWT's avatar ZWT

得到的

parent 18a11145
...@@ -483,7 +483,7 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer ...@@ -483,7 +483,7 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
.lineId(lineId) .lineId(lineId)
.stationName(power.getStationName()) .stationName(power.getStationName())
.powerGeneration(power.getPhotovoltaicPower()) .powerGeneration(power.getPhotovoltaicPower())
.powerConsumption(collect.get(lineId)) .powerConsumption(collect.getOrDefault(lineId, BigDecimal.ZERO))
.dataDate(power.getCreateDate()) .dataDate(power.getCreateDate())
.systemSource(oilFieldCode) .systemSource(oilFieldCode)
.build()); .build());
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
ID=#{id} ID=#{id}
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list" databaseId="MySQL">
INSERT INTO ENERGY_CONSUMPTION_ANALYSIS ( ID, LINE_ID, STATION_NAME, POWER_GENERATION, POWER_CONSUMPTION, INSERT INTO ENERGY_CONSUMPTION_ANALYSIS ( ID, LINE_ID, STATION_NAME, POWER_GENERATION, POWER_CONSUMPTION,
DATA_DATE, SYSTEM_SOURCE ) DATA_DATE, SYSTEM_SOURCE )
VALUES VALUES
...@@ -56,4 +56,34 @@ ...@@ -56,4 +56,34 @@
) )
</foreach> </foreach>
</insert> </insert>
<insert id="batchInsertList" parameterType="list" databaseId="Oracle">
INSERT ALL
<foreach collection="list" item="item">
INTO ENERGY_CONSUMPTION_ANALYSIS ( ID,
<if test="item.lineId != null and item.lineId != ''">
LINE_ID,
</if>
STATION_NAME, POWER_GENERATION,
<if test="item.powerConsumption != null">
POWER_CONSUMPTION,
</if>
DATA_DATE, SYSTEM_SOURCE )
VALUES
(
#{item.id},
<if test="item.lineId != null and item.lineId != ''">
#{item.lineId},
</if>
#{item.stationName},
#{item.powerGeneration},
<if test="item.powerConsumption != null">
#{item.powerConsumption},
</if>
#{item.dataDate},
#{item.systemSource}
)
</foreach>
SELECT * FROM DUAL
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
</resultMap> </resultMap>
<select id="selectSumDailyElectricityConsumption" parameterType="date" <select id="selectSumDailyElectricityConsumption" parameterType="date"
resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView"> resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView" databaseId="MySQL">
SELECT W.LINE_ID AS LINE_ID, SELECT W.LINE_ID AS LINE_ID,
L.LINE_NAME AS LINE_NAME, L.LINE_NAME AS LINE_NAME,
IFNULL(SUM(S.DAILY_ELECTRICITY_CONSUMPTION), 0) AS DAILY_ELECTRICITY_CONSUMPTION IFNULL(SUM(S.DAILY_ELECTRICITY_CONSUMPTION), 0) AS DAILY_ELECTRICITY_CONSUMPTION
...@@ -120,9 +120,26 @@ ...@@ -120,9 +120,26 @@
LEFT JOIN BASE_POWER_LINE L ON W.LINE_ID = L.ID LEFT JOIN BASE_POWER_LINE L ON W.LINE_ID = L.ID
WHERE W.IS_DELETED = 1 WHERE W.IS_DELETED = 1
AND S.DATA_DATE = #{date} AND S.DATA_DATE = #{date}
<if test="systemSource != null"> <if test="oilFieldCode != null and oilFieldCode != ''">
AND S.SYSTEM_SOURCE = #{systemSource} AND S.SYSTEM_SOURCE = #{oilFieldCode}
</if> </if>
GROUP BY W.LINE_ID GROUP BY W.LINE_ID
</select> </select>
<select id="selectSumDailyElectricityConsumption" parameterType="date"
resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView" databaseId="Oracle">
SELECT W.LINE_ID AS LINE_ID,
L.LINE_NAME AS LINE_NAME,
NVL(SUM(S.DAILY_ELECTRICITY_CONSUMPTION), 0) AS DAILY_ELECTRICITY_CONSUMPTION
FROM BASE_POWER_LINE_WELLHEAD W
JOIN WELLHEAD_DAILY_PRODUCTION_SITUATION S ON W.WELLHEAD_ID = S.WELLHEAD_ID
LEFT JOIN BASE_POWER_LINE L ON W.LINE_ID = L.ID
WHERE W.IS_DELETED = 1
AND S.DATA_DATE = #{date}
<if test="oilFieldCode != null and oilFieldCode != ''">
AND S.SYSTEM_SOURCE = #{oilFieldCode}
</if>
GROUP BY W.LINE_ID,
L.LINE_NAME
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment