package com.chinacreator.videoalliance.sdk.dao; import java.sql.SQLException; import java.util.List; import org.apache.commons.lang.math.NumberUtils; import org.springframework.stereotype.Component; import com.chinacreator.common.dao.ExecutorDao; import com.chinacreator.videoalliance.common.util.DataSource; import com.chinacreator.videoalliance.sdk.bean.Terminal; import com.frameworkset.common.poolman.SQLExecutor; @Component public class TerminalDao extends ExecutorDao{ public List query(Terminal bean) throws SQLException{ return this.getExecutor().queryListBeanWithDBName(Terminal.class,DataSource.NET3G175,"queryTerminaluserid",bean); } public int queryMaxNum(Terminal bean) throws SQLException{ String sql = "select devicednum from TB_PRODUCT_TERMINAL_CONFIG where cpid=? and spid=?"; return NumberUtils.toInt(SQLExecutor.queryFieldWithDBName(DataSource.NET3G175, sql,bean.getCpid(),bean.getSpid()), 0); } public void insertInfo(Terminal bean) throws SQLException{ this.executor.insertBean(DataSource.NET3G175,"addTerminal", bean); } public void updateInfo(Terminal bean) throws SQLException{ String sql = "update TD_TERMINAL_RELATION_RECORD set operType = '1' where userid = ? and cpid = ? and spid = ?"; SQLExecutor.updateWithDBName(DataSource.NET3G175, sql, bean.getUserid(),bean.getCpid(),bean.getSpid()); } }