eason.qian 7 years ago
parent a206d3a8c5
commit 50321ef85c

@ -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) {

@ -19,9 +19,12 @@
INNER JOIN sys_client_bd d ON temp.client_id = d.client_id AND d.start_date <= 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)

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

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