feat(biz_project+meeting): 项目+会议软删除级联, admin/manager 双角色可删
biz_project* 5 表级联 (project/plan/assign/sponsor_assign/rating) + 会议链 biz_meeting* 6 表级联 admin-only → admin/manager 可删 DB: - 5 ALTER TABLE 加 is_deleted TINYINT DEFAULT 0 NOT NULL (biz_project/plan/assign/sponsor_assign/rating) - biz_meeting* 6 表已有 is_deleted 列 (上轮已 ALTER) Domain (10 文件): - 5 个 biz_project* 加 isDeleted 字段 - 6 个 biz_meeting* 加 isDeleted 字段 - (audit_log 列名特殊: 使用 deleted 字段存操作类型, 不冲突) Mapper 接口 (10 文件): - 5 个 project mapper 加 softDeleteByProjectId / softDeleteByProjectNo - 5 个 meeting mapper 加 softDeleteByMeetingId - BizMeetingMapper 加 selectIdListByProjectId (级联调用) Mapper XML (10 文件): - 所有 SELECT 加 is_deleted=0 过滤 (含 JOIN 子查询) - 加 softDeleteByXxx UPDATE (10 处) - BizMeetingMapper.xml 的 plan LEFT JOIN 加 proj.is_deleted=0 防悬挂 Service (3 文件): - IBizProjectService.softDeleteCascade/Batch (含会议链调用) - IBizMeetingService.softDeleteCascade/Batch - BizProjectServiceImpl / BizMeetingServiceImpl @Transactional(rollbackFor=Exception.class) Controller (2 文件): - BizProjectController.DELETE 改 admin+manager 可删 - BizMeetingController.DELETE 改 admin+manager 可删 (放宽权限)
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="isDeleted" column="is_deleted" />
|
||||
</resultMap>
|
||||
<sql id="selectFields">
|
||||
select p.plan_id, p.plan_name, p.plan_direction, p.plan_direction_id,
|
||||
@@ -32,20 +33,21 @@
|
||||
p.project_no, p.remark, p.audit_opinion, p.audit_by, p.audit_time, p.submitter_id,
|
||||
COALESCE(bp.name, u.user_name) as submitter_name,
|
||||
proj.project_name as project_name,
|
||||
p.create_by, p.create_time, p.update_by, p.update_time
|
||||
p.create_by, p.create_time, p.update_by, p.update_time, p.is_deleted
|
||||
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
|
||||
left join biz_project proj on proj.project_no = p.project_no
|
||||
left join biz_project proj on proj.project_no = p.project_no and proj.is_deleted = 0
|
||||
</sql>
|
||||
<select id="selectByPrimaryKey" resultMap="BizProjectPlanResult" parameterType="String">
|
||||
<include refid="selectFields"/>
|
||||
where p.plan_id = #{planId}
|
||||
where p.plan_id = #{planId} and p.is_deleted = 0
|
||||
</select>
|
||||
<select id="selectList" resultMap="BizProjectPlanResult" parameterType="BizProjectPlan">
|
||||
<include refid="selectFields"/>
|
||||
<where>
|
||||
p.is_deleted = 0
|
||||
<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>
|
||||
@@ -118,4 +120,8 @@
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
<!-- 软删除: 项目级联删除时按 projectNo 置 is_deleted=1 (biz_project_plan 用 project_no 关联项目) -->
|
||||
<update id="softDeleteByProjectNo" parameterType="String">
|
||||
update biz_project_plan set is_deleted = 1 where project_no = #{projectNo}
|
||||
</update>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user