|
@@ -5,66 +5,74 @@
|
|
|
<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
|
|
|
+ tsm.id,
|
|
|
+ tklr.systemName,
|
|
|
+ tklr.tableName,
|
|
|
+ tklr.tableEnglishName,
|
|
|
+ tklr.num,
|
|
|
+ FORMAT(tklr.createTime, 'yyyy-MM-dd HH:mm:ss') time
|
|
|
FROM
|
|
|
- 数据同步日志_2025_4 d
|
|
|
- left join tab_system_msg tsm
|
|
|
+ tab_kb_listen_result tklr
|
|
|
+ INNER JOIN (
|
|
|
+ SELECT
|
|
|
+ MAX(createTime) createTime,
|
|
|
+ tableEnglishName
|
|
|
+ FROM
|
|
|
+ tab_kb_listen_result
|
|
|
+ GROUP BY
|
|
|
+ tableEnglishName) tklr2
|
|
|
on
|
|
|
- tsm.table_english_name = d.操作表
|
|
|
+ tklr.tableEnglishName = tklr2.tableEnglishName
|
|
|
+ AND tklr.createTime = tklr2.createTime
|
|
|
+ LEFT JOIN tab_system_msg tsm on
|
|
|
+ tklr.tableEnglishName = tsm.table_english_name
|
|
|
<where>
|
|
|
- d.操作 = 'insert'
|
|
|
<if test="tableName != null">
|
|
|
- and tsm.table_name like concat('%',#{tableName},'%')
|
|
|
+ and tklr.tableName 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,
|
|
|
- d.操作表 tableEnglishName,
|
|
|
- tsm.table_name,
|
|
|
- tsm.system_name
|
|
|
- FROM
|
|
|
- 数据同步日志_2025_4 d
|
|
|
- left join tab_system_msg tsm
|
|
|
- on
|
|
|
- tsm.table_english_name = d.操作表
|
|
|
+ SELECT id, systemName, tableName, tableEnglishName, num, FORMAT(createTime, 'yyyy-MM-dd HH:mm:ss') time FROM
|
|
|
+ tab_kb_listen_result
|
|
|
<where>
|
|
|
- d.操作 = 'insert'
|
|
|
<if test="tableEnglishName != null">
|
|
|
- and d.操作表 like concat('%',#{tableEnglishName},'%')
|
|
|
+ and tableEnglishName like concat('%',#{tableEnglishName},'%')
|
|
|
</if>
|
|
|
</where>
|
|
|
<if test="startTime != null">
|
|
|
- and 操作时间 >= #{startTime}
|
|
|
- and 操作时间 <= #{endTime}
|
|
|
+ and createTime >= #{startTime}
|
|
|
+ and createTime <= #{endTime}
|
|
|
</if>
|
|
|
- group by
|
|
|
- d.操作表,
|
|
|
- tsm.table_name,
|
|
|
- tsm.system_name
|
|
|
</select>
|
|
|
|
|
|
<select id="getLinkTitle" resultType="com.citygis.web.domain.TabLinkTitle"
|
|
|
parameterType="com.citygis.web.domain.TabDatalog">
|
|
|
SELECT
|
|
|
- MAX(cnt) big,
|
|
|
- AVG(cnt) average,
|
|
|
- MIN(cnt) small
|
|
|
+ MAX(num) big,
|
|
|
+ AVG(num) average,
|
|
|
+ MIN(num) small
|
|
|
+ FROM tab_kb_listen_result
|
|
|
+ where tableEnglishName = #{tableEnglishName}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getDataByThatDay" resultType="com.citygis.web.domain.TabDatalog">
|
|
|
+ SELECT
|
|
|
+ s.system_name,
|
|
|
+ s.table_name,
|
|
|
+ s.table_english_name ,
|
|
|
+ COUNT(1) num
|
|
|
FROM
|
|
|
- (SELECT COUNT(1) AS cnt FROM 数据同步日志_2025_4 WHERE 操作表 = #{tableEnglishName} GROUP BY 操作时间) AS
|
|
|
- subquery
|
|
|
+ 数据同步日志_2025_4 d
|
|
|
+ INNER JOIN (SELECT system_name, table_name, table_english_name FROM tab_system_msg WHERE access_manner = '库表接口'
|
|
|
+ AND isApply = 1) s ON d.[操作表] = s.table_english_name
|
|
|
+ WHERE CONVERT(DATE, d.[操作时间], 103) = FORMAT(GETDATE(), 'yyyy-MM-dd')
|
|
|
+ GROUP BY
|
|
|
+ s.system_name,
|
|
|
+ s.table_name,
|
|
|
+ s.table_english_name
|
|
|
</select>
|
|
|
|
|
|
</mapper>
|