Files
ipms-sjy/yudao-module-mall/yudao-module-statistics-biz/src/main/resources/mapper/infra/ApiAccessLogStatisticsMapper.xml
2023-10-14 01:26:06 +08:00

25 lines
925 B
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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">
<select id="selectCountByIp" resultType="java.lang.Integer">
<!-- TODO @疯狂distinct 会不会更合适哈 -->
SELECT COUNT(1)
FROM infra_api_access_log
WHERE create_time BETWEEN #{beginTime} AND #{endTime}
AND deleted = FALSE
GROUP BY user_ip
</select>
<select id="selectCountByUserId" resultType="java.lang.Integer">
<!-- TODO @疯狂distinct 会不会更合适哈 -->
SELECT COUNT(1)
FROM infra_api_access_log
WHERE user_id > 0
AND create_time BETWEEN #{beginTime} AND #{endTime}
AND deleted = FALSE
GROUP BY user_id
</select>
</mapper>