From 61f0357bef6d6aea12a8c6ecad97db57ee4149fe Mon Sep 17 00:00:00 2001
From: “djh” <“3298565835@qq.com”>
Date: 星期四, 25 九月 2025 08:35:39 +0800
Subject: [PATCH] 修改
---
multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml | 75 ++++++++++++++++++++++++++++++++++---
1 files changed, 68 insertions(+), 7 deletions(-)
diff --git a/multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml b/multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml
index 5dd47f1..cf76a5c 100644
--- a/multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml
+++ b/multi-system/src/main/resources/mapper/system/CompanyIndustryTemplateMapper.xml
@@ -1,6 +1,16 @@
<?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.CompanyIndustryTemplateMapper">
+ <insert id="insertIndustrys">
+ INSERT INTO `company_industry_template` (
+ `company_id`,`chapter`,`type`,`template_name`,`industry_type`,`create_by`,`create_time`
+ )
+ VALUES
+ <foreach collection="companyIndustryTemplates" separator="," item="item">
+ (#{item.companyId},#{item.chapter},#{item.type},#{item.templateName},#{item.industryType},
+ #{item.createBy},#{item.createTime})
+ </foreach>
+ </insert>
<update id="updateCompanyIndustryTemplateById" parameterType="com.gkhy.exam.system.domain.CompanyIndustryTemplate">
UPDATE company_industry_template
<set>
@@ -10,6 +20,9 @@
<if test="companyName != null and companyName != ''" >
company_name = #{companyName},
</if>
+ <if test="chapter!=null and chapter!=''">
+ chapter = #{chapter},
+ </if>
<if test="templateName != null and templateName !=''" >
template_name = #{templateName},
</if>
@@ -18,6 +31,9 @@
</if>
<if test="filePath != null and filePath !=''" >
file_path = #{filePath},
+ </if>
+ <if test="fileName != null and fileName !=''" >
+ file_name = #{fileName},
</if>
<if test="format != null and format !=''" >
format = #{format},
@@ -43,12 +59,62 @@
<select id="selectCompanyIndustryTemplateList" resultType="com.gkhy.exam.system.domain.CompanyIndustryTemplate">
SELECT
+ ci.`id`,
+ ci.`company_id`,
+ ci.`company_name`,
+ ci.chapter,
+ ci.`type`,
+ ci.`template_name`,
+ ci.`industry_type`,
+ cit.name as industry_name,
+ ci.`file_path`,
+ ci.`file_name`,
+ ci.`format`,
+ ci.`del_flag`,
+ ci.`create_by`,
+ ci.`create_time`,
+ ci.`update_by`,
+ ci.`update_time`
+ FROM
+ company_industry_template ci
+ left join company_industry_type cit on ci.industry_type = cit.id
+ WHERE
+ ci.del_flag = 0
+ <if test="companyId!=null and companyId!=''">
+ and ci.company_id = #{companyId}
+ </if>
+ <if test="industryType!=null">
+ and ci.industry_type = #{industryType}
+ </if>
+ <if test="type!=null and type!=''">
+ and ci.type like concat('%',#{type},'%')
+ </if>
+ <if test="templateName!=null and templateName!=''">
+ and ci.`template_name` like concat('%',#{templateName},'%')
+ </if>
+ ORDER BY
+ CAST(SUBSTRING_INDEX(ci.chapter, '.', 1) AS UNSIGNED) ASC,
+ CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(ci.chapter, '.', 2), '.', -1) AS UNSIGNED) ASC, -- 第二级
+ CAST(
+ CASE
+ WHEN LENGTH(ci.chapter) - LENGTH(REPLACE(ci.chapter, '.', '')) >= 2
+ THEN SUBSTRING_INDEX(ci.chapter, '.', -1)
+ ELSE '0'
+ END AS UNSIGNED
+ ) ASC
+ </select>
+ <select id="selectCompanyIndustryTemplate"
+ resultType="com.gkhy.exam.system.domain.CompanyIndustryTemplate">
+ SELECT
`id`,
`company_id`,
`company_name`,
+ chapter,
+ `type`,
`template_name`,
`industry_type`,
`file_path`,
+ `file_name`,
`format`,
`del_flag`,
`create_by`,
@@ -56,13 +122,8 @@
`update_by`,
`update_time`
FROM
- company_industry_template
+ company_industry_template
WHERE
- del_flag = 0
- <if test="companyId!=null and companyId!=''">
- and company_id = #{companyId}
- </if>
- ORDER BY
- create_time DESC
+ del_flag = 0 and template_name = #{name}
</select>
</mapper>
--
Gitblit v1.9.2