package com.chinacreator.process.dao;


import com.chinacreator.process.util.DataSource;
import com.frameworkset.common.poolman.SQLExecutor;
import org.apache.commons.lang.math.NumberUtils;
import org.springframework.stereotype.Component;

import java.sql.SQLException;

@Component
public class CycleDao {


    /**
     * 查询是否在迁移表中
     * @param userid
     * @param cpid
     * @param spid
     * @return
     * @throws SQLException
     */
    public  boolean qryIsExist(String userid,String cpid,String spid) throws SQLException{
        String sql = "select count(*) from TL_CAP_CYCLETRANS_PARAMS where userid = ? and RSPCODE = '0000' and cpid = ? and spid = ?";
        return  NumberUtils.toInt(SQLExecutor.queryFieldWithDBName(DataSource.NET3G, sql, new Object[] {userid,cpid,spid}),0) > 0;

    }



}
