<?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.ruoyi.system.mapper_shate.AustraliaMiddleEastMapper">
    <resultMap id="RM_AustraliaMiddleEast" type="com.ruoyi.system.domain_shate.AustraliaMiddleEastVO">

        <result property="yearMonth" column="particular_month"/>
        <result property="month" column="month"/>
        <result property="id" column="ID"/>
        <result property="sstAnomalyIndex" column="sst_anomaly_index"/>
        <result property="temperatureAnomolies" column="temperature_anomolies"/>
        <result property="precipitationAnomolies" column="precipitation_anomolies"/>
        <result property="vaiAnomolies" column="vai_anomolies"/>
        <result property="createBy" column="created_by"/>
        <result property="createTime" column="created_time"/>

    </resultMap>

    <sql id="columns">
	    <![CDATA[
        ID,particular_month,sst_anomaly_index,temperature_anomolies,precipitation_anomolies,vai_anomolies,created_by,created_time,month
        ]]>
	</sql>

    <select id="selectAustralia" resultMap="RM_AustraliaMiddleEast">
        SELECT  <include refid="columns"/>  FROM  central_and_eastern_australia
        WHERE 1=1
        <if test="yearMonth!= null and yearMonth !=''">
            AND particular_month = #{yearMonth}
        </if>
        <if test="month!= null and month !=''">
            AND month = #{month}
        </if>
    </select>

    <delete id="DelAustralia">
        DELETE FROM central_and_eastern_australia
        WHERE ID=#{id}
    </delete>
    
    <insert id="IntoAustralia">
        <![CDATA[
        INSERT INTO central_and_eastern_australia (
            particular_month ,
            month,
            sst_anomaly_index ,
            temperature_anomolies ,
            precipitation_anomolies ,
            vai_anomolies ,
            created_by ,
            created_time
        ) VALUES (
                     #{yearMonth,jdbcType=VARCHAR},
                     #{month,jdbcType=VARCHAR},
                     #{sstAnomalyIndex,jdbcType=DOUBLE},
                     #{temperatureAnomolies,jdbcType=DOUBLE},
                     #{precipitationAnomolies,jdbcType=DOUBLE},
                     #{vaiAnomolies,jdbcType=DOUBLE},
                     #{createBy,jdbcType=VARCHAR},
                     #{createTime,jdbcType=TIMESTAMP}
                 )
        ]]>
    </insert>
</mapper> 