package com.northglass.repository; import java.util.List; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; import com.northglass.entity.GalssTaskDetails; import com.northglass.entity.PatternTask; public interface PatternTaskDao extends JpaRepository{ /*@Query("select t from RawPackage t where t.fileName = '052-123' and t.fileUrl = '1' and t.state = '已下发' and t.operator = '1' and t.createTime = '2021-09-22 13:22:18' and t.receiveTime = '2021-09-22 13:22:21' ") public List findMachineDispose();*/ @Query("select count(t) from PatternTask t where t.workState='已完成' and t.rawFile.id=?1") public int findcount(Long rawid); @Query("select count(t) from PatternTask t where t.rawFile.id=?1") public int findsum(Long rawid); @Query("select t from PatternTask t where t.workState='正在工作' and t.rawFile.id=?1") public PatternTask findbyword(Long rawid); @Query("select t from PatternTask t where t.rawFile.id=?1") public List findbygroup(Long rawid); @Query("select t from PatternTask t where t.workState='已完成' and t.groups=?1") public List findbygroups(Long groups); @Query("select t from PatternTask t where t.workState='已完成' and t.groups=?1 and t.rawFile.id=?2") public List findbygroups2(Long groups,Long id); @Query("select t from PatternTask t where t.groups=?1 order by t.rawFile.createTime desc,t.rank") public List findIdGroup(Long groups); @Query("select t from PatternTask t where t.groups=?1 group by t.rawWidth,t.rawHeight,t.rawThickness,t.color") public List findIdGroupby(Long groups); @Modifying @Query("delete from PatternTask t where t.rawFile.id=?1") public void deletepatternTask(Long rawid); @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=0 and groups=?1 ") public List findbygroups3(Long groups); @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=0 and work_state='已完成' and groups=?1 order by rank limit 0,1") public PatternTask findbygroups2(Long groups); @Query(nativeQuery=true,value="select * from gmms_pattern_task where flag=1 and work_state='已完成' and groups=?1 order by rank desc limit 0,1") public PatternTask findbygroupsfalg(Long groups); }