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:
@@ -56,10 +56,13 @@ public class BizProject extends BaseEntity {
|
|||||||
private String sponsorOrgName;
|
private String sponsorOrgName;
|
||||||
/** 支持单位筛选 (sys_user.user_id 列表, IN 查询, 多选 select 透传) */
|
/** 支持单位筛选 (sys_user.user_id 列表, IN 查询, 多选 select 透传) */
|
||||||
private List<Long> sponsorAdminUserIds;
|
private List<Long> sponsorAdminUserIds;
|
||||||
/** 服务机构名称 (查询条件, 仅匹配 org_type='executor' + org_name LIKE) */
|
/** 服务机构名称 (旧 LIKE 查询条件, 已废弃, 新查询走 execAdminUserIds 精确 IN, 保留字段以兼容老 API 调用) */
|
||||||
|
@Deprecated
|
||||||
private String execOrgName;
|
private String execOrgName;
|
||||||
/** 服务机构名称列表, 多个用英文逗号连接 (GROUP_CONCAT 派生, 不入库, 仅展示) */
|
/** 服务机构名称列表, 多个用英文逗号连接 (GROUP_CONCAT 派生, 不入库, 仅展示) */
|
||||||
private String execOrgNames;
|
private String execOrgNames;
|
||||||
|
/** 服务机构筛选 (biz_project_assign.exec_user_id 列表, IN 查询, 多选 select 透传) */
|
||||||
|
private List<Long> execAdminUserIds;
|
||||||
/** project_form */
|
/** project_form */
|
||||||
@Excel(name = "project_form")
|
@Excel(name = "project_form")
|
||||||
private String projectForm;
|
private String projectForm;
|
||||||
@@ -172,6 +175,8 @@ public class BizProject extends BaseEntity {
|
|||||||
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; }
|
||||||
public void setExecOrgNames(String execOrgNames) { this.execOrgNames = execOrgNames; }
|
public void setExecOrgNames(String execOrgNames) { this.execOrgNames = execOrgNames; }
|
||||||
|
public List<Long> getExecAdminUserIds() { return execAdminUserIds; }
|
||||||
|
public void setExecAdminUserIds(List<Long> execAdminUserIds) { this.execAdminUserIds = execAdminUserIds; }
|
||||||
public String getProjectForm() { return projectForm; }
|
public String getProjectForm() { return projectForm; }
|
||||||
public void setProjectForm(String projectForm) { this.projectForm = projectForm; }
|
public void setProjectForm(String projectForm) { this.projectForm = projectForm; }
|
||||||
public String getIsFinished() { return isFinished; }
|
public String getIsFinished() { return isFinished; }
|
||||||
|
|||||||
@@ -142,6 +142,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>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -170,16 +170,14 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
<if test="execOrgName != null and execOrgName != ''">
|
<if test="execAdminUserIds != null and execAdminUserIds.size() > 0">
|
||||||
and exists (
|
and exists (
|
||||||
select 1 from biz_project_assign bpa
|
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
|
where bpa.project_id = project_id
|
||||||
and su.role_type = 'executor'
|
and bpa.exec_user_id in
|
||||||
and (o2.org_name like concat('%', #{execOrgName}, '%')
|
<foreach collection="execAdminUserIds" item="id" open="(" separator="," close=")">
|
||||||
or su.user_name like concat('%', #{execOrgName}, '%')
|
#{id}
|
||||||
or su.nick_name like concat('%', #{execOrgName}, '%'))
|
</foreach>
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<if test="isFinished != null and isFinished != ''">and is_finished = #{isFinished}</if>
|
<if test="isFinished != null and isFinished != ''">and is_finished = #{isFinished}</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user