|
|
|
@ -275,10 +275,12 @@
|
|
|
|
|
SELECT
|
|
|
|
|
ifnull(sum(s.orders),0) orders,
|
|
|
|
|
ifnull(sum(s.total),0) total,
|
|
|
|
|
ifnull(sum(s.single_amount),0) single_amount
|
|
|
|
|
ifnull(sum(s.single_amount),0) single_amount,
|
|
|
|
|
ifnull(count(distinct s.client_id), 0) transaction_partners
|
|
|
|
|
FROM statistics_customer_order s
|
|
|
|
|
LEFT JOIN sys_clients c ON c.client_id = s.client_id and c.is_valid=1
|
|
|
|
|
<where>
|
|
|
|
|
AND s.client_id != 0
|
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
|
AND s.client_id IN
|
|
|
|
|
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
|
|
|
|
@ -566,4 +568,50 @@
|
|
|
|
|
</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
<select id="countEnableChannel" resultType="java.lang.Integer">
|
|
|
|
|
<![CDATA[
|
|
|
|
|
SELECT
|
|
|
|
|
IFNULL(
|
|
|
|
|
COUNT(DISTINCT c.client_id),
|
|
|
|
|
0
|
|
|
|
|
) count
|
|
|
|
|
FROM
|
|
|
|
|
sys_clients c
|
|
|
|
|
INNER JOIN sys_client_config cc ON cc.client_id = c.client_id
|
|
|
|
|
INNER JOIN sys_org o ON o.org_id = c.org_id
|
|
|
|
|
WHERE
|
|
|
|
|
c.open_status = 5
|
|
|
|
|
AND c.approve_result = 1
|
|
|
|
|
AND c.approve_time IS NOT NULL
|
|
|
|
|
]]>
|
|
|
|
|
<if test="client_ids!=null">
|
|
|
|
|
AND c.client_id IN
|
|
|
|
|
<foreach collection="client_ids" open="(" close=")" separator="," item="client_id">
|
|
|
|
|
#{client_id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
|
and c.client_id=#{client_id}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="gateway_alipay_online!=null">and cc.gateway_alipay_online = #{gateway_alipay_online}</if>
|
|
|
|
|
<if test="enable_wechat!=null">and cc.enable_wechat = #{enable_wechat}</if>
|
|
|
|
|
<if test="enable_alipay!=null">and cc.enable_alipay = #{enable_alipay}</if>
|
|
|
|
|
<if test="enable_bestpay!=null">and cc.enable_bestpay = #{enable_bestpay}</if>
|
|
|
|
|
<if test="enable_jd!=null">and cc.enable_jd = #{enable_jd}</if>
|
|
|
|
|
<if test="enable_hf!=null">and cc.enable_hf = #{enable_hf}</if>
|
|
|
|
|
<if test="enable_rpay!=null">and cc.enable_rpay = #{enable_rpay}</if>
|
|
|
|
|
<if test="enable_yeepay!=null">and cc.enable_yeepay = #{enable_yeepay}</if>
|
|
|
|
|
<if test="org_id!=null and org_ids==null">and c.org_id=#{org_id}</if>
|
|
|
|
|
<if test="org_ids!=null">and c.org_id in
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
|
</if>
|
|
|
|
|
<if test="bd_group!=null">and c.client_id in
|
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
|
|
where b.is_valid=1 and b.start_date<=now() and (b.end_date is null or b.end_date >= now())
|
|
|
|
|
AND (c.bd_group=#{bd_group} or c.manager_id=#{bd_group})
|
|
|
|
|
<if test="bd_group_bd">and c.manager_id=#{bd_group_bd}</if>
|
|
|
|
|
)
|
|
|
|
|
</if>
|
|
|
|
|
</select>
|
|
|
|
|
</mapper>
|
|
|
|
|