select scc.id, scc.sheep_id, bs.manage_tags as manage_tags, sf.sheepfold_name as sheepfold_name, '改备注' as event_type, scc.new_comment, scc.old_comment, scc.create_by, scc.create_time from sc_change_comment scc left join bas_sheep bs on scc.sheep_id = bs.id left join da_sheepfold sf on bs.sheepfold_id = sf.id insert into sc_change_comment sheep_id, new_comment, old_comment, create_by, create_time, #{sheepId}, #{newComment}, #{oldComment}, #{createBy}, #{createTime}, update sc_change_comment sheep_id = #{sheepId}, new_comment = #{newComment}, old_comment = #{oldComment}, create_by = #{createBy}, create_time = #{createTime}, where id = #{id} delete from sc_change_comment where id = #{id} delete from sc_change_comment where id in #{id}