20a38b1bd31e1a9d2dae4ffdd3a715d25f7c4063.svn-base
3.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
package com.espeed.service.impl;
import java.util.List;
import com.espeed.dao.YxySendFilterAddressDao;
import com.espeed.dao.YxySendFilterDao;
import com.espeed.pojo.YxySendFilter;
import com.espeed.service.YxySendFilterService;
/**
* 程序名称: EspeedMail_时速邮箱
* 程序版本: V1.0
* 作 者: 深圳市科飞时速网络技术有限公司(0755-88843776)
* 版权所有: 深圳市科飞时速网络技术有限公司
* 技术支持: Tech@21gmail.com
* 单元名称: 发送过滤分组Service接口实现类
* 开始时间: 2013.12.09
* 程 序 员: 谢勇
* 最后修改:
* 备 注: 如需修改请通知程序员
*/
public class YxySendFilterServiceImpl implements YxySendFilterService{
/**查询发送过滤分组所有类别*/
public List<YxySendFilter> findUserFilter(String loginid, String domain)throws Exception {
String hql="from YxySendFilter where filterloginid='"+loginid+"' and filterdomain='"+domain+"'";
return yxysendfilterdao.findByHql(hql);
}
/**添加编辑过滤分组类别*/
public void addEditFilter(YxySendFilter o) throws Exception {
if(o.getFilterid()>0){//编辑
yxysendfilterdao.updatePojo(o);
}else{//添加
yxysendfilterdao.addPojo(o);
}
}
/**删除过滤分组*/
public void delFilter(String loginid,String domain,int filterid,int operation) throws Exception {
if(operation==1){//删除地址
//删除地址
String hql1="delete YxySendFilterAddress where filterid="+filterid;
yxysendfilteraddressdao.updateByHql(hql1);
}else{//地址修改为默认过滤分组
String hql2="update YxySendFilterAddress set filterid=0 where filterid="+filterid;
yxysendfilteraddressdao.updateByHql(hql2);
}
String hql="delete YxySendFilter where id="+filterid;
yxysendfilterdao.updateByHql(hql);
}
/**清空过滤分组*/
public void delFilterData(int filterid) throws Exception {
//删除地址
String hql1="delete YxySendFilterAddress where filterid="+filterid;
yxysendfilteraddressdao.updateByHql(hql1);
}
/**过滤分组是否存在*/
public int findisExits(String name,String loginid,String domain)throws Exception{
String hql="select count(*) from YxySendFilter where filtername='"+name+"' and filterloginid='"+loginid+"' and filterdomain='"+domain+"'";
int count=yxysendfilterdao.findByHqlCount(hql);
if(count>0){
return 0;
}else{
return 1;
}
}
private YxySendFilterDao yxysendfilterdao;//过滤分组类别Dao
private YxySendFilterAddressDao yxysendfilteraddressdao;//过滤地址dao
public YxySendFilterDao getYxysendfilterdao() {
return yxysendfilterdao;
}
public void setYxysendfilterdao(YxySendFilterDao yxysendfilterdao) {
this.yxysendfilterdao = yxysendfilterdao;
}
public YxySendFilterAddressDao getYxysendfilteraddressdao() {
return yxysendfilteraddressdao;
}
public void setYxysendfilteraddressdao(
YxySendFilterAddressDao yxysendfilteraddressdao) {
this.yxysendfilteraddressdao = yxysendfilteraddressdao;
}
}