|
@@ -129,4 +129,59 @@
|
129
|
129
|
AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
130
|
130
|
</if>
|
131
|
131
|
</select>
|
|
132
|
+ <select id="getNewCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
|
|
133
|
+ SELECT
|
|
134
|
+ <if test="params.type == 'day''">
|
|
135
|
+ date_format( t.create_date, '%d' ) as coordinate,
|
|
136
|
+ </if>
|
|
137
|
+ <if test="params.type == 'month''">
|
|
138
|
+ date_format( t.create_date, '%m' ) as coordinate,
|
|
139
|
+ </if>
|
|
140
|
+ COUNT(1) as customerNum
|
|
141
|
+ FROM
|
|
142
|
+ xlk_channel_customer t
|
|
143
|
+ WHERE t.channel_id = #{params.channelId}
|
|
144
|
+ and t.building_id = #{params.buildingId}
|
|
145
|
+ and t.`status` = 1
|
|
146
|
+ <if test="params.startDate != null or params.endDate != null">
|
|
147
|
+ AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
|
|
148
|
+ </if>
|
|
149
|
+ <if test="params.startDate == null or params.endDate == null">
|
|
150
|
+ AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
|
151
|
+ </if>
|
|
152
|
+ <if test="params.type == 'day''">
|
|
153
|
+ group by date_format( t.create_date, '%Y-%m-%d' )
|
|
154
|
+ </if>
|
|
155
|
+ <if test="params.type == 'month''">
|
|
156
|
+ group by date_format( t.create_date, '%Y-%m' )
|
|
157
|
+ </if>
|
|
158
|
+ </select>
|
|
159
|
+ <select id="getSuccessCustomerDetail" resultType="com.yunzhi.marketing.xlk.vo.CustomerDetailVO">
|
|
160
|
+ SELECT
|
|
161
|
+ <if test="params.type == 'day''">
|
|
162
|
+ date_format( t.create_date, '%d' ) as coordinate,
|
|
163
|
+ </if>
|
|
164
|
+ <if test="params.type == 'month''">
|
|
165
|
+ date_format( t.create_date, '%m' ) as coordinate,
|
|
166
|
+ </if>
|
|
167
|
+ COUNT(1) as customerNum
|
|
168
|
+ FROM
|
|
169
|
+ xlk_channel_customer t
|
|
170
|
+ LEFT join ta_recommend_customer r on t.customer_id = r.customer_id
|
|
171
|
+ WHERE t.channel_id = #{params.channelId}
|
|
172
|
+ and t.building_id = #{params.buildingId}
|
|
173
|
+ and r.`status` in (4,5)
|
|
174
|
+ <if test="params.startDate != null or params.endDate != null">
|
|
175
|
+ AND t.create_date BETWEEN #{params.startDate} and #{params.endDate}
|
|
176
|
+ </if>
|
|
177
|
+ <if test="params.startDate == null or params.endDate == null">
|
|
178
|
+ AND t.create_date BETWEEN DATE_SUB(now(),INTERVAL 7 DAY) and now()
|
|
179
|
+ </if>
|
|
180
|
+ <if test="params.type == 'day''">
|
|
181
|
+ group by date_format( t.create_date, '%Y-%m-%d' )
|
|
182
|
+ </if>
|
|
183
|
+ <if test="params.type == 'month''">
|
|
184
|
+ group by date_format( t.create_date, '%Y-%m' )
|
|
185
|
+ </if>
|
|
186
|
+ </select>
|
132
|
187
|
</mapper>
|