feat: 支持单位筛选改 IN 查询 (后端)

BizProject.sponsorOrgName 字段历史上同时承担「查询参数 + 列表展示」两个职责, 现拆开:
- 保留: sponsorOrgName (String), 列表展示, JOIN biz_org 派生
- 新增: sponsorAdminUserIds (List<Long>), 查询参数, IN 多个 user_id

对齐方案 1 设计 (与 DB 列 sponsor_admin_user_id 命名一致, 与 assignForm.sponsorAdminUserId 单数版对齐)。

改动:
- BizProject.java: 加 import java.util.List; 加 List<Long> sponsorAdminUserIds + getter/setter; 改 sponsorOrgName 注释 (不再当查询参数, 只展示)
- BizProjectMapper.xml L167-173: 替换 sponsorOrgName LIKE 块为 sponsorAdminUserIds IN 块 (foreach 展开)
- BizOrgMapper.xml L120: selectSponsorOrgOptions 末尾加 LIMIT 5 (前端多选下拉最多 5 条)

未做:
- 前端 manager/Projects.vue L6 el-input 还在 (下一 commit 切到 el-select multiple)
- 旧的 sponsorOrgName LIKE 块已不存在, 但前端 q.sponsorOrgName 字段也还没改 (prototype 兼容期)
This commit is contained in:
郭庆泰
2026-08-20 22:19:52 +08:00
parent 44a020da68
commit 1b35161722
3 changed files with 12 additions and 8 deletions
@@ -164,13 +164,11 @@
<if test="projectNo != null and projectNo != ''">and project_no like concat('%', #{projectNo}, '%')</if>
<if test="projectName != null and projectName != ''">and project_name like concat('%', #{projectName}, '%')</if>
<if test="projectForm != null and projectForm != ''">and project_form = #{projectForm}</if>
<if test="sponsorOrgName != null and sponsorOrgName != ''">
and exists (
select 1 from biz_org o
where o.user_id = sponsor_admin_user_id
and o.org_type = 'sponsor'
and o.org_name like concat('%', #{sponsorOrgName}, '%')
)
<if test="sponsorAdminUserIds != null and sponsorAdminUserIds.size() > 0">
and sponsor_admin_user_id in
<foreach collection="sponsorAdminUserIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="execOrgName != null and execOrgName != ''">
and exists (