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
<?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.NettyUpgradeProgramMapper">
    
    <resultMap type="NettyUpgradeProgram" id="NettyUpgradeProgramResult">
        <result property="id"    column="id"    />
        <result property="dataTotalLength"    column="data_total_length"    />
        <result property="name"    column="name"    />
        <result property="pageNum"    column="page_num"    />
        <result property="blockNum"    column="block_num"    />
        <result property="everBlockLenght"    column="ever_block_lenght"    />
        <result property="updateTime"    column="update_time"    />
        <result property="fileName"    column="file_name"    />
    </resultMap>
 
    <sql id="selectNettyUpgradeProgramVo">
        select id, data_total_length, name, page_num, block_num, ever_block_lenght, update_time, file_name from netty_upgrade_program
    </sql>
 
    <select id="selectNettyUpgradeProgramList" parameterType="NettyUpgradeProgram" resultMap="NettyUpgradeProgramResult">
        <include refid="selectNettyUpgradeProgramVo"/>
        <where>  
            <if test="dataTotalLength != null "> and data_total_length = #{dataTotalLength}</if>
            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
            <if test="pageNum != null "> and page_num = #{pageNum}</if>
            <if test="blockNum != null "> and block_num = #{blockNum}</if>
            <if test="everBlockLenght != null "> and ever_block_lenght = #{everBlockLenght}</if>
            <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
        </where>
    </select>
    
    <select id="selectNettyUpgradeProgramById" parameterType="Long" resultMap="NettyUpgradeProgramResult">
        <include refid="selectNettyUpgradeProgramVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertNettyUpgradeProgram" parameterType="NettyUpgradeProgram">
        insert into netty_upgrade_program
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="dataTotalLength != null">data_total_length,</if>
            <if test="name != null">name,</if>
            <if test="pageNum != null">page_num,</if>
            <if test="blockNum != null">block_num,</if>
            <if test="everBlockLenght != null">ever_block_lenght,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="fileName != null">file_name,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="dataTotalLength != null">#{dataTotalLength},</if>
            <if test="name != null">#{name},</if>
            <if test="pageNum != null">#{pageNum},</if>
            <if test="blockNum != null">#{blockNum},</if>
            <if test="everBlockLenght != null">#{everBlockLenght},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="fileName != null">#{fileName},</if>
         </trim>
    </insert>
 
    <update id="updateNettyUpgradeProgram" parameterType="NettyUpgradeProgram">
        update netty_upgrade_program
        <trim prefix="SET" suffixOverrides=",">
            <if test="dataTotalLength != null">data_total_length = #{dataTotalLength},</if>
            <if test="name != null">name = #{name},</if>
            <if test="pageNum != null">page_num = #{pageNum},</if>
            <if test="blockNum != null">block_num = #{blockNum},</if>
            <if test="everBlockLenght != null">ever_block_lenght = #{everBlockLenght},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="fileName != null">file_name = #{fileName},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteNettyUpgradeProgramById" parameterType="Long">
        delete from netty_upgrade_program where id = #{id}
    </delete>
 
    <delete id="deleteNettyUpgradeProgramByIds" parameterType="String">
        delete from netty_upgrade_program where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>