heheng
2025-01-13 a27162cb82ef0cabf9b43cbfd1f3eb8c177d1e14
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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);
}