liu
2026-09-22 0837c3ff473499d8a267924125c776b34cc8b517
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
<?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.ruoyi.system.mapper.CjFormConfigMapper">
 
    <resultMap type="CjFormConfig" id="CjFormConfigResult">
        <result property="configId"       column="config_id"       />
        <result property="configName"     column="config_name"     />
        <result property="description"    column="description"     />
        <result property="groupsJson"     column="groups_json"     />
        <result property="attachmentsJson" column="attachments_json"/>
        <result property="fieldCount"     column="field_count"     />
        <result property="version"        column="version"         />
        <result property="status"         column="status"          />
        <result property="delFlag"        column="del_flag"        />
        <result property="createBy"       column="create_by"       />
        <result property="createTime"     column="create_time"     />
        <result property="updateBy"       column="update_by"       />
        <result property="updateTime"     column="update_time"     />
        <result property="remark"         column="remark"          />
    </resultMap>
 
    <sql id="selectCjFormConfigVo">
        select config_id, config_name, description, groups_json, attachments_json, field_count, version, status, del_flag,
               create_by, create_time, update_by, update_time, remark
        from cj_form_config
    </sql>
 
    <select id="selectCjFormConfigList" parameterType="CjFormConfig" resultMap="CjFormConfigResult">
        <include refid="selectCjFormConfigVo"/>
        <where>
            <if test="configName != null  and configName != ''"> and config_name like concat('%', #{configName}, '%')</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
        </where>
        order by update_time desc, config_id desc
    </select>
 
    <select id="selectCjFormConfigByConfigId" parameterType="Long" resultMap="CjFormConfigResult">
        <include refid="selectCjFormConfigVo"/>
        where config_id = #{configId}
    </select>
 
    <insert id="insertCjFormConfig" parameterType="CjFormConfig" useGeneratedKeys="true" keyProperty="configId">
        insert into cj_form_config
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="configName != null and configName != ''">config_name,</if>
            <if test="description != null">description,</if>
            <if test="groupsJson != null">groups_json,</if>
            <if test="attachmentsJson != null">attachments_json,</if>
            <if test="fieldCount != null">field_count,</if>
            <if test="version != null">version,</if>
            <if test="status != null">status,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="remark != null">remark,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="configName != null and configName != ''">#{configName},</if>
            <if test="description != null">#{description},</if>
            <if test="groupsJson != null">#{groupsJson},</if>
            <if test="attachmentsJson != null">#{attachmentsJson},</if>
            <if test="fieldCount != null">#{fieldCount},</if>
            <if test="version != null">#{version},</if>
            <if test="status != null">#{status},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="remark != null">#{remark},</if>
        </trim>
    </insert>
 
    <update id="updateCjFormConfig" parameterType="CjFormConfig">
        update cj_form_config
        <trim prefix="SET" suffixOverrides=",">
            <if test="configName != null and configName != ''">config_name = #{configName},</if>
            <if test="description != null">description = #{description},</if>
            <if test="groupsJson != null">groups_json = #{groupsJson},</if>
            <if test="attachmentsJson != null">attachments_json = #{attachmentsJson},</if>
            <if test="fieldCount != null">field_count = #{fieldCount},</if>
            <if test="version != null">version = #{version},</if>
            <if test="status != null">status = #{status},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where config_id = #{configId}
    </update>
 
    <delete id="deleteCjFormConfigByConfigId" parameterType="Long">
        delete from cj_form_config where config_id = #{configId}
    </delete>
 
    <delete id="deleteCjFormConfigByConfigIds" parameterType="String">
        delete from cj_form_config where config_id in
        <foreach item="configId" collection="array" open="(" separator="," close=")">
            #{configId}
        </foreach>
    </delete>
</mapper>