wuyouming666
2024-04-15 65058e7227fcfc53e81d9bb87e0e2667879edd05
hangzhoumesParent/moduleService/UnLoadGlassModule/src/main/java/com/mes/downstorage/mapper/DownStorageCageDetailsMapper.java
@@ -1,7 +1,12 @@
package com.mes.downstorage.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mes.downglassinfo.entity.DownGlassTask;
import com.mes.downstorage.entity.DownStorageCageDetails;
import com.mes.uppattenusage.entity.GlassInfo;
import org.apache.ibatis.annotations.*;
import java.util.List;
/**
 * <p>
@@ -11,6 +16,55 @@
 * @author zhoush
 * @since 2024-03-27
 */
@Mapper
public interface DownStorageCageDetailsMapper extends BaseMapper<DownStorageCageDetails> {
//
//    @Select("select * from `glass_info` where id=#{id}")
//    GlassInfo SelectGlassId(String id);
    // 查询笼子内空闲
    @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is null order by escd.slot")
    List<DownStorageCageDetails> SelectCacheLeisure();
    // 查询笼子内出片任务
    @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot WHERE escd.slot IS NOT NULL order by escd.tempering_layout_id,escd.tempering_feed_sequence")
    List<DownStorageCageDetails> SelectCacheOut();
    // 查询笼子内信息
    @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot order by esc.slot")
    List<DownStorageCageDetails> SelectCachInfo();
    // 查询可进此片玻璃的栅格号
    @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id=#{tempering_layout_id} and escd.tempering_feed_sequence<#{tempering_feed_sequence} and esc.remain_width-#{width}>0 order by escd.tempering_feed_sequence")
    List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, Integer tempering_feed_sequence,
                                                        double width);
    // 查询可进此片玻璃的栅格号
    @Select("select escd.* from down_storage_cage as esc LEFT JOIN down_storage_cage_details as escd on esc.slot=escd.slot where escd.slot is not null escd.tempering_layout_id<#{tempering_layout_id} and esc.remain_width-#{width}>0 order by escd.tempering_layout_id desc,escd.tempering_feed_sequence")
    List<DownStorageCageDetails> SelectIsExistIntoCache(Integer tempering_layout_id, double width);
//    // 查询全部任务
//    @Select("select * from down_glass_task")
//    List<DownGlassTask> SelectCacheInfoAll();
//
//    // 查询进片任务
//    @Select("select * from down_glass_task where task_type='1' and task_stauts='0'")
//    List<DownGlassTask> SelectInputCacheInfo();
//
//    // 查询出片任务
//    @Select("select * from down_glass_task where task_type='2' and task_stauts='0'")
//    List<DownGlassTask> SelectOutCacheInfo();
    // 查询  A06  或 A11 最新的一片 出片任务
    @Select("select * from down_glass_task where task_type='2' and task_stauts='2' and end_cell=#{EndCell} limit 1")
    GlassInfo SelectLastOutCacheInfo(String EndCell);
    // 修改笼子内信息
//    @Update("update")
//    Integer UpdateCache(@Param("id") Integer id, @Param("order_id") String order_id);
    // 添加下片任务
    @Insert("INSERT into down_glass_task VALUES(#{id},#{start},#{end},#{type},0,)")
    Integer insertCacheTask(String id, String start, String end, String type,double width,double height,Integer filmsId,double thickness,String flowCardId);
}