Commit 844a1894 authored by ZWT's avatar ZWT

得到的

parent 8a8fd452
...@@ -2,62 +2,62 @@ ...@@ -2,62 +2,62 @@
<!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.SpaceOptimizeShortPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeShortPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortPeriodView">
<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="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">
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,
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">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_SHORT_PERIOD FROM SPACE_OPTIMIZE_SHORT_PERIOD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<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
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,75 +2,78 @@ ...@@ -2,75 +2,78 @@
<!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.SpaceOptimizeShortWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeShortWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView">
<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="SHORT_PERIOD_ID" property="shortPeriodId" /> <result column="SHORT_PERIOD_ID" property="shortPeriodId"/>
<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"/>
<result column="frostproof_well" property="frostproofWell" /> <result column="FROSTPROOF_WELL" property="frostproofWell"/>
</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,
SHORT_PERIOD_ID, SHORT_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
START_SEQ, START_SEQ,
frostproof_well FROSTPROOF_WELL
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_SHORT_WELLHEAD FROM SPACE_OPTIMIZE_SHORT_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_SHORT_WELLHEAD FROM SPACE_OPTIMIZE_SHORT_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeShortWellheadView" extends="BaseResultMap">
<result column="RUN_DURATION" property="runDuration" /> <result column="RUN_DURATION" property="runDuration"/>
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeShortWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.WELLHEAD_ID, SELECT S.WELLHEAD_ID,
s.WELL_NUMBER, S.WELL_NUMBER,
s.START_SEQ, S.START_SEQ,
s.OPTIMIZE_DATE, S.OPTIMIZE_DATE,
CASE CASE
w.RUN_TYPE_KEY W.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.RUN_DURATION ELSE W.RUN_DURATION
END RUN_DURATION END RUN_DURATION
FROM SPACE_OPTIMIZE_SHORT_WELLHEAD s FROM SPACE_OPTIMIZE_SHORT_WELLHEAD S
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.SHORT_PERIOD_ID = #{shortPeriodId} AND S.SHORT_PERIOD_ID = #{shortPeriodId}
AND s.OPTIMIZE_DATE = #{optimizeDate} AND S.OPTIMIZE_DATE = #{optimizeDate}
ORDER BY s.START_SEQ ASC ORDER BY S.START_SEQ ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,35 +2,36 @@ ...@@ -2,35 +2,36 @@
<!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.SpaceOptimizeUltraDurationViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraDurationViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraDurationView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraDurationView">
<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="RECORD_ID" property="recordId" /> <result column="RECORD_ID" property="recordId"/>
<result column="ultra_period_id" property="ultraPeriodId" /> <result column="ULTRA_PERIOD_ID" property="ultraPeriodId"/>
<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"/>
<result column="OPEN_WELL_TIME" property="openWellTime" /> <result column="OPEN_WELL_TIME" property="openWellTime"/>
<result column="CLOSE_WELL_TIME" property="closeWellTime" /> <result column="CLOSE_WELL_TIME" property="closeWellTime"/>
<result column="FIRST_START" property="firstStart" /> <result column="FIRST_START" property="firstStart"/>
</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,
RECORD_ID, RECORD_ID,
ultra_period_id, ULTRA_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
IS_OPTIMIZE, IS_OPTIMIZE,
GENERATION_TYPE_KEY, GENERATION_TYPE_KEY,
...@@ -38,20 +39,22 @@ ...@@ -38,20 +39,22 @@
CLOSE_WELL_TIME, CLOSE_WELL_TIME,
FIRST_START FIRST_START
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraDurationView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraDurationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_ULTRA_DURATION FROM SPACE_OPTIMIZE_ULTRA_DURATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraDurationView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraDurationView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_ULTRA_DURATION FROM SPACE_OPTIMIZE_ULTRA_DURATION
where WHERE
id=#{id} ID=#{id}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,65 +2,67 @@ ...@@ -2,65 +2,67 @@
<!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.SpaceOptimizeUltraPeriodViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraPeriodViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraPeriodView">
<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="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
, ,
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,
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
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_ULTRA_PERIOD FROM SPACE_OPTIMIZE_ULTRA_PERIOD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<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
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -2,73 +2,76 @@ ...@@ -2,73 +2,76 @@
<!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.SpaceOptimizeUltraWellheadViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeUltraWellheadViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView">
<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="ultra_period_id" property="ultraPeriodId" /> <result column="ULTRA_PERIOD_ID" property="ultraPeriodId"/>
<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"/>
</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,
ultra_period_id, ULTRA_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
WELL_NUMBER, WELL_NUMBER,
START_SEQ START_SEQ
</sql> </sql>
<select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView" <select id="selectOne" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_ULTRA_WELLHEAD FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView" <select id="selectList" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from SPACE_OPTIMIZE_ULTRA_WELLHEAD FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD
where WHERE
id=#{id} ID=#{id}
</select> </select>
<resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.SpaceOptimizeUltraWellheadView" extends="BaseResultMap">
<result column="RUN_DURATION" property="runDuration" /> <result column="RUN_DURATION" property="runDuration"/>
</resultMap> </resultMap>
<select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView" <select id="selectListJoin" parameterType="pps.core.space.entity.SpaceOptimizeUltraWellheadView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
SELECT s.WELLHEAD_ID, SELECT S.WELLHEAD_ID,
s.WELL_NUMBER, S.WELL_NUMBER,
s.START_SEQ, S.START_SEQ,
s.OPTIMIZE_DATE, S.OPTIMIZE_DATE,
CASE CASE
w.RUN_TYPE_KEY W.RUN_TYPE_KEY
WHEN 'CONTINUOUS' THEN WHEN 'CONTINUOUS' THEN
24 24
ELSE w.RUN_DURATION ELSE W.RUN_DURATION
END RUN_DURATION END RUN_DURATION
FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD s FROM SPACE_OPTIMIZE_ULTRA_WELLHEAD S
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.ultra_period_id = #{ultraPeriodId} AND S.ULTRA_PERIOD_ID = #{ultraPeriodId}
AND s.OPTIMIZE_DATE = #{optimizeDate} AND S.OPTIMIZE_DATE = #{optimizeDate}
ORDER BY s.START_SEQ ASC ORDER BY S.START_SEQ ASC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<mapper namespace="pps.core.space.mapper.SpaceOptimizeViewMapper"> <mapper namespace="pps.core.space.mapper.SpaceOptimizeViewMapper">
<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=",">
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
</insert> </insert>
<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=",">
( (
...@@ -49,13 +49,13 @@ ...@@ -49,13 +49,13 @@
<insert id="longDurationBatchInsertList" parameterType="list"> <insert id="longDurationBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_LONG_DURATION ( INSERT INTO SPACE_OPTIMIZE_LONG_DURATION (
id, ID,
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,
RECORD_ID, RECORD_ID,
LONG_PERIOD_ID, LONG_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
...@@ -96,8 +96,8 @@ ...@@ -96,8 +96,8 @@
</insert> </insert>
<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=",">
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
</insert> </insert>
<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=",">
( (
...@@ -142,13 +142,13 @@ ...@@ -142,13 +142,13 @@
<insert id="midDurationBatchInsertList" parameterType="list"> <insert id="midDurationBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_MID_DURATION ( INSERT INTO SPACE_OPTIMIZE_MID_DURATION (
id, ID,
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,
RECORD_ID, RECORD_ID,
MID_PERIOD_ID, MID_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
...@@ -189,8 +189,8 @@ ...@@ -189,8 +189,8 @@
</insert> </insert>
<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=",">
( (
...@@ -210,9 +210,9 @@ ...@@ -210,9 +210,9 @@
</insert> </insert>
<insert id="shortWellheadBatchInsertList" parameterType="list"> <insert id="shortWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_SHORT_WELLHEAD (id, create_by_id, create_by_name, create_time, modify_by_id, INSERT INTO SPACE_OPTIMIZE_SHORT_WELLHEAD (ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME, MODIFY_BY_ID,
modify_by_name, modify_time, SHORT_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER, START_SEQ, MODIFY_BY_NAME, MODIFY_TIME, SHORT_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER, START_SEQ,
OPTIMIZE_DATE,frostproof_well) OPTIMIZE_DATE,FROSTPROOF_WELL)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
</insert> </insert>
<insert id="shortDurationBatchInsertList" parameterType="list"> <insert id="shortDurationBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_SHORT_DURATION (id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_SHORT_DURATION (ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME,
modify_by_id, modify_by_name, modify_time, RECORD_ID, SHORT_PERIOD_ID, WELLHEAD_ID, IS_OPTIMIZE, MODIFY_BY_ID, MODIFY_BY_NAME, MODIFY_TIME, RECORD_ID, SHORT_PERIOD_ID, WELLHEAD_ID, IS_OPTIMIZE,
GENERATION_TYPE_KEY, OPEN_WELL_TIME, CLOSE_WELL_TIME, FIRST_START, OPTIMIZE_DATE) GENERATION_TYPE_KEY, OPEN_WELL_TIME, CLOSE_WELL_TIME, FIRST_START, OPTIMIZE_DATE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
...@@ -268,8 +268,8 @@ ...@@ -268,8 +268,8 @@
</insert> </insert>
<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=",">
...@@ -291,8 +291,8 @@ ...@@ -291,8 +291,8 @@
</insert> </insert>
<insert id="ultraWellheadBatchInsertList" parameterType="list"> <insert id="ultraWellheadBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_ULTRA_WELLHEAD ( id, create_by_id, create_by_name, create_time, INSERT INTO SPACE_OPTIMIZE_ULTRA_WELLHEAD ( ID, CREATE_BY_ID, CREATE_BY_NAME, CREATE_TIME,
modify_by_id, modify_by_name, modify_time, ultra_period_id, WELLHEAD_ID, WELL_NUMBER, START_SEQ, OPTIMIZE_DATE) MODIFY_BY_ID, MODIFY_BY_NAME, MODIFY_TIME, ULTRA_PERIOD_ID, WELLHEAD_ID, WELL_NUMBER, START_SEQ, OPTIMIZE_DATE)
VALUES VALUES
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
( (
...@@ -314,15 +314,15 @@ ...@@ -314,15 +314,15 @@
<insert id="ultraDurationBatchInsertList" parameterType="list"> <insert id="ultraDurationBatchInsertList" parameterType="list">
INSERT INTO SPACE_OPTIMIZE_ULTRA_DURATION ( INSERT INTO SPACE_OPTIMIZE_ULTRA_DURATION (
id, ID,
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,
RECORD_ID, RECORD_ID,
ultra_period_id, ULTRA_PERIOD_ID,
WELLHEAD_ID, WELLHEAD_ID,
IS_OPTIMIZE, IS_OPTIMIZE,
GENERATION_TYPE_KEY, GENERATION_TYPE_KEY,
......
...@@ -2,59 +2,62 @@ ...@@ -2,59 +2,62 @@
<!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.WellDailyElectricityTrendViewMapper"> <mapper namespace="pps.core.space.mapper.WellDailyElectricityTrendViewMapper">
<resultMap id="BaseResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView"> <resultMap id="BaseResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView">
<id column="ID" property="id" /> <id column="ID" property="id"/>
<result column="WELL_NUMBER" property="wellNumber" /> <result column="WELL_NUMBER" property="wellNumber"/>
<result column="space_run_duration" property="spaceRunDuration" /> <result column="SPACE_RUN_DURATION" property="spaceRunDuration"/>
<result column="daily_open_hour" property="dailyOpenHour" /> <result column="DAILY_OPEN_HOUR" property="dailyOpenHour"/>
<result column="daily_green_open_hour" property="dailyGreenOpenHour" /> <result column="DAILY_GREEN_OPEN_HOUR" property="dailyGreenOpenHour"/>
<result column="daily_green_consumption" property="dailyGreenConsumption" /> <result column="DAILY_GREEN_CONSUMPTION" property="dailyGreenConsumption"/>
<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="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">
id ID
, ,
WELL_NUMBER, WELL_NUMBER,
space_run_duration, SPACE_RUN_DURATION,
daily_open_hour, DAILY_OPEN_HOUR,
daily_green_open_hour, DAILY_GREEN_OPEN_HOUR,
daily_green_consumption, DAILY_GREEN_CONSUMPTION,
daily_electricity_consumption, DAILY_ELECTRICITY_CONSUMPTION,
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"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
where WHERE
id=#{id} ID=#{id}
</select> </select>
<select id="selectList" parameterType="pps.core.space.entity.WellDailyElectricityTrendView" <select id="selectList" parameterType="pps.core.space.entity.WellDailyElectricityTrendView"
resultMap="BaseResultMap"> resultMap="BaseResultMap">
select SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
from WELL_DAILY_ELECTRICITY_TREND FROM WELL_DAILY_ELECTRICITY_TREND
where WHERE
id=#{id} ID=#{id}
</select> </select>
<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=",">
( (
...@@ -76,42 +79,42 @@ ...@@ -76,42 +79,42 @@
</insert> </insert>
<resultMap id="ExtResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView" extends="BaseResultMap"> <resultMap id="ExtResultMap" type="pps.core.space.entity.WellDailyElectricityTrendView" extends="BaseResultMap">
<result column="month_daily_green_open_hour" property="monthDailyGreenOpenHour" /> <result column="MONTH_DAILY_GREEN_OPEN_HOUR" property="monthDailyGreenOpenHour"/>
<result column="month_space_run_duration" property="monthSpaceRunDuration" /> <result column="MONTH_SPACE_RUN_DURATION" property="monthSpaceRunDuration"/>
<result column="month_daily_green_consumption" property="monthDailyGreenConsumption" /> <result column="MONTH_DAILY_GREEN_CONSUMPTION" property="monthDailyGreenConsumption"/>
<result column="month_valley_electric_open_hour" property="monthValleyElectricOpenHour" /> <result column="MONTH_VALLEY_ELECTRIC_OPEN_HOUR" property="monthValleyElectricOpenHour"/>
<result column="year_daily_green_open_hour" property="yearDailyGreenOpenHour" /> <result column="YEAR_DAILY_GREEN_OPEN_HOUR" property="yearDailyGreenOpenHour"/>
<result column="year_space_run_duration" property="yearSpaceRunDuration" /> <result column="YEAR_SPACE_RUN_DURATION" property="yearSpaceRunDuration"/>
<result column="year_daily_green_consumption" property="yearDailyGreenConsumption" /> <result column="YEAR_DAILY_GREEN_CONSUMPTION" property="yearDailyGreenConsumption"/>
<result column="year_valley_electric_open_hour" property="yearValleyElectricOpenHour" /> <result column="YEAR_VALLEY_ELECTRIC_OPEN_HOUR" property="yearValleyElectricOpenHour"/>
</resultMap> </resultMap>
<select id="selectWellheadAnalysisPage" parameterType="pps.core.space.entity.WellDailyElectricityTrendView" <select id="selectWellheadAnalysisPage" parameterType="pps.core.space.entity.WellDailyElectricityTrendView"
resultMap="ExtResultMap"> resultMap="ExtResultMap">
SELECT SELECT
z.* Z.*
FROM FROM
( (
SELECT t.WELL_NUMBER, SELECT T.WELL_NUMBER,
t.space_run_duration, T.SPACE_RUN_DURATION,
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,
m.month_valley_electric_open_hour, M.MONTH_VALLEY_ELECTRIC_OPEN_HOUR,
y.year_daily_green_open_hour, Y.YEAR_DAILY_GREEN_OPEN_HOUR,
y.year_space_run_duration, Y.YEAR_SPACE_RUN_DURATION,
y.year_daily_green_consumption, Y.YEAR_DAILY_GREEN_CONSUMPTION,
y.year_valley_electric_open_hour Y.YEAR_VALLEY_ELECTRIC_OPEN_HOUR
FROM WELL_DAILY_ELECTRICITY_TREND t FROM WELL_DAILY_ELECTRICITY_TREND T
LEFT JOIN (SELECT WELL_NUMBER, LEFT JOIN (SELECT WELL_NUMBER,
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}
...@@ -120,12 +123,12 @@ ...@@ -120,12 +123,12 @@
#{item} #{item}
</foreach> </foreach>
GROUP BY GROUP BY
WELL_NUMBER) m ON t.WELL_NUMBER = m.WELL_NUMBER WELL_NUMBER) M ON T.WELL_NUMBER = M.WELL_NUMBER
LEFT JOIN (SELECT WELL_NUMBER, LEFT JOIN (SELECT WELL_NUMBER,
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}
...@@ -134,19 +137,19 @@ ...@@ -134,19 +137,19 @@
#{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}
</foreach> </foreach>
) z ) Z
<where> <where>
<if test="wellNumber != null and wellNumber != ''"> <if test="wellNumber != null and wellNumber != ''">
AND z.WELL_NUMBER LIKE concat('%',#{wellNumber},'%') AND Z.WELL_NUMBER LIKE CONCAT('%',#{wellNumber},'%')
</if> </if>
</where> </where>
ORDER BY ORDER BY
z.WELL_NUMBER Z.WELL_NUMBER
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<result column="STATION_ID" property="stationId" /> <result column="STATION_ID" property="stationId" />
<result column="DATA_DATE" property="dataDate" /> <result column="DATA_DATE" property="dataDate" />
<result column="production_time" property="productionTime" /> <result column="production_time" property="productionTime" />
<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="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption" <result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption"
/> />
<result column="electricity_consumption_ph" property="electricityConsumptionPh" /> <result column="electricity_consumption_ph" property="electricityConsumptionPh" />
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
STATION_ID, STATION_ID,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, DAILY_ELECTRICITY_CONSUMPTION,
daily_liquid_production, DAILY_LIQUID_PRODUCTION,
daily_utility_electricity_consumption, daily_utility_electricity_consumption,
electricity_consumption_ph, electricity_consumption_ph,
electricity_consumption_hh, electricity_consumption_hh,
...@@ -68,8 +68,8 @@ ...@@ -68,8 +68,8 @@
STATION_NAME, STATION_NAME,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, DAILY_ELECTRICITY_CONSUMPTION,
daily_liquid_production, DAILY_LIQUID_PRODUCTION,
daily_utility_electricity_consumption, daily_utility_electricity_consumption,
electricity_consumption_ph, electricity_consumption_ph,
electricity_consumption_hh, electricity_consumption_hh,
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
SELECT SELECT
d.STATION_NAME, d.STATION_NAME,
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
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
SELECT SELECT
STATION_NAME, STATION_NAME,
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
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<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" />
<result column="energy_storage_discharge" property="energyStorageDischarge" /> <result column="energy_storage_discharge" property="energyStorageDischarge" />
<result column="save_date" property="saveDate" /> <result column="save_date" property="saveDate" />
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
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,
energy_storage_discharge, energy_storage_discharge,
save_date, save_date,
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
<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)
VALUES VALUES
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<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>
...@@ -81,12 +81,12 @@ ...@@ -81,12 +81,12 @@
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
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
</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
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
</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
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
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
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<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" />
<result column="energy_storage_discharge" property="energyStorageDischarge" /> <result column="energy_storage_discharge" property="energyStorageDischarge" />
<result column="save_date" property="saveDate" /> <result column="save_date" property="saveDate" />
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
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,
energy_storage_discharge, energy_storage_discharge,
save_date save_date
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<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
<foreach collection="list" item="item" separator=","> <foreach collection="list" item="item" separator=",">
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<result column="WELL_NUMBER" property="wellNumber" /> <result column="WELL_NUMBER" property="wellNumber" />
<result column="DATA_DATE" property="dataDate" /> <result column="DATA_DATE" property="dataDate" />
<result column="production_time" property="productionTime" /> <result column="production_time" property="productionTime" />
<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="SYSTEM_SOURCE" property="systemSource" /> <result column="SYSTEM_SOURCE" property="systemSource" />
<result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption" <result column="daily_utility_electricity_consumption" property="dailyUtilityElectricityConsumption"
/> />
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
WELL_NUMBER, WELL_NUMBER,
data_date, data_date,
production_time, production_time,
daily_electricity_consumption, DAILY_ELECTRICITY_CONSUMPTION,
daily_liquid_production, DAILY_LIQUID_PRODUCTION,
daily_utility_electricity_consumption, daily_utility_electricity_consumption,
electricity_consumption_ph, electricity_consumption_ph,
electricity_consumption_hh, electricity_consumption_hh,
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<insert id="batchInsertList" parameterType="list"> <insert id="batchInsertList" parameterType="list">
INSERT INTO WELLHEAD_DAILY_PRODUCTION_SITUATION ( WELLHEAD_ID, WELL_NUMBER, data_date, production_time, INSERT INTO WELLHEAD_DAILY_PRODUCTION_SITUATION ( WELLHEAD_ID, WELL_NUMBER, data_date, production_time,
daily_electricity_consumption, daily_liquid_production, SYSTEM_SOURCE, daily_utility_electricity_consumption, DAILY_ELECTRICITY_CONSUMPTION, DAILY_LIQUID_PRODUCTION, SYSTEM_SOURCE, daily_utility_electricity_consumption,
electricity_consumption_ph, electricity_consumption_ph,
electricity_consumption_hh, electricity_consumption_hh,
electricity_consumption_np, electricity_consumption_np,
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView"> resultType="pps.core.prediction.entity.WellheadDailyProductionSituationView">
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
FROM BASE_POWER_LINE_WELLHEAD w FROM BASE_POWER_LINE_WELLHEAD w
JOIN WELLHEAD_DAILY_PRODUCTION_SITUATION s ON w.WELLHEAD_ID = s.WELLHEAD_ID 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 LEFT JOIN BASE_POWER_LINE l ON w.line_id = l.id
......
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