<?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">
<mapper namespace="com.shcd.mapper.SpStatementContainerMapper">

    <resultMap id="BaseResultMap" type="com.shcd.entity.SpStatementContainer">
            <result property="id" column="ID" jdbcType="VARCHAR"/>
            <result property="reportDate" column="REPORT_DATE" jdbcType="VARCHAR"/>
            <result property="shipUsage" column="SHIP_USAGE" jdbcType="DECIMAL"/>
            <result property="shipUsageTon" column="SHIP_USAGE_TON" jdbcType="DECIMAL"/>
            <result property="chargeTime" column="CHARGE_TIME" jdbcType="DECIMAL"/>
            <result property="chargeTimeTon" column="CHARGE_TIME_TON" jdbcType="DECIMAL"/>
            <result property="electUsage" column="ELECT_USAGE" jdbcType="DECIMAL"/>
            <result property="electUsageTon" column="ELECT_USAGE_TON" jdbcType="DECIMAL"/>
            <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
            <result property="sumShipUsageNum" column="SUM_SHIP_USAGE_NUM" jdbcType="DECIMAL"/>
            <result property="sumShipUsageTon" column="SUM_SHIP_USAGE_TON" jdbcType="DECIMAL"/>
            <result property="sumChargeTime" column="SUM_CHARGE_TIME" jdbcType="DECIMAL"/>
            <result property="sumElectUse" column="SUM_ELECT_USE" jdbcType="DECIMAL"/>
            <result property="sumElectUseTon" column="SUM_ELECT_USE_TON" jdbcType="DECIMAL"/>
    </resultMap>

    <sql id="Base_Column_List">
        ID,REPORT_DATE,SHIP_USAGE,
        SHIP_USAGE_TON,CHARGE_TIME,CHARGE_TIME_TON,
        ELECT_USAGE,ELECT_USAGE_TON,CREATE_TIME,
        SUM_SHIP_USAGE_NUM,SUM_SHIP_USAGE_TON,SUM_CHARGE_TIME,
        SUM_ELECT_USE,SUM_ELECT_USE_TON
    </sql>

  <select id="selectCurrentQuarterData" resultType="com.shcd.vo.SpQuarterReportOriginVo">
    select SUM(t.ship_usage) shipUsage,SUM(t.charge_time) chargeTime,SUM(t.elect_usage) elect from
    GHJG_PORT_MANAGE.SP_STATEMENT_CONTAINER t where t.report_date in
    <foreach item="item" collection="reportDateList" separator="," open="(" close=")">
      #{item}
    </foreach>
  </select>
</mapper>
