feat(projects): 服务机构筛选改 IN 精确查询

- BizProject: 加 List<Long> execAdminUserIds (多选 select IN 透传),
  execOrgName 标 @Deprecated (兼容老 API)
- BizProjectMapper: selectList 替换 3 列 OR LIKE (org_name/user_name/nick_name)
  → EXISTS + bpa.exec_user_id IN (精确, 跟 sponsorAdminUserIds 对称)
- BizOrgMapper: selectExecutorOrgOptions 加 LIMIT 5 (跟 sponsor 对齐)
This commit is contained in:
郭庆泰
2026-08-20 22:30:40 +08:00
parent 9d2ed60a32
commit 8d50450606
3 changed files with 12 additions and 8 deletions
@@ -142,6 +142,7 @@
<if test="userId != null">and o.user_id = #{userId}</if>
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
order by o.org_id desc
LIMIT 5
</select>
<!--
@@ -170,16 +170,14 @@
#{id}
</foreach>
</if>
<if test="execOrgName != null and execOrgName != ''">
<if test="execAdminUserIds != null and execAdminUserIds.size() > 0">
and exists (
select 1 from biz_project_assign bpa
join biz_org o2 on o2.org_id = bpa.execution_unit_id and o2.org_type = 'executor'
join sys_user su on su.user_id = bpa.exec_user_id
where bpa.project_id = project_id
and su.role_type = 'executor'
and (o2.org_name like concat('%', #{execOrgName}, '%')
or su.user_name like concat('%', #{execOrgName}, '%')
or su.nick_name like concat('%', #{execOrgName}, '%'))
and bpa.exec_user_id in
<foreach collection="execAdminUserIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
)
</if>
<if test="isFinished != null and isFinished != ''">and is_finished = #{isFinished}</if>