ソースを参照

:bug: 季度报表修改

lag 1 年間 前
コミット
df0ef63c5a

+ 7 - 1
src/main/java/com/shcd/service/impl/SpStatementShipUsageMonthServiceImpl.java

@@ -177,7 +177,13 @@ public class SpStatementShipUsageMonthServiceImpl extends
       SpStatementShipUsageMonthVo underLineYear = spStatementShipUsageMonthMapper.getUnderLineYearData(
           toDateBegin, toDate);
       SpStatementShipUsageMonth underLine = new SpStatementShipUsageMonth();
-      if (underLineMonth != null && underLineYear != null) {
+      if (underLineMonth != null || underLineYear != null) {
+        if (underLineMonth == null){
+          underLineMonth = new SpStatementShipUsageMonthVo();
+        }
+        if (underLineYear == null){
+          underLineYear = new SpStatementShipUsageMonthVo();
+        }
         underLine.setId(snowflakeGenerator.next().toString());
         underLine.setReportDate(toDate);
         underLine.setDataSource(20);

+ 1 - 1
src/main/resources/mapper/SpStatementInlandLowMapper.xml

@@ -109,7 +109,7 @@
       TO_DATE(#{lastReportDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND T.MODIFYTIME <=
       TO_DATE(#{reportDateEnd}, 'yyyy-MM-dd HH24:mi:ss')
       AND T.MODIFYTIME >=
-      TO_DATE(#{reportDateStart}, 'yyyy-MM-dd HH24:mi:ss'))
+      TO_DATE(#{reportDateStart}, 'yyyy-MM-dd HH24:mi:ss') AND T.CONNTYPE != '低压(标准化)')
     </if>
     )
     GROUP BY PORT.AREA

+ 166 - 103
src/main/resources/mapper/SpStatementShipUsageMonthMapper.xml

@@ -1,108 +1,171 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+  "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.shcd.mapper.SpStatementShipUsageMonthMapper">
 
-    <resultMap id="BaseResultMap" type="com.shcd.entity.SpStatementShipUsageMonth">
-            <result property="reportDate" column="REPORT_DATE" jdbcType="TIMESTAMP"/>
-            <result property="shipUsageYear" column="SHIP_USAGE_YEAR" jdbcType="DECIMAL"/>
-            <result property="shorePowerTimeMonth" column="SHORE_POWER_TIME_MONTH" jdbcType="DECIMAL"/>
-            <result property="shorePowerTimeYear" column="SHORE_POWER_TIME_YEAR" jdbcType="DECIMAL"/>
-            <result property="shorePowerCountMonth" column="SHORE_POWER_COUNT_MONTH" jdbcType="DECIMAL"/>
-            <result property="shorePowerCountYear" column="SHORE_POWER_COUNT_YEAR" jdbcType="DECIMAL"/>
-            <result property="dataSource" column="DATA_SOURCE" jdbcType="DECIMAL"/>
-            <result property="shipUsageMonth" column="SHIP_USAGE_MONTH" jdbcType="DECIMAL"/>
-    </resultMap>
-    <delete id="deleteByDate">
-        delete from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH where trunc(REPORT_DATE) = to_date(#{toDate},'yyyy-mm-dd')
-    </delete>
-    <select id="selectOriginDataMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
-        select STARTTIME chargeStartDate, ENDTIME chargeEndDate ,ELECT shorePowerCount  from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO
-        where (STARTTIME between #{lastDate} and #{thisDate}) OR (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND MODIFYTIME between #{lastDate} and #{thisDate})
-    </select>
-    <select id="selectGhDataMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select decode(sum(SHORE_POWER_BOAT_USE_NUMBER),null,0,sum(SHORE_POWER_BOAT_USE_NUMBER)) shipUsage,decode(sum(POWER_CONN_HOURS),null,0,sum(POWER_CONN_HOURS)) shorePowerTime,decode(sum(ELECTRICITY_CONSUMPTION),null,0,sum(ELECTRICITY_CONSUMPTION)) shorePowerCount  from GHJG_PORT_MANAGE.SHORE_POWER_DEVICE_USAGE
-        where trunc(REPORT_DATE) = #{thisDate}
-    </select>
-    <select id="selectOriginDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select SHIP_USAGE_YEAR shipUsage, SHORE_POWER_COUNT_YEAR shorePowerCount,SHORE_POWER_TIME_YEAR shorePowerTime from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH where trunc(REPORT_DATE) = to_date(#{toDate},'yyyy-mm-dd')
-        and DATA_SOURCE = 0
-    </select>
-    <select id="selectGhDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select SHIP_USAGE_YEAR shipUsage, SHORE_POWER_COUNT_YEAR shorePowerCount,SHORE_POWER_TIME_YEAR shorePowerTime from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH where trunc(REPORT_DATE) = to_date(#{toDate},'yyyy-mm-dd')
-        and DATA_SOURCE = 10
-    </select>
-    <select id="getInRiverDataBeforeThisMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select SHIP_USAGE_YEAR shipUsage, SHORE_POWER_COUNT_YEAR shorePowerCount,SHORE_POWER_TIME_YEAR shorePowerTime from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH WHERE trunc(REPORT_DATE) = to_date(#{toDate},'yyyy-mm-dd')
-        AND DATA_SOURCE = 1
-    </select>
-    <select id="getUnderLineMonthData" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  ship_usage shipUsage, power_time_use shorePowerTime, power_elec_use  shorePowerCount from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
-        where trunc(REPORT_DATE) = #{toDate} and NAME = '上海市黄浦江码头岸线建设管理有限公司'
-    </select>
-    <select id="getUnderLineYearData" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  SUM(ship_usage) shipUsage, SUM(power_time_use) shorePowerTime , SUM(power_elec_use) shorePowerCount from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
-        where  trunc(REPORT_DATE) >= #{yearCountBegin} and trunc(REPORT_DATE) &lt;= #{yearCountEnd} and NAME = '上海市黄浦江码头岸线建设管理有限公司'
-    </select>
-    <select id="selectOriginSelfDataMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  sum(USE_COUNT) shipUsage, sum(ELE_TIME) shorePowerCount, sum(USE_ELECTRICITY) shorePowerTime from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse
-        where MODIFY_TIME >= #{lastDate} and MODIFY_TIME &lt;= #{thisDate}
-    </select>
-    <select id="selectOriginSelfDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  sum(USE_COUNT) shipUsage, sum(ELE_TIME) shorePowerCount, sum(USE_ELECTRICITY) shorePowerTime from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse
-        where MODIFY_TIME >= #{yearCountBegin} and MODIFY_TIME &lt;= #{yearCountEnd}
-    </select>
-    <select id="selectQuarterOrigin" resultType="com.shcd.vo.SpQuarterReportOriginVo">
-      select b.BERTHTYPE, b.CAPACITY, i.STARTTIME, i.ENDTIME, i.ELECT
-      from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO i
-             left join GHJG_PORT_MANAGE.SHORE_POWER_BERTH_INFO_NEW b on i.BERTHID = b.BERTHID
-      where b.BERTHTYPE is not null
-        AND ((i.STARTTIME >= #{startDate}
-        AND i.STARTTIME &lt;= #{endDate})
-        OR (i.STARTTIME >= #{newStartDate} and i.STARTTIME &lt;= #{newStartEnd} AND
-            i.MODIFYTIME >= #{startDate} and i.MODIFYTIME &lt;= #{endDate}))
-    </select>
-    <select id="selectQuarterBlBerth" resultType="com.shcd.vo.SpQuarterReportBlVo">
-        select B.BERTH_TYPE berthType, b.TONNAGE capacity , m.USE_COUNT useCount, m.ELE_TIME elect, m.USE_ELECTRICITY useElectricity
-        from GHJG_PORT_MANAGE.SHORE_POWER_BLBERTHMONTHUSE m
-                 left join
-             GHJG_PORT_MANAGE.SHORE_POWER_CHDEVICEFBO b on m.USER_BERTH_ID = b.ID
-        where m.MODIFY_TIME >= #{startDate}
-        and  m.MODIFY_TIME &lt;= #{endDate} AND b.BERTH_TYPE is not null
-    </select>
-    <select id="selectWgqMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
-        select STARTTIME chargeStartDate, ENDTIME chargeEndDate ,ELECT shorePowerCount  from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO
-        where ((STARTTIME between #{lastDate} and #{thisDate}) OR (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND MODIFYTIME between #{lastDate} and #{thisDate})) and ENTERPRISESNAME in ('上海外高桥发电有限责任公司','上海外高桥第二发电有限责任公司','上海外高桥第三发电有限责任公司')
-    </select>
-    <select id="selectWgqYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select SHIP_USAGE_YEAR shipUsage, SHORE_POWER_COUNT_YEAR shorePowerCount,SHORE_POWER_TIME_YEAR shorePowerTime
-        from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH where trunc(REPORT_DATE) = to_date(#{toDate},'yyyy-mm-dd')
-        and DATA_SOURCE = 100
-    </select>
-    <select id="getInRiverDataThisMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
-        select STARTTIME chargeStartDate, ENDTIME chargeEndDate ,ELECT shorePowerCount  from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO i
-        left join GHJG_PORT_MANAGE.SHORE_POWER_PORT_INFO_NEW b on B.PORTID = i.PORTID
-        where ((STARTTIME between #{lastDate} and #{thisDate}) OR (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND MODIFYTIME between #{lastDate} and #{thisDate})) and (CONNTYPE = '低压(标准化)' and area >= 2 AND b.AREA &lt;= 12)
-    </select>
-    <select id="getInRiverDataSelfThisMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  sum(USE_COUNT) shipUsage, sum(ELE_TIME) shorePowerCount, sum(USE_ELECTRICITY) shorePowerTime from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse b
-                                                                                                             left join GHJG_PORT_MANAGE.SHORE_POWER_CHDEVICEFBO c on b.USER_BERTH_ID = c.ID
-        where b.MODIFY_TIME >= #{lastDate} and b.MODIFY_TIME &lt;= #{thisDate} and c.AREA >= 2 AND c.AREA &lt;= 12
-    </select>
-    <select id="getUnderLineMonthDataSg" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
-        select  ship_usage shipUsage, power_time_use shorePowerTime, power_elec_use shorePowerCount from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
-        where trunc(REPORT_DATE) = #{toDate} and NAME = '上海国际港务(集团)股份有限公司'
-    </select>
-    <select id="selectThreeMonthsDataTotal" resultType="com.shcd.vo.SpShipUsageMonthQuarterVo">
-      SELECT SUM(T.SHIP_USAGE_MONTH) shipUsageMonth,
-             MAX(T.SHIP_USAGE_YEAR) shipUsageYear,
-             SUM(T.SHORE_POWER_TIME_MONTH) shorePowerCountMonth,
-             MAX(T.SHORE_POWER_TIME_YEAR) shorePowerCountYear,
-             SUM(T.SHORE_POWER_COUNT_MONTH) shorePowerTimeMonth,
-             MAX(T.SHORE_POWER_COUNT_YEAR) shorePowerTimeYear
-      FROM GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH T
-      where T.DATA_SOURCE = 99
-      AND T.REPORT_DATE >= #{start} AND T.REPORT_DATE &lt;= #{end}
-    </select>
+  <resultMap id="BaseResultMap" type="com.shcd.entity.SpStatementShipUsageMonth">
+    <result property="reportDate" column="REPORT_DATE" jdbcType="TIMESTAMP"/>
+    <result property="shipUsageYear" column="SHIP_USAGE_YEAR" jdbcType="DECIMAL"/>
+    <result property="shorePowerTimeMonth" column="SHORE_POWER_TIME_MONTH" jdbcType="DECIMAL"/>
+    <result property="shorePowerTimeYear" column="SHORE_POWER_TIME_YEAR" jdbcType="DECIMAL"/>
+    <result property="shorePowerCountMonth" column="SHORE_POWER_COUNT_MONTH" jdbcType="DECIMAL"/>
+    <result property="shorePowerCountYear" column="SHORE_POWER_COUNT_YEAR" jdbcType="DECIMAL"/>
+    <result property="dataSource" column="DATA_SOURCE" jdbcType="DECIMAL"/>
+    <result property="shipUsageMonth" column="SHIP_USAGE_MONTH" jdbcType="DECIMAL"/>
+  </resultMap>
+  <delete id="deleteByDate">
+    delete
+    from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH
+    where trunc(REPORT_DATE) = to_date(#{toDate}, 'yyyy-mm-dd')
+  </delete>
+  <select id="selectOriginDataMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
+    select STARTTIME chargeStartDate, ENDTIME chargeEndDate, ELECT shorePowerCount
+    from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO
+    where (STARTTIME between #{lastDate} and #{thisDate})
+       OR (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND
+           MODIFYTIME between #{lastDate} and #{thisDate} AND CONNTYPE != '低压(标准化)')
+  </select>
+  <select id="selectGhDataMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select decode(sum(SHORE_POWER_BOAT_USE_NUMBER), null, 0,
+                  sum(SHORE_POWER_BOAT_USE_NUMBER))                      shipUsage,
+           decode(sum(POWER_CONN_HOURS), null, 0, sum(POWER_CONN_HOURS)) shorePowerTime,
+           decode(sum(ELECTRICITY_CONSUMPTION), null, 0,
+                  sum(ELECTRICITY_CONSUMPTION))                          shorePowerCount
+    from GHJG_PORT_MANAGE.SHORE_POWER_DEVICE_USAGE
+    where trunc(REPORT_DATE) = #{thisDate}
+  </select>
+  <select id="selectOriginDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select SHIP_USAGE_YEAR        shipUsage,
+           SHORE_POWER_COUNT_YEAR shorePowerCount,
+           SHORE_POWER_TIME_YEAR  shorePowerTime
+    from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH
+    where trunc(REPORT_DATE) = to_date(#{toDate}, 'yyyy-mm-dd')
+      and DATA_SOURCE = 0
+  </select>
+  <select id="selectGhDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select SHIP_USAGE_YEAR        shipUsage,
+           SHORE_POWER_COUNT_YEAR shorePowerCount,
+           SHORE_POWER_TIME_YEAR  shorePowerTime
+    from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH
+    where trunc(REPORT_DATE) = to_date(#{toDate}, 'yyyy-mm-dd')
+      and DATA_SOURCE = 10
+  </select>
+  <select id="getInRiverDataBeforeThisMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select SHIP_USAGE_YEAR        shipUsage,
+           SHORE_POWER_COUNT_YEAR shorePowerCount,
+           SHORE_POWER_TIME_YEAR  shorePowerTime
+    from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH
+    WHERE trunc(REPORT_DATE) = to_date(#{toDate}, 'yyyy-mm-dd')
+      AND DATA_SOURCE = 1
+  </select>
+  <select id="getUnderLineMonthData" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select ship_usage shipUsage, power_time_use shorePowerTime, power_elec_use shorePowerCount
+    from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
+    where trunc(REPORT_DATE) = #{toDate}
+      and NAME = '上海市黄浦江码头岸线建设管理有限公司'
+  </select>
+  <select id="getUnderLineYearData" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select SUM(ship_usage)     shipUsage,
+           SUM(power_time_use) shorePowerTime,
+           SUM(power_elec_use) shorePowerCount
+    from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
+    where trunc(REPORT_DATE) >= #{yearCountBegin}
+      and trunc(REPORT_DATE) &lt;= #{yearCountEnd}
+      and NAME = '上海市黄浦江码头岸线建设管理有限公司'
+  </select>
+  <select id="selectOriginSelfDataMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select sum(USE_COUNT)       shipUsage,
+           sum(USE_ELECTRICITY) shorePowerCount,
+           sum(ELE_TIME)        shorePowerTime
+    from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse
+    where MODIFY_TIME >= #{lastDate}
+      and MODIFY_TIME &lt;= #{thisDate}
+  </select>
+  <select id="selectOriginSelfDataYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select sum(USE_COUNT)       shipUsage,
+           sum(USE_ELECTRICITY)        shorePowerCount,
+           sum(ELE_TIME) shorePowerTime
+    from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse
+    where MODIFY_TIME >= #{yearCountBegin}
+      and MODIFY_TIME &lt;= #{yearCountEnd}
+  </select>
+  <select id="selectQuarterOrigin" resultType="com.shcd.vo.SpQuarterReportOriginVo">
+    select b.BERTHTYPE, b.CAPACITY, i.STARTTIME, i.ENDTIME, i.ELECT
+    from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO i
+           left join GHJG_PORT_MANAGE.SHORE_POWER_BERTH_INFO_NEW b on i.BERTHID = b.BERTHID
+    where b.BERTHTYPE is not null
+      AND ((i.STARTTIME >= #{startDate}
+      AND i.STARTTIME &lt;= #{endDate})
+      OR (i.STARTTIME >= #{newStartDate} and i.STARTTIME &lt;= #{newStartEnd} AND
+          i.MODIFYTIME >= #{startDate} and i.MODIFYTIME &lt;= #{endDate}) AND i.CONNTYPE != '低压(标准化)')
+  </select>
+  <select id="selectQuarterBlBerth" resultType="com.shcd.vo.SpQuarterReportBlVo">
+    select B.BERTH_TYPE      berthType,
+           b.TONNAGE         capacity,
+           m.USE_COUNT       useCount,
+           m.ELE_TIME        elect,
+           m.USE_ELECTRICITY useElectricity
+    from GHJG_PORT_MANAGE.SHORE_POWER_BLBERTHMONTHUSE m
+           left join
+         GHJG_PORT_MANAGE.SHORE_POWER_CHDEVICEFBO b on m.USER_BERTH_ID = b.ID
+    where m.MODIFY_TIME >= #{startDate}
+      and m.MODIFY_TIME &lt;= #{endDate}
+      AND b.BERTH_TYPE is not null
+  </select>
+  <select id="selectWgqMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
+    select STARTTIME chargeStartDate, ENDTIME chargeEndDate, ELECT shorePowerCount
+    from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO
+    where ((STARTTIME between #{lastDate} and #{thisDate}) OR
+           (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND
+            MODIFYTIME between #{lastDate} and #{thisDate}))
+      and ENTERPRISESNAME in ('上海外高桥发电有限责任公司', '上海外高桥第二发电有限责任公司',
+                              '上海外高桥第三发电有限责任公司')
+  </select>
+  <select id="selectWgqYear" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select SHIP_USAGE_YEAR        shipUsage,
+           SHORE_POWER_COUNT_YEAR shorePowerCount,
+           SHORE_POWER_TIME_YEAR  shorePowerTime
+    from GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH
+    where trunc(REPORT_DATE) = to_date(#{toDate}, 'yyyy-mm-dd')
+      and DATA_SOURCE = 100
+  </select>
+  <select id="getInRiverDataThisMonth" resultType="com.shcd.vo.SpStatementShipUsageDetail">
+    select STARTTIME chargeStartDate, ENDTIME chargeEndDate, ELECT shorePowerCount
+    from GHJG_PORT_MANAGE.SHORE_POWER_CONN_RECORD_INFO i
+           left join GHJG_PORT_MANAGE.SHORE_POWER_PORT_INFO_NEW b on B.PORTID = i.PORTID
+    where ((STARTTIME between #{lastDate} and #{thisDate}) OR
+           (STARTTIME between #{lastCycleStart} and #{lastCycleEnd} AND
+            MODIFYTIME between #{lastDate} and #{thisDate}))
+      and (CONNTYPE = '低压(标准化)' and area >= 2 AND b.AREA &lt;= 12)
+  </select>
+  <select id="getInRiverDataSelfThisMonth" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select sum(USE_COUNT)       shipUsage,
+           sum(USE_ELECTRICITY) shorePowerCount,
+           sum(ELE_TIME)        shorePowerTime
+    from GHJG_PORT_MANAGE.Shore_Power_Blberthmonthuse b
+           left join GHJG_PORT_MANAGE.SHORE_POWER_CHDEVICEFBO c on b.USER_BERTH_ID = c.ID
+    where b.MODIFY_TIME >= #{lastDate}
+      and b.MODIFY_TIME &lt;= #{thisDate}
+      and c.AREA >= 2
+      AND c.AREA &lt;= 12
+  </select>
+  <select id="getUnderLineMonthDataSg" resultType="com.shcd.vo.SpStatementShipUsageMonthVo">
+    select ship_usage shipUsage, power_time_use shorePowerTime, power_elec_use shorePowerCount
+    from GHJG_PORT_MANAGE.SP_STATEMENT_UNDERLINE
+    where trunc(REPORT_DATE) = #{toDate}
+      and NAME = '上海国际港务(集团)股份有限公司'
+  </select>
+  <select id="selectThreeMonthsDataTotal" resultType="com.shcd.vo.SpShipUsageMonthQuarterVo">
+    SELECT SUM(T.SHIP_USAGE_MONTH)        shipUsageMonth,
+           MAX(T.SHIP_USAGE_YEAR)         shipUsageYear,
+           SUM(T.SHORE_POWER_COUNT_MONTH) shorePowerCountMonth,
+           MAX(T.SHORE_POWER_COUNT_YEAR)  shorePowerCountYear,
+           SUM(T.SHORE_POWER_TIME_MONTH)  shorePowerTimeMonth,
+           MAX(T.SHORE_POWER_TIME_YEAR)   shorePowerTimeYear
+    FROM GHJG_PORT_MANAGE.SP_STATEMENT_SHIP_USAGE_MONTH T
+    where T.DATA_SOURCE = 99
+      AND T.REPORT_DATE >= #{start}
+      AND T.REPORT_DATE &lt;= #{end}
+  </select>
 </mapper>