Files
guoju0808/ry-api/ruoyi-business/src/main/resources/mapper/business/BizProjectMapper.xml
T
郭庆泰andClaude e099211cbd feat(项目管理): 招标字段/负责人/导出/下拉/登录短信 完整链路
后端 (ruoyi-business)
- BizProject: +is_bid_project, +execOrgNames(GROUP_CONCAT派生), +leadUserName
- BizProjectMapper.xml: 上述字段全部贯通 selectFields/insert/update, 列表加 exec_org_names 子查询 + lead_user_name JOIN
- BizSysUserQueryMapper (新): 干净查 sys_user by role_type, 避开 @DataScope 切面污染, 用于项目负责人下拉
- BizOrgMapper.selectExecutorOrgOptions (新): JOIN sys_user (parent_user_id IS NULL) 限定 MAIN 账号, 排除同公司普通员工子账号
- BizOrgController: +/business/org/executorOptions 端点
- BizExecutionIntentController: +exportSignupExperts 端点 (POST /business/executionIntent/export)
- BizSignupExpertExportVo (新): 中文列头 Excel 导出 VO (专家姓名/科室/医院/职称/报名时间/手机号)
- BizProjectAssign / SponsorAssign 重命名 + Service 实现调整
- 删除 sql/ 下所有迁移脚本 (按用户要求不再保存 SQL 文件)

前端 (ry-vue3)
- api/system.js: +listExecutorOrgs 走新接口, listExecutor/listSupporters/listManagers 保持 listByRole 兼容
- views/manager/Projects.vue: 执行方下拉改 label=u.orgName / value=u.userId, 数据源走 listExecutorOrgs
  +execOrgNames 列展示 +导出报名专家 dropdown 项 +is_bid_project 表单字段
- views/manager/ProjectsNew.vue + ManagerProjectDetail.vue: +is_bid_project 表单/展示
- views/auth/Login.vue: +手机号验证码登录 tab (复用 SysSmsService, dev 模式 10 开头手机号固定码 1234)
- 路由/布局/角色视角多页面整理 (SponsorOrgs/People/SponsorPersonNew 等)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-17 00:34:13 +08:00

