Files
ipms-sjy/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/infra/ApiAccessLogStatisticsMapper.xml

25 lines
925 B
XML
Raw Normal View History

2023-10-09 23:27:10 +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="cn.iocoder.yudao.module.statistics.dal.mysql.infra.ApiAccessLogStatisticsMapper">
2023-10-11 12:32:28 +08:00
2023-10-09 23:27:10 +08:00
<select id="selectCountByIp" resultType="java.lang.Integer">
2023-10-14 01:26:06 +08:00
<!-- TODO @疯狂distinct 会不会更合适哈 -->
2023-10-09 23:27:10 +08:00
SELECT COUNT(1)
FROM infra_api_access_log
2023-10-11 12:32:28 +08:00
WHERE create_time BETWEEN #{beginTime} AND #{endTime}
AND deleted = FALSE
2023-10-09 23:27:10 +08:00
GROUP BY user_ip
</select>
<select id="selectCountByUserId" resultType="java.lang.Integer">
2023-10-14 01:26:06 +08:00
<!-- TODO @疯狂distinct 会不会更合适哈 -->
2023-10-09 23:27:10 +08:00
SELECT COUNT(1)
FROM infra_api_access_log
2023-10-11 12:32:28 +08:00
WHERE user_id > 0
2023-10-09 23:27:10 +08:00
AND create_time BETWEEN #{beginTime} AND #{endTime}
2023-10-11 12:32:28 +08:00
AND deleted = FALSE
2023-10-09 23:27:10 +08:00
GROUP BY user_id
</select>
2023-10-11 12:32:28 +08:00
2023-10-09 23:27:10 +08:00
</mapper>