2022-05-17 18:13:13 +08:00
|
|
|
<?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="io.renren.modules.resourceBrowse.dao.ResourceBrowseDao">
|
|
|
|
|
|
|
|
<resultMap type="io.renren.modules.resourceBrowse.entity.ResourceBrowseEntity" id="resourceBrowseMap">
|
|
|
|
<result property="id" column="id"/>
|
|
|
|
<result property="userId" column="user_id"/>
|
|
|
|
<result property="resourceId" column="resource_id"/>
|
|
|
|
<result property="state" column="state"/>
|
|
|
|
<result property="creator" column="creator"/>
|
|
|
|
<result property="createDate" column="create_date"/>
|
|
|
|
<result property="updater" column="updater"/>
|
|
|
|
<result property="updateDate" column="update_date"/>
|
|
|
|
<result property="note1" column="note1"/>
|
|
|
|
<result property="note2" column="note2"/>
|
|
|
|
<result property="note3" column="note3"/>
|
|
|
|
</resultMap>
|
2022-05-18 18:06:47 +08:00
|
|
|
<select id="selectDayAvg" resultType="java.lang.Integer">
|
|
|
|
SELECT IFNULL(COUNT(id), 0) / ${days}
|
|
|
|
FROM tb_resource_browse
|
|
|
|
WHERE 1 = 1
|
|
|
|
AND state = 0
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectDayMax" resultType="java.lang.Integer">
|
|
|
|
SELECT IFNULL(MAX(count), 0)
|
|
|
|
FROM
|
|
|
|
(SELECT
|
|
|
|
COUNT( id ) AS "count"
|
|
|
|
FROM
|
|
|
|
tb_resource_browse
|
|
|
|
WHERE
|
|
|
|
1 = 1
|
|
|
|
AND state = 0
|
|
|
|
GROUP BY
|
|
|
|
SUBSTR(create_date, 1, 10)) temp
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectDayList" resultType="java.util.Map">
|
|
|
|
SELECT
|
|
|
|
SUBSTR(create_date, 1, 10) AS "date",
|
|
|
|
COUNT( id ) AS "count"
|
|
|
|
FROM
|
|
|
|
tb_resource_browse
|
|
|
|
WHERE
|
|
|
|
1 = 1
|
|
|
|
AND state = 0
|
|
|
|
AND create_date BETWEEN ${startDate} AND ${endDate}
|
|
|
|
GROUP BY
|
|
|
|
SUBSTR(create_date, 1, 10)
|
|
|
|
</select>
|
2022-05-17 18:13:13 +08:00
|
|
|
|
|
|
|
</mapper>
|