1099ccca1d83cf605b6f6fb86d91376f6688ee92.svn-base
5.7 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package com.espeed.service.impl;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.espeed.dao.YxyLinkInfoDao;
import com.espeed.dao.YxyMailNumCountDao;
import com.espeed.dao.YxyReadingInfoDao;
import com.espeed.dao.YxyReplyInfoDao;
import com.espeed.dao.YxySendMailMasterBaseDao;
import com.espeed.dao.YxyUnsubscribeInfoDao;
import com.espeed.pojo.YxyLinkInfo;
import com.espeed.pojo.YxyMailNumCount;
import com.espeed.pojo.YxyReadingInfo;
import com.espeed.pojo.YxyReplyInfo;
import com.espeed.pojo.YxySendMailMasterBase;
import com.espeed.pojo.YxyUnsubscribeInfo;
import com.espeed.service.YxyMailNumCountService;
public class YxyMailNumCountServiceImpl implements YxyMailNumCountService {
/**获取邮件对应的统计数据*/
public YxyMailNumCount getNumCountByUid(String mail_uid)throws Exception{
YxyMailNumCount count = new YxyMailNumCount();
count.setMail_uid(mail_uid);
if(null!=mail_uid && !"".equals(mail_uid)){
String hql = "from YxyMailNumCount where mail_uid = '"+mail_uid+"'";
List<YxyMailNumCount> counts = yxymailnumcountdao.findByHql(hql);
if(counts.size() > 0){
count = counts.get(0);
}
}
return count;
}
/**获取阅读总数列表数据*/
public List<YxyReadingInfo> getReadingInfoList(String mail_uid,int nums)throws Exception{
if(nums == 0){
return new ArrayList<YxyReadingInfo>();
}
String hql = "from YxyReadingInfo where yxy_reading_mailuid = '"+mail_uid+"' order by yxy_reading_date desc";
return yxyreadinginfodao.findByHqlSet(hql, nums);
}
/**获取阅读人数列表数据*/
public Map<String,Integer> getReadingPersonList(String mail_uid,int nums)throws Exception{
Map<String,Integer> map = new HashMap<String,Integer>();
if(nums == 0){
return map;
}
String hql = "from YxyReadingInfo where yxy_reading_mailuid = '"+mail_uid+"' order by yxy_reading_date desc";
List<YxyReadingInfo> reads = yxyreadinginfodao.findByHqlSet(hql, nums);
for(YxyReadingInfo read : reads){
if(map.containsKey(read.getYxy_reading_email())){
map.put(read.getYxy_reading_email(), map.get(read.getYxy_reading_email())+1);
}else{
map.put(read.getYxy_reading_email(), 1);
}
}
return map;
}
/**获取回复列表数据*/
public List<YxyReplyInfo> getReplyInfoList(String mail_uid,int nums)throws Exception{
if(nums == 0){
return new ArrayList<YxyReplyInfo>();
}
String hql = "from YxyReplyInfo where mailuid = '"+mail_uid+"' order by replydate desc";
return yxyreplyinfodao.findByHqlSet(hql, nums);
}
/**获取退订列表数据*/
public List<YxyUnsubscribeInfo> getUnsubInfoList(String mail_uid,int nums)throws Exception{
if(nums == 0){
return new ArrayList<YxyUnsubscribeInfo>();
}
String hql = "from YxyUnsubscribeInfo where unsubscribe_issys = 0 and unsubscribe_mail_uid = '"+mail_uid+"' order by unsubscribe_date desc";
return yxyunsubscribeinfodao.findByHqlSet(hql, nums);
}
/**获取打开链接人数列表数据*/
public Map<String,Integer> getLinkPersonList(String mail_uid,int nums)throws Exception{
Map<String,Integer> map = new HashMap<String,Integer>();
if(nums == 0){
return map;
}
String hql = "from YxyLinkInfo where mail_uid = '"+mail_uid+"' order by create_time desc";
List<YxyLinkInfo> links = yxylinkinfodao.findByHqlSet(hql, nums);
for(YxyLinkInfo link : links){
String key = link.getLink_email()+"@espeed@"+link.getLink_url();
if(map.containsKey(key)){
map.put(key, map.get(key)+1);
}else{
map.put(key, 1);
}
}
return map;
}
/**获取打开链接总数列表数据*/
public List<YxyLinkInfo> getLinkInfoList(String mail_uid,int nums)throws Exception{
if(nums == 0){
return new ArrayList<YxyLinkInfo>();
}
String hql = "from YxyLinkInfo where mail_uid = '"+mail_uid+"' order by create_time desc";
return yxylinkinfodao.findByHqlSet(hql, nums);
}
/**获取邮件的所有邮件信息*/
public List<YxySendMailMasterBase> findAllMailById(int send_mail_id)throws Exception{
String hql = "from YxySendMailMasterBase where send_mail_id = "+send_mail_id+" or mainid = "+send_mail_id+" order by send_mail_id asc";
return yxysendmailmasterbasedao.findByHql(hql);
}
private YxyMailNumCountDao yxymailnumcountdao;
private YxyReadingInfoDao yxyreadinginfodao;
private YxyReplyInfoDao yxyreplyinfodao;
private YxyUnsubscribeInfoDao yxyunsubscribeinfodao;
private YxyLinkInfoDao yxylinkinfodao;
private YxySendMailMasterBaseDao yxysendmailmasterbasedao;
public YxyMailNumCountDao getYxymailnumcountdao() {
return yxymailnumcountdao;
}
public void setYxymailnumcountdao(YxyMailNumCountDao yxymailnumcountdao) {
this.yxymailnumcountdao = yxymailnumcountdao;
}
public YxyReadingInfoDao getYxyreadinginfodao() {
return yxyreadinginfodao;
}
public void setYxyreadinginfodao(YxyReadingInfoDao yxyreadinginfodao) {
this.yxyreadinginfodao = yxyreadinginfodao;
}
public YxyReplyInfoDao getYxyreplyinfodao() {
return yxyreplyinfodao;
}
public void setYxyreplyinfodao(YxyReplyInfoDao yxyreplyinfodao) {
this.yxyreplyinfodao = yxyreplyinfodao;
}
public YxyUnsubscribeInfoDao getYxyunsubscribeinfodao() {
return yxyunsubscribeinfodao;
}
public void setYxyunsubscribeinfodao(YxyUnsubscribeInfoDao yxyunsubscribeinfodao) {
this.yxyunsubscribeinfodao = yxyunsubscribeinfodao;
}
public YxyLinkInfoDao getYxylinkinfodao() {
return yxylinkinfodao;
}
public void setYxylinkinfodao(YxyLinkInfoDao yxylinkinfodao) {
this.yxylinkinfodao = yxylinkinfodao;
}
public YxySendMailMasterBaseDao getYxysendmailmasterbasedao() {
return yxysendmailmasterbasedao;
}
public void setYxysendmailmasterbasedao(
YxySendMailMasterBaseDao yxysendmailmasterbasedao) {
this.yxysendmailmasterbasedao = yxysendmailmasterbasedao;
}
}