wangning 7 years ago
commit 6e990510af

@ -214,7 +214,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) {
throw new InvalidShortIdException();
}
checkClientOrg(manager, client);
if (manager!=null){
checkClientOrg(manager, client);
}
client.put("show_all_permission", true);
int role = manager != null ? manager.getIntValue("role") : 0;
if (manager != null) {

@ -106,7 +106,8 @@ public class ManagerAccountServiceImpl implements ManagerAccountsService {
@Override
public List<JSONObject> listBDUsers(JSONObject loginManager) {
return managerMapper.listByRole(loginManager.getInteger("org_id"), ManagerRole.BD_USER.getMask());
loginManager.put("mask",ManagerRole.BD_USER.getMask());
return managerMapper.listByRole(loginManager);
}
@Override

@ -19,9 +19,12 @@
INNER JOIN sys_client_bd d ON temp.client_id = d.client_id AND d.start_date &lt;= temp.create_time and
d.is_valid = '1'
AND (d.end_date is null or d.end_date > temp.create_time)
<if test="org_id!=null">
<if test="org_id!=null and org_ids==null">
INNER JOIN sys_managers m on m.manager_id = d.bd_id and m.org_id = #{org_id}
</if>
<if test="org_ids!=null">
INNER JOIN sys_managers m on m.manager_id = d.bd_id and m.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="bd_group!=null">and temp.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
@ -142,7 +145,9 @@
ON c.client_id = b.client_id AND b.start_date <= c.approve_time AND (b.end_date > c.approve_time OR b.end_date IS NULL)
WHERE c.approve_time >= #{begin} AND c.approve_time < #{end} AND c.is_valid = 1 AND c.approve_result = 1
]]>
<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>
<if test="source==1">and c.source=1</if>
<if test="source==2">and c.source!=1</if>
group by bd_id

@ -42,7 +42,9 @@
) c ON c.client_id = r.client_id
]]>
<where>
<if test="org_id!=null">m.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">m.org_id=#{org_id}</if>
<if test="org_ids!=null">and m.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
<if test="bd_group!=null">and m.manager_id in (select manager_id from financial_bd_config where (bd_group=#{bd_group} or manager_id=#{bd_group}))</if>
</where>
GROUP BY m.manager_id
@ -78,7 +80,9 @@
GROUP BY c.client_id
) c
<where>
<if test="org_id!=null">c.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">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
@ -171,9 +175,11 @@
]]>
</if>
and c.approve_result=1 and c.is_valid=1
<if test="org_id!=null">
<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>
</mapper>

@ -220,7 +220,9 @@
<if test="customer_id!=null">
and o.customer_id=#{customer_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>
</where>
GROUP BY o.customer_id ORDER BY points desc
</select>
@ -248,7 +250,9 @@
<if test="customer_id!=null">
and o.customer_id=#{customer_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>
</where>
</select>
</mapper>

@ -52,7 +52,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="analysisTotalCount" resultType="java.lang.Double">
@ -72,7 +74,10 @@
<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="analysisRefundAmount" resultType="java.lang.Double">
@ -156,7 +161,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.order_id
]]>
@ -199,7 +206,9 @@
<if test="client_id!=null">AND l.client_id = #{client_id}</if>
<if test="begin!=null">and o.create_time &gt;= #{begin}</if>
<if test="end!=null">and o.create_time &lt;= #{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
</select>
<select id="tradeAnalysisInHours" resultType="com.alibaba.fastjson.JSONObject">
@ -226,7 +235,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>
<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
@ -260,7 +271,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>
<![CDATA[
GROUP BY date(o.create_time)
ORDER BY date(o.create_time)
@ -285,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[
@ -304,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
]]>
@ -327,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
@ -366,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
@ -431,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
@ -478,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
@ -558,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[
@ -608,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">
@ -656,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">

@ -50,9 +50,11 @@
<if test="client_moniker!=null">
and c.client_moniker = #{client_moniker}
</if>
<if test="org_id!=null">
<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>

@ -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">

@ -78,7 +78,9 @@
and c.remark like #{name_pattern}
</if>
</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>
and c.is_valid=1
</where>
</select>

@ -41,9 +41,11 @@
<if test="client_type!=null">
and d.client_type=#{client_type}
</if>
<if test="org_id!=null">
<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>
</mapper>

@ -117,7 +117,9 @@
and c.remark like #{name_pattern}
</if>
</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>
<if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if>
<if test="is_valid">and c.is_valid=1</if>
</where>

@ -149,7 +149,7 @@
and c.remark like #{name_pattern}
</if>
</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>
<if test="referrer_id!=null">and c.referrer_id=#{referrer_id}</if>
@ -191,7 +191,9 @@
and c.remark like #{name_pattern}
</if>
</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>
and c.is_valid=1
</where>
GROUP BY c.contact_email

@ -8,7 +8,9 @@
WHERE role & #{mask} >0 and m.is_valid=1
AND o.type = 0
]]>
<if test="org_id!=null">and m.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">and m.org_id=#{org_id}</if>
<if test="org_ids!=null">and org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</select>
<select id="listAvailable" resultType="com.alibaba.fastjson.JSONObject">
SELECT manager_id,
@ -26,7 +28,9 @@
) o
ON m.wx_openid = o.wechat_openid
<where>
<if test="org_id!=null">m.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">m.org_id=#{org_id}</if>
<if test="org_ids!=null">m.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
and m.is_valid=1
</where>
</select>
@ -42,7 +46,9 @@
SELECT m.* FROM sys_managers m
WHERE role & #{mask} >0 and m.is_valid=1
]]>
<if test="org_id!=null">and m.org_id=#{org_id}</if>
<if test="org_id!=null and org_ids==null">and m.org_id=#{org_id}</if>
<if test="org_ids!=null">and m.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if>
</select>
<select id="listRoyalPayUsers" resultType="com.alibaba.fastjson.JSONObject">
SELECT m.*

@ -64,9 +64,6 @@
<if test="name!=null">
and org.name=#{name}
</if>
<if test="parent_org_id!=null">
and org.parent_org_id=#{parent_org_id}
</if>
<if test="org_id!=null">
and (org.org_id=#{org_id} or org.parent_org_id=#{org_id})
</if>

Loading…
Cancel
Save