<?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.eventSupplement" name="事件">

    <select id="getNotAreasOcuslist" parameterType="map" resultType="map">
        SELECT
        DISTINCT
        occurrence_time as occurrenceTime,
        event_category_id as eventCategoryId
        FROM
        jl_warring_supplement_event
        WHERE
        is_areas_ocus = 0
        and
        create_time &lt;= #{yesterdayEnd}
        <if test="regionLevel == '2'">
            AND city_id = #{regionId}
        </if>
        <if test="regionLevel == '3'">
            AND area_id = #{regionId}
        </if>
    </select>

    <update id="updateEventSupplementInfo" parameterType="map">
        update
          jl_warring_supplement_event
        set
          is_areas_ocus = 1
        where
          is_areas_ocus = 0
        and
        create_time &lt;= #{yesterdayEnd}
    </update>
    <insert id="insertEventSupplementInfo" parameterType="com.scpyun.platform.jilinsscgsdp.bean.entity.SupplementEvent">
        INSERT INTO jl_warring_supplement_event ( event_id, create_time, is_areas_ocus, area_id, city_id, occurrence_time, event_category_id )
        VALUES
        (#{eventId}, #{createTime}, #{isAreasOcus}, #{areaId}, #{cityId}, #{occurrenceTime}, #{eventCategoryId})
    </insert>

    <delete id="deleteSupplementInfo" parameterType="map">
        delete from jl_warring_supplement_event where id = #{id}
    </delete>


</mapper>
