eason.qian 7 years ago
parent a206d3a8c5
commit 50321ef85c

@ -214,7 +214,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if (client == null) { if (client == null) {
throw new InvalidShortIdException(); throw new InvalidShortIdException();
} }
if (manager!=null){
checkClientOrg(manager, client); checkClientOrg(manager, client);
}
client.put("show_all_permission", true); client.put("show_all_permission", true);
int role = manager != null ? manager.getIntValue("role") : 0; int role = manager != null ? manager.getIntValue("role") : 0;
if (manager != null) { 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 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' d.is_valid = '1'
AND (d.end_date is null or d.end_date > temp.create_time) 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} INNER JOIN sys_managers m on m.manager_id = d.bd_id and m.org_id = #{org_id}
</if> </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 <if test="bd_group!=null">and temp.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
@ -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) 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 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==1">and c.source=1</if>
<if test="source==2">and c.source!=1</if> <if test="source==2">and c.source!=1</if>
group by bd_id group by bd_id

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

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

@ -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 &gt;= #{begin}</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="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 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)

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

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

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

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

@ -149,7 +149,7 @@
and c.remark like #{name_pattern} and c.remark like #{name_pattern}
</if> </if>
</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 <if test="org_ids!=null">and c.org_id in
<foreach collection="org_ids" item="org_id" open="(" close=")" separator=",">#{org_id}</foreach></if> <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="referrer_id!=null">and c.referrer_id=#{referrer_id}</if>
@ -191,7 +191,9 @@
and c.remark like #{name_pattern} and c.remark like #{name_pattern}
</if> </if>
</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 and c.is_valid=1
</where> </where>
GROUP BY c.contact_email GROUP BY c.contact_email

@ -8,7 +8,9 @@
WHERE role & #{mask} >0 and m.is_valid=1 WHERE role & #{mask} >0 and m.is_valid=1
AND o.type = 0 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>
<select id="listAvailable" resultType="com.alibaba.fastjson.JSONObject"> <select id="listAvailable" resultType="com.alibaba.fastjson.JSONObject">
SELECT manager_id, SELECT manager_id,
@ -26,7 +28,9 @@
) o ) o
ON m.wx_openid = o.wechat_openid ON m.wx_openid = o.wechat_openid
<where> <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 and m.is_valid=1
</where> </where>
</select> </select>
@ -42,7 +46,9 @@
SELECT m.* FROM sys_managers m SELECT m.* FROM sys_managers m
WHERE role & #{mask} >0 and m.is_valid=1 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>
<select id="listRoyalPayUsers" resultType="com.alibaba.fastjson.JSONObject"> <select id="listRoyalPayUsers" resultType="com.alibaba.fastjson.JSONObject">
SELECT m.* SELECT m.*

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

Loading…
Cancel
Save