<insert id="insertDataErrorExtension" parameterType="com.xx.campaign.dataobject.DataErrorExtensionDO" useGeneratedKeys="true" keyProperty="id">
insert into data_error_extension
(group_id, page_id, module_id, tag_id, schedule_id, error_type, error_code, error_level, error_message, error_details, status, version, attr)
values 
(#{groupId}, #{pageId}, #{moduleId}, #{tagId}, #{scheduleId}, #{errorType},#{errorCode}, #{errorLevel}, #{errorMessage}, #{errorDetails}, #{status}, #{version}, #{attr})
</insert>

在insert语句中 添加useGeneratedKeys="true" keyProperty="id"