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.constants.StateConstants.RawPackageTxtState;
|
import com.northglass.entity.OptPattern;
|
import com.northglass.entity.ShelfRank;
|
|
|
public interface OptPatternDao extends JpaRepository<OptPattern, Long> {
|
|
@Query("select p from OptPattern p where p.optId like ?1%")
|
public List<OptPattern> findOptPatternByNumberPrefix(String numberPrefix);
|
|
@Query("select p from OptPattern p where p.batch=?1")
|
public List<OptPattern> findOptPatternByBatchNumber(String apartId);
|
|
@Query("select p from OptPattern p where p.batch=?1 and p.state is null")
|
public List<OptPattern> findOptPatternByBatchNumberAndState(String apartId);
|
|
@Query("select p from OptPattern p where p.groups=?1")
|
public List<OptPattern> findOptPatternByGroups(String groups);
|
|
// //查找正在工作的任务
|
// @Query("select p from OptPattern p where p.batch=?1 and p.status=''")
|
// public List<OptPattern> findOptPattern(String groups);
|
|
//根据领取的任务id查找属于当前TXT下的所有pattern
|
@Query("select t from OptPattern t where t.rawPackageTxt.id=?1")
|
public List<OptPattern> findById(Long raw_package_txt_id);
|
|
@Query(nativeQuery=true,value="select * from gmms_opt_pattern where raw_package_txt_id=?1")
|
public List<OptPattern> findById2(Long raw_package_txt_id);
|
|
//找到第一个状态为已下发的TXT下的所有pattern
|
@Query("select m from OptPattern m where m.rawPackageTxt.id = (select min(id) from RawPackageTxt t where t.status='"+RawPackageTxtState.SENDED+"')")
|
public List<OptPattern> findFirstTxtPattern();
|
|
@Query("select p from OptPattern p where p.batch=?1 and p.width=?2 and p.height=?2")
|
public List<OptPattern> findbylength(String optname, double width, double height);
|
|
@Query(nativeQuery=true,value="select * from gmms_opt_pattern where raw_package_txt_id=321")
|
public List<OptPattern> qaz();
|
|
@Query("select p from OptPattern p where p.batch=?1")
|
public List<OptPattern> qaz1(String optname);
|
}
|