zhangback
7 天以前 90c4fbd121dd18013e333346c99bbc9844cd6fec
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?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.tms.mapper.TmsContainerMapper">
 
    <resultMap type="com.ruoyi.tms.domain.TmsContainer" id="TmsContainerResult">
        <result property="id"    column="id"    />
        <result property="systemCode"    column="system_code"    />
        <result property="containerCode"    column="container_code"    />
        <result property="containerUseType"    column="container_use_type"    />
        <result property="containerSize"    column="container_size"    />
        <result property="ownerTeamId"    column="owner_team_id"    />
        <result property="ownerTeamName"    column="owner_team_name"    />
        <result property="manufacturer"    column="manufacturer"    />
        <result property="manufactureDate"    column="manufacture_date"    />
        <result property="lengthMm"    column="length_mm"    />
        <result property="widthMm"    column="width_mm"    />
        <result property="heightMm"    column="height_mm"    />
        <result property="maxTotalWeightKg"    column="max_total_weight_kg"    />
        <result property="maxLoadKg"    column="max_load_kg"    />
        <result property="volumeM3"    column="volume_m3"    />
        <result property="isInUse"    column="is_in_use"    />
        <result property="maintenanceStatus"    column="maintenance_status"    />
        <result property="lastMaintenanceDate"    column="last_maintenance_date"    />
        <result property="nextMaintenanceDate"    column="next_maintenance_date"    />
        <result property="status"    column="status"    />
        <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"    />
        <result property="selfLeasType"    column="self_leas_type"    />
 
    </resultMap>
 
    <sql id="selectTmsContainerVo">
        select thisTab.id, thisTab.system_code, thisTab.container_code, thisTab.container_use_type, thisTab.container_size, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_total_weight_kg, thisTab.max_load_kg, thisTab.volume_m3, thisTab.is_in_use, thisTab.maintenance_status, thisTab.last_maintenance_date, thisTab.next_maintenance_date, thisTab.status, thisTab.create_by, thisTab.create_time, thisTab.update_by, thisTab.update_time, thisTab.remark ,thisTab.self_leas_type from tms_container AS thisTab
    </sql>
    <sql id="selectTmsContainerVoCount">
        select count(0) from tms_container as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="systemCode != null  and systemCode != ''"> and thisTab.system_code = #{systemCode}</if>
        <if test="containerCode != null  and containerCode != ''"> and thisTab.container_code = #{containerCode}</if>
        <if test="containerUseType != null "> and thisTab.container_use_type = #{containerUseType}</if>
        <if test="containerSize != null "> and thisTab.container_size = #{containerSize}</if>
        <if test="ownerTeamId != null "> and thisTab.owner_team_id = #{ownerTeamId}</if>
        <if test="ownerTeamName != null  and ownerTeamName != ''"> and  thisTab.owner_team_name like concat('%', #{ownerTeamName}, '%')</if>
        <if test="isInUse != null "> and thisTab.is_in_use = #{isInUse}</if>
        <if test="maintenanceStatus != null "> and thisTab.maintenance_status = #{maintenanceStatus}</if>
        <if test="status != null "> and thisTab.status = #{status}</if>
        <if test="selfLeasType != null "> and thisTab.self_leas_type = #{selfLeasType}</if>
 
    </sql>
 
    <!--查询-->
    <select id="selectTmsContainerById" parameterType="Integer" resultMap="TmsContainerResult">
        <include refid="selectTmsContainerVo"/>
        where id = #{id}
    </select>
 
    <select id="selectTmsContainerCount" parameterType="com.ruoyi.tms.domain.TmsContainer" resultType="int">
        <include refid="selectTmsContainerVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectTmsContainerList" parameterType="com.ruoyi.tms.domain.TmsContainer" resultMap="TmsContainerResult">
        <include refid="selectTmsContainerVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertTmsContainer" parameterType="com.ruoyi.tms.domain.TmsContainer"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_container
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">system_code,</if>
            <if test="containerCode != null and containerCode != ''">container_code,</if>
            <if test="containerUseType != null">container_use_type,</if>
            <if test="containerSize != null">container_size,</if>
            <if test="ownerTeamId != null">owner_team_id,</if>
            <if test="ownerTeamName != null">owner_team_name,</if>
            <if test="manufacturer != null">manufacturer,</if>
            <if test="manufactureDate != null">manufacture_date,</if>
            <if test="lengthMm != null">length_mm,</if>
            <if test="widthMm != null">width_mm,</if>
            <if test="heightMm != null">height_mm,</if>
            <if test="maxTotalWeightKg != null">max_total_weight_kg,</if>
            <if test="maxLoadKg != null">max_load_kg,</if>
            <if test="volumeM3 != null">volume_m3,</if>
            <if test="isInUse != null">is_in_use,</if>
            <if test="maintenanceStatus != null">maintenance_status,</if>
            <if test="lastMaintenanceDate != null">last_maintenance_date,</if>
            <if test="nextMaintenanceDate != null">next_maintenance_date,</if>
            <if test="status != null">status,</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>
            <if test="selfLeasType != null">self_leas_type,</if>
 
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">#{systemCode},</if>
            <if test="containerCode != null and containerCode != ''">#{containerCode},</if>
            <if test="containerUseType != null">#{containerUseType},</if>
            <if test="containerSize != null">#{containerSize},</if>
            <if test="ownerTeamId != null">#{ownerTeamId},</if>
            <if test="ownerTeamName != null">#{ownerTeamName},</if>
            <if test="manufacturer != null">#{manufacturer},</if>
            <if test="manufactureDate != null">#{manufactureDate},</if>
            <if test="lengthMm != null">#{lengthMm},</if>
            <if test="widthMm != null">#{widthMm},</if>
            <if test="heightMm != null">#{heightMm},</if>
            <if test="maxTotalWeightKg != null">#{maxTotalWeightKg},</if>
            <if test="maxLoadKg != null">#{maxLoadKg},</if>
            <if test="volumeM3 != null">#{volumeM3},</if>
            <if test="isInUse != null">#{isInUse},</if>
            <if test="maintenanceStatus != null">#{maintenanceStatus},</if>
            <if test="lastMaintenanceDate != null">#{lastMaintenanceDate},</if>
            <if test="nextMaintenanceDate != null">#{nextMaintenanceDate},</if>
            <if test="status != null">#{status},</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>
            <if test="selfLeasType != null">#{selfLeasType},</if>
 
        </trim>
    </insert>
 
    <insert id="insertTmsContainerBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_container
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_code,container_code,container_use_type,container_size,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_total_weight_kg,max_load_kg,volume_m3,is_in_use,maintenance_status,last_maintenance_date,next_maintenance_date,status,create_by,create_time,update_by,update_time,remark,self_leas_type,
        </trim>
        <foreach item="item" index="index" collection="list" separator=",">
            <trim prefix="(" suffix=") " suffixOverrides=",">
                #{item.id},#{item.systemCode},#{item.containerCode},#{item.containerUseType},#{item.containerSize},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxTotalWeightKg},#{item.maxLoadKg},#{item.volumeM3},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.item.selfLeasType},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateTmsContainer" parameterType="com.ruoyi.tms.domain.TmsContainer">
        update tms_container
        <trim prefix="SET" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">system_code = #{systemCode},</if>
            <if test="containerCode != null and containerCode != ''">container_code = #{containerCode},</if>
            <if test="containerUseType != null">container_use_type = #{containerUseType},</if>
            <if test="containerSize != null">container_size = #{containerSize},</if>
            <if test="ownerTeamId != null">owner_team_id = #{ownerTeamId},</if>
            <if test="ownerTeamName != null">owner_team_name = #{ownerTeamName},</if>
            <if test="manufacturer != null">manufacturer = #{manufacturer},</if>
            <if test="manufactureDate != null">manufacture_date = #{manufactureDate},</if>
            <if test="lengthMm != null">length_mm = #{lengthMm},</if>
            <if test="widthMm != null">width_mm = #{widthMm},</if>
            <if test="heightMm != null">height_mm = #{heightMm},</if>
            <if test="maxTotalWeightKg != null">max_total_weight_kg = #{maxTotalWeightKg},</if>
            <if test="maxLoadKg != null">max_load_kg = #{maxLoadKg},</if>
            <if test="volumeM3 != null">volume_m3 = #{volumeM3},</if>
            <if test="isInUse != null">is_in_use = #{isInUse},</if>
            <if test="maintenanceStatus != null">maintenance_status = #{maintenanceStatus},</if>
            <if test="lastMaintenanceDate != null">last_maintenance_date = #{lastMaintenanceDate},</if>
            <if test="nextMaintenanceDate != null">next_maintenance_date = #{nextMaintenanceDate},</if>
            <if test="status != null">status = #{status},</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>
            <if test="remark != null">remark = #{remark},</if>
            <if test="selfLeasType != null">self_leas_type = #{selfLeasType},</if>
 
        </trim>
        where id = #{id}
    </update>
    <!-- 修改 -->
    <update id="updateTmsContainerBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_container
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.systemCode != null and item.systemCode != ''">system_code = #{item.systemCode},</if>
                <if test="item.containerCode != null and item.containerCode != ''">container_code = #{item.containerCode},</if>
                <if test="item.containerUseType != null">container_use_type = #{item.containerUseType},</if>
                <if test="item.containerSize != null">container_size = #{item.containerSize},</if>
                <if test="item.ownerTeamId != null">owner_team_id = #{item.ownerTeamId},</if>
                <if test="item.ownerTeamName != null">owner_team_name = #{item.ownerTeamName},</if>
                <if test="item.manufacturer != null">manufacturer = #{item.manufacturer},</if>
                <if test="item.manufactureDate != null">manufacture_date = #{item.manufactureDate},</if>
                <if test="item.lengthMm != null">length_mm = #{item.lengthMm},</if>
                <if test="item.widthMm != null">width_mm = #{item.widthMm},</if>
                <if test="item.heightMm != null">height_mm = #{item.heightMm},</if>
                <if test="item.maxTotalWeightKg != null">max_total_weight_kg = #{item.maxTotalWeightKg},</if>
                <if test="item.maxLoadKg != null">max_load_kg = #{item.maxLoadKg},</if>
                <if test="item.volumeM3 != null">volume_m3 = #{item.volumeM3},</if>
                <if test="item.isInUse != null">is_in_use = #{item.isInUse},</if>
                <if test="item.maintenanceStatus != null">maintenance_status = #{item.maintenanceStatus},</if>
                <if test="item.lastMaintenanceDate != null">last_maintenance_date = #{item.lastMaintenanceDate},</if>
                <if test="item.nextMaintenanceDate != null">next_maintenance_date = #{item.nextMaintenanceDate},</if>
                <if test="item.status != null">status = #{item.status},</if>
                <if test="item.createBy != null">create_by = #{item.createBy},</if>
                <if test="item.createTime != null">create_time = #{item.createTime},</if>
                <if test="item.updateBy != null">update_by = #{item.updateBy},</if>
                <if test="item.updateTime != null">update_time = #{item.updateTime},</if>
                <if test="item.remark != null">remark = #{item.remark},</if>
                <if test="item.selfLeasType != null">self_leas_type = #{item.selfLeasType},</if>
            </trim>
            where id = #{item.id}
        </foreach>
    </update>
 
    <!--删除-->
    <delete id="deleteTmsContainerById" parameterType="Integer">
        delete from tms_container where id = #{id}
    </delete>
    <delete id="deleteTmsContainerByIds" parameterType="Integer">
        delete from tms_container where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>