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:
@@ -2,6 +2,7 @@ package com.ruoyi.business.domain;
|
|||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.ruoyi.common.annotation.Excel;
|
import com.ruoyi.common.annotation.Excel;
|
||||||
import com.ruoyi.common.core.domain.BaseEntity;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
@@ -51,8 +52,10 @@ public class BizProject extends BaseEntity {
|
|||||||
/** 支持方负责人用户名(冗余) — 原 org_name */
|
/** 支持方负责人用户名(冗余) — 原 org_name */
|
||||||
@Excel(name = "sponsor_admin_user_name")
|
@Excel(name = "sponsor_admin_user_name")
|
||||||
private String sponsorAdminUserName;
|
private String sponsorAdminUserName;
|
||||||
/** 支持单位名称 (查询参数 + 列表展示列, JOIN biz_org 取 org_name, org_type='sponsor') */
|
/** 支持单位名称 (列表展示列, JOIN biz_org 取 org_name, org_type='sponsor') */
|
||||||
private String sponsorOrgName;
|
private String sponsorOrgName;
|
||||||
|
/** 支持单位筛选 (sys_user.user_id 列表, IN 查询, 多选 select 透传) */
|
||||||
|
private List<Long> sponsorAdminUserIds;
|
||||||
/** 服务机构名称 (查询条件, 仅匹配 org_type='executor' + org_name LIKE) */
|
/** 服务机构名称 (查询条件, 仅匹配 org_type='executor' + org_name LIKE) */
|
||||||
private String execOrgName;
|
private String execOrgName;
|
||||||
/** 服务机构名称列表, 多个用英文逗号连接 (GROUP_CONCAT 派生, 不入库, 仅展示) */
|
/** 服务机构名称列表, 多个用英文逗号连接 (GROUP_CONCAT 派生, 不入库, 仅展示) */
|
||||||
@@ -163,6 +166,8 @@ public class BizProject extends BaseEntity {
|
|||||||
public void setSponsorAdminUserName(String sponsorAdminUserName) { this.sponsorAdminUserName = sponsorAdminUserName; }
|
public void setSponsorAdminUserName(String sponsorAdminUserName) { this.sponsorAdminUserName = sponsorAdminUserName; }
|
||||||
public String getSponsorOrgName() { return sponsorOrgName; }
|
public String getSponsorOrgName() { return sponsorOrgName; }
|
||||||
public void setSponsorOrgName(String sponsorOrgName) { this.sponsorOrgName = sponsorOrgName; }
|
public void setSponsorOrgName(String sponsorOrgName) { this.sponsorOrgName = sponsorOrgName; }
|
||||||
|
public List<Long> getSponsorAdminUserIds() { return sponsorAdminUserIds; }
|
||||||
|
public void setSponsorAdminUserIds(List<Long> sponsorAdminUserIds) { this.sponsorAdminUserIds = sponsorAdminUserIds; }
|
||||||
public String getExecOrgName() { return execOrgName; }
|
public String getExecOrgName() { return execOrgName; }
|
||||||
public void setExecOrgName(String execOrgName) { this.execOrgName = execOrgName; }
|
public void setExecOrgName(String execOrgName) { this.execOrgName = execOrgName; }
|
||||||
public String getExecOrgNames() { return execOrgNames; }
|
public String getExecOrgNames() { return execOrgNames; }
|
||||||
|
|||||||
@@ -118,6 +118,7 @@
|
|||||||
<if test="userId != null">and o.user_id = #{userId}</if>
|
<if test="userId != null">and o.user_id = #{userId}</if>
|
||||||
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
|
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
|
||||||
order by o.org_id desc
|
order by o.org_id desc
|
||||||
|
LIMIT 5
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -164,13 +164,11 @@
|
|||||||
<if test="projectNo != null and projectNo != ''">and project_no like concat('%', #{projectNo}, '%')</if>
|
<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="projectName != null and projectName != ''">and project_name like concat('%', #{projectName}, '%')</if>
|
||||||
<if test="projectForm != null and projectForm != ''">and project_form = #{projectForm}</if>
|
<if test="projectForm != null and projectForm != ''">and project_form = #{projectForm}</if>
|
||||||
<if test="sponsorOrgName != null and sponsorOrgName != ''">
|
<if test="sponsorAdminUserIds != null and sponsorAdminUserIds.size() > 0">
|
||||||
and exists (
|
and sponsor_admin_user_id in
|
||||||
select 1 from biz_org o
|
<foreach collection="sponsorAdminUserIds" item="id" open="(" separator="," close=")">
|
||||||
where o.user_id = sponsor_admin_user_id
|
#{id}
|
||||||
and o.org_type = 'sponsor'
|
</foreach>
|
||||||
and o.org_name like concat('%', #{sponsorOrgName}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
</if>
|
||||||
<if test="execOrgName != null and execOrgName != ''">
|
<if test="execOrgName != null and execOrgName != ''">
|
||||||
and exists (
|
and exists (
|
||||||
|
|||||||
Reference in New Issue
Block a user