package com.northglass.repository;
|
|
import java.util.List;
|
|
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.Query;
|
|
import com.northglass.entity.LoadRack;
|
|
public interface LoadRackDao extends JpaRepository<LoadRack, Long>{
|
|
@Query("select t from LoadRack t where t.machineLoad!=null and t.rackName=?1")
|
public List<LoadRack> findRackName(String rackName);
|
|
//查找 上片工位
|
@Query("select t from LoadRack t where t.machineLoad!=null")
|
public List<LoadRack> findLoads();
|
|
//查找 此上片机 有任务的工位
|
@Query("select t from LoadRack t where t.machineLoad=null")
|
public List<LoadRack> findDiaos();
|
|
//查找 此上片机工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1")
|
public List<LoadRack> findOnlySecondrelayMachine(Long machineSecondrelay);
|
|
//查找 此上片机 有任务的工位
|
@Query("select t from LoadRack t where t.machineLoad.id=?1 and t.outTasks!=null")
|
public List<LoadRack> findLoadMachine(Long machineLoad);
|
|
//查找 此上片机 在上片工位 任务
|
@Query("select t from LoadRack t where t.machineLoad.id=?1 and t.outTasks.machineStatus='铁架已到上片位'")
|
public List<LoadRack> findLoadMachineTasks(Long machineLoad);
|
|
//查找 此上片机 machineStatus状态下的料架
|
@Query("select t from LoadRack t where t.machineLoad.id=?1 and t.outTasks.machineStatus='铁架已到上片位' and t.outTasks.workStatus=?2")
|
public List<LoadRack> findLoadMachineTaskWorkStatus(Long machineLoad,String workStatus);
|
|
//查找 此二次接力 正在工作的工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1")
|
public List<LoadRack> findSecondRelays(Long machineSecondrelay);
|
|
//查找 此二次接力 正在工作的工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1 and (t.outTasks.machineStatus='铁架已到二次接力' or t.outTasks.machineStatus='铁架退回二次接力') and t.outTasks.workStatus='正在工作'")
|
public List<LoadRack> findSecondRelayTasking(Long machineSecondrelay);
|
|
//查找 此二次接力 正在工作的工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1 and (t.outTasks.machineStatus='铁架已到二次接力' or t.outTasks.machineStatus='铁架退回二次接力') and t.outTasks.workStatus='等待中'")
|
public List<LoadRack> findSecondRelayTasksa(Long machineSecondrelay);
|
|
//查找 此二次接力 有任务的工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1 and t.outTasks.machineStatus=?2 and t.outTasks.workStatus='等待中' order by t.outTasks.id")
|
public List<LoadRack> findSecondRelayTasks(Long machineSecondrelay,String machineStatus);
|
|
//查找 此二次接力 补片任务工位
|
@Query("select t from LoadRack t where t.machineSecondrelay.id=?1 and t.outTasks.machineStatus=?2 and t.outTasks.workStatus='等待中' and t.outTasks.taskType='在线库到上片台(补片)' order by t.outTasks.id")
|
public List<LoadRack> findSecondRelayBuTasks(Long machineSecondrelay,String machineStatus);
|
|
//查找此此编号工位 空工位
|
@Query("select t from LoadRack t where t.number=?1 and t.outTasks=null")
|
public List<LoadRack> findNumber(String number);
|
|
//查找此架号是否再某工位上 outTasks.stockName
|
@Query("select t from LoadRack t where t.outTasks.stockName=?1")
|
public List<LoadRack> findLoadRacksTasksRacks(String stockName);
|
|
//查找 t.rackName (根据目的地查找) 无任务 ,且启用的工位
|
@Query("select t from LoadRack t where t.rackName=?1 and t.outTasks=null and flag='启用'")
|
public List<LoadRack> findRackNames(String rackName);
|
|
//查找 此任务ID在 哪个工位 outTasks.id
|
@Query("select t from LoadRack t where t.outTasks.id=?1")
|
public List<LoadRack> findOutTasksId(Long outTasksId);
|
|
}
|