/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.crunii.com</a>
 */
package com.crunii.micro.platform.jdbc;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.crunii.micro.domain.common.jdbc.BaseJdbcTemplate;
import com.crunii.micro.domain.common.jdbc.BaseNPJdbcTemplate;
import com.crunii.micro.domain.entity.main.TsmTemplate;

import lombok.extern.slf4j.Slf4j;

/**
 * <pre>
 * 统一的模板管理
 * </pre>
 *
 * @author 田平 create 2017年8月11日下午12:44:04
 */
@Slf4j
@Repository
public class TemplateJdbcDao {

	@Resource(name = "mainJT")
	protected BaseJdbcTemplate JT;

	@Resource(name = "mainNPJT")
	protected BaseNPJdbcTemplate NPJT;

	private static final String getTemplateSql = "select * from tsm_template where temp_code=? ";

	public TsmTemplate getTemplate(String tempCode) {
		TsmTemplate temp = JT.queryForBean(TsmTemplate.class, getTemplateSql, tempCode);
		return temp;
	}

}
