<?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.citygis.web.mapper.TabDatalogMapper">

    <select id="getDataLogList" resultType="com.citygis.web.domain.TabDatalog"
            parameterType="com.citygis.web.domain.TabDatalog">
        SELECT
        count(1) num,
        d.操作表 tableEnglishName,
        tsm.table_name,
        tsm.system_name
        FROM
        test.dbo.数据同步日志_2025_4 d
        left join tab_system_msg tsm
        on
        tsm.table_english_name = d.操作表
        <where>
            <if test="tableName != null">
                tsm.table_name like concat('%',#{tableName},'%')
            </if>
        </where>

        group by
        d.操作表,
        tsm.table_name,
        tsm.system_name

    </select>

    <select id="getDatalogDetailByTableEnglishName" resultType="com.citygis.web.domain.TabDatalog"
            parameterType="com.citygis.web.domain.TabDatalog">
        SELECT
        count(1) num,操作时间 time
        from
        test.dbo.数据同步日志_2025_4
        WHERE
        操作表 = #{tableEnglishName}
        <if test="startTime != null">
            and 操作时间 >= #{startTime}
            and 操作时间 &lt;= #{endTime}
        </if>
        group by
        操作时间
    </select>

</mapper>
