select fh.id, bs.manage_tags as manageTags, '修蹄' as event_type, bs.sheepfold_id as sheepfold, sf.sheepfold_name as sheepfoldName, bs.variety_id as varietyId, bv.variety as varietyName, fh.comment, fh.technician, fh.create_by, fh.create_time, fh.event_date as eventDate from sc_fix_hoof fh left join bas_sheep bs on fh.sheep_id = bs.id left join da_sheepfold sf on bs.sheepfold_id = sf.id left join bas_sheep_variety bv on bs.variety_id = bv.id insert into sc_fix_hoof sheep_id, sheepfold, variety_id, comment, technician, event_date, create_by, create_time, user_id, dept_id, #{sheepId}, #{sheepfold}, #{varietyId}, #{comment}, #{technician}, #{eventDate}, #{createBy}, #{createTime}, #{userId}, #{deptId}, update sc_fix_hoof sheep_id = #{sheepId}, sheepfold = #{sheepfold}, variety_id=#{varietyId}, comment = #{comment}, technician = #{technician}, create_by = #{createBy}, create_time = #{createTime}, where id = #{id} delete from sc_fix_hoof where id = #{id} delete from sc_fix_hoof where id in #{id}