|
|
@@ -1443,14 +1443,18 @@
|
|
|
FROM sys_user_jzg_info u
|
|
|
LEFT JOIN sys_dept d on u.dept_id = d.id
|
|
|
LEFT JOIN sys_area a ON d.city = a.area_code
|
|
|
- where d.province = #{province}
|
|
|
- AND u.user_id in (select distinct suji.user_id
|
|
|
- from sys_user_jzg_info suji
|
|
|
- left join sys_role_data_scope_link srdsl on suji.dept_id = srdsl.dept_id
|
|
|
- left join sys_user_role sur on sur.role_id = srdsl.role_id
|
|
|
- where sur.user_id = #{userId}
|
|
|
- and suji.system_code = #{systemCode}
|
|
|
- UNION ALL select #{userId} as user_id )
|
|
|
+ <where>
|
|
|
+ <if test="province != null and province != ''">
|
|
|
+ and d.province = #{province}
|
|
|
+ </if>
|
|
|
+ AND u.user_id in (select distinct suji.user_id
|
|
|
+ from sys_user_jzg_info suji
|
|
|
+ left join sys_role_data_scope_link srdsl on suji.dept_id = srdsl.dept_id
|
|
|
+ left join sys_user_role sur on sur.role_id = srdsl.role_id
|
|
|
+ where sur.user_id = #{userId}
|
|
|
+ and suji.system_code = #{systemCode}
|
|
|
+ UNION ALL select #{userId} as user_id )
|
|
|
+ </where>
|
|
|
GROUP BY a.area_code, a.area_cname
|
|
|
ORDER BY total_salesman_count DESC
|
|
|
</select>
|