package com.ann.demo.repository;

import com.ann.demo.entity.filing.MessageSubordinate;
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/7/9 16:44
 * @Created by  ljx
 */
@Repository
public interface MessageSubordinateRepository extends JpaRepository<MessageSubordinate, String> {

    public Integer countByPatientMainAndContentJson(String patientMain, String contentJson);


    @Query(nativeQuery = true , value = "select * from message_subordinate where message_id in (" +
            "select id from message_log where  create_time > '2020-01-01 00:00:00.000') and status = 2 and remark = 'java.lang.StringIndexOutOfBoundsException: String index out of range: -1'")
    public List<MessageSubordinate> findHaha();
}
