SELECT adp.ID, adp.NAME, adp.text, adp.longitude, adp.latitude, adp.dept_id, adp.user_id, adp.create_by, adp.create_time, adp.update_by, adp.update_time, u.user_id as sub_user_id, u.nick_name as sub_nick_name, u.dept_id as sub_dept_id FROM ard_dispatch_police adp left join ard_dispatch_police_user b on b.dispatch_id = adp.id left join sys_user u on b.user_id = u.user_id insert into ard_dispatch_police id, name, text, longitude, latitude, dept_id, user_id, create_by, create_time, update_by, update_time, #{id}, #{name}, #{text}, #{longitude}, #{latitude}, #{deptId}, #{userId}, #{createBy}, #{createTime}, #{updateBy}, #{updateTime}, update ard_dispatch_police name = #{name}, text = #{text}, longitude = #{longitude}, latitude = #{latitude}, dept_id = #{deptId}, user_id = #{userId}, create_by = #{createBy}, create_time = #{createTime}, update_by = #{updateBy}, update_time = #{updateTime}, where id = #{id} delete from ard_dispatch_police where id = #{id} delete from ard_dispatch_police where id in #{id} delete from ard_dispatch_police_user where dispatch_id in #{dispatchId} delete from ard_dispatch_police_user where dispatch_id = #{dispatchId} insert into ard_dispatch_police_user( dispatch_id, user_id) values ( #{item.dispatchId}, #{item.userId})