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, JpaSpecificationExecutor { /** * 基础实验人员 - 根据名字查询 */ @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 listPerson(Long currentUserId); /** * 基础实验人员 - 列表- 查询相关 */ @Query(value = "select t from BasicExperimentPerson t where createByUserId = :currentUserId and t.deleteStatus = 0") List listPersonByUserId(Long currentUserId); /** * 基础实验人员 - 通过id列表查询 * */ @Query(value = "select t from BasicExperimentPerson t where t.id in (?1) and t.deleteStatus = 0") List batchById(List ids); }