|
|
@@ -333,4 +333,28 @@
|
|
|
</if>
|
|
|
and money > 0
|
|
|
</select>
|
|
|
+
|
|
|
+ <select id="getTagUserDataPage" resultType="com.cyksj.model.views.UserOrderDetailView">
|
|
|
+ select count(if(status != 'refund', 1, NULL)) as numOfOrder, (sum(money) - sum(ifnull(refund_money, 0))) / 100
|
|
|
+ as orderMoney,date_format(o.created_time,'%Y-%m-%d') as date
|
|
|
+ from `order_don` o
|
|
|
+ where exists (select cu.user_id
|
|
|
+ from (select relation_id
|
|
|
+ from `corp_user_tag`
|
|
|
+ where tag_name = #{tagName}) s
|
|
|
+ left join corp_user_follow_relation cufr on cufr.id = s.relation_id
|
|
|
+ left join corp_user_auth ca on ca.external_userid = cufr.corp_user_id
|
|
|
+ left join corp_user cu on cu.id = ca.corp_user_id
|
|
|
+ where cu.user_id != 0 and cu.user_id = o.user_id )
|
|
|
+ and status not in ('close', 'noPayment')
|
|
|
+ <if test="startTime != null">
|
|
|
+ and o.created_time >= #{startTime}
|
|
|
+ </if>
|
|
|
+ <if test="endTime != null">
|
|
|
+ and o.created_time < #{endTime}
|
|
|
+ </if>
|
|
|
+ and money > 0
|
|
|
+ group by date_format(o.created_time,'%Y-%m-%d')
|
|
|
+ order by date_format(o.created_time,'%Y-%m-%d') desc
|
|
|
+ </select>
|
|
|
</mapper>
|