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> {

    public Integer countByInputContentAndInterfaceName(String inputContent, String interfaceName);

    @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 archiveState <> '作废' ")
    public String getArchiveMasterId(String inpNo,String visitId);

}
