devops 1 ماه پیش
والد
کامیت
8cc1e43f08

+ 2 - 4
ruoyi-admin/src/main/resources/mapper/project/TrsPolicyResultsMapper.xml

@@ -67,13 +67,12 @@
 
     <!-- 修复 insert 语句,添加 ID 生成 -->
     <insert id="insertTrsPolicyResults" parameterType="TrsPolicyResults">
-        <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_policy_results_id')
         </selectKey>
 
         insert into trs_policy_results
         <trim prefix="(" suffix=")" suffixOverrides=",">
-            id,
             <if test="sitename != null">sitename,</if>
             <if test="sitetag != null">sitetag,</if>
             <if test="page != null">page,</if>
@@ -92,7 +91,6 @@
             <if test="tenantId != null">tenant_id,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
-            #{id},
             <if test="sitename != null">#{sitename},</if>
             <if test="sitetag != null">#{sitetag},</if>
             <if test="page != null">#{page},</if>

+ 26 - 6
ruoyi-admin/src/main/resources/mapper/project/TrsSensitiveResultsMapper.xml

@@ -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>

+ 1 - 1
ruoyi-project/src/main/java/com/ruoyi/project/service/impl/TrsSiteconfigServiceImpl.java

@@ -409,7 +409,7 @@ public class TrsSiteconfigServiceImpl implements ITrsSiteconfigService
                     trsArticleInfo.setSitename(site.getSitename());
                     trsArticleInfo.setRecord(site.getRecord());
                     Map<String, Object> params = new HashMap<>();
-                    params.put("beginTime","2025-08-01");
+                    params.put("beginTime","2026-02-01");
                     params.put("endTime","2050-04-20");
 //                    trsArticleInfo.setTitle("习近平夫妇会见柬埔寨国王西哈莫尼和太后莫尼列");
                     trsArticleInfo.setParams(params);