ea193b11e1fa437fcbdf6f22b04b7d16cdbea541.svn-base 2.0 KB
package yxy.timer.service.impl;

import java.util.List;

import yxy.timer.dao.YxySendMailDetailDao;
import yxy.timer.dao.YxyUserAddressDao;
import yxy.timer.dao.YxyUserSetDao;
import yxy.timer.pojo.YxyUserSet;
import yxy.timer.service.YxyAddressService;

public class YxyAddressServiceImpl implements YxyAddressService{
	
	/**查询所有用户设置信息*/
	public List<YxyUserSet> findAllSet() throws Exception {
		
		return yxyusersetdao.findAllSet();
	}
	/**删除7天前的地址(默认未分类的)*/
	public void delAddress(String timer) throws Exception {
		String hql="delete YxyUserAddress where user_addr_type_id=0 and user_addr_add_date<'"+timer+"'";
		yxyuseraddressdao.delByHql(hql);
	}
	/**根据用户与域名删除*/
	public void delAddressByUser(String timer, String loginid, String domain)
			throws Exception {
		String hql="delete YxyUserAddress where user_loginid='"+loginid+"' and user_domain='"+domain+"' and user_addr_type_id!=0 and user_addr_add_date<'"+timer+"'";
		yxyuseraddressdao.delByHql(hql);	
	}
	
	/**删除待发地址*/
	public void delDetail() throws Exception {
		String hql="delete YxySendMailDetail where status=1";
		yxysendmaildetaildao.updateDelByHql(hql);
	}
	private YxyUserSetDao yxyusersetdao;//用户设置dao
	private YxyUserAddressDao yxyuseraddressdao;//用户地址dao
	private YxySendMailDetailDao yxysendmaildetaildao;//待发地址dao
	
	public YxyUserSetDao getYxyusersetdao() {
		return yxyusersetdao;
	}
	public void setYxyusersetdao(YxyUserSetDao yxyusersetdao) {
		this.yxyusersetdao = yxyusersetdao;
	}
	public YxyUserAddressDao getYxyuseraddressdao() {
		return yxyuseraddressdao;
	}
	public void setYxyuseraddressdao(YxyUserAddressDao yxyuseraddressdao) {
		this.yxyuseraddressdao = yxyuseraddressdao;
	}
	public YxySendMailDetailDao getYxysendmaildetaildao() {
		return yxysendmaildetaildao;
	}
	public void setYxysendmaildetaildao(YxySendMailDetailDao yxysendmaildetaildao) {
		this.yxysendmaildetaildao = yxysendmaildetaildao;
	}
	
	
	
	
}