|
|
@@ -39,7 +39,7 @@
|
|
|
</select>
|
|
|
|
|
|
<!-- 修复 GROUP BY 问题:改为 DISTINCT + 聚合函数 -->
|
|
|
- <select id="selectTrsSensitiveResultsList" parameterType="TrsSensitiveResults" resultMap="TrsSensitiveResultsResult">
|
|
|
+<!-- <select id="selectTrsSensitiveResultsList" parameterType="TrsSensitiveResults" resultMap="TrsSensitiveResultsResult">
|
|
|
select
|
|
|
MAX(id) as id,
|
|
|
MAX(sitename) as sitename,
|
|
|
@@ -77,6 +77,29 @@
|
|
|
</where>
|
|
|
group by page, wrong_word
|
|
|
order by MAX(time) desc
|
|
|
+ </select>-->
|
|
|
+
|
|
|
+ <select id="selectTrsSensitiveResultsList" parameterType="TrsSensitiveResults" resultMap="TrsSensitiveResultsResult">
|
|
|
+ <include refid="selectTrsSensitiveResultsVo"/>
|
|
|
+ <where>
|
|
|
+ <if test="sitename != null and sitename != ''"> and sitename = #{sitename}</if>
|
|
|
+ <if test="sitetag != null and sitetag != ''"> and sitetag = #{sitetag}</if>
|
|
|
+ <if test="title != null and title != ''"> and title = #{title}</if>
|
|
|
+ <if test="page != null and page != ''"> and page like '%' || #{page} || '%'</if>
|
|
|
+ <if test="wrongWord != null and wrongWord != ''"> and wrong_word like '%' || #{wrongWord} || '%'</if>
|
|
|
+ <if test="correctWord != null and correctWord != ''"> and correct_word like '%' || #{correctWord} || '%'</if>
|
|
|
+ <if test="errorType != null and errorType != ''"> and error_type = #{errorType}</if>
|
|
|
+ <if test="errorGrade != null and errorGrade != ''"> and error_grade = #{errorGrade}</if>
|
|
|
+ <if test="context != null and context != ''"> and context like '%' || #{context} || '%'</if>
|
|
|
+ <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''">
|
|
|
+ and time between #{params.beginTime} and #{params.endTime}
|
|
|
+ </if>
|
|
|
+ <if test="status != null and status != ''"> and status like '%' || #{status} || '%'</if>
|
|
|
+ <if test="version != null and version != ''"> and version = #{version}</if>
|
|
|
+ <if test="datakey != null and datakey != ''"> and datakey = #{datakey}</if>
|
|
|
+ <if test="tenantId != null and tenantId != ''"> and tenant_id = #{tenantId}</if>
|
|
|
+ </where>
|
|
|
+ order by time desc
|
|
|
</select>
|
|
|
|
|
|
<!-- 修复 selectTrsSensitiveResultsListAll 中的 concat 问题 -->
|
|
|
@@ -116,15 +139,13 @@
|
|
|
where t.id = #{id}
|
|
|
</select>
|
|
|
|
|
|
- <!-- 修复 insert 语句,添加 id 字段 -->
|
|
|
<insert id="insertTrsSensitiveResults" parameterType="TrsSensitiveResults">
|
|
|
- <selectKey keyProperty="id" resultType="java.lang.String" order="BEFORE">
|
|
|
- SELECT replace(cast(gen_random_uuid() as varchar), '-', '')
|
|
|
+ <selectKey keyProperty="id" resultType="java.lang.Long" order="BEFORE">
|
|
|
+ SELECT nextval('seq_trs_sensitive_results_id')
|
|
|
</selectKey>
|
|
|
|
|
|
insert into trs_sensitive_results
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
- id,
|
|
|
<if test="page != null">page,</if>
|
|
|
<if test="title != null">title,</if>
|
|
|
<if test="sitename != null">sitename,</if>
|
|
|
@@ -143,7 +164,6 @@
|
|
|
<if test="tenantId != null">tenant_id,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
- #{id},
|
|
|
<if test="page != null">#{page},</if>
|
|
|
<if test="title != null">#{title},</if>
|
|
|
<if test="sitename != null">#{sitename},</if>
|