From 63264fe00b684bfec91ca5888f640971dabc0ed2 Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Mon, 02 Feb 2026 13:41:34 +0800
Subject: [PATCH] 修改模版,新增置顶

---
 multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 40 insertions(+), 6 deletions(-)

diff --git a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
index c555dad..76d33a3 100644
--- a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
@@ -56,7 +56,7 @@
         where id = #{id}
     </update>
 
-    <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate">
+    <select id="selectStandardizedTemplateList" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
         SELECT
             st.`id`,
             st.`company_id`,
@@ -83,12 +83,30 @@
         <if test="companyId!=null and companyId!=''">
             and st.company_id = #{companyId}
         </if>
-        ORDER BY
-            st.create_time DESC
+        <if test="templateName!=null and templateName!=''">
+            and st.template_name like concat('%',#{templateName},'%')
+        </if>
+        <if test="sort!=null and sort==1">
+            ORDER BY
+            st.top_time desc,
+            st.template_name asc
+        </if>
+        <if test="sort!=null and sort==2">
+            ORDER BY
+            st.top_time desc,
+            st.template_name desc
+        </if>
+        <if test="sort ==null or sort== '' or sort == 0">
+            ORDER BY
+            st.top_time desc,
+            st.create_time desc
+        </if>
+
+
     </select>
 
 
-    <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate">
+    <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
         SELECT
         st.`id`,
         st.`company_id`,
@@ -122,8 +140,24 @@
         <if test="industryTypeId!=null ">
             and st.industry_type_id = #{industryTypeId}
         </if>
-        ORDER BY
-        st.create_time DESC
+        <if test="templateName!=null and templateName!=''">
+            and st.template_name like concat('%',#{templateName},'%')
+        </if>
+        <if test="sort!=null and sort==1">
+            ORDER BY
+            st.top_time desc,
+            st.template_name asc
+        </if>
+        <if test="sort!=null and sort==2">
+            ORDER BY
+            st.top_time desc,
+            st.template_name desc
+        </if>
+        <if test="sort ==null or sort== '' or sort == 0">
+            ORDER BY
+            st.top_time desc,
+            st.create_time desc
+        </if>
     </select>
 
 </mapper>

--
Gitblit v1.9.2