c212df13ec8f43598dd3360ace70358a296ec456.svn-base 2.2 KB
package com.espeed.service.impl;

import java.util.List;

import com.espeed.dao.YxySendSmtpInfoDao;
import com.espeed.dao.YxySmtpListDao;
import com.espeed.pojo.YxySendSmtpInfo;
import com.espeed.pojo.YxySmtpList;
import com.espeed.service.YxySendSmtpInfoService;

public class YxySendSmtpInfoServiceImpl implements YxySendSmtpInfoService{

	/**根据用户与域名查询用户SMTP*/
	public List<YxySendSmtpInfo> findAllSmtp(String loginid,String domain) throws Exception {		
		String hql="from YxySendSmtpInfo where smtp_user_loginid='"+loginid+"' and smtp_user_domain='"+domain+"'";
		return yxysendsmtpinfodao.findByHql(hql);
	}

	/**查询SMTP List信息*/
	public List<YxySmtpList> findAllList() throws Exception {		
		return yxysmtplistdao.findAllList();
	}
	
	/**添加SMTP基本信息*/
	public void addSmtpinfo(YxySendSmtpInfo o) throws Exception {
		yxysendsmtpinfodao.addSmtpinfo(o);		
	}
	/**SMTP是否存在*/
	public List<YxySendSmtpInfo> findByAccount(String loginid, String domain,
			String account) throws Exception {
		String hql="from YxySendSmtpInfo where smtp_user_loginid='"+loginid+"' and smtp_user_domain='"+domain+"' and smtp_service_account='"+account+"'";
		return yxysendsmtpinfodao.findByHql(hql);
	}
	
	/**SMTP删除*/
	public void delSmtp(int id) throws Exception {
		yxysendsmtpinfodao.delSmtp(id);		
	}
	
	/**模糊查询SMTP信息*/
	public List<YxySendSmtpInfo> findByLike(String loginid, String domain,
			String value) throws Exception {
		String hql="from YxySendSmtpInfo where smtp_user_loginid='"+loginid+"' and smtp_user_domain='"+domain+"' and (smtp_service_account like'%"+value+"%' or smtp_service_number like '%"+value+"%')";
		return yxysendsmtpinfodao.findByHql(hql);
	}
	
	private YxySendSmtpInfoDao yxysendsmtpinfodao;//smtp DAO
	private YxySmtpListDao yxysmtplistdao;//SMTP List DAO
	
	public YxySendSmtpInfoDao getYxysendsmtpinfodao() {
		return yxysendsmtpinfodao;
	}
	public void setYxysendsmtpinfodao(YxySendSmtpInfoDao yxysendsmtpinfodao) {
		this.yxysendsmtpinfodao = yxysendsmtpinfodao;
	}
	public YxySmtpListDao getYxysmtplistdao() {
		return yxysmtplistdao;
	}
	public void setYxysmtplistdao(YxySmtpListDao yxysmtplistdao) {
		this.yxysmtplistdao = yxysmtplistdao;
	}

	

	
	

	
	
	
	
}