<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//oos.juyouhx.com//DTD Mapper 3.0//EN" "http://oss.juyouhx.com/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.scpyun.platform.standard.jilinsscgsdp.focusareasSnapshot" name="重点领域统计">
    
    <update id="updateinfo" parameterType="map">
        UPDATE `ji_warning_focus_areas_snapshot`
        SET
        count	= #{count},
        percentage = #{percentage},
        alarm_level = #{alarmLevel}
        WHERE
        region_code = #{regionCode}
        and
        area_level = #{areaLevel}
        and
        statistical_time = #{statisticalTime}
        and
        event_category_id = #{eventCategoryId}
    </update>
    <insert id="insertFocusArea" parameterType="com.scpyun.platform.jilinsscgsdp.bean.entity.FocusAreas">
        INSERT INTO ji_warning_focus_areas_snapshot (
        fid,
        event_category_id,
        percentage,
        count,
        statistical_time,
        region_code,
        area_level,
        alarm_level
        )
        VALUES (
        #{fid},
        #{eventCategoryId},
        #{percentage},
        #{count},
        #{statisticalTime},
        #{regionCode},
        #{areaLevel},
        #{alarmLevel}
        )
    </insert>

    <delete id="truncateTable" parameterType="java.lang.String">
        delete from ji_warning_focus_areas_snapshot
    </delete>

    <select id="findAll" resultType="com.scpyun.platform.jilinsscgsdp.bean.entity.FocusAreas">
        SELECT
        `id` id ,
        `fid` fid,
        `event_category_id` eventCategoryId,
        `percentage` percentage,
        `count` count,
        `statistical_time` statisticalTime,
        `region_code` regionCode,
        `area_level` areaLevel,
        `alarm_level` alarmLevel
        FROM `ji_warning_focus_areas_snapshot`;
    </select>
</mapper>
