主要改动: - SQL: biz_support_unit → biz_org, 加 org_type, 加 business_nature; 删 biz_execution_unit, biz_service_org - SQL: biz_project.support_unit_id/name + service_org_id/name → org_id/name/type - SQL: biz_meeting.support_unit_name → org_name - SQL: biz_person.work_unit → org_id (FK) - 后端: 新 BizOrg entity/mapper/service/controller - 后端: BizProject/BizMeeting 字段重命名 - 后端: 删 12 个 BizSupportUnit/BizExecutionUnit/BizServiceOrg Java 文件 - 后端: BizPersonImportVO.workUnit → orgName (导入时查 biz_org 取 org_id) - 后端: BizAuthController.registerExecutor 完整实现 (原 registerSupplier stub) - 前端: 新 admin/Orgs.vue + manager/Orgs.vue (原 SupportUnits) - 前端: RegisterExecutor.vue (原 RegisterSupplier, 单页 2 步) - 前端: sponsor/executor/manager 多个文件 workUnit → orgId/orgName 重命名 - 前端: 统一 supplier → executor, 业务命名 sponsor(赞助方) / executor(执行方=供应商) - 前端: 全工程 execution → executor (company type / role / person unit_type)
256 lines
18 KiB
XML
256 lines
18 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="ratingQ1" column="rating_q1" />
|
|
<result property="ratingQ2" column="rating_q2" />
|
|
<result property="ratingQ3" column="rating_q3" />
|
|
<result property="ratingQ4" column="rating_q4" />
|
|
<result property="orgName" column="org_name" />
|
|
<result property="orgType" column="org_type" />
|
|
<result property="projectForm" column="project_form" />
|
|
<result property="isFinished" column="is_finished" />
|
|
<result property="isSettled" column="is_settled" />
|
|
<result property="orgId" column="org_id" />
|
|
<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" />
|
|
<result property="noticeUrl" column="notice_url" />
|
|
<result property="scheduleUrl" column="schedule_url" />
|
|
<result property="isPublished" column="is_published" />
|
|
<result property="publishTime" column="publish_time" />
|
|
<result property="announcementType" column="announcement_type" />
|
|
</resultMap>
|
|
<sql id="selectFields">
|
|
select project_id, project_no, project_name, total_sessions, done_sessions, todo_sessions, total_amount, available_amount, paid_labor_amount, paid_meeting_amount, rating_score, rating_q1, rating_q2, rating_q3, rating_q4, org_name, org_type, project_form, is_finished, is_settled, org_id, create_by, create_time, update_by, update_time, manage_fee, start_time, end_time, submit_deadline_days, support_contract_url, execute_contract_url, invitation_url, support_letter_url, publish_url, notice_url, schedule_url, is_published, publish_time, announcement_type
|
|
from biz_project
|
|
</sql>
|
|
|
|
<!-- sponsor 端专属查询: 字段 = selectFields + LEFT JOIN 当前 login 用户对该项目的评分 -->
|
|
<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.org_name, p.org_type, p.project_form, p.is_finished, p.is_settled,
|
|
p.org_id,
|
|
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, p.notice_url, p.schedule_url, p.is_published, p.publish_time, p.announcement_type,
|
|
bps.sponsor_rating as sponsor_rating,
|
|
bps.sponsor_q1 as sponsor_q1,
|
|
bps.sponsor_q2 as sponsor_q2,
|
|
bps.sponsor_q3 as sponsor_q3,
|
|
bps.sponsor_q4 as sponsor_q4,
|
|
bps.sponsor_remark as sponsor_remark
|
|
from biz_project p
|
|
left join biz_project_sponsor bps on bps.project_id = p.project_id and bps.user_id = #{params.loginUid}
|
|
</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 >= #{startTime}</if>
|
|
<if test="endTime != null and endTime != ''">and p.end_time <= #{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="orgName != null and orgName != ''">and org_name like concat('%', #{orgName}, '%')</if>
|
|
<if test="orgType != null and orgType != ''">and org_type = #{orgType}</if>
|
|
<if test="isFinished != null and isFinished != ''">and is_finished = #{isFinished}</if>
|
|
<if test="isSettled != null and isSettled != ''">and is_settled = #{isSettled}</if>
|
|
<if test="isPublished != null and isPublished != ''">and is_published = #{isPublished}</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="ratingQ1 != null">rating_q1,</if>
|
|
<if test="ratingQ2 != null">rating_q2,</if>
|
|
<if test="ratingQ3 != null">rating_q3,</if>
|
|
<if test="ratingQ4 != null">rating_q4,</if>
|
|
<if test="orgName != null and orgName != ''">org_name,</if>
|
|
<if test="orgType != null and orgType != ''">org_type,</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="orgId != null">org_id,</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>
|
|
<if test="noticeUrl != null and noticeUrl != ''">notice_url,</if>
|
|
<if test="scheduleUrl != null and scheduleUrl != ''">schedule_url,</if>
|
|
<if test="isPublished != null and isPublished != ''">is_published,</if>
|
|
<if test="publishTime != null">publish_time,</if>
|
|
<if test="announcementType != null and announcementType != ''">announcement_type,</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="ratingQ1 != null">#{ratingQ1},</if>
|
|
<if test="ratingQ2 != null">#{ratingQ2},</if>
|
|
<if test="ratingQ3 != null">#{ratingQ3},</if>
|
|
<if test="ratingQ4 != null">#{ratingQ4},</if>
|
|
<if test="orgName != null and orgName != ''">#{orgName},</if>
|
|
<if test="orgType != null and orgType != ''">#{orgType},</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="orgId != null">#{orgId},</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>
|
|
<if test="noticeUrl != null and noticeUrl != ''">#{noticeUrl},</if>
|
|
<if test="scheduleUrl != null and scheduleUrl != ''">#{scheduleUrl},</if>
|
|
<if test="isPublished != null and isPublished != ''">#{isPublished},</if>
|
|
<if test="publishTime != null">#{publishTime},</if>
|
|
<if test="announcementType != null and announcementType != ''">#{announcementType},</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="noticeUrl != null and noticeUrl != ''">notice_url = #{noticeUrl},</if>
|
|
<if test="scheduleUrl != null and scheduleUrl != ''">schedule_url = #{scheduleUrl},</if>
|
|
<if test="isPublished != null and isPublished != ''">is_published = #{isPublished},</if>
|
|
<if test="publishTime != null">publish_time = #{publishTime},</if>
|
|
<if test="announcementType != null and announcementType != ''">announcement_type = #{announcementType},</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="ratingQ1 != null">rating_q1 = #{ratingQ1},</if>
|
|
<if test="ratingQ2 != null">rating_q2 = #{ratingQ2},</if>
|
|
<if test="ratingQ3 != null">rating_q3 = #{ratingQ3},</if>
|
|
<if test="ratingQ4 != null">rating_q4 = #{ratingQ4},</if>
|
|
<if test="orgName != null and orgName != ''">org_name = #{orgName},</if>
|
|
<if test="orgType != null and orgType != ''">org_type = #{orgType},</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="orgId != null">org_id = #{orgId},</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> |