java/wangpan-common/target/classes/com/wangpan/common/dal/mapper/TmdbScraperLogMapper.xml
2026-06-15 10:25:06 +08:00

38 lines
1.6 KiB
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">
<!-- TMDB定时刮削执行记录 Mapper XML存放复杂SQL简单CRUD由MyBatis-Plus BaseMapper自动提供 -->
<mapper namespace="com.wangpan.common.dal.mapper.TmdbScraperLogMapper">
<!-- 插入一条执行记录 -->
<insert id="insertLog" parameterType="map">
INSERT INTO wp_tmdb_scraper_log (
trigger_type, status, total_processed, total_success, total_skipped,
total_failed, user_count, detail_json, error_message, duration_ms,
start_time, end_time
) VALUES (
#{log.triggerType}, #{log.status}, #{log.totalProcessed}, #{log.totalSuccess}, #{log.totalSkipped},
#{log.totalFailed}, #{log.userCount}, #{log.detailJson}, #{log.errorMessage}, #{log.durationMs},
#{log.startTime}, #{log.endTime}
)
</insert>
<!-- 分页查询最近的执行记录 -->
<select id="queryRecent" resultType="java.util.Map">
SELECT * FROM wp_tmdb_scraper_log ORDER BY start_time DESC
LIMIT #{pageSize} OFFSET #{pageNo}
</select>
<!-- 查询最近的N条执行记录 -->
<select id="queryRecentByLimit" resultType="java.util.Map">
SELECT * FROM wp_tmdb_scraper_log ORDER BY start_time DESC LIMIT #{limit}
</select>
<!-- 根据ID查询单条记录 -->
<select id="findById" resultType="java.util.Map">
SELECT * FROM wp_tmdb_scraper_log WHERE id = #{id}
</select>
</mapper>