package com.sw.mes.yb.seed.dao;

import com.sw.mes.core.base.BaseDao;
import com.sw.mes.yb.seed.entity.SeedGroupBracketDetails;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface SeedGroupBracketDetailsDao extends BaseDao<SeedGroupBracketDetails,Long> {
    @Query(value = "select * from seed_group_bracket_details where parent_id = ?1",nativeQuery = true)
    List<SeedGroupBracketDetails> findParentId(Long id);

    @Query(value = "delete from seed_group_bracket_details where parent_id = ?1",nativeQuery = true)
    Boolean deleteParentId(Long id);

    @Query(value = "select * from seed_group_bracket_details where batch_no = ?1",nativeQuery = true)
    List<SeedGroupBracketDetails> findBatchNo(String batchNo);
    @Query(value = "select * from seed_group_bracket_details where seed_code = ?1",nativeQuery = true)
    SeedGroupBracketDetails findBySeedCode(String seedCode);
    @Query(value = "select * from seed_group_bracket_details where batch_no = ?1 and status != '拒收'",nativeQuery = true)
    List<SeedGroupBracketDetails> findBatchNoAndStatus(String batchNo);
}
