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;
|
||||
/** 支持单位筛选 (sys_user.user_id 列表, IN 查询, 多选 select 透传) */
|
||||
private List<Long> sponsorAdminUserIds;
|
||||
/** 服务机构名称 (查询条件, 仅匹配 org_type='executor' + org_name LIKE) */
|
||||
/** 服务机构名称 (旧 LIKE 查询条件, 已废弃, 新查询走 execAdminUserIds 精确 IN, 保留字段以兼容老 API 调用) */
|
||||
@Deprecated
|
||||
private String execOrgName;
|
||||
/** 服务机构名称列表, 多个用英文逗号连接 (GROUP_CONCAT 派生, 不入库, 仅展示) */
|
||||
private String execOrgNames;
|
||||
/** 服务机构筛选 (biz_project_assign.exec_user_id 列表, IN 查询, 多选 select 透传) */
|
||||
private List<Long> execAdminUserIds;
|
||||
/** project_form */
|
||||
@Excel(name = "project_form")
|
||||
private String projectForm;
|
||||
@@ -172,6 +175,8 @@ public class BizProject extends BaseEntity {
|
||||
public void setExecOrgName(String execOrgName) { this.execOrgName = execOrgName; }
|
||||
public String getExecOrgNames() { return 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 void setProjectForm(String projectForm) { this.projectForm = projectForm; }
|
||||
public String getIsFinished() { return isFinished; }
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user