feat: 项目导出 + 会议跳转 + 机构软删除 + 供应商账号同步

- 项目/项目评价/报名专家 3 类导出, 勾选透传 projectIds
- 项目列表 总场次/已执行/未执行 三列点击跳对应会议列表 (executor 复用后端 role 隔离)
- 机构软删除 + 级联软删机构下账号
- 供应商开放接口账号同步

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
郭庆泰
2026-08-30 10:42:35 +08:00
co-authored by Claude
parent 1876601ba7
commit f4d8bc1463
25 changed files with 880 additions and 171 deletions
@@ -17,23 +17,27 @@
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFlag" column="del_flag" />
<result property="isSynced" column="is_synced" />
</resultMap>
<sql id="selectFields">
select org_id, user_id, org_name, org_type, business_nature, address, tax_no, status, create_time,
contact_name, contact_phone, intent_count,
create_by, update_by, update_time
create_by, update_by, update_time, del_flag, is_synced
from biz_org
</sql>
<select id="selectByPrimaryKey" resultMap="BizOrgResult" parameterType="Long">
<include refid="selectFields"/>
where org_id = #{orgId}
and del_flag = '0'
</select>
<select id="selectList" resultMap="BizOrgResult" parameterType="BizOrg">
<include refid="selectFields"/>
<where>
del_flag = '0'
<if test="userId != null"> and user_id = #{userId}</if>
<if test="orgType != null and orgType != ''"> and org_type = #{orgType}</if>
<if test="orgName != null and orgName != ''"> and org_name like concat('%', #{orgName}, '%')</if>
@@ -56,6 +60,7 @@
<if test="contactPhone != null and contactPhone != ''">contact_phone,</if>
<if test="intentCount != null">intent_count,</if>
<if test="status != null and status != ''">status,</if>
<if test="isSynced != null">is_synced,</if>
<if test="createBy != null and createBy != ''">create_by,</if>
create_time,
</trim>
@@ -70,6 +75,7 @@
<if test="contactPhone != null and contactPhone != ''">#{contactPhone},</if>
<if test="intentCount != null">#{intentCount},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="isSynced != null">#{isSynced},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate(),
</trim>
@@ -88,18 +94,29 @@
<if test="contactPhone != null">contact_phone = #{contactPhone},</if>
<if test="intentCount != null">intent_count = #{intentCount},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="isSynced != null">is_synced = #{isSynced},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
update_time = sysdate(),
</trim>
where org_id = #{orgId}
</update>
<delete id="deleteByPrimaryKeys" parameterType="Long">
delete from biz_org where org_id in
<update id="deleteByPrimaryKeys" parameterType="Long">
update biz_org set del_flag = '1' where org_id in
<foreach collection="array" item="orgId" open="(" separator="," close=")">
#{orgId}
</foreach>
</delete>
and del_flag = '0'
</update>
<!-- 级联软删机构下所有账号 (主账号 biz_org.user_id + 子账号 biz_person.user_id), 删除机构时调用 -->
<update id="softDeleteUsersByOrgId" parameterType="Long">
update sys_user set del_flag = '1'
where del_flag = '0' and (
user_id in (select user_id from biz_person where org_id = #{orgId})
or user_id = (select user_id from biz_org where org_id = #{orgId})
)
</update>
<!--
支持方下拉选项: JOIN sys_user 取主账号 user_name (供分配弹窗缓存 biz_project.sponsor_admin_user_name 用)
@@ -116,6 +133,7 @@
from biz_org o
join sys_user u on u.user_id = o.user_id
where o.org_type = 'sponsor'
and o.del_flag = '0'
and u.del_flag = '0'
<if test="orgId != null">and o.org_id = #{orgId}</if>
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
@@ -141,6 +159,7 @@
from biz_org o
join sys_user u on u.user_id = o.user_id
where o.org_type = 'executor'
and o.del_flag = '0'
and u.del_flag = '0'
and u.parent_user_id is null
<if test="orgId != null">and o.org_id = #{orgId}</if>
@@ -162,6 +181,7 @@
from biz_org o
where o.org_type = 'sponsor'
and o.status = '0'
and o.del_flag = '0'
<if test="orgName != null and orgName != ''">and o.org_name like concat('%', #{orgName}, '%')</if>
order by o.org_id desc
limit 20
@@ -180,9 +200,10 @@
case when p.user_id is null then 1 else 0 end as isOwner
from sys_user u
left join biz_person p on p.user_id = u.user_id and p.unit_type = 'sponsor'
left join biz_org own on own.user_id = u.user_id and own.org_type = 'sponsor'
left join biz_org own on own.user_id = u.user_id and own.org_type = 'sponsor' and own.del_flag = '0'
left join biz_org o on o.org_id = COALESCE(own.org_id, p.org_id)
where u.user_id = #{userId}
and o.del_flag = '0'
limit 1
</select>
@@ -194,7 +215,7 @@
-->
<select id="selectOrgIdByUserId" parameterType="Long" resultType="Long">
select coalesce(
(select org_id from biz_org where user_id = #{userId} limit 1),
(select org_id from biz_org where user_id = #{userId} and del_flag = '0' limit 1),
(select org_id from biz_person where user_id = #{userId} limit 1)
)
</select>
@@ -203,7 +224,28 @@
<select id="countByOrgName" parameterType="BizOrg" resultType="int">
select count(*) from biz_org
where org_type = #{orgType}
and del_flag = '0'
and trim(org_name) = #{orgName}
<if test="orgId != null"> and org_id != #{orgId}</if>
</select>
<!-- 供应商同步 org 去重: 按税号精确定位 (org_type='executor' 且税号非空), 取 org_id 最小的一条 -->
<select id="selectByTaxNo" parameterType="BizOrg" resultMap="BizOrgResult">
<include refid="selectFields"/>
where org_type = 'executor'
and del_flag = '0'
and tax_no = #{taxNo}
order by org_id asc
limit 1
</select>
<!-- 供应商同步 org 去重兜底: 税号缺失时按企业名精确定位 (org_type='executor'), 取 org_id 最小的一条 -->
<select id="selectByNameAndType" parameterType="BizOrg" resultMap="BizOrgResult">
<include refid="selectFields"/>
where org_type = 'executor'
and del_flag = '0'
and trim(org_name) = #{orgName}
order by org_id asc
limit 1
</select>
</mapper>