select * from (select a.id, a.magid, a.topic, a.title, a.deptid, a.authorName, a.authorPhone, a.ord, a.images, a.content, a.remark, a.is_del, a.create_by, a.create_time, a.update_by, a.update_time, b.name, c.dept_name deptName, d.dict_label topicName FROM base_mag_detail a, base_mag b, sys_dept c, sys_dict_data d WHERE a.magid = b.id AND a.deptid = c.dept_id AND a.topic = d.dict_value AND d.dict_type = 'base_mag_topic') base_mag_detail insert into base_mag_detail magid, topic, title, deptid, authorName, authorPhone, ord, images, content, remark, is_del, create_by, create_time, update_by, update_time, #{magid}, #{topic}, #{title}, #{deptid}, #{authorName}, #{authorPhone}, #{ord}, #{images}, #{content}, #{remark}, #{isDel}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, update base_mag_detail magid = #{magid}, topic = #{topic}, title = #{title}, deptid = #{deptid}, authorName = #{authorName}, authorPhone = #{authorPhone}, ord = #{ord}, images = #{images}, content = #{content}, remark = #{remark}, is_del = #{isDel}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, where id = #{id} delete from base_mag_detail where id = #{id} delete from base_mag_detail where id in #{id}