refactor(doctor/submissions): 合并到 biz_project_plan + 删除 biz_submission 死代码
- /doctor/submissions 改走 biz_project_plan,与 /manager/plans 字段/组件/状态字典完全对齐 - BizProjectPlan 加 submitter_id (BIGINT) + submitter_name (LEFT JOIN 查询字段) - mapper 改 LEFT JOIN biz_person + sys_user,COALESCE(bp.name, u.user_name) 兜底 - biz_person.user_id 加 UNIQUE 索引 (1:1 LEFT JOIN 无笛卡尔积) - controller 加 doctor 角色自动过滤: list 按 submitter_id, add/edit 强制 submitter_id - 删除 7 个 BizSubmission 死代码 (Controller/Service/Mapper/Domain/XML/Enum) + 1 utils - 路由参数 :subId → :planId (路径名 submission 保留产品文案) - 新增 migration_submission_to_projectPlan_2026_08_18.sql
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
<id property="planId" column="plan_id" />
|
||||
<result property="planName" column="plan_name" />
|
||||
<result property="planDirection" column="plan_direction" />
|
||||
<result property="planDirectionId" column="plan_direction_id" />
|
||||
<result property="planDirectionTitle" column="plan_direction_title" />
|
||||
<result property="planCategory" column="plan_category" />
|
||||
<result property="projectForm" column="project_form" />
|
||||
<result property="designFileUrl" column="design_file_url" />
|
||||
@@ -12,38 +14,59 @@
|
||||
<result property="isSettled" column="is_settled" />
|
||||
<result property="projectNo" column="project_no" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="submitterId" column="submitter_id" />
|
||||
<result property="submitterName" column="submitter_name" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
<sql id="selectFields">
|
||||
select plan_id, plan_name, plan_direction, plan_category, project_form, design_file_url, status, is_settled, project_no, remark, create_by, create_time, update_by, update_time
|
||||
from biz_project_plan
|
||||
select p.plan_id, p.plan_name, p.plan_direction, p.plan_direction_id,
|
||||
s.title as plan_direction_title,
|
||||
p.plan_category, p.project_form, p.design_file_url, p.status, p.is_settled,
|
||||
p.project_no, p.remark, p.submitter_id,
|
||||
COALESCE(bp.name, u.user_name) as submitter_name,
|
||||
p.create_by, p.create_time, p.update_by, p.update_time
|
||||
from biz_project_plan p
|
||||
left join biz_special_plan s on s.id = p.plan_direction_id
|
||||
left join sys_user u on u.user_id = p.submitter_id
|
||||
left join biz_person bp on bp.user_id = u.user_id
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BizProjectPlanResult" parameterType="String">
|
||||
<include refid="selectFields"/>
|
||||
where plan_id = #{planId}
|
||||
where p.plan_id = #{planId}
|
||||
</select>
|
||||
<select id="selectList" resultMap="BizProjectPlanResult" parameterType="BizProjectPlan">
|
||||
<include refid="selectFields"/>
|
||||
<where>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
||||
<if test="planDirectionId != null"> and p.plan_direction_id = #{planDirectionId}</if>
|
||||
<if test="planCategory != null and planCategory != ''"> and p.plan_category = #{planCategory}</if>
|
||||
<if test="submitterId != null"> and p.submitter_id = #{submitterId}</if>
|
||||
<choose>
|
||||
<!-- 选了具体状态: 等值匹配 -->
|
||||
<when test="status != null and status != ''"> and p.status = #{status}</when>
|
||||
<!-- 未选: 不加 status 过滤, 由前端按角色决定默认值 (经理侧默认查 1/2/3, 医生侧默认查全部含 0) -->
|
||||
</choose>
|
||||
<if test="remark != null and remark != ''"> and p.remark = #{remark}</if>
|
||||
</where>
|
||||
order by plan_id desc
|
||||
order by p.plan_id desc
|
||||
</select>
|
||||
<insert id="insert" parameterType="BizProjectPlan">
|
||||
insert into biz_project_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null and planId != ''">plan_id,</if>
|
||||
<if test="planDirectionId != null">plan_direction_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="submitterId != null">submitter_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null and planId != ''">#{planId},</if>
|
||||
<if test="planDirectionId != null">#{planDirectionId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="submitterId != null">#{submitterId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKey" parameterType="BizProjectPlan">
|
||||
@@ -51,6 +74,7 @@
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planName != null and planName != ''">plan_name = #{planName},</if>
|
||||
<if test="planDirection != null and planDirection != ''">plan_direction = #{planDirection},</if>
|
||||
<if test="planDirectionId != null">plan_direction_id = #{planDirectionId},</if>
|
||||
<if test="planCategory != null and planCategory != ''">plan_category = #{planCategory},</if>
|
||||
<if test="projectForm != null and projectForm != ''">project_form = #{projectForm},</if>
|
||||
<if test="designFileUrl != null and designFileUrl != ''">design_file_url = #{designFileUrl},</if>
|
||||
@@ -61,6 +85,7 @@
|
||||
<if test="auditTime != null and auditTime != ''">audit_time = #{auditTime},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="submitterId != null">submitter_id = #{submitterId},</if>
|
||||
</trim>
|
||||
where plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
<?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.BizSubmissionMapper">
|
||||
<resultMap type="BizSubmission" id="BizSubmissionResult">
|
||||
<id property="subId" column="sub_id" />
|
||||
<result property="title" column="title" />
|
||||
<result property="direction" column="direction" />
|
||||
<result property="projectForm" column="project_form" />
|
||||
<result property="projectCategory" column="project_category" />
|
||||
<result property="designFileUrl" column="design_file_url" />
|
||||
<result property="submitterId" column="submitter_id" />
|
||||
<result property="submitterName" column="submitter_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
<sql id="selectFields">
|
||||
select sub_id, title, direction, project_form, project_category, design_file_url, submitter_id, submitter_name, status, remark, create_by, create_time, update_by, update_time
|
||||
from biz_submission
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BizSubmissionResult" parameterType="String">
|
||||
<include refid="selectFields"/>
|
||||
where sub_id = #{subId}
|
||||
</select>
|
||||
<select id="selectList" resultMap="BizSubmissionResult" parameterType="BizSubmission">
|
||||
<include refid="selectFields"/>
|
||||
<where>
|
||||
<if test="submitterId != null and submitterId != ''"> and submitter_id = #{submitterId}</if>
|
||||
<if test="title != null and title != ''"> and title = #{title}</if>
|
||||
<if test="direction != null and direction != ''"> and direction = #{direction}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
||||
</where>
|
||||
order by sub_id desc
|
||||
</select>
|
||||
<insert id="insert" parameterType="BizSubmission">
|
||||
insert into biz_submission
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="subId != null and subId != ''">sub_id,</if>
|
||||
<if test="title != null">title,</if>
|
||||
<if test="direction != null">direction,</if>
|
||||
<if test="projectForm != null">project_form,</if>
|
||||
<if test="projectCategory != null">project_category,</if>
|
||||
<if test="designFileUrl != null">design_file_url,</if>
|
||||
<if test="submitterId != null">submitter_id,</if>
|
||||
<if test="submitterName != null">submitter_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time,
|
||||
<if test="updateBy != null and updateBy != ''">update_by,</if>
|
||||
update_time,
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="subId != null and subId != ''">#{subId},</if>
|
||||
<if test="title != null">#{title},</if>
|
||||
<if test="direction != null">#{direction},</if>
|
||||
<if test="projectForm != null">#{projectForm},</if>
|
||||
<if test="projectCategory != null">#{projectCategory},</if>
|
||||
<if test="designFileUrl != null">#{designFileUrl},</if>
|
||||
<if test="submitterId != null">#{submitterId},</if>
|
||||
<if test="submitterName != null">#{submitterName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate(),
|
||||
<if test="updateBy != null and updateBy != ''">#{updateBy},</if>
|
||||
sysdate(),
|
||||
</trim>
|
||||
</insert>
|
||||
<update id="updateByPrimaryKey" parameterType="BizSubmission">
|
||||
update biz_submission
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="submitterId != null and submitterId != ''">submitter_id = #{submitterId},</if>
|
||||
<if test="submitterName != null and submitterName != ''">submitter_name = #{submitterName},</if>
|
||||
<if test="projectForm != null and projectForm != ''">project_form = #{projectForm},</if>
|
||||
<if test="projectCategory != null and projectCategory != ''">project_category = #{projectCategory},</if>
|
||||
<if test="designFileUrl != null and designFileUrl != ''">design_file_url = #{designFileUrl},</if>
|
||||
<if test="auditOpinion != null and auditOpinion != ''">audit_opinion = #{auditOpinion},</if>
|
||||
<if test="auditBy != null and auditBy != ''">audit_by = #{auditBy},</if>
|
||||
<if test="auditTime != null and auditTime != ''">audit_time = #{auditTime},</if>
|
||||
<if test="title != null">title = #{title},</if>
|
||||
<if test="direction != null">direction = #{direction},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate(),
|
||||
</trim>
|
||||
where sub_id = #{subId}
|
||||
</update>
|
||||
<delete id="deleteByPrimaryKey" parameterType="String">
|
||||
delete from biz_submission where sub_id = #{subId}
|
||||
</delete>
|
||||
<delete id="deleteByPrimaryKeys" parameterType="String">
|
||||
delete from biz_submission where sub_id in
|
||||
<foreach collection="subIds" item="subId" open="(" separator="," close=")">
|
||||
#{subId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user