中国算力平台算力登记系统2.0
yanzhaofeige
3 days ago 9a224d216652ef2d6ff2e0bd01fba69c86a3f277
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
<?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.odcc.cpzidc.bis.mapper.IdcUseStorageMapper">
    
    <resultMap type="IdcUseStorage" id="IdcUseStorageResult">
        <result property="id"    column="id"    />
        <result property="baseId"    column="base_id"    />
        <result property="dateNode"    column="date_node"    />
        <result property="haveStoragePlatform"    column="have_storage_platform"    />
        <result property="storageCapacityAll"    column="storage_capacity_all"    />
        <result property="storageCapacitySsd"    column="storage_capacity_ssd"    />
        <result property="storageCapacityRate"    column="storage_capacity_rate"    />
        <result property="serverStorageNum"    column="server_storage_num"    />
        <result property="serverStorageCapacity"    column="server_storage_capacity"    />
        <result property="serverStorageSsd"    column="server_storage_ssd"    />
        <result property="serverStorageSsdCapacity"    column="server_storage_ssd_capacity"    />
        <result property="serverCalculationNum"    column="server_calculation_num"    />
        <result property="serverCalculationCapacity"    column="server_calculation_capacity"    />
        <result property="serverCalculationSsd"    column="server_calculation_ssd"    />
        <result property="serverCalculationSsdCapacity"    column="server_calculation_ssd_capacity"    />
        <result property="serverDiskNum"    column="server_disk_num"    />
        <result property="serverDiskCapacity"    column="server_disk_capacity"    />
        <result property="serverSsdNum"    column="server_ssd_num"    />
        <result property="serverSsdCapacity"    column="server_ssd_capacity"    />
        <result property="serverExternalNumber"    column="server_external_number"    />
        <result property="serverExternalCapacity"    column="server_external_capacity"    />
        <result property="serverExternalSsdNumber"    column="server_external_ssd_number"    />
        <result property="serverExternalSsdCapacity"    column="server_external_ssd_capacity"    />
        <result property="Sort"    column="_sort"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateTime"    column="update_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="createUser"    column="create_user"    />
        <result property="remark"    column="remark"    />
    </resultMap>
 
    <sql id="selectIdcUseStorageVo">
        select id, base_id, date_node, have_storage_platform, storage_capacity_all, storage_capacity_ssd, storage_capacity_rate, server_storage_num, server_storage_capacity, server_storage_ssd, server_storage_ssd_capacity, server_calculation_num, server_calculation_capacity, server_calculation_ssd, server_calculation_ssd_capacity, server_disk_num, server_disk_capacity, server_ssd_num, server_ssd_capacity, server_external_number, server_external_capacity, server_external_ssd_number, server_external_ssd_capacity, _sort, create_time, update_time, update_user, create_user, remark from idc_use_storage
    </sql>
 
    <select id="selectIdcUseStorageList" parameterType="IdcUseStorage" resultMap="IdcUseStorageResult">
        <include refid="selectIdcUseStorageVo"/>
        <where>  
            <if test="baseId != null "> and base_id = #{baseId}</if>
            <if test="dateNode != null  and dateNode != ''"> and date_node = #{dateNode}</if>
            <if test="haveStoragePlatform != null "> and have_storage_platform = #{haveStoragePlatform}</if>
            <if test="storageCapacityAll != null  and storageCapacityAll != ''"> and storage_capacity_all = #{storageCapacityAll}</if>
            <if test="storageCapacitySsd != null  and storageCapacitySsd != ''"> and storage_capacity_ssd = #{storageCapacitySsd}</if>
            <if test="storageCapacityRate != null  and storageCapacityRate != ''"> and storage_capacity_rate = #{storageCapacityRate}</if>
            <if test="serverStorageNum != null  and serverStorageNum != ''"> and server_storage_num = #{serverStorageNum}</if>
            <if test="serverStorageCapacity != null  and serverStorageCapacity != ''"> and server_storage_capacity = #{serverStorageCapacity}</if>
            <if test="serverStorageSsd != null  and serverStorageSsd != ''"> and server_storage_ssd = #{serverStorageSsd}</if>
            <if test="serverStorageSsdCapacity != null  and serverStorageSsdCapacity != ''"> and server_storage_ssd_capacity = #{serverStorageSsdCapacity}</if>
            <if test="serverCalculationNum != null  and serverCalculationNum != ''"> and server_calculation_num = #{serverCalculationNum}</if>
            <if test="serverCalculationCapacity != null  and serverCalculationCapacity != ''"> and server_calculation_capacity = #{serverCalculationCapacity}</if>
            <if test="serverCalculationSsd != null  and serverCalculationSsd != ''"> and server_calculation_ssd = #{serverCalculationSsd}</if>
            <if test="serverCalculationSsdCapacity != null  and serverCalculationSsdCapacity != ''"> and server_calculation_ssd_capacity = #{serverCalculationSsdCapacity}</if>
            <if test="serverDiskNum != null  and serverDiskNum != ''"> and server_disk_num = #{serverDiskNum}</if>
            <if test="serverDiskCapacity != null  and serverDiskCapacity != ''"> and server_disk_capacity = #{serverDiskCapacity}</if>
            <if test="serverSsdNum != null  and serverSsdNum != ''"> and server_ssd_num = #{serverSsdNum}</if>
            <if test="serverSsdCapacity != null  and serverSsdCapacity != ''"> and server_ssd_capacity = #{serverSsdCapacity}</if>
            <if test="serverExternalNumber != null  and serverExternalNumber != ''"> and server_external_number = #{serverExternalNumber}</if>
            <if test="serverExternalCapacity != null  and serverExternalCapacity != ''"> and server_external_capacity = #{serverExternalCapacity}</if>
            <if test="serverExternalSsdNumber != null  and serverExternalSsdNumber != ''"> and server_external_ssd_number = #{serverExternalSsdNumber}</if>
            <if test="serverExternalSsdCapacity != null  and serverExternalSsdCapacity != ''"> and server_external_ssd_capacity = #{serverExternalSsdCapacity}</if>
            <if test="Sort != null "> and _sort = #{Sort}</if>
            <if test="updateUser != null "> and update_user = #{updateUser}</if>
            <if test="createUser != null "> and create_user = #{createUser}</if>
        </where>
    </select>
    
    <select id="selectIdcUseStorageById" parameterType="Long" resultMap="IdcUseStorageResult">
        <include refid="selectIdcUseStorageVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertIdcUseStorage" parameterType="IdcUseStorage" useGeneratedKeys="true" keyProperty="id">
        insert into idc_use_storage
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="baseId != null">base_id,</if>
            <if test="dateNode != null and dateNode != ''">date_node,</if>
            <if test="haveStoragePlatform != null">have_storage_platform,</if>
            <if test="storageCapacityAll != null">storage_capacity_all,</if>
            <if test="storageCapacitySsd != null">storage_capacity_ssd,</if>
            <if test="storageCapacityRate != null">storage_capacity_rate,</if>
            <if test="serverStorageNum != null">server_storage_num,</if>
            <if test="serverStorageCapacity != null">server_storage_capacity,</if>
            <if test="serverStorageSsd != null">server_storage_ssd,</if>
            <if test="serverStorageSsdCapacity != null">server_storage_ssd_capacity,</if>
            <if test="serverCalculationNum != null">server_calculation_num,</if>
            <if test="serverCalculationCapacity != null">server_calculation_capacity,</if>
            <if test="serverCalculationSsd != null">server_calculation_ssd,</if>
            <if test="serverCalculationSsdCapacity != null">server_calculation_ssd_capacity,</if>
            <if test="serverDiskNum != null">server_disk_num,</if>
            <if test="serverDiskCapacity != null">server_disk_capacity,</if>
            <if test="serverSsdNum != null">server_ssd_num,</if>
            <if test="serverSsdCapacity != null">server_ssd_capacity,</if>
            <if test="serverExternalNumber != null">server_external_number,</if>
            <if test="serverExternalCapacity != null">server_external_capacity,</if>
            <if test="serverExternalSsdNumber != null">server_external_ssd_number,</if>
            <if test="serverExternalSsdCapacity != null">server_external_ssd_capacity,</if>
            <if test="Sort != null">_sort,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="createUser != null">create_user,</if>
            <if test="remark != null">remark,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="baseId != null">#{baseId},</if>
            <if test="dateNode != null and dateNode != ''">#{dateNode},</if>
            <if test="haveStoragePlatform != null">#{haveStoragePlatform},</if>
            <if test="storageCapacityAll != null">#{storageCapacityAll},</if>
            <if test="storageCapacitySsd != null">#{storageCapacitySsd},</if>
            <if test="storageCapacityRate != null">#{storageCapacityRate},</if>
            <if test="serverStorageNum != null">#{serverStorageNum},</if>
            <if test="serverStorageCapacity != null">#{serverStorageCapacity},</if>
            <if test="serverStorageSsd != null">#{serverStorageSsd},</if>
            <if test="serverStorageSsdCapacity != null">#{serverStorageSsdCapacity},</if>
            <if test="serverCalculationNum != null">#{serverCalculationNum},</if>
            <if test="serverCalculationCapacity != null">#{serverCalculationCapacity},</if>
            <if test="serverCalculationSsd != null">#{serverCalculationSsd},</if>
            <if test="serverCalculationSsdCapacity != null">#{serverCalculationSsdCapacity},</if>
            <if test="serverDiskNum != null">#{serverDiskNum},</if>
            <if test="serverDiskCapacity != null">#{serverDiskCapacity},</if>
            <if test="serverSsdNum != null">#{serverSsdNum},</if>
            <if test="serverSsdCapacity != null">#{serverSsdCapacity},</if>
            <if test="serverExternalNumber != null">#{serverExternalNumber},</if>
            <if test="serverExternalCapacity != null">#{serverExternalCapacity},</if>
            <if test="serverExternalSsdNumber != null">#{serverExternalSsdNumber},</if>
            <if test="serverExternalSsdCapacity != null">#{serverExternalSsdCapacity},</if>
            <if test="Sort != null">#{Sort},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="remark != null">#{remark},</if>
         </trim>
    </insert>
 
    <update id="updateIdcUseStorage" parameterType="IdcUseStorage">
        update idc_use_storage
        <trim prefix="SET" suffixOverrides=",">
            <if test="baseId != null">base_id = #{baseId},</if>
            <if test="dateNode != null and dateNode != ''">date_node = #{dateNode},</if>
            <if test="haveStoragePlatform != null">have_storage_platform = #{haveStoragePlatform},</if>
            <if test="storageCapacityAll != null">storage_capacity_all = #{storageCapacityAll},</if>
            <if test="storageCapacitySsd != null">storage_capacity_ssd = #{storageCapacitySsd},</if>
            <if test="storageCapacityRate != null">storage_capacity_rate = #{storageCapacityRate},</if>
            <if test="serverStorageNum != null">server_storage_num = #{serverStorageNum},</if>
            <if test="serverStorageCapacity != null">server_storage_capacity = #{serverStorageCapacity},</if>
            <if test="serverStorageSsd != null">server_storage_ssd = #{serverStorageSsd},</if>
            <if test="serverStorageSsdCapacity != null">server_storage_ssd_capacity = #{serverStorageSsdCapacity},</if>
            <if test="serverCalculationNum != null">server_calculation_num = #{serverCalculationNum},</if>
            <if test="serverCalculationCapacity != null">server_calculation_capacity = #{serverCalculationCapacity},</if>
            <if test="serverCalculationSsd != null">server_calculation_ssd = #{serverCalculationSsd},</if>
            <if test="serverCalculationSsdCapacity != null">server_calculation_ssd_capacity = #{serverCalculationSsdCapacity},</if>
            <if test="serverDiskNum != null">server_disk_num = #{serverDiskNum},</if>
            <if test="serverDiskCapacity != null">server_disk_capacity = #{serverDiskCapacity},</if>
            <if test="serverSsdNum != null">server_ssd_num = #{serverSsdNum},</if>
            <if test="serverSsdCapacity != null">server_ssd_capacity = #{serverSsdCapacity},</if>
            <if test="serverExternalNumber != null">server_external_number = #{serverExternalNumber},</if>
            <if test="serverExternalCapacity != null">server_external_capacity = #{serverExternalCapacity},</if>
            <if test="serverExternalSsdNumber != null">server_external_ssd_number = #{serverExternalSsdNumber},</if>
            <if test="serverExternalSsdCapacity != null">server_external_ssd_capacity = #{serverExternalSsdCapacity},</if>
            <if test="Sort != null">_sort = #{Sort},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="remark != null">remark = #{remark},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteIdcUseStorageById" parameterType="Long">
        delete from idc_use_storage where id = #{id}
    </delete>
 
    <delete id="deleteIdcUseStorageByIds" parameterType="String">
        delete from idc_use_storage where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>