StatisticsServiceImpl.java
7.62 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/**
*
*/
package com.bjivt.service.showtime.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.bjivt.dao.showtime.CompetenceDao;
import com.bjivt.dao.showtime.StatisticsDao;
import com.bjivt.entity.showtime.User;
import com.bjivt.entity.vo.StatisticMobile;
import com.bjivt.entity.vo.StatisticsAnchor;
import com.bjivt.entity.vo.StatisticsDecResult;
import com.bjivt.entity.vo.StatisticsIncome;
import com.bjivt.entity.vo.StatisticsResult;
import com.bjivt.entity.vo.StatisticsTwoSeries;
import com.bjivt.entity.vo.StatisticsUser;
import com.bjivt.service.showtime.StatisticsService;
import com.bjivt.util.DateTool;
import com.bjivt.util.Pager;
/**
* @author ts
* 2016年7月18日 上午9:52:04
*
*/
@Component
public class StatisticsServiceImpl implements StatisticsService {
@Autowired
private StatisticsDao statisticsDao;
/* (non-Javadoc)
* @see com.bjivt.service.showtime.StatisticsService#getRegisterUserByMap(java.util.Map)
*/
@Override
public List<StatisticsResult> getRegistUserEveryDayByMap(String startTime,String endTime,String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
return statisticsDao.getRegistUserEveryDayByMap(map);
}
@Override
public List<StatisticsResult> getRegistUserTotalByMap(String startTime,String endTime,String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
return statisticsDao.getRegistUserTotalByMap(map);
}
@Override
public List<User> getUserListByMap(Map<String, Object> map) {
// TODO Auto-generated method stub
return statisticsDao.getUserListByMap(map);
}
@Override
public List<StatisticMobile> findMobileListByPage(StatisticMobile statisticMobile, Pager page) {
Map<String, Object> map = new HashMap<String, Object>();
if (page != null) {
page.setCount(getMobileCountBy(statisticMobile));
}
map.put("page", page);
map.put(statisticMobile.getClass().getSimpleName(), statisticMobile);
return statisticsDao.findMobileListByMap(map);
}
@Override
public Integer getMobileCountBy(StatisticMobile param) {
// TODO Auto-generated method stub
return statisticsDao.getMobileCountBy(param);
}
@Override
public Integer getRegistUserBeforeDayCount(String startTime, String endTime) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
return statisticsDao.getRegistUserBeforeDayCount(map);
}
@Override
public List<StatisticsDecResult> getRetainedUserByMap(String startTime, String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("types", types);
return statisticsDao.getRetainedUserByMap(map);
}
@Override
public List<StatisticsUser> getUserDataByMap(String startTime, String endTime, String orderfield, Integer id,String orderrule, Pager page) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("orderfield", orderfield);
map.put("orderrule", orderrule);
if(page != null){
int count = statisticsDao.getUserDataCountBy(map);
page.setCount(count);
map.put("page", page);
}
map.put("id", id);
return statisticsDao.getUserDataByMap(map);
}
@Override
public List<StatisticsResult> getUserVisitTime(String startTime, String endTime, String types, String id) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
map.put("id", id);
return statisticsDao.getUserVisitTime(map);
}
@Override
public List<StatisticsResult> getUserRecharge(String startTime, String endTime, String types, String id) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
map.put("id", id);
return statisticsDao.getUserRecharge(map);
}
@Override
public List<StatisticsResult> getUserAnchorTotal(String startTime, String endTime, String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
return statisticsDao.getUserAnchorTotal(map);
// int type = 0;
// if(StringUtils.isEmpty(types))
// type=0;
// else
// type = Integer.parseInt(types);
// if(type==0 || type==1){
// types = "'%Y-%m-%d'";
// type=0;
// }else if(type==2){
// types = "'%Y年第%u周'";
// }else if(type==3){
// types = "'%Y年%m月'";
// }else if(type==4){
// types = "'%Y'";
// }
// StatisticsAnchor sa = new StatisticsAnchor();
// sa.setStartTime(DateTool.stringToDate(startTime));
// sa.setEndTime(DateTool.stringToDate(endTime));
// sa.setTypes(types);
// sa.setType(type);
// return statisticsDao.getUserAnchorTotal(startTime, endTime, types);
// return statisticsDao.getUserAnchorTotal(sa);
}
@Override
public List<StatisticsResult> getUserAnchorDayIncrease(String startTime, String endTime, String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
return statisticsDao.getUserAnchorDayIncrease(map);
}
/**
* 获取主播用户的数据
* @see com.bjivt.service.showtime.StatisticsService#getAnchorUserDataList(java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, com.bjivt.util.Pager)
*/
@Override
public List<StatisticsUser> getAnchorUserDataList(String startTime, String endTime, String orderfield, Integer id,
String orderrule, Pager page) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("orderfield", orderfield);
map.put("orderrule", orderrule);
if(page != null){
int count = statisticsDao.getAnchorUserDataCount(map);
page.setCount(count);
map.put("page", page);
}
map.put("id", id);
return statisticsDao.getAnchorUserDataList(map);
}
@Override
public List<StatisticsDecResult> getAnchorUserTimeTotal(String startTime, String endTime, String types, String id) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
map.put("id", id);
return statisticsDao.getAnchorUserTimeTotal(map);
}
@Override
public List<StatisticsResult> getAnchorByVisitUser(String startTime, String endTime, String types, String id) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
map.put("id", id);
return statisticsDao.getAnchorByVisitUser(map);
}
@Override
public List<StatisticsTwoSeries> getAnchorVisitUserAndTimeTotal(String startTime, String endTime, String types,
String id) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
map.put("id", id);
return statisticsDao.getAnchorVisitUserAndTimeTotal(map);
}
@Override
public List<StatisticsIncome> getIncomeTotal(String startTime, String endTime, String types) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("startTime", startTime);
map.put("endTime", endTime);
map.put("types", types);
return statisticsDao.getIncomeTotal(map);
}
}