eason.qian 7 years ago
parent 8eca73d1a0
commit e064d30a64

@ -298,7 +298,9 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</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 id="countCustomers" resultType="java.lang.Integer">
<![CDATA[
@ -317,7 +319,9 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</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[
GROUP BY o.customer_id) p
]]>
@ -340,7 +344,9 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</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>
<![CDATA[
GROUP BY o.customer_id) p
@ -379,7 +385,9 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</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>
<![CDATA[
GROUP BY o.customer_id) p
@ -444,7 +452,9 @@
WHERE l.transaction_type = 'Credit'
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
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -491,7 +501,9 @@
<if test="trade_type=='Share Code'">
and o.gateway=11
</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
(SELECT b.client_id FROM sys_client_bd b
INNER JOIN financial_bd_config c ON c.manager_id=b.bd_id
@ -571,7 +583,9 @@
<if test="trade_type=='Share Code'">
and o.gateway=11
</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 id="listExchangeRates" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
@ -621,7 +635,9 @@
<if test="client_ids==null and client_id != null">
and o.client_id=#{client_id}
</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
</select>
<select id="getOrgTransactionAnalysis" resultType="com.alibaba.fastjson.JSONObject">
@ -669,7 +685,9 @@
and o.client_id=#{client_id}
</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 id="countAmountRangeAnalysis" resultType="java.lang.Integer">

@ -178,6 +178,8 @@
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">#{gateway}</foreach>
</if>
<if test="org_id!=null and org_ids==null">and p.org_id=#{org_id}</if>
<if test="org_ids!=null">and p.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="date!=null">and date(o.create_time)=date(#{date})</if>
@ -291,7 +293,9 @@
<if test="trade_type!=null">and o.gateway in
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">#{gateway}</foreach>
</if>
<if test="org_id!=null">and p.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">and p.org_id=#{org_id}</if>
<if test="org_ids!=null">and p.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="date!=null">and date(o.create_time)=date(#{date})</if>
@ -468,7 +472,9 @@
</if>
<if test="from!=null">and ocreate_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="org_id!=null">and c.org_id=#{org_id}</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>
</where>
</select>
@ -524,7 +530,9 @@
<if test="trade_type!=null">and o.gateway in
<foreach collection="trade_type" item="gateway" open="(" close=")" separator=",">#{gateway}</foreach>
</if>
<if test="org_id!=null">and p.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">and p.org_id=#{org_id}</if>
<if test="org_ids!=null">and p.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="from!=null">and o.create_time &gt;= #{from}</if>
<if test="to!=null">and o.create_time &lt; #{to}</if>
<if test="date!=null">and date(o.create_time)=date(#{date})</if>

@ -272,7 +272,9 @@
</if>
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="org_id!=null">and c.org_id = #{org_id}</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>
GROUP BY DATE(t.transaction_time)
order by t.clearing_time desc
</select>
@ -289,7 +291,9 @@
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null">and c.org_id = #{org_id}</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>
GROUP BY c.client_id
order by total desc
</select>
@ -306,7 +310,9 @@
<if test="from!=null">and t.transaction_time &gt;= #{from}</if>
<if test="to!=null">and t.transaction_time &lt; #{to}</if>
<if test="client_moniker!=null">and c.client_moniker=#{client_moniker}</if>
<if test="org_id!=null">and c.org_id = #{org_id}</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>
</select>
<select id="getAusTracData" resultType="com.alibaba.fastjson.JSONObject">

Loading…
Cancel
Save