Commit 6d84013c authored by ZWT's avatar ZWT

得到的

parent 18a11145
......@@ -483,7 +483,7 @@ public class ThirdDataAccessCloudServiceImpl implements IThirdDataAccessCloudSer
.lineId(lineId)
.stationName(power.getStationName())
.powerGeneration(power.getPhotovoltaicPower())
.powerConsumption(collect.get(lineId))
.powerConsumption(collect.getOrDefault(lineId, BigDecimal.ZERO))
.dataDate(power.getCreateDate())
.systemSource(oilFieldCode)
.build());
......
......@@ -40,7 +40,7 @@
ID=#{id}
</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,
DATA_DATE, SYSTEM_SOURCE )
VALUES
......@@ -56,4 +56,34 @@
)
</foreach>
</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>
\ No newline at end of file
......@@ -111,7 +111,7 @@
</resultMap>
<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,
L.LINE_NAME AS LINE_NAME,
IFNULL(SUM(S.DAILY_ELECTRICITY_CONSUMPTION), 0) AS DAILY_ELECTRICITY_CONSUMPTION
......@@ -120,9 +120,26 @@
LEFT JOIN BASE_POWER_LINE L ON W.LINE_ID = L.ID
WHERE W.IS_DELETED = 1
AND S.DATA_DATE = #{date}
<if test="systemSource != null">
AND S.SYSTEM_SOURCE = #{systemSource}
<if test="oilFieldCode != null and oilFieldCode != ''">
AND S.SYSTEM_SOURCE = #{oilFieldCode}
</if>
GROUP BY W.LINE_ID
</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>
\ 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