Pārlūkot izejas kodu

Merge branch 'develop' of http://git.ycjcjy.com/marketing/services into develop

Your Name 3 gadus atpakaļ
vecāks
revīzija
dc96164f7b

+ 2
- 0
src/main/java/com/yunzhi/marketing/dto/ChannelReportDTO.java Parādīt failu

@@ -38,4 +38,6 @@ public class ChannelReportDTO {
38 38
      * 性别
39 39
      */
40 40
     private Integer sex;
41
+
42
+    private String remark;
41 43
 }

+ 2
- 0
src/main/java/com/yunzhi/marketing/dto/StatisticsDTO.java Parādīt failu

@@ -20,4 +20,6 @@ public class StatisticsDTO {
20 20
     private Integer channelId;
21 21
 
22 22
     private String type;
23
+
24
+    private String customerType;
23 25
 }

+ 13
- 11
src/main/java/com/yunzhi/marketing/service/impl/ChannelCustomerStatisticsServiceImpl.java Parādīt failu

@@ -16,6 +16,7 @@ import org.ietf.jgss.ChannelBinding;
16 16
 import org.springframework.beans.factory.annotation.Autowired;
17 17
 import org.springframework.stereotype.Service;
18 18
 
19
+import java.util.ArrayList;
19 20
 import java.util.HashMap;
20 21
 import java.util.List;
21 22
 import java.util.Map;
@@ -96,16 +97,17 @@ public class ChannelCustomerStatisticsServiceImpl implements ChannelCustomerStat
96 97
         }
97 98
         statisticsDTo.setChannelId(taChannelPerson.getChannelId());
98 99
 
99
-        // 获取新增客户
100
-        List<CustomerDetailVO> newCustomerDetail = channelCustomerMapper.getNewCustomerDetail(statisticsDTo);
101
-        // 获取跟进客户
102
-        List<CustomerDetailVO> followCustomerDetail = customerVisitMapper.getFollowCustomerDetail(statisticsDTo);
103
-        // 获取成交客户
104
-        List<CustomerDetailVO> successCustomerDetail = channelCustomerMapper.getSuccessCustomerDetail(statisticsDTo);
105
-        Map<String,Object> map = new HashMap<>();
106
-        map.put("newCustomerDetail",newCustomerDetail);
107
-        map.put("followCustomerDetail",followCustomerDetail);
108
-        map.put("successCustomerDetail",successCustomerDetail);
109
-        return ResponseBean.success(map);
100
+        List<CustomerDetailVO> customerDetail = new ArrayList<>();
101
+        if ("new".equals(statisticsDTo.getCustomerType())){
102
+            // 获取新增客户
103
+            customerDetail = channelCustomerMapper.getNewCustomerDetail(statisticsDTo);
104
+        }else if ("follow".equals(statisticsDTo.getCustomerType())){
105
+            // 获取跟进客户
106
+            customerDetail = customerVisitMapper.getFollowCustomerDetail(statisticsDTo);
107
+        }else if ("success".equals(statisticsDTo.getCustomerType())) {
108
+            // 获取成交客户
109
+            customerDetail = channelCustomerMapper.getSuccessCustomerDetail(statisticsDTo);
110
+        }
111
+        return ResponseBean.success(customerDetail);
110 112
     }
111 113
 }

+ 1
- 0
src/main/java/com/yunzhi/marketing/service/impl/TaRecommendCustomerServiceImpl.java Parādīt failu

@@ -432,6 +432,7 @@ public class TaRecommendCustomerServiceImpl extends ServiceImpl<TaRecommendCusto
432 432
         channelCustomer.setStatus("1");
433 433
         channelCustomer.setChannelId(taChannelPeople.getChannelId());
434 434
         channelCustomer.setOrgId(channelReportDTO.getOrgId());
435
+        channelCustomer.setRemark(channelReportDTO.getRemark());
435 436
         channelCustomerMapper.insert(channelCustomer);
436 437
         return ResponseBean.success(channelCustomer);
437 438
     }

+ 1
- 1
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerController.java Parādīt failu

