t_notice.notice_id,
t_notice.notice_type_id,
t_notice.title,
t_notice.all_visible_flag,
t_notice.scheduled_publish_flag,
t_notice.publish_time,
t_notice.content_text,
t_notice.content_html,
t_notice.attachment,
t_notice.page_view_count,
t_notice.user_view_count,
t_notice.source,
t_notice.author,
t_notice.document_number,
t_notice.deleted_flag,
t_notice.create_user_id,
t_notice.update_time,
t_notice.create_time
insert into t_notice_visible_range
(notice_id, data_type, data_id)
values
( #{noticeId} , #{item.dataType}, #{item.dataId} )
delete
from t_notice_visible_range
where notice_id = #{noticeId}
update t_notice
set deleted_flag = true
where notice_id = #{noticeId}
insert into t_notice_view_record (notice_id, employee_id, first_ip, first_user_agent, page_view_count)
values (#{noticeId}, #{employeeId}, #{ip}, #{userAgent}, #{pageViewCount})
update t_notice_view_record
set page_view_count = page_view_count + 1,
last_ip = #{ip},
last_user_agent = #{userAgent}
where notice_id = #{noticeId}
and employee_id = #{employeeId}
update t_notice
set page_view_count = page_view_count + #{pageViewCountIncrement},
user_view_count = user_view_count + #{userViewCountIncrement}
where notice_id = #{noticeId}