“djh”
2025-12-03 e32ac074e0cdc07b7551155e2e1c24684857f2b7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?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">
    <update id="updateStandardizedTemplateById" parameterType="com.gkhy.exam.system.domain.StandardizedTemplate">
        UPDATE standardized_template
        <set>
            <if test="companyId != null and companyId != ''" >
                company_id = #{companyId},
            </if>
            <if test="companyName != null and companyName != ''" >
                company_name = #{companyName},
            </if>
            <if test="templateName != null and templateName !=''" >
                template_name = #{templateName},
            </if>
            <if test="templateType != null " >
                template_type = #{templateType},
            </if>
            <if test="filePath != null and filePath !=''" >
                file_path = #{filePath},
            </if>
            <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>
            <if test="createBy != null" >
                create_by = #{createBy},
            </if>
            <if test="createTime != null" >
                create_time = #{createTime},
            </if>
            <if test="updateBy != null" >
                update_by = #{updateBy},
            </if>
            <if test="updateTime != null" >
                update_time = #{updateTime}
            </if>
        </set>
        where id = #{id}
    </update>
 
    <select id="selectStandardizedTemplateList" 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`
        FROM
        standardized_template st
        left join  sys_dept sd on st.dept_id =sd.dept_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="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>