liurunyu
2024-08-15 f7e731bdc2fce4445c0d22993134c6c2b07d207b
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
<?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.NettyUpgradeContentMapper">
    
    <resultMap type="NettyUpgradeContent" id="NettyUpgradeContentResult">
        <result property="id"    column="id"    />
        <result property="version"    column="version"    />
        <result property="dataLength"    column="data_length"    />
        <result property="pageName"    column="page_name"    />
        <result property="blockNum"    column="block_num"    />
        <result property="blockPackageNum"    column="block_package_num"    />
        <result property="totalNum"    column="total_num"    />
        <result property="upgradeContent"    column="upgrade_content"    />
    </resultMap>
 
    <sql id="selectNettyUpgradeContentVo">
        select id, version, data_length, page_name, block_num, block_package_num, total_num, upgrade_content from netty_upgrade_content
    </sql>
 
    <select id="selectNettyUpgradeContentList" parameterType="NettyUpgradeContent" resultMap="NettyUpgradeContentResult">
        <include refid="selectNettyUpgradeContentVo"/>
        <where>  
            <if test="version != null "> and version like concat('%', #{version}, '%')</if>
            <if test="dataLength != null "> and data_length = #{dataLength}</if>
            <if test="pageName != null  and pageName != ''"> and page_name like concat('%', #{pageName}, '%')</if>
            <if test="blockNum != null "> and block_num = #{blockNum}</if>
            <if test="blockPackageNum != null "> and block_package_num = #{blockPackageNum}</if>
            <if test="totalNum != null "> and total_num = #{totalNum}</if>
            <if test="upgradeContent != null  and upgradeContent != ''"> and upgrade_content = #{upgradeContent}</if>
        </where>
    </select>
    
    <select id="selectNettyUpgradeContentById" parameterType="Long" resultMap="NettyUpgradeContentResult">
        <include refid="selectNettyUpgradeContentVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertNettyUpgradeContent" parameterType="NettyUpgradeContent">
        insert into netty_upgrade_content
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="version != null">version,</if>
            <if test="dataLength != null">data_length,</if>
            <if test="pageName != null">page_name,</if>
            <if test="blockNum != null">block_num,</if>
            <if test="blockPackageNum != null">block_package_num,</if>
            <if test="totalNum != null">total_num,</if>
            <if test="upgradeContent != null">upgrade_content,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="version != null">#{version},</if>
            <if test="dataLength != null">#{dataLength},</if>
            <if test="pageName != null">#{pageName},</if>
            <if test="blockNum != null">#{blockNum},</if>
            <if test="blockPackageNum != null">#{blockPackageNum},</if>
            <if test="totalNum != null">#{totalNum},</if>
            <if test="upgradeContent != null">#{upgradeContent},</if>
         </trim>
    </insert>
 
    <update id="updateNettyUpgradeContent" parameterType="NettyUpgradeContent">
        update netty_upgrade_content
        <trim prefix="SET" suffixOverrides=",">
            <if test="version != null">version = #{version},</if>
            <if test="dataLength != null">data_length = #{dataLength},</if>
            <if test="pageName != null">page_name = #{pageName},</if>
            <if test="blockNum != null">block_num = #{blockNum},</if>
            <if test="blockPackageNum != null">block_package_num = #{blockPackageNum},</if>
            <if test="totalNum != null">total_num = #{totalNum},</if>
            <if test="upgradeContent != null">upgrade_content = #{upgradeContent},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteNettyUpgradeContentById" parameterType="Long">
        delete from netty_upgrade_content where id = #{id}
    </delete>
 
    <delete id="deleteNettyUpgradeContentByIds" parameterType="String">
        delete from netty_upgrade_content where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>