|
|
@ -52,7 +52,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="analysisTotalCount" resultType="java.lang.Double">
|
|
|
|
<select id="analysisTotalCount" resultType="java.lang.Double">
|
|
|
@ -72,7 +74,10 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach>
|
|
|
|
|
|
|
|
</if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="analysisRefundAmount" resultType="java.lang.Double">
|
|
|
|
<select id="analysisRefundAmount" resultType="java.lang.Double">
|
|
|
@ -156,7 +161,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and o.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and o.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
GROUP BY o.order_id
|
|
|
|
GROUP BY o.order_id
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
@ -199,7 +206,9 @@
|
|
|
|
<if test="client_id!=null">AND l.client_id = #{client_id}</if>
|
|
|
|
<if test="client_id!=null">AND l.client_id = #{client_id}</if>
|
|
|
|
<if test="begin!=null">and o.create_time >= #{begin}</if>
|
|
|
|
<if test="begin!=null">and o.create_time >= #{begin}</if>
|
|
|
|
<if test="end!=null">and o.create_time <= #{end}</if>
|
|
|
|
<if test="end!=null">and o.create_time <= #{end}</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
GROUP BY gateway_label
|
|
|
|
GROUP BY gateway_label
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="tradeAnalysisInHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="tradeAnalysisInHours" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
@ -226,7 +235,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
@ -260,7 +271,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
GROUP BY date(o.create_time)
|
|
|
|
GROUP BY date(o.create_time)
|
|
|
|
ORDER BY date(o.create_time)
|
|
|
|
ORDER BY date(o.create_time)
|
|
|
@ -285,7 +298,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="countCustomers" resultType="java.lang.Integer">
|
|
|
|
<select id="countCustomers" resultType="java.lang.Integer">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
@ -304,7 +319,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and o.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and o.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
@ -327,7 +344,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and t.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and t.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and t.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<if test="channel !=null"> and o.channel = #{channel}</if>
|
|
|
|
<if test="channel !=null"> and o.channel = #{channel}</if>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
@ -366,7 +385,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and t.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and t.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and t.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<if test="channel !=null"> and o.channel = #{channel}</if>
|
|
|
|
<if test="channel !=null"> and o.channel = #{channel}</if>
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
|
GROUP BY o.customer_id) p
|
|
|
@ -431,7 +452,9 @@
|
|
|
|
WHERE l.transaction_type = 'Credit'
|
|
|
|
WHERE l.transaction_type = 'Credit'
|
|
|
|
AND o.create_time >= #{begin} AND o.create_time <= #{end}
|
|
|
|
AND o.create_time >= #{begin} AND o.create_time <= #{end}
|
|
|
|
]]>
|
|
|
|
]]>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
@ -478,7 +501,9 @@
|
|
|
|
<if test="trade_type=='Share Code'">
|
|
|
|
<if test="trade_type=='Share Code'">
|
|
|
|
and o.gateway=11
|
|
|
|
and o.gateway=11
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
<if test="bd_group!=null">and l.client_id in
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
(SELECT b.client_id FROM sys_client_bd b
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
|
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
|
|
|
@ -558,7 +583,9 @@
|
|
|
|
<if test="trade_type=='Share Code'">
|
|
|
|
<if test="trade_type=='Share Code'">
|
|
|
|
and o.gateway=11
|
|
|
|
and o.gateway=11
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and ptran.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and ptran.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and ptran.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<![CDATA[
|
|
|
|
<![CDATA[
|
|
|
@ -608,7 +635,9 @@
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
<if test="client_ids==null and client_id != null">
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="org_id!=null">and o.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and o.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and o.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
GROUP BY date , channel ORDER BY date DESC
|
|
|
|
GROUP BY date , channel ORDER BY date DESC
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
|
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
|
|
|
@ -656,7 +685,9 @@
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
and o.client_id=#{client_id}
|
|
|
|
</if>
|
|
|
|
</if>
|
|
|
|
<if test="channel!=null">and o.channel=#{channel}</if>
|
|
|
|
<if test="channel!=null">and o.channel=#{channel}</if>
|
|
|
|
<if test="org_id!=null">and l.org_id=#{org_id}</if>
|
|
|
|
<if test="org_id!=null and org_ids==null">and l.org_id=#{org_id}</if>
|
|
|
|
|
|
|
|
<if test="org_ids!=null">and l.org_id in
|
|
|
|
|
|
|
|
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
<select id="countAmountRangeAnalysis" resultType="java.lang.Integer">
|
|
|
|
<select id="countAmountRangeAnalysis" resultType="java.lang.Integer">
|
|
|
|