| | |
| | | <result column="remain_width" property="remainWidth" jdbcType="INTEGER"/> |
| | | </resultMap> |
| | | |
| | | <update id="resetSlotRemainWidth"> |
| | | <foreach collection="list" item="item" separator=";" open="begin" close=";end;"> |
| | | update edg_storage_cage set remain_width = #{item.remainWidth} where |
| | | device_id = #{item.deviceId} and slot = #{item.slot} |
| | | </foreach> |
| | | </update> |
| | | |
| | | <select id="getEdgStorageCageBySize" resultMap="baseMap"> |
| | | select t.* |
| | | from edg_storage_cage t |
| | | left join edg_storage_cage_details t1 on t.slot = t1.slot |
| | | where t.device_id = #{deviceId} |
| | | and t1.state = 100 |
| | | and t.remain_width >= #{width} |
| | | and t.remain_width >= GREATEST(#{width}, #{height}) |
| | | and t1.width = #{width} |
| | | and t1.height = #{height} |
| | | and t.enable_state = 1 |