package com.gkhy.labRiskManage.domain.basic.repository.jpa;
|
|
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentStuff;
|
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.stereotype.Repository;
|
|
import java.util.List;
|
|
/**
|
* 基础实验耗材
|
*/
|
@Repository
|
public interface BasicExperimentStuffRepository extends JpaRepository<BasicExperimentStuff, Long>, JpaSpecificationExecutor<BasicExperimentStuff> {
|
|
/**
|
* 基础实验耗材 - 通过名字查询
|
*/
|
@Query(value = "select t from BasicExperimentStuff t where t.stuffName = :stuffName and t.deleteStatus = 0")
|
BasicExperimentStuff getStuffByName(String stuffName);
|
/**
|
* 基础实验耗材 - 通过id
|
*/
|
@Query(value = "select t from BasicExperimentStuff t where t.id = :id and t.deleteStatus = 0")
|
BasicExperimentStuff getStuffById(Long id);
|
/**
|
* 基础实验耗材管理 - 列表
|
*/
|
@Query(value = "select t from BasicExperimentStuff t where t.deleteStatus = 0")
|
List<BasicExperimentStuff> listStuff(Long currentUserId);
|
/**
|
* 基础实验耗材管理 - 列表
|
*/
|
@Query(value = "select t from BasicExperimentStuff t where t.createByUserId = :currentUserId and t.deleteStatus = 0")
|
List<BasicExperimentStuff> listStuffByUserId(Long currentUserId);
|
/**
|
* 基础实验耗材管理 - 通过id列表项
|
*/
|
@Query(value = "select t from BasicExperimentStuff t where t.id in (?1) and t.deleteStatus = 0")
|
List<BasicExperimentStuff> batchById(List<Long> ids);
|
}
|