示例#1
0
 	/**
	 * 创建 配置表
	 * @param id
	 * @return deleted count 
	 */
	public Eterminfo createEterminfo(Eterminfo eterminfo) throws SQLException{
	
		if(eterminfo.getId()>0){
			throw new SQLException("ID must <= 0.");
		}
		eterminfo.setId(DBTools.getID(getSqlMapClientTemplate().getDataSource().getConnection(), "T_ETERMINFO"));
		getSqlMapClientTemplate().insert("createEterminfo",eterminfo);
		return eterminfo;
	}
示例#2
0
	/**
	 * 修改 配置表但忽略空值 
	 * @param id
	 * @return 
	 */
	public int updateEterminfoIgnoreNull(Eterminfo eterminfo){
		Eterminfo tmp = findEterminfo(eterminfo.getId());
		int flag =0;
		
		
		if(eterminfo.getEtermtype()!=null){
			tmp.setEtermtype(eterminfo.getEtermtype());
			
			flag++;
		}
		
		if(eterminfo.getEtermaccount()!=null){
			tmp.setEtermaccount(eterminfo.getEtermaccount());
			
			flag++;
		}
		
		if(eterminfo.getPassword()!=null){
			tmp.setPassword(eterminfo.getPassword());
			
			flag++;
		}
		
		if(eterminfo.getServerip()!=null){
			tmp.setServerip(eterminfo.getServerip());
			
			flag++;
		}
		
		if(eterminfo.getPortnum()!=null){
			tmp.setPortnum(eterminfo.getPortnum());
			
			flag++;
		}
		
		if(eterminfo.getSinum()!=null){
			tmp.setSinum(eterminfo.getSinum());
			
			flag++;
		}
		
		if(eterminfo.getPrintnum()!=null){
			tmp.setPrintnum(eterminfo.getPrintnum());
			
			flag++;
		}
		
		if(eterminfo.getAgentid()!=null){
			tmp.setAgentid(eterminfo.getAgentid());
			
			flag++;
		}
		
		if(eterminfo.getStatus()!=null){
			tmp.setStatus(eterminfo.getStatus());
			
			flag++;
		}
		
		if(eterminfo.getCreateuser()!=null){
			tmp.setCreateuser(eterminfo.getCreateuser());
			
			flag++;
		}
		
		if(eterminfo.getCreatetime()!=null){
			tmp.setCreatetime(eterminfo.getCreatetime());
			
			flag++;
		}
		
		if(eterminfo.getModifyuser()!=null){
			tmp.setModifyuser(eterminfo.getModifyuser());
			
			flag++;
		}
		
		if(eterminfo.getModifytime()!=null){
			tmp.setModifytime(eterminfo.getModifytime());
			
			flag++;
		}
		
		
		if(flag==0){
			return 0;
		}else{
			return getSqlMapClientTemplate().update("updateEterminfo",tmp);
		}
	}