253 lines
17 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.business.mapper.BizProjectMapper">
<resultMap type="BizProject" id="BizProjectResult">
<id property="projectId" column="project_id" />
<result property="projectNo" column="project_no" />
<result property="projectName" column="project_name" />
<result property="totalSessions" column="total_sessions" />
<result property="doneSessions" column="done_sessions" />
<result property="todoSessions" column="todo_sessions" />
<result property="totalAmount" column="total_amount" />
<result property="availableAmount" column="available_amount" />
<result property="paidLaborAmount" column="paid_labor_amount" />
<result property="paidMeetingAmount" column="paid_meeting_amount" />
<result property="ratingScore" column="rating_score" />
<result property="sponsorAdminUserName" column="sponsor_admin_user_name" />
<result property="sponsorAdminUserId" column="sponsor_admin_user_id" />
<result property="leadUserId" column="lead_user_id" />
<result property="leadUserName" column="lead_user_name" />
<result property="isBidProject" column="is_bid_project" />
<result property="sponsorOrgName" column="sponsor_org_name" />
<result property="execOrgNames" column="exec_org_names" />
<result property="projectForm" column="project_form" />
<result property="isFinished" column="is_finished" />
<result property="isSettled" column="is_settled" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="manageFee" column="manage_fee" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="submitDeadlineDays" column="submit_deadline_days" />
<result property="supportContractUrl" column="support_contract_url" />
<result property="executeContractUrl" column="execute_contract_url" />
<result property="invitationUrl" column="invitation_url" />
<result property="supportLetterUrl" column="support_letter_url" />
<result property="publishUrl" column="publish_url" />
</resultMap>
<sql id="selectFields">
select p.project_id, p.project_no, p.project_name, p.total_sessions, p.done_sessions, p.todo_sessions, p.total_amount, p.available_amount, p.paid_labor_amount, p.paid_meeting_amount, p.rating_score, p.sponsor_admin_user_name, p.project_form, p.is_finished, p.is_settled, p.sponsor_admin_user_id, p.lead_user_id, p.is_bid_project, p.create_by, p.create_time, p.update_by, p.update_time, p.manage_fee, p.start_time, p.end_time, p.submit_deadline_days, p.support_contract_url, p.execute_contract_url, p.invitation_url, p.support_letter_url, p.publish_url,
o.org_name as sponsor_org_name,
lu.user_name as lead_user_name,
(select group_concat(distinct o2.org_name separator ',')
from biz_project_assign bpa
join biz_org o2 on o2.org_id = bpa.execution_unit_id and o2.org_type = 'executor'
where bpa.project_id = p.project_id) as exec_org_names
from biz_project p
left join biz_org o on o.user_id = p.sponsor_admin_user_id and o.org_type = 'sponsor'
left join sys_user lu on lu.user_id = p.lead_user_id
</sql>
<!-- sponsor 端专属查询: 与 selectFields 等价 (sponsor 评分改走 biz_project_rating 子表, 这里只查项目本体) -->
<sql id="selectFieldsForSponsor">
select p.project_id, p.project_no, p.project_name, p.total_sessions, p.done_sessions, p.todo_sessions,
p.total_amount, p.available_amount, p.paid_labor_amount, p.paid_meeting_amount,
p.rating_score, p.sponsor_admin_user_name, p.project_form, p.is_finished, p.is_settled,
p.sponsor_admin_user_id, p.lead_user_id, p.is_bid_project,
p.create_by, p.create_time, p.update_by, p.update_time, p.manage_fee,
p.start_time, p.end_time, p.submit_deadline_days,
p.support_contract_url, p.execute_contract_url, p.invitation_url, p.support_letter_url,
p.publish_url,
o.org_name as sponsor_org_name,
lu.user_name as lead_user_name,
(select group_concat(distinct o2.org_name separator ',')
from biz_project_assign bpa
join biz_org o2 on o2.org_id = bpa.execution_unit_id and o2.org_type = 'executor'
where bpa.project_id = p.project_id) as exec_org_names
from biz_project p
left join biz_org o on o.user_id = p.sponsor_admin_user_id and o.org_type = 'sponsor'
left join sys_user lu on lu.user_id = p.lead_user_id
</sql>
<select id="selectByPrimaryKey" resultMap="BizProjectResult" parameterType="String">
<include refid="selectFields"/>
where project_id = #{projectId}
</select>
<!-- sponsor 专属列表 (走 params.projectIds + LEFT JOIN 当前 login 用户评分) -->
<select id="selectSponsorList" resultMap="BizProjectResult" parameterType="BizProject">
<include refid="selectFieldsForSponsor"/>
<where>
<if test="params.projectIds != null and params.projectIds.size() > 0">
and p.project_id in
<foreach collection="params.projectIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="projectNo != null and projectNo != ''">and p.project_no like concat('%', #{projectNo}, '%')</if>
<if test="projectName != null and projectName != ''">and p.project_name like concat('%', #{projectName}, '%')</if>
<if test="startTime != null and startTime != ''">and p.start_time &gt;= #{startTime}</if>
<if test="endTime != null and endTime != ''">and p.end_time &lt;= #{endTime}</if>
<if test="isFinished != null and isFinished != ''">and p.is_finished = #{isFinished}</if>
</where>
order by p.project_id desc
</select>
<select id="selectList" resultMap="BizProjectResult" parameterType="BizProject">
<include refid="selectFields"/>
<where>
<if test="params.projectIds != null and params.projectIds.size() > 0">
and project_id in
<foreach collection="params.projectIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="params.projectNos != null and params.projectNos.size() > 0">
and project_no in
<foreach collection="params.projectNos" item="no" open="(" separator="," close=")">
#{no}
</foreach>
</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="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>
<if test="execOrgName != null and execOrgName != ''">
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}, '%'))
)
</if>
<if test="isFinished != null and isFinished != ''">and is_finished = #{isFinished}</if>
<if test="isSettled != null and isSettled != ''">and is_settled = #{isSettled}</if>
</where>
order by project_id desc
</select>
<insert id="insert" parameterType="BizProject">
insert into biz_project
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="projectId != null and projectId != ''">project_id,</if>
<if test="projectNo != null and projectNo != ''">project_no,</if>
<if test="projectName != null and projectName != ''">project_name,</if>
<if test="totalSessions != null">total_sessions,</if>
<if test="doneSessions != null">done_sessions,</if>
<if test="todoSessions != null">todo_sessions,</if>
<if test="totalAmount != null">total_amount,</if>
<if test="availableAmount != null">available_amount,</if>
<if test="paidLaborAmount != null">paid_labor_amount,</if>
<if test="paidMeetingAmount != null">paid_meeting_amount,</if>
<if test="ratingScore != null">rating_score,</if>
<if test="sponsorAdminUserName != null and sponsorAdminUserName != ''">sponsor_admin_user_name,</if>
<if test="projectForm != null and projectForm != ''">project_form,</if>
<if test="isFinished != null and isFinished != ''">is_finished,</if>
<if test="isSettled != null and isSettled != ''">is_settled,</if>
<if test="sponsorAdminUserId != null">sponsor_admin_user_id,</if>
<if test="leadUserId != null">lead_user_id,</if>
<if test="isBidProject != null and isBidProject != ''">is_bid_project,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="manageFee != null">manage_fee,</if>
<if test="startTime != null and startTime != ''">start_time,</if>
<if test="endTime != null and endTime != ''">end_time,</if>
<if test="submitDeadlineDays != null">submit_deadline_days,</if>
<if test="supportContractUrl != null and supportContractUrl != ''">support_contract_url,</if>
<if test="executeContractUrl != null and executeContractUrl != ''">execute_contract_url,</if>
<if test="invitationUrl != null and invitationUrl != ''">invitation_url,</if>
<if test="supportLetterUrl != null and supportLetterUrl != ''">support_letter_url,</if>
<if test="publishUrl != null and publishUrl != ''">publish_url,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="projectId != null and projectId != ''">#{projectId},</if>
<if test="projectNo != null and projectNo != ''">#{projectNo},</if>
<if test="projectName != null and projectName != ''">#{projectName},</if>
<if test="totalSessions != null">#{totalSessions},</if>
<if test="doneSessions != null">#{doneSessions},</if>
<if test="todoSessions != null">#{todoSessions},</if>
<if test="totalAmount != null">#{totalAmount},</if>
<if test="availableAmount != null">#{availableAmount},</if>
<if test="paidLaborAmount != null">#{paidLaborAmount},</if>
<if test="paidMeetingAmount != null">#{paidMeetingAmount},</if>
<if test="ratingScore != null">#{ratingScore},</if>
<if test="sponsorAdminUserName != null and sponsorAdminUserName != ''">#{sponsorAdminUserName},</if>
<if test="projectForm != null and projectForm != ''">#{projectForm},</if>
<if test="isFinished != null and isFinished != ''">#{isFinished},</if>
<if test="isSettled != null and isSettled != ''">#{isSettled},</if>
<if test="sponsorAdminUserId != null">#{sponsorAdminUserId},</if>
<if test="leadUserId != null">#{leadUserId},</if>
<if test="isBidProject != null and isBidProject != ''">#{isBidProject},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="manageFee != null">#{manageFee},</if>
<if test="startTime != null and startTime != ''">#{startTime},</if>
<if test="endTime != null and endTime != ''">#{endTime},</if>
<if test="submitDeadlineDays != null">#{submitDeadlineDays},</if>
<if test="supportContractUrl != null and supportContractUrl != ''">#{supportContractUrl},</if>
<if test="executeContractUrl != null and executeContractUrl != ''">#{executeContractUrl},</if>
<if test="invitationUrl != null and invitationUrl != ''">#{invitationUrl},</if>
<if test="supportLetterUrl != null and supportLetterUrl != ''">#{supportLetterUrl},</if>
<if test="publishUrl != null and publishUrl != ''">#{publishUrl},</if>
</trim>
</insert>
<update id="updateByPrimaryKey" parameterType="BizProject">
update biz_project
<trim prefix="SET" suffixOverrides=",">
<if test="manageFee != null and manageFee != ''">manage_fee = #{manageFee},</if>
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
<if test="endTime != null and endTime != ''">end_time = #{endTime},</if>
<if test="submitDeadlineDays != null and submitDeadlineDays != ''">submit_deadline_days = #{submitDeadlineDays},</if>
<if test="supportContractUrl != null and supportContractUrl != ''">support_contract_url = #{supportContractUrl},</if>
<if test="executeContractUrl != null and executeContractUrl != ''">execute_contract_url = #{executeContractUrl},</if>
<if test="invitationUrl != null and invitationUrl != ''">invitation_url = #{invitationUrl},</if>
<if test="supportLetterUrl != null and supportLetterUrl != ''">support_letter_url = #{supportLetterUrl},</if>
<if test="publishUrl != null and publishUrl != ''">publish_url = #{publishUrl},</if>
<if test="projectNo != null and projectNo != ''">project_no = #{projectNo},</if>
<if test="projectName != null and projectName != ''">project_name = #{projectName},</if>
<if test="totalSessions != null">total_sessions = #{totalSessions},</if>
<if test="doneSessions != null">done_sessions = #{doneSessions},</if>
<if test="todoSessions != null">todo_sessions = #{todoSessions},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="availableAmount != null">available_amount = #{availableAmount},</if>
<if test="paidLaborAmount != null">paid_labor_amount = #{paidLaborAmount},</if>
<if test="paidMeetingAmount != null">paid_meeting_amount = #{paidMeetingAmount},</if>
<if test="ratingScore != null">rating_score = #{ratingScore},</if>
<if test="sponsorAdminUserName != null and sponsorAdminUserName != ''">sponsor_admin_user_name = #{sponsorAdminUserName},</if>
<if test="projectForm != null and projectForm != ''">project_form = #{projectForm},</if>
<if test="isFinished != null and isFinished != ''">is_finished = #{isFinished},</if>
<if test="isSettled != null and isSettled != ''">is_settled = #{isSettled},</if>
<if test="sponsorAdminUserId != null">sponsor_admin_user_id = #{sponsorAdminUserId},</if>
<if test="leadUserId != null">lead_user_id = #{leadUserId},</if>
<if test="isBidProject != null and isBidProject != ''">is_bid_project = #{isBidProject},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where project_id = #{projectId}
</update>
<delete id="deleteByPrimaryKey" parameterType="String">
delete from biz_project where project_id = #{projectId}
</delete>
<delete id="deleteByPrimaryKeys" parameterType="String">
delete from biz_project where project_id in
<foreach collection="projectIds" item="projectId" open="(" separator="," close=")">
#{projectId}
</foreach>
</delete>
</mapper>