package com.gkhy.labRiskManage.domain.riskReport.repository.jpa;
|
|
import com.gkhy.labRiskManage.domain.riskReport.entity.RiskAssessPlanIdentificationPha;
|
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.time.LocalDateTime;
|
import java.util.List;
|
|
/**
|
* 辨识方法-Pha
|
*/
|
@Repository
|
public interface RiskAssessPlanIdentificationPhaRepository extends JpaRepository<RiskAssessPlanIdentificationPha, Long>, JpaSpecificationExecutor<RiskAssessPlanIdentificationPha> {
|
|
/**
|
* 辨识方法 - 查询 by id
|
*/
|
@Query(value = "select t from RiskAssessPlanIdentificationPha t where t.id = :id and t.deleteStatus = 0")
|
RiskAssessPlanIdentificationPha getPhaById(Long id);
|
/**
|
* 辨识方法 - 删除
|
*/
|
@Query(value = "update RiskAssessPlanIdentificationPha set delete_status = 1,update_time = :date where id = :id and delete_status = 0", nativeQuery = true)
|
RiskAssessPlanIdentificationPha deletePhaByPlanId(Long id, LocalDateTime date);
|
/**
|
* 辨识方法-Pha - list
|
*/
|
@Query(value = "select t from RiskAssessPlanIdentificationPha t where t.assessPlanId = :id and t.deleteStatus = 0")
|
List<RiskAssessPlanIdentificationPha> listPhaByPlanId(Long id);
|
}
|