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
44
45
46
47
48
49
50
51
52
package com.gkhy.labRiskManage.domain.basic.repository.jpa;
 
import com.gkhy.labRiskManage.domain.basic.entity.BasicExperimentPerson;
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 BasicExperimentPersonRepository extends JpaRepository<BasicExperimentPerson, Long>, JpaSpecificationExecutor<BasicExperimentPerson> {
 
    /**
     * 基础实验人员 - 根据名字查询
     */
    @Query(value = "select t from BasicExperimentPerson t where t.personName = :personName and t.deleteStatus = 0")
    BasicExperimentPerson getPersonByName(String personName);
 
    /**
     * 基础实验人员 - 根据手机号查询
     */
    @Query(value = "select t from BasicExperimentPerson t where t.phone = :phone and t.deleteStatus = 0")
    BasicExperimentPerson getPersonByPhone(Long phone);
 
    /**
     * 基础实验人员 - 根据手机号查询
     */
    @Query(value = "select t from BasicExperimentPerson t where t.id = :id and t.deleteStatus = 0")
    BasicExperimentPerson getPersonById(Long id);
 
    /**
     * 基础实验人员 - 列表 -查询所有
     */
    @Query(value = "select t from BasicExperimentPerson t where  t.deleteStatus = 0")
    List<BasicExperimentPerson> listPerson(Long currentUserId);
 
    /**
     * 基础实验人员 - 列表- 查询相关
     */
    @Query(value = "select t from BasicExperimentPerson t where createByUserId = :currentUserId and t.deleteStatus = 0")
    List<BasicExperimentPerson> listPersonByUserId(Long currentUserId);
    /**
     * 基础实验人员 - 通过id列表查询
     * */
    @Query(value = "select t from BasicExperimentPerson t where t.id in (?1) and t.deleteStatus = 0")
    List<BasicExperimentPerson> batchById(List<Long> ids);
}