|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
4
|
4
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
5
|
5
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
6
|
6
|
import com.huiju.estateagents.base.ResponseBean;
|
|
7
|
+import com.huiju.estateagents.common.StringUtils;
|
7
|
8
|
import com.huiju.estateagents.entity.TaChannel;
|
8
|
9
|
import com.huiju.estateagents.entity.TsActivityDaily;
|
9
|
10
|
import com.huiju.estateagents.excel.ActivityStatistics.*;
|
|
@@ -42,9 +43,19 @@ public class TaChannelServiceImpl extends ServiceImpl<TaChannelMapper, TaChannel
|
42
|
43
|
* @return
|
43
|
44
|
*/
|
44
|
45
|
@Override
|
45
|
|
- public ResponseBean getChannelIntroductionList(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId) {
|
|
46
|
+ public ResponseBean getChannelIntroductionList(Integer pageNum, Integer pageSize, Integer orgId, LocalDate startDate, LocalDate endDate, String channelType, String buildingId, Integer channelId,String sortField,String sortOrder) {
|
46
|
47
|
IPage<TsActivityDaily> pg = new Page<>(pageNum, pageSize);
|
47
|
|
- IPage<TsActivityDaily> data = taChannelMapper.getChannelIntroductionList(pg, orgId,startDate,endDate,channelType,buildingId, channelId);
|
|
48
|
+ String orderType = "asc";
|
|
49
|
+ if ("descend".equals(sortOrder)){
|
|
50
|
+ orderType = "desc";
|
|
51
|
+ }else if ("ascend".equals(sortOrder)){
|
|
52
|
+ orderType = "asc";
|
|
53
|
+ }
|
|
54
|
+ if(StringUtils.isEmpty(sortField)){
|
|
55
|
+ sortField = "new_customers";
|
|
56
|
+ orderType = "desc";
|
|
57
|
+ }
|
|
58
|
+ IPage<TsActivityDaily> data = taChannelMapper.getChannelIntroductionList(pg, orgId,startDate,endDate,channelType,buildingId, channelId, sortField, orderType);
|
48
|
59
|
return ResponseBean.success(data);
|
49
|
60
|
}
|
50
|
61
|
|