From c26e227abe288476c11b0a8b7875045e71efa14c Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: Thu, 30 Apr 2026 17:30:00 +0800
Subject: [PATCH] 新增修改
---
multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml | 125 ++++++++++++++++++++++++++++++++++++++++-
1 files changed, 122 insertions(+), 3 deletions(-)
diff --git a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
index 7c226a2..1fb3daa 100644
--- a/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/StandardizedTemplateMapper.xml
@@ -1,6 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.gkhy.exam.system.mapper.StandardizedTemplateMapper">
+ <insert id="insertBatch">
+ INSERT INTO `standardized_template` (
+ `company_id`,
+ `company_name`,
+ `create_by`,
+ `create_time`,
+ `template_name`,
+ `template_type`,
+ `file_path`,
+ `format`,
+ `classify`,
+ `dept_id`,
+ `industry_type_id`,
+ `stage`,
+ `department`
+ )
+ VALUES
+ <foreach collection="standardizedTemplates" item="item" separator=",">
+ (
+ #{item.companyId},
+ #{item.companyName},
+ #{item.createBy},
+ #{item.createTime},
+ #{item.templateName},
+ #{item.templateType},
+ #{item.filePath},
+ #{item.format},
+ #{item.classify},
+ #{item.deptId},
+ #{item.industryTypeId},
+ #{item.stage},
+ #{item.department}
+ )
+ </foreach>
+ </insert>
<update id="updateStandardizedTemplateById" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
UPDATE standardized_template
<set>
@@ -25,8 +60,17 @@
<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},
@@ -47,7 +91,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`,
@@ -59,6 +103,7 @@
st. `classify`,
st. `dept_id`,
sd.`dept_name`,
+ st.`stage`,
st. `del_flag`,
st. `create_by`,
st. `create_time`,
@@ -73,7 +118,81 @@
<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" 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.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