@@ -194,7 +194,7 @@ public class ChannelCustomerController extends BaseController {
194 194
             if (StringUtils.isEmpty(channelCustomer.getCustomerId())){
195 195
                 return ResponseBean.success(channelCustomer);
196 196
             }
197
-            responseBean.addSuccess(taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId()));
197
+            responseBean = taRecommendCustomerService.getCustDetail(channelCustomer.getCustomerId());
198 198
         }catch (Exception e){
199 199
             e.printStackTrace();
200 200
             logger.error("channelCustomerDelete -=- {}",e.toString());

+ 7
- 12
src/main/java/com/yunzhi/marketing/xlk/controller/ChannelCustomerStatisticsController.java Parādīt failu

@@ -31,8 +31,7 @@ public class ChannelCustomerStatisticsController extends BaseController {
31 31
 
32 32
     @ApiOperation(value = "wx-龙虎榜排名数据", notes = "wx-龙虎榜排名数据")
33 33
     @GetMapping(value="/wx/ranklist")
34
-    public ResponseBean getRanklist(@RequestParam("buildingId") String buildingId,
35
-                                    @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
34
+    public ResponseBean getRanklist(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
36 35
                                     @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
37 36
                                     @RequestHeader("authorization") String token, HttpServletRequest request){
38 37
         ResponseBean responseBean = new ResponseBean();
@@ -46,7 +45,6 @@ public class ChannelCustomerStatisticsController extends BaseController {
46 45
 
47 46
         // 构造参数
48 47
         StatisticsDTO statisticsDTo = new StatisticsDTO();
49
-        statisticsDTo.setBuildingId(buildingId);
50 48
         statisticsDTo.setStartDate(startDate);
51 49
         statisticsDTo.setEndDate(endDate);
52 50
         statisticsDTo.setOrgId(orgId);
@@ -56,8 +54,7 @@ public class ChannelCustomerStatisticsController extends BaseController {
56 54
 
57 55
     @ApiOperation(value = "wx-销售简报", notes = "wx-销售简报")
58 56
     @GetMapping(value="/wx/briefing")
59
-    public ResponseBean getBriefing(@RequestParam("buildingId") String buildingId,
60
-                                    @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
57
+    public ResponseBean getBriefing(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
61 58
                                     @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
62 59
                                     @RequestHeader("authorization") String token, HttpServletRequest request){
63 60
         ResponseBean responseBean = new ResponseBean();
@@ -71,7 +68,6 @@ public class ChannelCustomerStatisticsController extends BaseController {
71 68
 
72 69
         // 构造参数
73 70
         StatisticsDTO statisticsDTo = new StatisticsDTO();
74
-        statisticsDTo.setBuildingId(buildingId);
75 71
         statisticsDTo.setStartDate(startDate);
76 72
         statisticsDTo.setEndDate(endDate);
77 73
         statisticsDTo.setOrgId(orgId);
@@ -79,13 +75,12 @@ public class ChannelCustomerStatisticsController extends BaseController {
79 75
         return  channelCustomerStatisticsService.getBriefing(statisticsDTo);
80 76
     }
81 77
 
82
-    @ApiOperation(value = "wx-销售简报", notes = "wx-销售简报")
78
+    @ApiOperation(value = "wx-销售简报折线图", notes = "wx-销售简报折线图")
83 79
     @GetMapping(value="/wx/briefing/detail")
84
-    public ResponseBean getBriefingDetail(@RequestParam("buildingId") String buildingId,
85
-                                    @RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
86
-                                    @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate,
80
+    public ResponseBean getBriefingDetail(@RequestParam(value = "startDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime startDate,
81
+                                    @RequestParam(value = "endDate", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) LocalDateTime endDate, @RequestParam(value = "customerType") String customerType,
87 82
                                     @RequestParam(value = "type") String type,
88
-                                    @RequestHeader("authorization") String token, HttpServletRequest request){
83
+                                    @RequestHeader("authorization") String token,HttpServletRequest request){
89 84
         ResponseBean responseBean = new ResponseBean();
90 85
         String openid = getOpenId(request);
91 86
         Integer orgId = getOrgId(request);
@@ -97,12 +92,12 @@ public class ChannelCustomerStatisticsController extends BaseController {
97 92
 
98 93
         // 构造参数
99 94
         StatisticsDTO statisticsDTo = new StatisticsDTO();
100
-        statisticsDTo.setBuildingId(buildingId);
101 95
         statisticsDTo.setStartDate(startDate);
102 96
         statisticsDTo.setEndDate(endDate);
103 97
         statisticsDTo.setOrgId(orgId);
104 98
         statisticsDTo.setPersonId(person.getPersonId());
105 99
         statisticsDTo.setType(type);
100
+        statisticsDTo.setCustomerType(customerType);
106 101
         return  channelCustomerStatisticsService.getBriefingDetail(statisticsDTo);
107 102
     }
108 103
 }

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerPreparatory.java Parādīt failu

@@ -1,5 +1,7 @@
1 1
 package com.yunzhi.marketing.xlk.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -27,6 +29,7 @@ public class CustomerPreparatory implements Serializable {
27 29
     /**
28 30
      * 客户认筹id
29 31
      */
32
+    @TableId(type = IdType.UUID)
30 33
     private String customerPreparatoryId;
31 34
 
32 35
     /**

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerSignatory.java Parādīt failu

@@ -1,5 +1,7 @@
1 1
 package com.yunzhi.marketing.xlk.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -27,6 +29,7 @@ public class CustomerSignatory implements Serializable {
27 29
     /**
28 30
      * 主键
29 31
      */
32
+    @TableId(type = IdType.UUID)
30 33
     private String customerSignatoryId;
31 34
 
32 35
     /**

+ 3
- 0
src/main/java/com/yunzhi/marketing/xlk/entity/CustomerVisit.java Parādīt failu

@@ -1,5 +1,7 @@
1 1
 package com.yunzhi.marketing.xlk.entity;
2 2
 
3
+import com.baomidou.mybatisplus.annotation.IdType;
4
+import com.baomidou.mybatisplus.annotation.TableId;
3 5
 import com.baomidou.mybatisplus.annotation.TableName;
4 6
 import lombok.Data;
5 7
 import lombok.EqualsAndHashCode;
@@ -27,6 +29,7 @@ public class CustomerVisit implements Serializable {
27 29
     /**
28 30
      * 客户到访id
29 31
      */
32
+    @TableId(type = IdType.UUID)
30 33
     private String customerVisitId;
31 34
 
32 35
     /**

+ 48
- 9
src/main/java/com/yunzhi/marketing/xlk/service/impl/ChannelCustomerServiceImpl.java Parādīt failu

@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
7 7
 import com.yunzhi.marketing.base.ResponseBean;
8 8
 import com.yunzhi.marketing.common.CommConstant;
9 9
 import com.yunzhi.marketing.common.StringUtils;
10
+import com.yunzhi.marketing.entity.TaPerson;
10 11
 import com.yunzhi.marketing.entity.TaRecommendCustomer;
12
+import com.yunzhi.marketing.mapper.TaPersonMapper;
11 13
 import com.yunzhi.marketing.mapper.TaRecommendCustomerMapper;
12 14
 import com.yunzhi.marketing.po.MineRecommendCustomerPO;
13 15
 import com.yunzhi.marketing.po.TaRecommendCustomerPO;
@@ -45,6 +47,9 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
45 47
 
46 48
     @Autowired
47 49
     private CustomerSignatoryMapper customerSignatoryMapper;
50
+
51
+    @Autowired
52
+    private TaPersonMapper taPersonMapper;
48 53
     /**
49 54
      * 审核
50 55
      *
@@ -64,8 +69,19 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
64 69
 
65 70
         // 保存到访单
66 71
         CustomerVisit customerVisit = channelCustomerDTO.getCustomerVisit();
67
-        customerVisit.setCreateDate(LocalDateTime.now());
68
-        customerVisitMapper.insert(customerVisit);
72
+        customerVisit.setBuildingId(customer.getBuildingId());
73
+        customerVisit.setName(customer.getName());
74
+        customerVisit.setRecommendPerson(customer.getRecommendPerson());
75
+        TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
76
+        if (null != recommendPerson) {
77
+            customerVisit.setRealtyConsultantName(recommendPerson.getName());
78
+        }
79
+        customerVisit.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
80
+        TaPerson channelPerson = taPersonMapper.getById(channelCustomerDTO.getRealtyConsultant());
81
+        if (null != channelPerson) {
82
+            customerVisit.setRealtyConsultantName(channelPerson.getName());
83
+        }
84
+        customerVisit.setOrgId(customer.getOrgId());
69 85
 
70 86
         // 审核通过 先查看在ta_recommend_customer 手机号是否存在
71 87
         LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
@@ -95,22 +111,27 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
95 111
             // 审核通过
96 112
             customer.setStatus("2");
97 113
             customer.setCustomerId(taRecommendCustomer.getCustomerId());
114
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
98 115
             customer.setVisitDate(LocalDateTime.now());
99 116
             channelCustomerMapper.updateById(customer);
100
-            return ResponseBean.success("审核成功");
101
-        }
102
-
103
-        if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
117
+        }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
104 118
                 (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
105 119
             // 审核通过
106 120
             customer.setStatus("2");
107 121
             customer.setCustomerId(recommendCustomer.getCustomerId());
122
+            customerVisit.setCustomerId(recommendCustomer.getCustomerId());
108 123
             customer.setVisitDate(LocalDateTime.now());
124
+            customer.setRealtyConsultant(channelCustomerDTO.getRealtyConsultant());
109 125
             channelCustomerMapper.updateById(customer);
110
-            return ResponseBean.success("审核成功");
126
+        }else {
127
+            return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
111 128
         }
112 129
 
113
-        return ResponseBean.error("此客户是私客或已被报备", ResponseBean.ERROR_UNAVAILABLE);
130
+
131
+        customerVisit.setCreateDate(LocalDateTime.now());
132
+        customerVisitMapper.insert(customerVisit);
133
+
134
+        return ResponseBean.success("审核成功");
114 135
     }
115 136
 
116 137
     /**
@@ -122,9 +143,25 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
122 143
      */
123 144
     @Override
124 145
     public ResponseBean markingChannelCustomer(MarkingChannelCustomerDTO params) {
146
+        CustomerVisit customerVisit = params.getCustomerVisit();
125 147
         // 渠道推荐的客户
126 148
         if ("report".equals(params.getType())) {
127 149
             ChannelCustomer customer = channelCustomerMapper.selectById(params.getId());
150
+
151
+            customerVisit.setBuildingId(customer.getBuildingId());
152
+            customerVisit.setName(customer.getName());
153
+            customerVisit.setRecommendPerson(customer.getRecommendPerson());
154
+            TaPerson recommendPerson = taPersonMapper.getById(customer.getRecommendPerson());
155
+            if (null != recommendPerson) {
156
+                customerVisit.setRealtyConsultantName(recommendPerson.getName());
157
+            }
158
+            customerVisit.setRealtyConsultant(params.getRealtyConsultant());
159
+            TaPerson channelPerson = taPersonMapper.getById(params.getRealtyConsultant());
160
+            if (null != channelPerson) {
161
+                customerVisit.setRealtyConsultantName(channelPerson.getName());
162
+            }
163
+            customerVisit.setOrgId(customer.getOrgId());
164
+
128 165
             // 审核通过 先查看在ta_recommend_customer 手机号是否存在
129 166
             LambdaQueryWrapper<TaRecommendCustomer> queryWrapper = new LambdaQueryWrapper<>();
130 167
             queryWrapper.eq(TaRecommendCustomer::getPhone,customer.getPhone());
@@ -155,6 +192,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
155 192
                 customer.setStatus("2");
156 193
                 customer.setVisitDate(LocalDateTime.now());
157 194
                 customer.setCustomerId(taRecommendCustomer.getCustomerId());
195
+                customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
158 196
                 channelCustomerMapper.updateById(customer);
159 197
             }else if (StringUtils.isEmpty(recommendCustomer.getRealtyConsultant()) &&
160 198
                     (StringUtils.isEmpty(recommendCustomer.getRecommendPerson()) || recommendCustomer.getRecommendPerson().equals(customer.getRecommendPerson()))){
@@ -162,6 +200,7 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
162 200
                 customer.setStatus("2");
163 201
                 customer.setVisitDate(LocalDateTime.now());
164 202
                 customer.setCustomerId(recommendCustomer.getCustomerId());
203
+                customerVisit.setCustomerId(recommendCustomer.getCustomerId());
165 204
                 channelCustomerMapper.updateById(customer);
166 205
 
167 206
                 // 修改状态为确认到访状态
@@ -178,13 +217,13 @@ public class ChannelCustomerServiceImpl extends ServiceImpl<ChannelCustomerMappe
178 217
             taRecommendCustomer.setVerifyStatus(CommConstant.VERIFY_AGREE);
179 218
             taRecommendCustomer.setStatus(CommConstant.CUSTOMER_VISITE);
180 219
             taRecommendCustomer.setCirculationTime(LocalDateTime.now());
220
+            customerVisit.setCustomerId(taRecommendCustomer.getCustomerId());
181 221
             taRecommendCustomerMapper.updateById(taRecommendCustomer);
182 222
         }else {
183 223
             return ResponseBean.error("请输入正确的类型参数", ResponseBean.ERROR_UNAVAILABLE);
184 224
         }
185 225
 
186 226
         // 保存到访单
187
-        CustomerVisit customerVisit = params.getCustomerVisit();
188 227
         customerVisit.setCreateDate(LocalDateTime.now());
189 228
         customerVisitMapper.insert(customerVisit);
190 229
 

+ 13
- 8
src/main/resources/mapper/xlk/ChannelCustomerMapper.xml Parādīt failu

@@ -52,10 +52,9 @@
52 52
             p.avatarurl
53 53
         FROM
54 54
             xlk_channel_customer t
55
+        INNER JOIN xlk_customer_visit v on t.customer_id = v.customer_id
55 56
         LEFT JOIN ta_person p on t.recommend_person = p.person_id
56 57
         WHERE t.channel_id  = #{params.channelId}
57
-        and t.building_id = #{params.buildingId}
58
-        and t.`status` != 3
59 58
         <if test="params.startDate != null or params.endDate != null">
60 59
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
61 60
         </if>
@@ -104,7 +103,6 @@
104 103
         FROM
105 104
         xlk_channel_customer t
106 105
         WHERE t.channel_id  = #{params.channelId}
107
-        and t.building_id = #{params.buildingId}
108 106
         and t.`status` = 1
109 107
         <if test="params.startDate != null or params.endDate != null">
110 108
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
@@ -120,7 +118,6 @@
120 118
         xlk_channel_customer t
121 119
         LEFT join ta_recommend_customer r on t.customer_id = r.customer_id
122 120
         WHERE t.channel_id  = #{params.channelId}
123
-        and t.building_id = #{params.buildingId}
124 121
         and r.`status` in (4,5)
125 122
         <if test="params.startDate != null or params.endDate != null">
126 123
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
@@ -131,12 +128,16 @@
131 128
     </select>
132 129
     <select id="getNewCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
133 130
         SELECT
134
-            date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
131
+            <if test="params.type == 'day'">
132
+                date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
133
+            </if>
134
+            <if test="params.type == 'month'">
135
+                date_format( t.create_date, '%Y-%m' ) as coordinate,
136
+            </if>
135 137
             COUNT(1) as customerNum
136 138
         FROM
137 139
         xlk_channel_customer t
138 140
         WHERE t.channel_id  = #{params.channelId}
139
-        and t.building_id = #{params.buildingId}
140 141
         and t.`status` = 1
141 142
         <if test="params.startDate != null or params.endDate != null">
142 143
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
@@ -153,13 +154,17 @@
153 154
     </select>
154 155
     <select id="getSuccessCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
155 156
         SELECT
156
-            date_format( t.create_date, '%%Y-%m-%d' ) as coordinate,
157
+            <if test="params.type == 'day'">
158
+                date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
159
+            </if>
160
+            <if test="params.type == 'month'">
161
+                date_format( t.create_date, '%Y-%m' ) as coordinate,
162
+            </if>
157 163
             COUNT(1) as customerNum
158 164
         FROM
159 165
         xlk_channel_customer t
160 166
         LEFT join ta_recommend_customer r on t.customer_id = r.customer_id
161 167
         WHERE t.channel_id  = #{params.channelId}
162
-        and t.building_id = #{params.buildingId}
163 168
         and r.`status` in (4,5)
164 169
         <if test="params.startDate != null or params.endDate != null">
165 170
             AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}

+ 6
- 1
src/main/resources/mapper/xlk/CustomerVisitMapper.xml Parādīt failu

@@ -19,7 +19,12 @@
19 19
     </select>
20 20
     <select id="getFollowCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
21 21
         SELECT
22
-            date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
22
+            <if test="params.type == 'day'">
23
+                date_format( t.create_date, '%Y-%m-%d' ) as coordinate,
24
+            </if>
25
+            <if test="params.type == 'month'">
26
+                date_format( t.create_date, '%Y-%m' ) as coordinate,
27
+            </if>
23 28
             COUNT(1) as customerNum
24 29
         FROM
25 30
         xlk_channel_customer t