/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights reserved. <a>http://www.cqcis.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.platform.dto.EncryptKey;

/**
 * @author 田平 create 2017年8月11日下午12:44:04
 */
@Repository
public class EncryptColJdbcDao {

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

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

	private static final String checkEncryptColOfTabSql = "select count(*) from t_encrypt_config where tab_name=? and col_name=? and state=1 ";

	public boolean checkEncryptColOfTab(EncryptKey key) {
		int size = JT.queryForInt(checkEncryptColOfTabSql, key.getTabName(), key.getColName());
		return size > 0 ? true : false;
	}

}
