package com.huimv.manage.eartag.dao.repo;

import com.huimv.manage.eartag.dao.entity.EtPackageEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface PackageRepo extends JpaRepository<EtPackageEntity, Integer>, JpaSpecificationExecutor<EtPackageEntity> {
    //
    @Query(nativeQuery = true , value = "SELECT * FROM et_package ORDER BY id DESC Limit ?1")
    List<EtPackageEntity> listPackage(int pageSize);

    @Query(nativeQuery = true , value = "UPDATE et_package SET produce_state=1 WHERE id=?1")
    void updateProduceState(String id, int state);
}