package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface MsgTplRepository extends JpaRepository<MsgTpl, Integer> {
    @Query(value = "select * from msg_tpl where module = ? and deleted = 0;", nativeQuery = true)
    List<MsgTpl> getMsgTplListByModule(int module);

    @Query(value = "select * from msg_tpl where type = ? and deleted = 0 order by create_time desc limit 1;", nativeQuery = true)
    MsgTpl getMsgTplByType(int type);
}
