package com.ann.demo.repository;

import com.ann.demo.entity.interfaceEntity.MessageLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description
 * @Date 2019/6/17 11:34
 * @Created by  ljx
 */
@Repository
public interface MessageRepository extends JpaRepository<MessageLog, Integer> {


    @Query("select  o from  MessageLog o  where o.interfaceName = 'InpSummary'  ")
    public List<MessageLog> findAllHaha();

    @Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1  ) and  (visit_id = ?2 )  and (patient_id = ?3) and archiveState <> '作废' and is_valid = 0")
    public String getArchiveMasterId(String inpNo,String visitId,String patientId);

    @Query(nativeQuery = true,value = " select id from archive_master where (inp_No = ?1  )  and (patient_id = ?2) and archiveState <> '作废' and is_valid = 0")
    public String getArchiveMasterId(String inpNo,String patientId);

}
