package com.example.springboot.mapper; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Update; import org.springframework.stereotype.Repository; import com.example.springboot.entity.StorageCage; import com.example.springboot.entity.north_glass_buffer1; @Mapper @Repository public interface AlbaniaMapper { //判断笼内是否有合适的类型空格 @Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} order by id limit 1") int SelectCage(int glasstype,Double width,int widths); //判断笼内没有玻璃的空格 @Select("select id from storage_cage where number=0 and cage>#{cage} and cage<#{cage2} order by id limit 1") int SelectNewCell(int cage,int cage2); //增加玻璃数 @Update("update storage_cage set number=number+1,width=width-glasswidth where id=#{id}") void UpdateCageNumberAdd(int id); //减少玻璃数 @Update("update storage_cage set number=number-1,width=width+glasswidth where id=#{id}") void UpdateCageNumberOut(int id); }