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 state from storage_cage where cage=#{cage} and cell=#{cell} and tier=1;")
|
int selectcell(int cage, int cell);
|
// 判断该笼子是否有合适宽度空格
|
@Select("select cage,cell,tier,id,ROUND(id/2)as prcId,width from storage_cage where cage=#{cage1} and cell=#{cell} and state=0 and disabled=0 and width>=#{width} ORDER BY cell asc,tier asc LIMIT 1")
|
StorageCage selectCage1(int cage1, int cell, double width);
|
|
// 判断笼子内玻璃数
|
@Select("select COUNT(tier)as tier from storage_cage where cage=#{cage} and cell=#{cell} and state!=0 and state!=3;")
|
int selectsum(int cage, int cell);
|
|
// 完成出片中的玻璃状态
|
@Update("update storage_cage set state=#{state} where glass_id=#{glassid} and state=3;")
|
void UpdateCageOver(String glassid, int state);
|
// 完成进片中的玻璃状态
|
@Update("update storage_cage set state=#{state} where glass_id=#{glassid} and state=2;")
|
void UpdateCageadd(String glassid, int state);
|
//查询是否有该类型的任务还未完成
|
// 判断出片为1时,是否可直接出片
|
@Select("select COUNT(state) from storage_cage where state=#{state}")
|
int SelectCageState(int state);
|
// 获取玻璃信息
|
@Select("select *,ordernumber ,glasslength_mm as glasslengthmm,glassheight_mm as glassheightmm,barcode,listnumber,boxnumber,glasslength,glassheight,FrameBarcode from north_glass_buffer1 where barcode=#{glassid}")
|
north_glass_buffer1 selectGlass(String glassid);
|
//判断笼内是否有合适的类型空格
|
@Select("select id from storage_cage where glasstype=#{glasstype} and width>=#{width}+#{widths} and state=0 order by id limit 1")
|
int SelectCage(int glasstype,int width,int widths);
|
//判断笼内没有玻璃的空格
|
@Select("select id from storage_cage where state=0 and number=0 order by id limit 1")
|
int SelectNewCell();
|
|
|
}
|