Commit 7002b464 authored by ZWT's avatar ZWT

得到的

parent 65e6ebe2
...@@ -3,37 +3,40 @@ ...@@ -3,37 +3,40 @@
<mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper"> <mapper namespace="pps.core.task.mapper.ConfigTimeTaskViewMapper">
<resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView"> <resultMap id="BaseResultMap" type="pps.core.task.entity.ConfigTimeTaskView">
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="class_path" property="classPath" /> <result column="CLASS_PATH" property="classPath" />
<result column="method_name" property="methodName" /> <result column="METHOD_NAME" property="methodName" />
<result column="other_param" property="otherParam" /> <result column="OTHER_PARAM" property="otherParam" />
<result column="scheduling_pattern" property="schedulingPattern" /> <result column="SCHEDULING_PATTERN" property="schedulingPattern" />
<result column="task_describe" property="taskDescribe" /> <result column="TASK_DESCRIBE" property="taskDescribe" />
<result column="IS_ENABLE" property="isEnable" /> <result column="IS_ENABLE" property="isEnable" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
class_path, CLASS_PATH,
method_name, METHOD_NAME,
other_param, OTHER_PARAM,
scheduling_pattern, SCHEDULING_PATTERN,
task_describe, TASK_DESCRIBE,
IS_ENABLE, IS_ENABLE,
SYSTEM_SOURCE SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from CONFIG_TIME_TASK FROM CONFIG_TIME_TASK
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.task.entity.ConfigTimeTaskView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from CONFIG_TIME_TASK FROM CONFIG_TIME_TASK
where WHERE
id=#{id} ID=#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -5,60 +5,63 @@ ...@@ -5,60 +5,63 @@
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="TOTAL_POWER" property="totalPower" /> <result column="TOTAL_POWER" property="totalPower" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="municipal_power" property="municipalPower" /> <result column="MUNICIPAL_POWER" property="municipalPower" />
<result column="last_total_power" property="lastTotalPower" /> <result column="LAST_TOTAL_POWER" property="lastTotalPower" />
<result column="last_photovoltaic_power" property="lastPhotovoltaicPower" /> <result column="LAST_PHOTOVOLTAIC_POWER" property="lastPhotovoltaicPower" />
<result column="last_municipal_power" property="lastMunicipalPower" /> <result column="LAST_MUNICIPAL_POWER" property="lastMunicipalPower" />
<result column="total_ratio" property="totalRatio" /> <result column="TOTAL_RATIO" property="totalRatio" />
<result column="photovoltaic_ratio" property="photovoltaicRatio" /> <result column="PHOTOVOLTAIC_RATIO" property="photovoltaicRatio" />
<result column="municipal_ratio" property="municipalRatio" /> <result column="MUNICIPAL_RATIO" property="municipalRatio" />
<result column="valley_electric_open_hour" property="valleyElectricOpenHour" /> <result column="VALLEY_ELECTRIC_OPEN_HOUR" property="valleyElectricOpenHour" />
<result column="valley_electric_rate" property="valleyElectricRate" /> <result column="VALLEY_ELECTRIC_RATE" property="valleyElectricRate" />
<result column="sum_run_duration" property="sumRunDuration" /> <result column="SUM_RUN_DURATION" property="sumRunDuration" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
STATION_NAME, STATION_NAME,
TOTAL_POWER, TOTAL_POWER,
photovoltaic_power, PHOTOVOLTAIC_POWER,
municipal_power, MUNICIPAL_POWER,
last_total_power, LAST_TOTAL_POWER,
last_photovoltaic_power, LAST_PHOTOVOLTAIC_POWER,
last_municipal_power, LAST_MUNICIPAL_POWER,
total_ratio, TOTAL_RATIO,
photovoltaic_ratio, PHOTOVOLTAIC_RATIO,
municipal_ratio, MUNICIPAL_RATIO,
valley_electric_open_hour, VALLEY_ELECTRIC_OPEN_HOUR,
valley_electric_rate, VALLEY_ELECTRIC_RATE,
sum_run_duration, SUM_RUN_DURATION,
create_date, CREATE_DATE,
SYSTEM_SOURCE SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectOne" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from LINE_DAILY_ELECTRICITY_TREND FROM LINE_DAILY_ELECTRICITY_TREND
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectList" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from LINE_DAILY_ELECTRICITY_TREND FROM LINE_DAILY_ELECTRICITY_TREND
where WHERE
id=#{id} ID=#{id}
</select> </select>
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO LINE_DAILY_ELECTRICITY_TREND (STATION_NAME, TOTAL_POWER, photovoltaic_power, municipal_power, INSERT INTO LINE_DAILY_ELECTRICITY_TREND (STATION_NAME, TOTAL_POWER, PHOTOVOLTAIC_POWER, MUNICIPAL_POWER,
last_total_power, last_photovoltaic_power, last_municipal_power, total_ratio, photovoltaic_ratio, LAST_TOTAL_POWER, LAST_PHOTOVOLTAIC_POWER, LAST_MUNICIPAL_POWER, TOTAL_RATIO, PHOTOVOLTAIC_RATIO,
municipal_ratio, valley_electric_open_hour, valley_electric_rate, sum_run_duration, create_date, SYSTEM_SOURCE) MUNICIPAL_RATIO, VALLEY_ELECTRIC_OPEN_HOUR, VALLEY_ELECTRIC_RATE, SUM_RUN_DURATION, CREATE_DATE, SYSTEM_SOURCE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -84,11 +87,11 @@ ...@@ -84,11 +87,11 @@
<select id="selectDailyElectricityTrend" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectDailyElectricityTrend" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT SELECT
IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power, IFNULL( SUM( PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER,
IFNULL( SUM( municipal_power ), 0 ) AS municipal_power, IFNULL( SUM( MUNICIPAL_POWER ), 0 ) AS MUNICIPAL_POWER,
IFNULL( SUM( last_photovoltaic_power ), 0 ) AS last_photovoltaic_power, IFNULL( SUM( LAST_PHOTOVOLTAIC_POWER ), 0 ) AS LAST_PHOTOVOLTAIC_POWER,
IFNULL( SUM( last_municipal_power ), 0 ) AS last_municipal_power, IFNULL( SUM( LAST_MUNICIPAL_POWER ), 0 ) AS LAST_MUNICIPAL_POWER,
DATE( create_date ) AS create_date DATE( CREATE_DATE ) AS CREATE_DATE
FROM FROM
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
...@@ -99,33 +102,33 @@ ...@@ -99,33 +102,33 @@
<if test="systemSource != null"> <if test="systemSource != null">
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
AND create_date BETWEEN #{startTime} AND CREATE_DATE BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
GROUP BY GROUP BY
DATE( create_date ) DATE( CREATE_DATE )
ORDER BY ORDER BY
create_date CREATE_DATE
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.LineDailyElectricityTrendView" extends="BaseResultMap">
<result column="day_flag" property="dayFlag" /> <result column="DAY_FLAG" property="dayFlag" />
</resultMap> </resultMap>
<select id="selectValleyElectricRate" parameterType="pps.core.space.entity.LineDailyElectricityTrendView" <select id="selectValleyElectricRate" parameterType="pps.core.space.entity.LineDailyElectricityTrendView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
z.day_flag, Z.DAY_FLAG,
IFNULL( ROUND( z.valley_electric_open_hour / z.sum_run_duration * 100, 2 ), 0 ) AS valley_electric_rate IFNULL( ROUND( Z.VALLEY_ELECTRIC_OPEN_HOUR / Z.SUM_RUN_DURATION * 100, 2 ), 0 ) AS VALLEY_ELECTRIC_RATE
FROM FROM
( (
SELECT SELECT
IFNULL( SUM( valley_electric_open_hour ), 0 ) AS valley_electric_open_hour, IFNULL( SUM( VALLEY_ELECTRIC_OPEN_HOUR ), 0 ) AS VALLEY_ELECTRIC_OPEN_HOUR,
IFNULL( SUM( sum_run_duration ), 0 ) AS sum_run_duration, IFNULL( SUM( SUM_RUN_DURATION ), 0 ) AS SUM_RUN_DURATION,
1 AS day_flag 1 AS DAY_FLAG
FROM FROM
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{createDate} DATE ( CREATE_DATE ) = #{createDate}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
...@@ -133,13 +136,13 @@ ...@@ -133,13 +136,13 @@
</foreach> </foreach>
UNION ALL UNION ALL
SELECT SELECT
IFNULL( SUM( valley_electric_open_hour ), 0 ) AS valley_electric_open_hour, IFNULL( SUM( VALLEY_ELECTRIC_OPEN_HOUR ), 0 ) AS VALLEY_ELECTRIC_OPEN_HOUR,
IFNULL( SUM( sum_run_duration ), 0 ) AS sum_run_duration, IFNULL( SUM( SUM_RUN_DURATION ), 0 ) AS SUM_RUN_DURATION,
2 AS day_flag 2 AS DAY_FLAG
FROM FROM
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{startTime} DATE ( CREATE_DATE ) = #{startTime}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
...@@ -147,18 +150,18 @@ ...@@ -147,18 +150,18 @@
</foreach> </foreach>
UNION ALL UNION ALL
SELECT SELECT
IFNULL( SUM( valley_electric_open_hour ), 0 ) AS valley_electric_open_hour, IFNULL( SUM( VALLEY_ELECTRIC_OPEN_HOUR ), 0 ) AS VALLEY_ELECTRIC_OPEN_HOUR,
IFNULL( SUM( sum_run_duration ), 0 ) AS sum_run_duration, IFNULL( SUM( SUM_RUN_DURATION ), 0 ) AS SUM_RUN_DURATION,
3 AS day_flag 3 AS DAY_FLAG
FROM FROM
LINE_DAILY_ELECTRICITY_TREND LINE_DAILY_ELECTRICITY_TREND
WHERE WHERE
DATE ( create_date ) = #{endTime} DATE ( CREATE_DATE ) = #{endTime}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
) z ) Z
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -11,61 +11,62 @@ ...@@ -11,61 +11,62 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="execution_cycle" property="executionCycle" /> <result column="EXECUTION_CYCLE" property="executionCycle" />
<result column="calibration_date" property="calibrationDate" /> <result column="CALIBRATION_DATE" property="calibrationDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
line_id, LINE_ID,
institution_id, INSTITUTION_ID,
execution_cycle, EXECUTION_CYCLE,
calibration_date CALIBRATION_DATE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_CALIBRATION_HISTORY FROM SPACE_CALIBRATION_HISTORY
where WHERE
id=#{id} ID=#{id}
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceCalibrationHistoryView" extends="BaseResultMap">
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationHistoryView" resultMap="BaseResultMap">
SELECT h.id, SELECT H.ID,
h.line_id, H.LINE_ID,
h.institution_id, H.INSTITUTION_ID,
h.execution_cycle, H.EXECUTION_CYCLE,
h.calibration_date, H.CALIBRATION_DATE,
d.ou_id, D.OU_ID,
d.grid_type_key, D.GRID_TYPE_KEY,
d.institution_name D.INSTITUTION_NAME
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL D
JOIN SPACE_CALIBRATION_HISTORY h ON d.id = h.institution_id JOIN SPACE_CALIBRATION_HISTORY H ON D.ID = H.INSTITUTION_ID
WHERE h.is_deleted = 1 WHERE H.IS_DELETED = 1
AND d.is_deleted = 1 AND D.IS_DELETED = 1
AND d.is_current_basic = 0 AND D.IS_CURRENT_BASIC = 0
AND h.line_id = #{lineId} AND H.LINE_ID = #{lineId}
ORDER BY h.calibration_date DESC ORDER BY H.CALIBRATION_DATE DESC
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO SPACE_CALIBRATION_HISTORY ( id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO SPACE_CALIBRATION_HISTORY ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, line_id, institution_id, execution_cycle, calibration_date ) MODIFY_BY_NAME, MODIFY_TIME, LINE_ID, INSTITUTION_ID, EXECUTION_CYCLE, CALIBRATION_DATE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -12,34 +12,37 @@ ...@@ -12,34 +12,37 @@
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="day_number" property="dayNumber" /> <result column="DAY_NUMBER" property="dayNumber" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
line_id, LINE_ID,
day_number DAY_NUMBER
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceCalibrationPeriodView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceCalibrationPeriodView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_CALIBRATION_PERIOD FROM SPACE_CALIBRATION_PERIOD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationPeriodView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceCalibrationPeriodView" resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_CALIBRATION_PERIOD FROM SPACE_CALIBRATION_PERIOD
where WHERE
id=#{id} ID=#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,126 +2,129 @@ ...@@ -2,126 +2,129 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pps.core.space.mapper.SpaceInstitutionDetailViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceInstitutionDetailViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView">
<id column="ID" property="id" /> <id column="ID" property="id"/>
<result column="IS_DELETED" property="isDeleted" /> <result column="IS_DELETED" property="isDeleted"/>
<result column="CREATE_BY_ID" property="createById" /> <result column="CREATE_BY_ID" property="createById"/>
<result column="CREATE_BY_NAME" property="createByName" /> <result column="CREATE_BY_NAME" property="createByName"/>
<result column="CREATE_TIME" property="createTime" /> <result column="CREATE_TIME" property="createTime"/>
<result column="MODIFY_BY_ID" property="modifyById" /> <result column="MODIFY_BY_ID" property="modifyById"/>
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName"/>
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime"/>
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId"/>
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId"/>
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey"/>
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName"/>
<result column="institution_start_date" property="institutionStartDate" /> <result column="INSTITUTION_START_DATE" property="institutionStartDate"/>
<result column="institution_end_date" property="institutionEndDate" /> <result column="INSTITUTION_END_DATE" property="institutionEndDate"/>
<result column="optimize_deadline" property="optimizeDeadline" /> <result column="OPTIMIZE_DEADLINE" property="optimizeDeadline"/>
<result column="optimize_state" property="optimizeState" /> <result column="OPTIMIZE_STATE" property="optimizeState"/>
<result column="is_current_basic" property="isCurrentBasic" /> <result column="IS_CURRENT_BASIC" property="isCurrentBasic"/>
<result column="START_INTERVAL" property="startInterval" /> <result column="START_INTERVAL" property="startInterval"/>
<result column="tundra_strategy" property="tundraStrategy" /> <result column="TUNDRA_STRATEGY" property="tundraStrategy"/>
<result column="optimize_type" property="optimizeType" /> <result column="OPTIMIZE_TYPE" property="optimizeType"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id ID
, ,
is_deleted, IS_DELETED,
create_by_id, CREATE_BY_ID,
create_by_name, CREATE_BY_NAME,
create_time, CREATE_TIME,
modify_by_id, MODIFY_BY_ID,
modify_by_name, MODIFY_BY_NAME,
modify_time, MODIFY_TIME,
ou_id, OU_ID,
line_id, LINE_ID,
grid_type_key, GRID_TYPE_KEY,
institution_name, INSTITUTION_NAME,
institution_start_date, INSTITUTION_START_DATE,
institution_end_date, INSTITUTION_END_DATE,
optimize_deadline, OPTIMIZE_DEADLINE,
optimize_state, OPTIMIZE_STATE,
is_current_basic, IS_CURRENT_BASIC,
START_INTERVAL, START_INTERVAL,
tundra_strategy, TUNDRA_STRATEGY,
optimize_type OPTIMIZE_TYPE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceInstitutionDetailView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceInstitutionDetailView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_INSTITUTION_DETAIL FROM SPACE_INSTITUTION_DETAIL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView" <select id="selectList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_INSTITUTION_DETAIL FROM SPACE_INSTITUTION_DETAIL
where WHERE
id=#{id} ID=#{id}
</select> </select>
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceInstitutionDetailView" extends="BaseResultMap">
<result column="long_period_id" property="longPeriodId" /> <result column="LONG_PERIOD_ID" property="longPeriodId"/>
<result column="long_execution_cycle" property="longExecutionCycle" /> <result column="LONG_EXECUTION_CYCLE" property="longExecutionCycle"/>
<result column="long_optimize_deadline" property="longOptimizeDeadline" /> <result column="LONG_OPTIMIZE_DEADLINE" property="longOptimizeDeadline"/>
<result column="mid_period_id" property="midPeriodId" /> <result column="MID_PERIOD_ID" property="midPeriodId"/>
<result column="mid_execution_cycle" property="midExecutionCycle" /> <result column="MID_EXECUTION_CYCLE" property="midExecutionCycle"/>
<result column="mid_optimize_deadline" property="midOptimizeDeadline" /> <result column="MID_OPTIMIZE_DEADLINE" property="midOptimizeDeadline"/>
</resultMap> </resultMap>
<select id="selectOptimizeHistoryList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView" <select id="selectOptimizeHistoryList" parameterType="pps.core.space.entity.SpaceInstitutionDetailView"
resultMap="ExtendResultMap"> resultMap="ExtendResultMap">
WITH institution_detail AS (SELECT id, WITH INSTITUTION_DETAIL AS (SELECT ID,
ou_id, OU_ID,
line_id, LINE_ID,
grid_type_key, GRID_TYPE_KEY,
institution_name, INSTITUTION_NAME,
institution_start_date, INSTITUTION_START_DATE,
institution_end_date, INSTITUTION_END_DATE,
optimize_deadline, OPTIMIZE_DEADLINE,
optimize_state, OPTIMIZE_STATE,
is_current_basic, IS_CURRENT_BASIC,
START_INTERVAL START_INTERVAL
FROM SPACE_INSTITUTION_DETAIL FROM SPACE_INSTITUTION_DETAIL
WHERE is_current_basic = 0 WHERE IS_CURRENT_BASIC = 0
AND is_deleted = 1 AND IS_DELETED = 1
AND ou_id = #{ouId}), AND OU_ID = #{ouId}),
long_period LONG_PERIOD
AS (SELECT row_number() over ( PARTITION BY institution_id ORDER BY optimize_deadline DESC ) AS line_number,id, AS (SELECT ROW_NUMBER() OVER ( PARTITION BY INSTITUTION_ID ORDER BY OPTIMIZE_DEADLINE DESC ) AS LINE_NUMBER,ID,
institution_id, INSTITUTION_ID,
execution_cycle, EXECUTION_CYCLE,
optimize_state, OPTIMIZE_STATE,
optimize_deadline OPTIMIZE_DEADLINE
FROM SPACE_OPTIMIZE_ULTRA_PERIOD FROM SPACE_OPTIMIZE_ULTRA_PERIOD
WHERE institution_id IN (SELECT id FROM institution_detail) WHERE INSTITUTION_ID IN (SELECT ID FROM INSTITUTION_DETAIL)
AND is_deleted = 1), AND IS_DELETED = 1),
mid_period MID_PERIOD
AS (SELECT row_number() over ( PARTITION BY institution_id ORDER BY optimize_date DESC ) AS line_number,id, AS (SELECT ROW_NUMBER() OVER ( PARTITION BY INSTITUTION_ID ORDER BY OPTIMIZE_DATE DESC ) AS LINE_NUMBER,ID,
institution_id, INSTITUTION_ID,
optimize_date AS execution_cycle, OPTIMIZE_DATE AS EXECUTION_CYCLE,
optimize_state, OPTIMIZE_STATE,
optimize_date AS optimize_deadline OPTIMIZE_DATE AS OPTIMIZE_DEADLINE
FROM SPACE_OPTIMIZE_SHORT_PERIOD FROM SPACE_OPTIMIZE_SHORT_PERIOD
WHERE institution_id IN (SELECT id FROM institution_detail) WHERE INSTITUTION_ID IN (SELECT ID FROM INSTITUTION_DETAIL)
AND is_deleted = 1) AND IS_DELETED = 1)
SELECT d.id, SELECT D.ID,
d.ou_id, D.OU_ID,
d.line_id, D.LINE_ID,
d.grid_type_key, D.GRID_TYPE_KEY,
d.institution_name, D.INSTITUTION_NAME,
l.id AS long_period_id, L.ID AS LONG_PERIOD_ID,
l.execution_cycle AS long_execution_cycle, L.EXECUTION_CYCLE AS LONG_EXECUTION_CYCLE,
l.optimize_deadline AS long_optimize_deadline, L.OPTIMIZE_DEADLINE AS LONG_OPTIMIZE_DEADLINE,
m.id AS mid_period_id, M.ID AS MID_PERIOD_ID,
m.execution_cycle AS mid_execution_cycle, M.EXECUTION_CYCLE AS MID_EXECUTION_CYCLE,
m.optimize_deadline AS mid_optimize_deadline M.OPTIMIZE_DEADLINE AS MID_OPTIMIZE_DEADLINE
FROM institution_detail d FROM INSTITUTION_DETAIL D
LEFT JOIN long_period l ON d.id = l.institution_id LEFT JOIN LONG_PERIOD L ON D.ID = L.INSTITUTION_ID
AND l.line_number = 1 AND L.LINE_NUMBER = 1
LEFT JOIN mid_period m ON d.id = m.institution_id LEFT JOIN MID_PERIOD M ON D.ID = M.INSTITUTION_ID
AND m.line_number = 1 AND M.LINE_NUMBER = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<result column="MODIFY_BY_ID" property="modifyById" /> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="config_id" property="configId" /> <result column="config_id" property="configId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="generation_type_key" property="generationTypeKey" /> <result column="generation_type_key" property="generationTypeKey" />
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, INSTITUTION_ID,
config_id, config_id,
WELLHEAD_ID, WELLHEAD_ID,
generation_type_key, generation_type_key,
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, INSTITUTION_ID,
config_id, config_id,
WELLHEAD_ID, WELLHEAD_ID,
generation_type_key, generation_type_key,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<result column="MODIFY_BY_ID" property="modifyById" /> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="WELL_NUMBER" property="wellNumber" /> <result column="WELL_NUMBER" property="wellNumber" />
<result column="RUN_TYPE_KEY" property="runTypeKey" /> <result column="RUN_TYPE_KEY" property="runTypeKey" />
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, INSTITUTION_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
RUN_TYPE_KEY, RUN_TYPE_KEY,
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
institution_id, INSTITUTION_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
RUN_TYPE_KEY, RUN_TYPE_KEY,
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT SELECT
DISTINCT DISTINCT
institution_id, INSTITUTION_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
RUN_TYPE_KEY, RUN_TYPE_KEY,
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
SPACE_INSTITUTION_WELLHEAD SPACE_INSTITUTION_WELLHEAD
WHERE WHERE
is_deleted = 1 is_deleted = 1
AND institution_id IN AND INSTITUTION_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
<select id="selectWellheadsByInstitutionIds" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView" <select id="selectWellheadsByInstitutionIds" parameterType="pps.core.space.entity.SpaceInstitutionWellheadView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
w.institution_id, w.INSTITUTION_ID,
w.WELLHEAD_ID, w.WELLHEAD_ID,
w.WELL_NUMBER, w.WELL_NUMBER,
w.RUN_TYPE_KEY, w.RUN_TYPE_KEY,
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
w.is_deleted = 1 w.is_deleted = 1
AND b.is_deleted = 1 AND b.is_deleted = 1
<if test="list != null and list.size()>0"> <if test="list != null and list.size()>0">
AND w.institution_id IN AND w.INSTITUTION_ID IN
<foreach collection="list" open="(" close=")" separator="," item="item"> <foreach collection="list" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
...@@ -196,10 +196,10 @@ ...@@ -196,10 +196,10 @@
w.max_close, w.max_close,
w.min_close w.min_close
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL d
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON d.id = w.institution_id LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON d.id = w.INSTITUTION_ID
WHERE d.is_deleted = 1 WHERE d.is_deleted = 1
AND d.is_current_basic = 0 AND d.IS_CURRENT_BASIC = 0
AND d.institution_end_date &gt; NOW() AND d.INSTITUTION_END_DATE &gt; NOW()
AND w.is_deleted = 1 AND w.is_deleted = 1
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" /> <result column="record_id" property="recordId" />
<result column="long_period_id" property="longPeriodId" /> <result column="LONG_PERIOD_ID" property="longPeriodId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" /> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" /> <result column="generation_type_key" property="generationTypeKey" />
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
record_id, record_id,
long_period_id, LONG_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
record_id, record_id,
long_period_id, LONG_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="execution_cycle" property="executionCycle" /> <result column="EXECUTION_CYCLE" property="executionCycle" />
<result column="optimize_state" property="optimizeState" /> <result column="OPTIMIZE_STATE" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" /> <result column="OPTIMIZE_DEADLINE" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
line_id, line_id,
institution_id, INSTITUTION_ID,
execution_cycle, EXECUTION_CYCLE,
optimize_state, OPTIMIZE_STATE,
optimize_deadline OPTIMIZE_DEADLINE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap">
select select
...@@ -43,21 +43,21 @@ ...@@ -43,21 +43,21 @@
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeLongPeriodView" extends="BaseResultMap">
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeLongPeriodView" resultMap="BaseResultMap">
SELECT p.id, SELECT p.id,
p.line_id, p.line_id,
p.institution_id, p.INSTITUTION_ID,
p.execution_cycle, p.EXECUTION_CYCLE,
p.optimize_state, p.OPTIMIZE_STATE,
p.optimize_deadline, p.OPTIMIZE_DEADLINE,
d.ou_id, d.ou_id,
d.grid_type_key, d.grid_type_key,
d.institution_name d.INSTITUTION_NAME
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL d
JOIN SPACE_OPTIMIZE_LONG_PERIOD p ON d.id = p.institution_id JOIN SPACE_OPTIMIZE_LONG_PERIOD p ON d.id = p.INSTITUTION_ID
WHERE p.is_deleted = 1 WHERE p.is_deleted = 1
AND p.line_id = #{lineId} AND p.line_id = #{lineId}
ORDER BY p.create_time DESC ORDER BY p.create_time DESC
...@@ -65,8 +65,8 @@ ...@@ -65,8 +65,8 @@
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_PERIOD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_PERIOD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, line_id, institution_id, execution_cycle, optimize_state, modify_by_id, modify_by_name, modify_time, line_id, INSTITUTION_ID, EXECUTION_CYCLE, OPTIMIZE_STATE,
optimize_deadline ) OPTIMIZE_DEADLINE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<result column="MODIFY_BY_ID" property="modifyById" /> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="long_period_id" property="longPeriodId" /> <result column="LONG_PERIOD_ID" property="longPeriodId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="WELL_NUMBER" property="wellNumber" /> <result column="WELL_NUMBER" property="wellNumber" />
<result column="START_SEQ" property="startSeq" /> <result column="START_SEQ" property="startSeq" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
long_period_id, LONG_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
START_SEQ START_SEQ
...@@ -67,14 +67,14 @@ ...@@ -67,14 +67,14 @@
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.long_period_id = #{longPeriodId} AND s.LONG_PERIOD_ID = #{longPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.START_SEQ ASC ORDER BY s.START_SEQ ASC
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, long_period_id, WELLHEAD_ID, WELL_NUMBER ) modify_by_id, modify_by_name, modify_time, LONG_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="record_id" property="recordId" /> <result column="record_id" property="recordId" />
<result column="mid_period_id" property="midPeriodId" /> <result column="MID_PERIOD_ID" property="midPeriodId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="is_optimize" property="isOptimize" /> <result column="is_optimize" property="isOptimize" />
<result column="generation_type_key" property="generationTypeKey" /> <result column="generation_type_key" property="generationTypeKey" />
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
record_id, record_id,
mid_period_id, MID_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="execution_cycle" property="executionCycle" /> <result column="EXECUTION_CYCLE" property="executionCycle" />
<result column="optimize_state" property="optimizeState" /> <result column="OPTIMIZE_STATE" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" /> <result column="OPTIMIZE_DEADLINE" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
line_id, line_id,
institution_id, INSTITUTION_ID,
execution_cycle, EXECUTION_CYCLE,
optimize_state, OPTIMIZE_STATE,
optimize_deadline OPTIMIZE_DEADLINE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap">
select select
...@@ -43,21 +43,21 @@ ...@@ -43,21 +43,21 @@
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeMidPeriodView" extends="BaseResultMap">
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap"> <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeMidPeriodView" resultMap="BaseResultMap">
SELECT p.id, SELECT p.id,
p.line_id, p.line_id,
p.institution_id, p.INSTITUTION_ID,
p.execution_cycle, p.EXECUTION_CYCLE,
p.optimize_state, p.OPTIMIZE_STATE,
p.optimize_deadline, p.OPTIMIZE_DEADLINE,
d.ou_id, d.ou_id,
d.grid_type_key, d.grid_type_key,
d.institution_name d.INSTITUTION_NAME
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL d
JOIN SPACE_OPTIMIZE_MID_PERIOD p ON d.id = p.institution_id JOIN SPACE_OPTIMIZE_MID_PERIOD p ON d.id = p.INSTITUTION_ID
WHERE p.is_deleted = 1 WHERE p.is_deleted = 1
AND p.line_id = #{lineId} AND p.line_id = #{lineId}
ORDER BY p.create_time DESC ORDER BY p.create_time DESC
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<result column="MODIFY_BY_ID" property="modifyById" /> <result column="MODIFY_BY_ID" property="modifyById" />
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="mid_period_id" property="midPeriodId" /> <result column="MID_PERIOD_ID" property="midPeriodId" />
<result column="WELLHEAD_ID" property="wellheadId" /> <result column="WELLHEAD_ID" property="wellheadId" />
<result column="WELL_NUMBER" property="wellNumber" /> <result column="WELL_NUMBER" property="wellNumber" />
<result column="START_SEQ" property="startSeq" /> <result column="START_SEQ" property="startSeq" />
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
modify_by_id, modify_by_id,
modify_by_name, modify_by_name,
modify_time, modify_time,
mid_period_id, MID_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
START_SEQ START_SEQ
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID LEFT JOIN SPACE_INSTITUTION_WELLHEAD w ON s.WELLHEAD_ID = w.WELLHEAD_ID
WHERE s.is_deleted = 1 WHERE s.is_deleted = 1
AND w.is_deleted = 1 AND w.is_deleted = 1
AND s.mid_period_id = #{midPeriodId} AND s.MID_PERIOD_ID = #{midPeriodId}
AND s.optimize_date = #{optimizeDate} AND s.optimize_date = #{optimizeDate}
ORDER BY s.START_SEQ ASC ORDER BY s.START_SEQ ASC
</select> </select>
......
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="optimize_state" property="optimizeState" /> <result column="OPTIMIZE_STATE" property="optimizeState" />
<result column="optimize_date" property="optimizeDate" /> <result column="optimize_date" property="optimizeDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
line_id, line_id,
institution_id, INSTITUTION_ID,
optimize_state, OPTIMIZE_STATE,
optimize_date optimize_date
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView" resultMap="BaseResultMap">
...@@ -41,21 +41,21 @@ ...@@ -41,21 +41,21 @@
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView" extends="BaseResultMap">
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortPeriodView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT p.id, SELECT p.id,
p.line_id, p.line_id,
p.institution_id, p.INSTITUTION_ID,
p.optimize_state, p.OPTIMIZE_STATE,
p.optimize_date, p.optimize_date,
d.ou_id, d.ou_id,
d.grid_type_key, d.grid_type_key,
d.institution_name d.INSTITUTION_NAME
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL d
JOIN SPACE_OPTIMIZE_SHORT_PERIOD p ON d.id = p.institution_id JOIN SPACE_OPTIMIZE_SHORT_PERIOD p ON d.id = p.INSTITUTION_ID
WHERE p.is_deleted = 1 WHERE p.is_deleted = 1
AND p.line_id = #{lineId} AND p.line_id = #{lineId}
ORDER BY p.create_time DESC ORDER BY p.create_time DESC
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
<result column="MODIFY_BY_NAME" property="modifyByName" /> <result column="MODIFY_BY_NAME" property="modifyByName" />
<result column="MODIFY_TIME" property="modifyTime" /> <result column="MODIFY_TIME" property="modifyTime" />
<result column="LINE_ID" property="lineId" /> <result column="LINE_ID" property="lineId" />
<result column="institution_id" property="institutionId" /> <result column="INSTITUTION_ID" property="institutionId" />
<result column="execution_cycle" property="executionCycle" /> <result column="EXECUTION_CYCLE" property="executionCycle" />
<result column="optimize_state" property="optimizeState" /> <result column="OPTIMIZE_STATE" property="optimizeState" />
<result column="optimize_deadline" property="optimizeDeadline" /> <result column="OPTIMIZE_DEADLINE" property="optimizeDeadline" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
line_id, line_id,
institution_id, INSTITUTION_ID,
execution_cycle, EXECUTION_CYCLE,
optimize_state, OPTIMIZE_STATE,
optimize_deadline OPTIMIZE_DEADLINE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView" resultMap="BaseResultMap"> <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView" resultMap="BaseResultMap">
select select
...@@ -43,22 +43,22 @@ ...@@ -43,22 +43,22 @@
<resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView" extends="BaseResultMap"> <resultMap id="ExtendResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView" extends="BaseResultMap">
<result column="OU_ID" property="ouId" /> <result column="OU_ID" property="ouId" />
<result column="GRID_TYPE_KEY" property="gridTypeKey" /> <result column="GRID_TYPE_KEY" property="gridTypeKey" />
<result column="institution_name" property="institutionName" /> <result column="INSTITUTION_NAME" property="institutionName" />
</resultMap> </resultMap>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraPeriodView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT p.id, SELECT p.id,
p.line_id, p.line_id,
p.institution_id, p.INSTITUTION_ID,
p.execution_cycle, p.EXECUTION_CYCLE,
p.optimize_state, p.OPTIMIZE_STATE,
p.optimize_deadline, p.OPTIMIZE_DEADLINE,
d.ou_id, d.ou_id,
d.grid_type_key, d.grid_type_key,
d.institution_name d.INSTITUTION_NAME
FROM SPACE_INSTITUTION_DETAIL d FROM SPACE_INSTITUTION_DETAIL d
JOIN SPACE_OPTIMIZE_ULTRA_PERIOD p ON d.id = p.institution_id JOIN SPACE_OPTIMIZE_ULTRA_PERIOD p ON d.id = p.INSTITUTION_ID
WHERE p.is_deleted = 1 WHERE p.is_deleted = 1
AND p.line_id = #{lineId} AND p.line_id = #{lineId}
ORDER BY p.create_time DESC ORDER BY p.create_time DESC
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<insert id="longPeriodBatchInsertList" parameterType="list"> <insert id="longPeriodBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_PERIOD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_PERIOD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, line_id, institution_id, execution_cycle, optimize_state, modify_by_id, modify_by_name, modify_time, line_id, INSTITUTION_ID, EXECUTION_CYCLE, OPTIMIZE_STATE,
optimize_deadline ) OPTIMIZE_DEADLINE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
<insert id="longWellheadBatchInsertList" parameterType="list"> <insert id="longWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_LONG_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, long_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date) modify_by_id, modify_by_name, modify_time, LONG_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
record_id, record_id,
long_period_id, LONG_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
...@@ -97,8 +97,8 @@ ...@@ -97,8 +97,8 @@
<insert id="midPeriodBatchInsertList" parameterType="list"> <insert id="midPeriodBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_MID_PERIOD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_MID_PERIOD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, line_id, institution_id, execution_cycle, optimize_state, modify_by_id, modify_by_name, modify_time, line_id, INSTITUTION_ID, EXECUTION_CYCLE, OPTIMIZE_STATE,
optimize_deadline ) OPTIMIZE_DEADLINE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
<insert id="midWellheadBatchInsertList" parameterType="list"> <insert id="midWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_MID_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_MID_WELLHEAD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, mid_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date) modify_by_id, modify_by_name, modify_time, MID_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER, START_SEQ, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
modify_by_name, modify_by_name,
modify_time, modify_time,
record_id, record_id,
mid_period_id, MID_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
is_optimize, is_optimize,
generation_type_key, generation_type_key,
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
<insert id="shortPeriodBatchInsertList" parameterType="list"> <insert id="shortPeriodBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_SHORT_PERIOD (id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO SPACE_OPTIMIZE_SHORT_PERIOD (id, create_by_id, create_by_name, create_time, modify_by_id,
modify_by_name, modify_time, line_id, institution_id, optimize_state, optimize_date) modify_by_name, modify_time, line_id, INSTITUTION_ID, OPTIMIZE_STATE, optimize_date)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -269,8 +269,8 @@ ...@@ -269,8 +269,8 @@
<insert id="ultraPeriodBatchInsertList" parameterType="list"> <insert id="ultraPeriodBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_ULTRA_PERIOD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_ULTRA_PERIOD ( id, create_by_id, create_by_name, create_time,
modify_by_id, modify_by_name, modify_time, line_id, institution_id, execution_cycle, optimize_state, modify_by_id, modify_by_name, modify_time, line_id, INSTITUTION_ID, EXECUTION_CYCLE, OPTIMIZE_STATE,
optimize_deadline ) OPTIMIZE_DEADLINE )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
<result column="daily_liquid_production" property="dailyLiquidProduction" /> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="daily_carbon_reduction" property="dailyCarbonReduction" /> <result column="daily_carbon_reduction" property="dailyCarbonReduction" />
<result column="green_electricity_rate" property="greenElectricityRate" /> <result column="green_electricity_rate" property="greenElectricityRate" />
<result column="valley_electric_open_hour" property="valleyElectricOpenHour" /> <result column="VALLEY_ELECTRIC_OPEN_HOUR" property="valleyElectricOpenHour" />
<result column="valley_electric_rate" property="valleyElectricRate" /> <result column="VALLEY_ELECTRIC_RATE" property="valleyElectricRate" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
daily_liquid_production, daily_liquid_production,
daily_carbon_reduction, daily_carbon_reduction,
green_electricity_rate, green_electricity_rate,
valley_electric_open_hour, VALLEY_ELECTRIC_OPEN_HOUR,
valley_electric_rate, VALLEY_ELECTRIC_RATE,
create_date, CREATE_DATE,
SYSTEM_SOURCE SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.WellDailyElectricityTrendView" <select id="selectOne" parameterType="pps.core.space.entity.WellDailyElectricityTrendView"
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
<insert id="batchInsert" parameterType="list"> <insert id="batchInsert" parameterType="list">
INSERT INTO WELL_DAILY_ELECTRICITY_TREND (WELL_NUMBER, space_run_duration, daily_open_hour, INSERT INTO WELL_DAILY_ELECTRICITY_TREND (WELL_NUMBER, space_run_duration, daily_open_hour,
daily_green_open_hour, daily_green_consumption, daily_electricity_consumption, daily_liquid_production, daily_green_open_hour, daily_green_consumption, daily_electricity_consumption, daily_liquid_production,
daily_carbon_reduction, green_electricity_rate, valley_electric_open_hour, valley_electric_rate, create_date, daily_carbon_reduction, green_electricity_rate, VALLEY_ELECTRIC_OPEN_HOUR, VALLEY_ELECTRIC_RATE, CREATE_DATE,
SYSTEM_SOURCE) VALUES SYSTEM_SOURCE) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
t.daily_liquid_production, t.daily_liquid_production,
t.green_electricity_rate, t.green_electricity_rate,
t.daily_carbon_reduction, t.daily_carbon_reduction,
t.valley_electric_rate, t.VALLEY_ELECTRIC_RATE,
m.month_daily_green_open_hour, m.month_daily_green_open_hour,
m.month_space_run_duration, m.month_space_run_duration,
m.month_daily_green_consumption, m.month_daily_green_consumption,
...@@ -111,10 +111,10 @@ ...@@ -111,10 +111,10 @@
SUM(daily_green_open_hour) AS month_daily_green_open_hour, SUM(daily_green_open_hour) AS month_daily_green_open_hour,
SUM(space_run_duration) AS month_space_run_duration, SUM(space_run_duration) AS month_space_run_duration,
SUM(daily_green_consumption) AS month_daily_green_consumption, SUM(daily_green_consumption) AS month_daily_green_consumption,
SUM(valley_electric_open_hour) AS month_valley_electric_open_hour SUM(VALLEY_ELECTRIC_OPEN_HOUR) AS month_valley_electric_open_hour
FROM WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
WHERE WHERE
MONTH ( create_date ) = #{month} MONTH ( CREATE_DATE ) = #{month}
AND WELL_NUMBER IN AND WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
...@@ -125,17 +125,17 @@ ...@@ -125,17 +125,17 @@
SUM(daily_green_open_hour) AS year_daily_green_open_hour, SUM(daily_green_open_hour) AS year_daily_green_open_hour,
SUM(space_run_duration) AS year_space_run_duration, SUM(space_run_duration) AS year_space_run_duration,
SUM(daily_green_consumption) AS year_daily_green_consumption, SUM(daily_green_consumption) AS year_daily_green_consumption,
SUM(valley_electric_open_hour) AS year_valley_electric_open_hour SUM(VALLEY_ELECTRIC_OPEN_HOUR) AS year_valley_electric_open_hour
FROM WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
WHERE WHERE
YEAR ( create_date ) = #{year} YEAR ( CREATE_DATE ) = #{year}
AND WELL_NUMBER IN AND WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
WELL_NUMBER) y ON t.WELL_NUMBER = y.WELL_NUMBER WELL_NUMBER) y ON t.WELL_NUMBER = y.WELL_NUMBER
WHERE t.create_date = #{createDate} WHERE t.CREATE_DATE = #{createDate}
AND t.WELL_NUMBER IN AND t.WELL_NUMBER IN
<foreach collection="wellNumberList" open="(" close=")" separator="," item="item"> <foreach collection="wellNumberList" open="(" close=")" separator="," item="item">
#{item} #{item}
......
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<result column="peak_hour_tariff" property="peakHourTariff" /> <result column="peak_hour_tariff" property="peakHourTariff" />
<result column="normal_period_tariff" property="normalPeriodTariff" /> <result column="normal_period_tariff" property="normalPeriodTariff" />
<result column="alley_hours_tariff" property="alleyHoursTariff" /> <result column="alley_hours_tariff" property="alleyHoursTariff" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
peak_hour_tariff, peak_hour_tariff,
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
photovoltaic_power, PHOTOVOLTAIC_POWER,
SYSTEM_SOURCE, SYSTEM_SOURCE,
create_date CREATE_DATE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.StationDailyProductionSituationView" <select id="selectOne" parameterType="pps.core.prediction.entity.StationDailyProductionSituationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -80,9 +80,9 @@ ...@@ -80,9 +80,9 @@
peak_hour_tariff, peak_hour_tariff,
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
photovoltaic_power, PHOTOVOLTAIC_POWER,
SYSTEM_SOURCE, SYSTEM_SOURCE,
create_date CREATE_DATE
) VALUES ) VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
d.production_time, d.production_time,
d.daily_liquid_production, d.daily_liquid_production,
d.daily_electricity_consumption, d.daily_electricity_consumption,
d.photovoltaic_power, d.PHOTOVOLTAIC_POWER,
IFNULL( m.month_photovoltaic_power, 0 ) AS month_photovoltaic_power, IFNULL( m.month_photovoltaic_power, 0 ) AS month_photovoltaic_power,
y.year_photovoltaic_power y.year_photovoltaic_power
FROM FROM
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
IFNULL( ROUND( AVG( production_time ), 2 ), 0 ) AS production_time, IFNULL( ROUND( AVG( production_time ), 2 ), 0 ) AS production_time,
IFNULL( ROUND( AVG( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production, IFNULL( ROUND( AVG( daily_liquid_production ), 2 ), 0 ) AS daily_liquid_production,
IFNULL( ROUND( AVG( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption, IFNULL( ROUND( AVG( daily_electricity_consumption ), 2 ), 0 ) AS daily_electricity_consumption,
IFNULL( ROUND( AVG( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power IFNULL( ROUND( AVG( PHOTOVOLTAIC_POWER ), 2 ), 0 ) AS PHOTOVOLTAIC_POWER
FROM FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE STATION_DAILY_PRODUCTION_SITUATION WHERE
data_date BETWEEN #{beginTime} AND #{endTime} data_date BETWEEN #{beginTime} AND #{endTime}
...@@ -143,14 +143,14 @@ ...@@ -143,14 +143,14 @@
GROUP BY GROUP BY
STATION_NAME STATION_NAME
) d ) d
LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS month_photovoltaic_power, STATION_NAME FROM LEFT JOIN ( SELECT IFNULL( SUM( PHOTOVOLTAIC_POWER ), 0 ) AS month_photovoltaic_power, STATION_NAME FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE MONTH ( data_date ) = #{month} STATION_DAILY_PRODUCTION_SITUATION WHERE MONTH ( data_date ) = #{month}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
GROUP BY STATION_NAME ) m ON d.STATION_NAME = m.STATION_NAME GROUP BY STATION_NAME ) m ON d.STATION_NAME = m.STATION_NAME
LEFT JOIN ( SELECT IFNULL( SUM( photovoltaic_power ), 0 ) AS year_photovoltaic_power, STATION_NAME FROM LEFT JOIN ( SELECT IFNULL( SUM( PHOTOVOLTAIC_POWER ), 0 ) AS year_photovoltaic_power, STATION_NAME FROM
STATION_DAILY_PRODUCTION_SITUATION WHERE YEAR ( data_date ) = #{year} STATION_DAILY_PRODUCTION_SITUATION WHERE YEAR ( data_date ) = #{year}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="STATION_ID" property="stationId" /> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="meter_power" property="meterPower" /> <result column="meter_power" property="meterPower" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="save_date" property="saveDate" /> <result column="save_date" property="saveDate" />
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
, ,
STATION_NAME, STATION_NAME,
STATION_ID, STATION_ID,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
meter_power, meter_power,
SYSTEM_SOURCE, SYSTEM_SOURCE,
save_date, save_date,
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
</delete> </delete>
<insert id="batchInsertList" parameterType="java.util.List"> <insert id="batchInsertList" parameterType="java.util.List">
insert into THIRD_ACTIVE_POWER_DAILY_UPDATE (STATION_NAME, STATION_ID, create_date, photovoltaic_power, insert into THIRD_ACTIVE_POWER_DAILY_UPDATE (STATION_NAME, STATION_ID, CREATE_DATE, PHOTOVOLTAIC_POWER,
meter_power, meter_power,
SYSTEM_SOURCE, save_date, save_hour) SYSTEM_SOURCE, save_date, save_hour)
values values
...@@ -90,9 +90,9 @@ ...@@ -90,9 +90,9 @@
<select id="selectEnergyUseCurve" resultMap="ExtBaseResultMap"> <select id="selectEnergyUseCurve" resultMap="ExtBaseResultMap">
SELECT hour_str AS hour_number, SELECT hour_str AS hour_number,
IFNULL( ROUND( AVG( photovoltaic_power ), 2 ), 0 ) AS photovoltaic_power, IFNULL( ROUND( AVG( PHOTOVOLTAIC_POWER ), 2 ), 0 ) AS PHOTOVOLTAIC_POWER,
IFNULL( ROUND( AVG( meter_power ), 2 ), 0 ) AS meter_power IFNULL( ROUND( AVG( meter_power ), 2 ), 0 ) AS meter_power
FROM (SELECT STATION_NAME, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power FROM (SELECT STATION_NAME, HOUR ( CREATE_DATE ) AS hour_str, PHOTOVOLTAIC_POWER, meter_power
FROM THIRD_ACTIVE_POWER_DAILY_UPDATE FROM THIRD_ACTIVE_POWER_DAILY_UPDATE
<where> <where>
<if test="systemSource != null"> <if test="systemSource != null">
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
AND STATION_ID = #{stationId} AND STATION_ID = #{stationId}
</if> </if>
<if test="createDate != null"> <if test="createDate != null">
AND create_date BETWEEN #{saveDate} AND #{createDate} AND CREATE_DATE BETWEEN #{saveDate} AND #{createDate}
</if> </if>
<if test="stationIds != null and stationIds.size() > 0"> <if test="stationIds != null and stationIds.size() > 0">
AND STATION_ID IN AND STATION_ID IN
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="STATION_ID" property="stationId" /> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="meter_power" property="meterPower" /> <result column="meter_power" property="meterPower" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="INPUT_TIME" property="inputTime" /> <result column="INPUT_TIME" property="inputTime" />
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
, ,
STATION_NAME, STATION_NAME,
STATION_ID, STATION_ID,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
meter_power, meter_power,
SYSTEM_SOURCE SYSTEM_SOURCE
</sql> </sql>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_ACTIVE_POWER ( STATION_NAME, STATION_ID, create_date, photovoltaic_power, meter_power, INSERT INTO THIRD_ACTIVE_POWER ( STATION_NAME, STATION_ID, CREATE_DATE, PHOTOVOLTAIC_POWER, meter_power,
SYSTEM_SOURCE, INPUT_TIME) SYSTEM_SOURCE, INPUT_TIME)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -60,12 +60,12 @@ ...@@ -60,12 +60,12 @@
<select id="selectEnergyUseCurve" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectEnergyUseCurve" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="ExtBaseResultMap"> resultMap="ExtBaseResultMap">
SELECT hour_str AS save_hour, SELECT hour_str AS save_hour,
IFNULL(AVG(photovoltaic_power), 0) AS photovoltaic_power, IFNULL(AVG(PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
IFNULL(AVG(meter_power), 0) AS meter_power IFNULL(AVG(meter_power), 0) AS meter_power
FROM (SELECT STATION_NAME, HOUR ( create_date ) AS hour_str, photovoltaic_power, meter_power FROM (SELECT STATION_NAME, HOUR ( CREATE_DATE ) AS hour_str, PHOTOVOLTAIC_POWER, meter_power
FROM THIRD_ACTIVE_POWER FROM THIRD_ACTIVE_POWER
WHERE STATION_NAME = #{stationName} WHERE STATION_NAME = #{stationName}
AND DATE ( create_date ) = #{createDate}) z AND DATE ( CREATE_DATE ) = #{createDate}) z
GROUP BY hour_str GROUP BY hour_str
ORDER BY hour_str ORDER BY hour_str
</select> </select>
...@@ -73,18 +73,18 @@ ...@@ -73,18 +73,18 @@
<select id="selectGeneratedPowerHour" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectGeneratedPowerHour" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="ExtBaseResultMap"> resultMap="ExtBaseResultMap">
SELECT SELECT
ROUND( SUM( photovoltaic_power ), 2 ) AS photovoltaic_power, ROUND( SUM( PHOTOVOLTAIC_POWER ), 2 ) AS PHOTOVOLTAIC_POWER,
create_date CREATE_DATE
FROM (SELECT IFNULL(AVG(photovoltaic_power), 0) AS photovoltaic_power, FROM (SELECT IFNULL(AVG(PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
<choose> <choose>
<when test="dayFlag == 3"> <when test="dayFlag == 3">
DATE_FORMAT( create_date, '%Y-%m-01' ) AS create_date, DATE_FORMAT( CREATE_DATE, '%Y-%m-01' ) AS CREATE_DATE,
</when> </when>
<when test="dayFlag == 2"> <when test="dayFlag == 2">
DATE_FORMAT( create_date, '%Y-%m-%d' ) AS create_date, DATE_FORMAT( CREATE_DATE, '%Y-%m-%d' ) AS CREATE_DATE,
</when> </when>
<otherwise> <otherwise>
DATE_FORMAT( create_date, '%Y-%m-%d %H:00:00' ) AS create_date, DATE_FORMAT( CREATE_DATE, '%Y-%m-%d %H:00:00' ) AS CREATE_DATE,
</otherwise> </otherwise>
</choose> </choose>
STATION_NAME STATION_NAME
...@@ -96,26 +96,26 @@ ...@@ -96,26 +96,26 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
AND create_date BETWEEN #{startTime} AND CREATE_DATE BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
<if test="systemSource != null"> <if test="systemSource != null">
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
) )
GROUP BY STATION_NAME, GROUP BY STATION_NAME,
create_date) z CREATE_DATE) z
GROUP BY create_date GROUP BY CREATE_DATE
ORDER BY ORDER BY
create_date CREATE_DATE
</select> </select>
<select id="selectAvgPhotovoltaicPower" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectAvgPhotovoltaicPower" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT g.STATION_NAME, SELECT g.STATION_NAME,
g.create_time AS create_date, g.create_time AS CREATE_DATE,
AVG(g.photovoltaic_power) AS photovoltaic_power AVG(g.PHOTOVOLTAIC_POWER) AS PHOTOVOLTAIC_POWER
FROM (SELECT a.STATION_NAME, FROM (SELECT a.STATION_NAME,
a.photovoltaic_power, a.PHOTOVOLTAIC_POWER,
DATE_FORMAT( DATE_FORMAT(
CASE CASE
WHEN MINUTE ( a.create_time ) IN ( 10, 20, 40, 50 ) THEN WHEN MINUTE ( a.create_time ) IN ( 10, 20, 40, 50 ) THEN
...@@ -124,26 +124,26 @@ ...@@ -124,26 +124,26 @@
'%H:%i:%s' '%H:%i:%s'
) AS create_time ) AS create_time
FROM (SELECT z.STATION_NAME, FROM (SELECT z.STATION_NAME,
z.photovoltaic_power, z.PHOTOVOLTAIC_POWER,
CASE CASE
WHEN z.mo &lt; 10 THEN WHEN z.mo &lt; 10 THEN
FROM_UNIXTIME(z.time_stamp + 10 - z.mo) FROM_UNIXTIME(z.time_stamp + 10 - z.mo)
ELSE z.create_date ELSE z.CREATE_DATE
END AS create_time END AS create_time
FROM (SELECT STATION_NAME, FROM (SELECT STATION_NAME,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
UNIX_TIMESTAMP(create_date) AS time_stamp, UNIX_TIMESTAMP(CREATE_DATE) AS time_stamp,
UNIX_TIMESTAMP(create_date) % 10 AS mo UNIX_TIMESTAMP(CREATE_DATE) % 10 AS mo
FROM FROM
THIRD_ACTIVE_POWER THIRD_ACTIVE_POWER
WHERE WHERE
DATE ( create_date ) = #{createDate} DATE ( CREATE_DATE ) = #{createDate}
<if test="systemSource != null"> <if test="systemSource != null">
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
</if> </if>
AND photovoltaic_power AND PHOTOVOLTAIC_POWER
&gt; 0) z) a) g &gt; 0) z) a) g
GROUP BY g.STATION_NAME, GROUP BY g.STATION_NAME,
g.create_time g.create_time
...@@ -153,19 +153,19 @@ ...@@ -153,19 +153,19 @@
<select id="selectAvgPower15" parameterType="pps.core.prediction.entity.ThirdActivePowerView" <select id="selectAvgPower15" parameterType="pps.core.prediction.entity.ThirdActivePowerView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT IFNULL(AVG(z.photovoltaic_power), 0) AS photovoltaic_power, SELECT IFNULL(AVG(z.PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
z.INPUT_TIME z.INPUT_TIME
FROM (SELECT photovoltaic_power, FROM (SELECT PHOTOVOLTAIC_POWER,
<choose> <choose>
<when test="systemSource == 'SY'"> <when test="systemSource == 'SY'">
CASE CASE
WHEN MINUTE ( create_date ) &lt; 15 THEN WHEN MINUTE ( CREATE_DATE ) &lt; 15 THEN
DATE_FORMAT( create_date, '%Y-%m-%d %H:00:00' ) DATE_FORMAT( CREATE_DATE, '%Y-%m-%d %H:00:00' )
WHEN MINUTE ( create_date ) &lt; 30 THEN WHEN MINUTE ( CREATE_DATE ) &lt; 30 THEN
DATE_FORMAT( create_date, '%Y-%m-%d %H:15:00' ) DATE_FORMAT( CREATE_DATE, '%Y-%m-%d %H:15:00' )
WHEN MINUTE ( create_date ) &lt; 45 THEN WHEN MINUTE ( CREATE_DATE ) &lt; 45 THEN
DATE_FORMAT( create_date, '%Y-%m-%d %H:30:00' ) DATE_FORMAT( CREATE_DATE, '%Y-%m-%d %H:30:00' )
ELSE DATE_FORMAT( create_date, '%Y-%m-%d %H:45:00' ) ELSE DATE_FORMAT( CREATE_DATE, '%Y-%m-%d %H:45:00' )
END INPUT_TIME END INPUT_TIME
</when> </when>
<otherwise> <otherwise>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="STATION_ID" property="stationId" /> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" /> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" /> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="in_place_consumption" property="inPlaceConsumption" /> <result column="in_place_consumption" property="inPlaceConsumption" />
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
, ,
STATION_NAME, STATION_NAME,
STATION_ID, STATION_ID,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
daily_electricity_consumption, daily_electricity_consumption,
daily_liquid_production, daily_liquid_production,
in_place_consumption, in_place_consumption,
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_DAILY_ACCUMULATION_UPDATE ( STATION_NAME, STATION_ID, create_date, photovoltaic_power, INSERT INTO THIRD_DAILY_ACCUMULATION_UPDATE ( STATION_NAME, STATION_ID, CREATE_DATE, PHOTOVOLTAIC_POWER,
daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge, daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge,
save_date, SYSTEM_SOURCE, save_date, SYSTEM_SOURCE,
save_hour) save_hour)
...@@ -72,52 +72,52 @@ ...@@ -72,52 +72,52 @@
<resultMap id="ExtResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" <resultMap id="ExtResultMap" type="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
extends="BaseResultMap"> extends="BaseResultMap">
<result column="day_flag" property="dayFlag" /> <result column="DAY_FLAG" property="dayFlag" />
<result column="green_electricity_rate" property="greenElectricityRate" /> <result column="green_electricity_rate" property="greenElectricityRate" />
<result column="avoid_peak_rate" property="avoidPeakRate" /> <result column="avoid_peak_rate" property="avoidPeakRate" />
</resultMap> </resultMap>
<select id="selectPowerStatisticsByDate" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" <select id="selectPowerStatisticsByDate" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT z.day_flag, SELECT z.DAY_FLAG,
ROUND(z.photovoltaic_power, 2) AS photovoltaic_power, ROUND(z.PHOTOVOLTAIC_POWER, 2) AS PHOTOVOLTAIC_POWER,
ROUND(z.daily_electricity_consumption, 2) AS daily_electricity_consumption, ROUND(z.daily_electricity_consumption, 2) AS daily_electricity_consumption,
IFNULL(ROUND(z.in_place_consumption / z.daily_electricity_consumption * 100, 2), IFNULL(ROUND(z.in_place_consumption / z.daily_electricity_consumption * 100, 2),
0) AS green_electricity_rate, 0) AS green_electricity_rate,
IFNULL(ROUND(z.photovoltaic_power - z.in_place_consumption, 2), 0) AS avoid_peak_rate IFNULL(ROUND(z.PHOTOVOLTAIC_POWER - z.in_place_consumption, 2), 0) AS avoid_peak_rate
FROM (SELECT IFNULL(SUM(photovoltaic_power), 0) AS photovoltaic_power, FROM (SELECT IFNULL(SUM(PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption, IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption,
IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption, IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption,
1 AS day_flag 1 AS DAY_FLAG
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date) = #{today} DATE ( CREATE_DATE) = #{today}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
UNION ALL UNION ALL
SELECT IFNULL(SUM(photovoltaic_power), 0) AS photovoltaic_power, SELECT IFNULL(SUM(PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption, IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption,
IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption, IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption,
2 AS day_flag 2 AS DAY_FLAG
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date ) = #{yesterday} DATE ( CREATE_DATE ) = #{yesterday}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
#{item} #{item}
</foreach> </foreach>
UNION ALL UNION ALL
SELECT IFNULL(SUM(photovoltaic_power), 0) AS photovoltaic_power, SELECT IFNULL(SUM(PHOTOVOLTAIC_POWER), 0) AS PHOTOVOLTAIC_POWER,
IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption, IFNULL(SUM(daily_electricity_consumption), 0) AS daily_electricity_consumption,
IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption, IFNULL(SUM(in_place_consumption), 0) AS in_place_consumption,
3 AS day_flag 3 AS DAY_FLAG
FROM THIRD_DAILY_ACCUMULATION_UPDATE FROM THIRD_DAILY_ACCUMULATION_UPDATE
WHERE WHERE
DATE ( create_date ) = #{lastYear} DATE ( CREATE_DATE ) = #{lastYear}
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
AND STATION_NAME IN AND STATION_NAME IN
<foreach collection="stationNameList" open="(" close=")" separator="," item="item"> <foreach collection="stationNameList" open="(" close=")" separator="," item="item">
...@@ -130,14 +130,14 @@ ...@@ -130,14 +130,14 @@
parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView" parameterType="pps.core.prediction.entity.ThirdDailyAccumulationUpdateView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
IFNULL( SUM( photovoltaic_power ), 0 ) AS photovoltaic_power, IFNULL( SUM( PHOTOVOLTAIC_POWER ), 0 ) AS PHOTOVOLTAIC_POWER,
IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption, IFNULL( SUM( daily_electricity_consumption ), 0 ) AS daily_electricity_consumption,
<choose> <choose>
<when test="dayFlag == 1"> <when test="dayFlag == 1">
DATE_FORMAT( create_date, '%Y-%m-01' ) AS create_date DATE_FORMAT( CREATE_DATE, '%Y-%m-01' ) AS CREATE_DATE
</when> </when>
<otherwise> <otherwise>
DATE_FORMAT( create_date, '%Y-%m-%d' ) AS create_date DATE_FORMAT( CREATE_DATE, '%Y-%m-%d' ) AS CREATE_DATE
</otherwise> </otherwise>
</choose> </choose>
FROM FROM
...@@ -148,11 +148,11 @@ ...@@ -148,11 +148,11 @@
#{item} #{item}
</foreach> </foreach>
<if test="startTime != null and endTime != null"> <if test="startTime != null and endTime != null">
AND create_date BETWEEN #{startTime} AND CREATE_DATE BETWEEN #{startTime}
AND #{endTime} AND #{endTime}
</if> </if>
<if test="month != null and month != ''"> <if test="month != null and month != ''">
AND MONTH(create_date) = #{month} AND MONTH(CREATE_DATE) = #{month}
</if> </if>
<if test="systemSource != null"> <if test="systemSource != null">
AND SYSTEM_SOURCE = #{systemSource} AND SYSTEM_SOURCE = #{systemSource}
...@@ -160,10 +160,10 @@ ...@@ -160,10 +160,10 @@
GROUP BY GROUP BY
<choose> <choose>
<when test="dayFlag == 1"> <when test="dayFlag == 1">
DATE_FORMAT( create_date, '%Y-%m-01' ) DATE_FORMAT( CREATE_DATE, '%Y-%m-01' )
</when> </when>
<otherwise> <otherwise>
DATE_FORMAT( create_date, '%Y-%m-%d' ) DATE_FORMAT( CREATE_DATE, '%Y-%m-%d' )
</otherwise> </otherwise>
</choose> </choose>
</select> </select>
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="STATION_ID" property="stationId" /> <result column="STATION_ID" property="stationId" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="daily_electricity_consumption" property="dailyElectricityConsumption" /> <result column="daily_electricity_consumption" property="dailyElectricityConsumption" />
<result column="daily_liquid_production" property="dailyLiquidProduction" /> <result column="daily_liquid_production" property="dailyLiquidProduction" />
<result column="in_place_consumption" property="inPlaceConsumption" /> <result column="in_place_consumption" property="inPlaceConsumption" />
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
, ,
STATION_NAME, STATION_NAME,
STATION_ID, STATION_ID,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
daily_electricity_consumption, daily_electricity_consumption,
daily_liquid_production, daily_liquid_production,
in_place_consumption, in_place_consumption,
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_DAILY_ACCUMULATION ( STATION_NAME, STATION_ID, create_date, photovoltaic_power, INSERT INTO THIRD_DAILY_ACCUMULATION ( STATION_NAME, STATION_ID, CREATE_DATE, PHOTOVOLTAIC_POWER,
daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge, daily_electricity_consumption, daily_liquid_production, in_place_consumption, energy_storage_discharge,
save_date, SYSTEM_SOURCE ) save_date, SYSTEM_SOURCE )
VALUES VALUES
......
...@@ -4,16 +4,16 @@ ...@@ -4,16 +4,16 @@
<resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdPhotovoltaicPowerView"> <resultMap id="BaseResultMap" type="pps.core.prediction.entity.ThirdPhotovoltaicPowerView">
<id column="ID" property="id" /> <id column="ID" property="id" />
<result column="STATION_NAME" property="stationName" /> <result column="STATION_NAME" property="stationName" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
<result column="photovoltaic_power" property="photovoltaicPower" /> <result column="PHOTOVOLTAIC_POWER" property="photovoltaicPower" />
<result column="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
, ,
STATION_NAME, STATION_NAME,
create_date, CREATE_DATE,
photovoltaic_power, PHOTOVOLTAIC_POWER,
SYSTEM_SOURCE SYSTEM_SOURCE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.ThirdPhotovoltaicPowerView" <select id="selectOne" parameterType="pps.core.prediction.entity.ThirdPhotovoltaicPowerView"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</select> </select>
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO THIRD_PHOTOVOLTAIC_POWER (STATION_NAME, create_date, photovoltaic_power, SYSTEM_SOURCE) INSERT INTO THIRD_PHOTOVOLTAIC_POWER (STATION_NAME, CREATE_DATE, PHOTOVOLTAIC_POWER, SYSTEM_SOURCE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<result column="peak_hour_tariff" property="peakHourTariff" /> <result column="peak_hour_tariff" property="peakHourTariff" />
<result column="normal_period_tariff" property="normalPeriodTariff" /> <result column="normal_period_tariff" property="normalPeriodTariff" />
<result column="alley_hours_tariff" property="alleyHoursTariff" /> <result column="alley_hours_tariff" property="alleyHoursTariff" />
<result column="create_date" property="createDate" /> <result column="CREATE_DATE" property="createDate" />
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id id
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
SYSTEM_SOURCE, SYSTEM_SOURCE,
create_date CREATE_DATE
</sql> </sql>
<select id="selectOne" parameterType="pps.core.prediction.entity.WellheadDailyProductionSituationView" <select id="selectOne" parameterType="pps.core.prediction.entity.WellheadDailyProductionSituationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
peak_hour_tariff, peak_hour_tariff,
normal_period_tariff, normal_period_tariff,
alley_hours_tariff, alley_hours_tariff,
create_date CREATE_DATE
) )
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
......
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