<?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.WebsiteAvailabilityMonitorMapper">
    
    <resultMap type="WebsiteAvailabilityMonitor" id="WebsiteAvailabilityMonitorResult">
    	<id     property="id"      column="id"      />
        <result property="siteName"    column="site_name"    />
        <result property="status"     column="status"     />
        <result property="monitorTime"   column="monitor_time"   />
    </resultMap>
    
    <sql id="selectWebsiteAvailabilityMonitorVo">
        select id, site_name, status, monitor_time from sooka_website_availability_monitor
    </sql>

    <select id="selectWebsiteAvailabilityMonitorList" parameterType="WebsiteAvailabilityMonitor" resultMap="WebsiteAvailabilityMonitorResult">
        <include refid="selectWebsiteAvailabilityMonitorVo"/>
    </select>

    <!--网站可用性实时监测-数据推送接口-->
	<delete id="deleteWebsiteAvailabilityMonitorAll" parameterType="Long">
		delete from sooka_website_availability_monitor
	</delete>
    <!--网站可用性实时监测-数据推送接口-->
	<insert id="insertBatch">
		insert into sooka_website_availability_monitor (site_name,status,monitor_time) values
		<foreach item="item" collection="list" separator=",">
			(#{item.siteName},#{item.status},#{item.monitorTime})
		</foreach>
	</insert>

</mapper>