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:
+9
-2
@@ -12,21 +12,23 @@
|
||||
<result property="auditTime" column="audit_time" />
|
||||
<result property="auditType" column="audit_type" />
|
||||
<result property="auditResult" column="audit_result" />
|
||||
<result property="isDeleted" column="is_deleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFields">
|
||||
select id, meeting_id, auditor, opinion, current_stage, create_time, audit_time, audit_type, audit_result
|
||||
select id, meeting_id, auditor, opinion, current_stage, create_time, audit_time, audit_type, audit_result, is_deleted
|
||||
from biz_meeting_audit_log
|
||||
</sql>
|
||||
|
||||
<select id="selectByPrimaryKey" resultMap="BizMeetingAuditLogResult" parameterType="Long">
|
||||
<include refid="selectFields"/>
|
||||
where id = #{id}
|
||||
where id = #{id} and is_deleted = 0
|
||||
</select>
|
||||
|
||||
<select id="selectList" resultMap="BizMeetingAuditLogResult" parameterType="BizMeetingAuditLog">
|
||||
<include refid="selectFields"/>
|
||||
<where>
|
||||
is_deleted = 0
|
||||
<if test="meetingId != null">and meeting_id = #{meetingId}</if>
|
||||
<if test="currentStage != null and currentStage != ''">and current_stage = #{currentStage}</if>
|
||||
<if test="auditor != null and auditor != ''">and auditor = #{auditor}</if>
|
||||
@@ -83,4 +85,9 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 软删除: admin 删除会议时级联置 is_deleted=1 (audit_log 历史保留为后续审计; 但不再随会议显示) -->
|
||||
<update id="softDeleteByMeetingId" parameterType="Long">
|
||||
update biz_meeting_audit_log set is_deleted = 1 where meeting_id = #{meetingId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user