|
@@ -155,11 +155,12 @@
|
|
(select `name` from `user` where id = creator_id) creatorName
|
|
(select `name` from `user` where id = creator_id) creatorName
|
|
from custom c
|
|
from custom c
|
|
left join sys_dict sd on c.customer_level_id = sd.id
|
|
left join sys_dict sd on c.customer_level_id = sd.id
|
|
- where c.company_id = #{companyId}
|
|
|
|
- and c.is_delete =#{isDelete}
|
|
|
|
- and c.incharger_id in
|
|
|
|
|
|
+ where
|
|
|
|
+ (c.incharger_id in
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
|
|
(SELECT id from `user` WHERE department_id = (SELECT department_id from `user` WHERE id = #{userId}))
|
|
- or c.incharger_id is null
|
|
|
|
|
|
+ or c.incharger_id is null)
|
|
|
|
+ and c.company_id = #{companyId}
|
|
|
|
+ and c.is_delete =#{isDelete}
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
and c.incharger_id =#{inchargerId}
|
|
and c.incharger_id =#{inchargerId}
|
|
</if>
|
|
</if>
|
|
@@ -287,7 +288,7 @@
|
|
from custom
|
|
from custom
|
|
where company_id = #{companyId}
|
|
where company_id = #{companyId}
|
|
and is_delete = #{isDelete}
|
|
and is_delete = #{isDelete}
|
|
- and incharger_id = #{inchargerId}
|
|
|
|
|
|
+ and incharger_id = #{userId}
|
|
or incharger_id is null
|
|
or incharger_id is null
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
<if test="inchargerId != null and inchargerId != '' ">
|
|
and incharger_id =#{inchargerId}
|
|
and incharger_id =#{inchargerId}
|