<?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.DailyTrafficRankingMapper">
    
    <resultMap type="DailyTrafficRanking" id="DailyTrafficRankingResult">
    	<id     property="id"      column="id"      />
        <result property="ranking"    column="ranking"    />
        <result property="accessName"     column="access_name"     />
        <result property="browseCount"     column="browse_count"     />
    </resultMap>
    
    <sql id="selectDailyTrafficRankingVo">
        select id, ranking, access_name, browse_count from sooka_daily_traffic_ranking
    </sql>

    <select id="selectDailyTrafficRankingList" parameterType="DailyTrafficRanking" resultMap="DailyTrafficRankingResult">
        <include refid="selectDailyTrafficRankingVo"/>
        order by ranking asc
    </select>

	<delete id="deleteDailyTrafficRankingAll" parameterType="Long">
		delete from sooka_daily_traffic_ranking
	</delete>

	<insert id="insertBatch">
		insert into sooka_daily_traffic_ranking (ranking, access_name, browse_count) values
		<foreach item="item" collection="list" separator=",">
			(#{item.ranking},#{item.accessName},#{item.browseCount})
		</foreach>
	</insert>


</mapper>