select c.id,
               c.well_id,
               c.well_number,
               c.oil_production,
               c.well_block,
               c.production_date,
               c.displacement_mode,
               c.surrounding_environment,
               c.well_type,
               c.installed_load,
               c.metering_station,
               c.transfer_station,
               c.dehydration_station,
               c.run_status,
               c.longitude,
               c.latitude,
               c.altitude,
               c.dept_id,
               c.user_id,
               c.create_by,
               c.create_time,
               c.update_by,
               c.update_time,
               c.camera_id
        from ard_alarmpoints_well c
                 left join sys_dept d on d.dept_id = c.dept_id
                 left join sys_user u on u.user_id = c.user_id
    
    
    
    
    
    
        insert into ard_alarmpoints_well
        
            id,
            well_id,
            well_number,
            oil_production,
            well_block,
            production_date,
            displacement_mode,
            surrounding_environment,
            well_type,
            installed_load,
            metering_station,
            transfer_station,
            dehydration_station,
            run_status,
            longitude,
            latitude,
            altitude,
            dept_id,
            user_id,
            create_by,
            create_time,
            update_by,
            update_time,
            camera_id,
        
        
            #{id},
            #{wellId},
            #{wellNumber},
            #{oilProduction},
            #{wellBlock},
            #{productionDate},
            #{displacementMode},
            #{surroundingEnvironment},
            #{wellType},
            #{installedLoad},
            #{meteringStation},
            #{transferStation},
            #{dehydrationStation},
            #{runStatus},
            #{longitude},
            #{latitude},
            #{altitude},
            #{deptId},
            #{userId},
            #{createBy},
            #{createTime},
            #{updateBy},
            #{updateTime},
            #{cameraId},
        
    
    
        update ard_alarmpoints_well
        
            well_id = #{wellId},
            well_number = #{wellNumber},
            oil_production = #{oilProduction},
            well_block = #{wellBlock},
            production_date = #{productionDate},
            displacement_mode = #{displacementMode},
            surrounding_environment = #{surroundingEnvironment},
            well_type = #{wellType},
            installed_load = #{installedLoad},
            metering_station = #{meteringStation},
            transfer_station = #{transferStation},
            dehydration_station = #{dehydrationStation},
            run_status = #{runStatus},
            longitude = #{longitude},
            latitude = #{latitude},
            altitude = #{altitude},
            dept_id = #{deptId},
            user_id = #{userId},
            create_by = #{createBy},
            create_time = #{createTime},
            update_by = #{updateBy},
            update_time = #{updateTime},
            camera_id = #{cameraId},
        
        where id = #{id}
    
    
        delete
        from ard_alarmpoints_well
        where id = #{id}
    
    
        delete from ard_alarmpoints_well where id in
        
            #{id}