insert into contact_log (org_id, contacted_on, method, summary, author)
values (#{orgId}, cast(#{contactedOn} as date), #{method}, #{summary}, #{author})
update contact_log set
contacted_on = cast(#{contactedOn} as date),
method = #{method},
summary = #{summary}
where id = #{id} and org_id = #{orgId}
delete from contact_log where id = #{id} and org_id = #{orgId}
insert into org_report (org_id, file_name, content_type, byte_size, content, uploaded_by)
values (#{orgId}, #{fileName}, #{contentType}, #{byteSize}, #{content}, #{uploadedBy})
update org_report set
file_name = #{fileName},
content_type = #{contentType},
byte_size = #{byteSize},
content = #{content},
uploaded_by = #{uploadedBy},
uploaded_at = now()
where id = #{id} and org_id = #{orgId}
delete from org_report where id = #{id} and org_id = #{orgId}