|
|
@@ -133,4 +133,24 @@
|
|
|
where ct.group_name = #{groupName}
|
|
|
and cufr.corp_user_id = #{externalUserId}
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getFansUserToMonthOrdersDetai" resultType="com.cyksj.model.views.UserOrderDetailView">
|
|
|
+ select count(distinct o.user_id) as numOfUser,count(1) as numOfOrder,
|
|
|
+ cast(sum(o.money)/100 as decimal(10,2)) as orderMoney,
|
|
|
+ count(if(goods_id = 15,1,NULL)) as numOfEpOrder,
|
|
|
+ cast(sum(if(goods_id = 15,o.money,0))/100 as decimal(10,2)) as epOrderMoney
|
|
|
+ from (select cu.user_id
|
|
|
+ from (select distinct cu.*
|
|
|
+ from (select DISTINCT relation_id from corp_user_tag where tag_id = #{tagIdStr}) ct
|
|
|
+ inner join corp_user_follow_relation cufr on cufr.id = ct.relation_id
|
|
|
+ inner join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
|
|
|
+ inner join corp_user cu on cu.id = ca.corp_user_id and cu.user_id != 0
|
|
|
+ <if test="thisDate != null">
|
|
|
+ where date_format(cu.created_time,'%Y-%m-%d') = #{thisDate}
|
|
|
+ </if>
|
|
|
+ ) cu) cu
|
|
|
+ left join order_don o on o.user_id = cu.user_id
|
|
|
+ where o.status not in ('close','noPayment','refund')
|
|
|
+ and o.created_time between #{st} and #{et}
|
|
|
+ </select>
|
|
|
</mapper>
|