zhangback
7 天以前 3974fad5d836431e417e99220cc07bb5b0aba331
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
<?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.TmsShelfMapper">
 
    <resultMap type="com.ruoyi.tms.domain.TmsShelf" id="TmsShelfResult">
        <result property="id"    column="id"    />
        <result property="systemCode"    column="system_code"    />
        <result property="shelfCode"    column="shelf_code"    />
        <result property="shelfType"    column="shelf_type"    />
        <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="maxLoadKg"    column="max_load_kg"    />
        <result property="compatibleContainerType"    column="compatible_container_type"    />
        <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="selectTmsShelfVo">
        select thisTab.id, thisTab.system_code, thisTab.shelf_code, thisTab.shelf_type, thisTab.owner_team_id, thisTab.owner_team_name, thisTab.manufacturer, thisTab.manufacture_date, thisTab.length_mm, thisTab.width_mm, thisTab.height_mm, thisTab.max_load_kg, thisTab.compatible_container_type, 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_shelf AS thisTab
    </sql>
    <sql id="selectTmsShelfVoCount">
        select count(0) from tms_shelf as thisTab
    </sql>
 
    <sql id="whereCondition">
        <if test="systemCode != null  and systemCode != ''"> and thisTab.system_code = #{systemCode}</if>
        <if test="shelfCode != null  and shelfCode != ''"> and thisTab.shelf_code = #{shelfCode}</if>
        <if test="shelfType != null "> and thisTab.shelf_type = #{shelfType}</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="maxLoadKg != null "> and thisTab.max_load_kg = #{maxLoadKg}</if>
        <if test="compatibleContainerType != null and compatibleContainerType != ''"> and thisTab.compatible_container_type like concat('%', #{compatibleContainerType}, '%')</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="selectTmsShelfById" parameterType="Integer" resultMap="TmsShelfResult">
        <include refid="selectTmsShelfVo"/>
        where id = #{id}
    </select>
 
    <select id="selectTmsShelfCount" parameterType="com.ruoyi.tms.domain.TmsShelf" resultType="int">
        <include refid="selectTmsShelfVoCount"/>
        <where>
            <include refid="whereCondition"/>
        </where>
    </select>
 
    <select id="selectTmsShelfList" parameterType="com.ruoyi.tms.domain.TmsShelf" resultMap="TmsShelfResult">
        <include refid="selectTmsShelfVo"/>
        <where>
            <include refid="whereCondition"/>
        </where>
        order by thisTab.id desc
    </select>
 
    <!-- 新增 -->
    <insert id="insertTmsShelf" parameterType="com.ruoyi.tms.domain.TmsShelf"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_shelf
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">system_code,</if>
            <if test="shelfCode != null and shelfCode != ''">shelf_code,</if>
            <if test="shelfType != null">shelf_type,</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="maxLoadKg != null">max_load_kg,</if>
            <if test="compatibleContainerType != null">compatible_container_type,</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="shelfCode != null and shelfCode != ''">#{shelfCode},</if>
            <if test="shelfType != null">#{shelfType},</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="maxLoadKg != null">#{maxLoadKg},</if>
            <if test="compatibleContainerType != null">#{compatibleContainerType},</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="insertTmsShelfBatch" parameterType="java.util.List"  useGeneratedKeys="true" keyProperty="id">
        insert into tms_shelf
        <trim prefix="(" suffix=") values" suffixOverrides=",">
            id,system_code,shelf_code,shelf_type,owner_team_id,owner_team_name,manufacturer,manufacture_date,length_mm,width_mm,height_mm,max_load_kg,compatible_container_type,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.shelfCode},#{item.shelfType},#{item.ownerTeamId},#{item.ownerTeamName},#{item.manufacturer},#{item.manufactureDate},#{item.lengthMm},#{item.widthMm},#{item.heightMm},#{item.maxLoadKg},#{item.compatibleContainerType},#{item.isInUse},#{item.maintenanceStatus},#{item.lastMaintenanceDate},#{item.nextMaintenanceDate},#{item.status},#{item.createBy},#{item.createTime},#{item.updateBy},#{item.updateTime},#{item.remark},#{item.selfLeasType},
            </trim>
        </foreach>
    </insert>
 
    <!-- 修改 -->
    <update id="updateTmsShelf" parameterType="com.ruoyi.tms.domain.TmsShelf">
        update tms_shelf
        <trim prefix="SET" suffixOverrides=",">
            <if test="systemCode != null and systemCode != ''">system_code = #{systemCode},</if>
            <if test="shelfCode != null and shelfCode != ''">shelf_code = #{shelfCode},</if>
            <if test="shelfType != null">shelf_type = #{shelfType},</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="maxLoadKg != null">max_load_kg = #{maxLoadKg},</if>
            <if test="compatibleContainerType != null">compatible_container_type = #{compatibleContainerType},</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="updateTmsShelfBatch" parameterType="java.util.List">
        <foreach collection="list" item="item" index="index" separator=";">
            update tms_shelf
            <trim prefix="SET" suffixOverrides=",">
                <if test="item.systemCode != null and item.systemCode != ''">system_code = #{item.systemCode},</if>
                <if test="item.shelfCode != null and item.shelfCode != ''">shelf_code = #{item.shelfCode},</if>
                <if test="item.shelfType != null">shelf_type = #{item.shelfType},</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.maxLoadKg != null">max_load_kg = #{item.maxLoadKg},</if>
                <if test="item.compatibleContainerType != null">compatible_container_type = #{item.compatibleContainerType},</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="deleteTmsShelfById" parameterType="Integer">
        delete from tms_shelf where id = #{id}
    </delete>
    <delete id="deleteTmsShelfByIds" parameterType="Integer">
        delete from tms_shelf where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
</mapper>