From 03a3edee9ff27fa9bb4b32dcda08e279c7c094c8 Mon Sep 17 00:00:00 2001
From: heheng <475597332@qq.com>
Date: 星期五, 28 十一月 2025 17:30:11 +0800
Subject: [PATCH] 功能修改

---
 multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml |  124 +++++++++++++++++++++++++++++++++++------
 1 files changed, 106 insertions(+), 18 deletions(-)

diff --git a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
index 9608bfd..3292342 100644
--- a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
@@ -22,6 +22,21 @@
             <if test="format != null and format !=''" >
                 format = #{format},
             </if>
+            <if test="classify !=null">
+                classify = #{classify},
+            </if>
+            <if test="industryTypeId !=null">
+                industry_type_id = #{industryTypeId},
+            </if>
+            <if test="deptId !=null">
+                dept_id = #{deptId},
+            </if>
+            <if test="department !=null">
+                department = #{department},
+            </if>
+            <if test="stage != null and stage != ''">
+                stage = #{stage},
+            </if>
             <if test="delFlag != null and delFlag != ''" >
                 del_flag = #{delFlag},
             </if>
@@ -41,29 +56,102 @@
         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
-            `id`,
-            `company_id`,
-            `company_name`,
-            `template_name`,
-            `template_type`,
-            `file_path`,
-            `format`,
-            `del_flag`,
-            `create_by`,
-            `create_time`,
-            `update_by`,
-            `update_time`
+            st.`id`,
+            st.`company_id`,
+            st.`company_name`,
+            st.`template_name`,
+            st. `template_type`,
+            st. `file_path`,
+            st. `format`,
+            st. `classify`,
+            st. `dept_id`,
+            sd.`dept_name`,
+            st.`stage`,
+            st. `del_flag`,
+            st. `create_by`,
+            st. `create_time`,
+            st. `update_by`,
+            st. `update_time`
         FROM
-        standardized_template
+        standardized_template st
+        left join  sys_dept sd on st.dept_id =sd.dept_id
         WHERE
-            del_flag = 0 and template_type = #{templateType}
+            st.del_flag = 0 and st.template_type = #{templateType}
 
         <if test="companyId!=null and companyId!=''">
-            and company_id = #{companyId}
+            and st.company_id = #{companyId}
         </if>
-        ORDER BY
-            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.template_name asc
+        </if>
+        <if test="sort!=null and sort==2">
+            ORDER BY
+            st.template_name desc
+        </if>
+        <if test="sort ==null or sort== '' or sort == 0">
+            ORDER BY
+            st.create_time desc
+        </if>
+
+
     </select>
+
+
+    <select id="selectStandardizedTemplateListV2" resultType="com.gkhy.exam.system.domain.StandardizedTemplate" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
+        SELECT
+        st.`id`,
+        st.`company_id`,
+        st.`company_name`,
+        st.`template_name`,
+        st. `template_type`,
+        st. `file_path`,
+        st. `format`,
+        st. `classify`,
+        st. `dept_id`,
+        sd.`dept_name`,
+        st. `stage`,
+        st. `del_flag`,
+        st. `create_by`,
+        st. `create_time`,
+        st. `update_by`,
+        st. `update_time`,
+        st.industry_type_id,
+        st.`department`,
+        cit.`name` as industryTypeName
+        FROM
+        standardized_template st
+        left join  sys_dept sd on st.dept_id =sd.dept_id
+        left join  company_industry_type cit on cit.id =st.industry_type_id
+        WHERE
+        st.del_flag = 0 and st.template_type = #{templateType}
+
+        <if test="companyId!=null and companyId!=''">
+            and st.company_id = #{companyId}
+        </if>
+        <if test="industryTypeId!=null ">
+            and st.industry_type_id = #{industryTypeId}
+        </if>
+        <if test="templateName!=null and templateName!=''">
+            and st.template_name like concat('%',#{templateName},'%')
+        </if>
+        <if test="sort!=null and sort==1">
+            ORDER BY
+            st.template_name asc
+        </if>
+        <if test="sort!=null and sort==2">
+            ORDER BY
+            st.template_name desc
+        </if>
+        <if test="sort ==null or sort== '' or sort == 0">
+            ORDER BY
+            st.create_time desc
+        </if>
+    </select>
+
 </mapper>

--
Gitblit v1.9.2