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>
|
||||
|
||||
Reference in New Issue
Block a user