package com.ssj.service.dao;

import com.ssj.bean.weixin.push.domain.TbWxTemplate;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface WxTemplateDao extends JpaRepository<TbWxTemplate, String> {

	@Query(nativeQuery = true, value = " SELECT * FROM `tb_wx_template` t where t.`status`=1  GROUP BY t.template_id_short ORDER BY t.create_time ASC ")
	public List<TbWxTemplate> queryTbWxTemplate();
	
	@Query(nativeQuery = true, value = "SELECT * FROM `tb_wx_template` t where t.template_id_short=?1 ")
	public List<TbWxTemplate> queryTbWxTemplateIdShort(String templateIdShort);
	
	

}
