From aa6320e363f530c1b494c86e1e450e881b633625 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Tue, 3 Mar 2026 09:01:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(DmsBillsMaintInstanceMapper):=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5SQL?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将dms_bills_maint_detail表的批量插入改为insert all语法 - 将dms_bills_maint_detail_project表的批量插入改为insert all语法 - 重构SQL语句格式,提升可读性和执行效率 - 保持原有的字段映射和数据绑定逻辑不变 - 统一SQL语句的缩进和换行格式 --- .../dms/DmsBillsMaintInstanceMapper.xml | 68 +++++++++++-------- 1 file changed, 40 insertions(+), 28 deletions(-) diff --git a/aucma-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml b/aucma-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml index 218f360..5b3fca6 100644 --- a/aucma-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml +++ b/aucma-dms/src/main/resources/mapper/dms/DmsBillsMaintInstanceMapper.xml @@ -165,38 +165,50 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - insert into dms_bills_maint_detail( bills_maint_detail_id, maint_instance_id, device_id, station_id, maint_standard_id, operation_description, maint_status, is_flag, remark, create_by, create_time, update_by, update_time) values - - ( HAIWEI.SEQ_DMS_MAINT_DETAIL.NEXTVAL, - #{item.maintInstanceId,jdbcType=NUMERIC}, - #{item.deviceId,jdbcType=NUMERIC}, - #{item.stationId,jdbcType=NUMERIC}, - #{item.maintStandardId,jdbcType=NUMERIC}, - #{item.operationDescription,jdbcType=VARCHAR}, - #{item.maintStatus,jdbcType=NUMERIC}, - #{item.isFlag,jdbcType=NUMERIC}, - #{item.remark,jdbcType=VARCHAR}, - #{item.createBy,jdbcType=NUMERIC}, - #{item.createTime,jdbcType=TIMESTAMP}, - #{item.updateBy,jdbcType=NUMERIC}, - #{item.updateTime,jdbcType=TIMESTAMP}) + insert all + + into dms_bills_maint_detail( + bills_maint_detail_id, maint_instance_id, device_id, station_id, maint_standard_id, + operation_description, maint_status, is_flag, remark, create_by, create_time, update_by, update_time + ) values ( + HAIWEI.SEQ_DMS_MAINT_DETAIL.NEXTVAL, + #{item.maintInstanceId,jdbcType=NUMERIC}, + #{item.deviceId,jdbcType=NUMERIC}, + #{item.stationId,jdbcType=NUMERIC}, + #{item.maintStandardId,jdbcType=NUMERIC}, + #{item.operationDescription,jdbcType=VARCHAR}, + #{item.maintStatus,jdbcType=NUMERIC}, + #{item.isFlag,jdbcType=NUMERIC}, + #{item.remark,jdbcType=VARCHAR}, + #{item.createBy,jdbcType=NUMERIC}, + #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateBy,jdbcType=NUMERIC}, + #{item.updateTime,jdbcType=TIMESTAMP} + ) + select 1 from dual - insert into dms_bills_maint_detail_project( maint_detail_project_id, bills_maint_detail_id, maint_project_id, maint_project_name, maint_project_desc, maint_project_status, remark, create_by, create_time, update_by, update_time) values - - ( HAIWEI.SEQ_DMS_MAINT_DTL_PROJ.NEXTVAL, - #{item.billsMaintDetailId,jdbcType=NUMERIC}, - #{item.maintProjectId,jdbcType=NUMERIC}, - #{item.maintProjectName,jdbcType=VARCHAR}, - #{item.maintProjectDesc,jdbcType=VARCHAR}, - #{item.maintProjectStatus,jdbcType=VARCHAR}, - #{item.remark,jdbcType=VARCHAR}, - #{item.createBy,jdbcType=NUMERIC}, - #{item.createTime,jdbcType=TIMESTAMP}, - #{item.updateBy,jdbcType=NUMERIC}, - #{item.updateTime,jdbcType=TIMESTAMP}) + insert all + + into dms_bills_maint_detail_project( + maint_detail_project_id, bills_maint_detail_id, maint_project_id, maint_project_name, + maint_project_desc, maint_project_status, remark, create_by, create_time, update_by, update_time + ) values ( + HAIWEI.SEQ_DMS_MAINT_DTL_PROJ.NEXTVAL, + #{item.billsMaintDetailId,jdbcType=NUMERIC}, + #{item.maintProjectId,jdbcType=NUMERIC}, + #{item.maintProjectName,jdbcType=VARCHAR}, + #{item.maintProjectDesc,jdbcType=VARCHAR}, + #{item.maintProjectStatus,jdbcType=VARCHAR}, + #{item.remark,jdbcType=VARCHAR}, + #{item.createBy,jdbcType=NUMERIC}, + #{item.createTime,jdbcType=TIMESTAMP}, + #{item.updateBy,jdbcType=NUMERIC}, + #{item.updateTime,jdbcType=TIMESTAMP} + ) + select 1 from dual