From f39675fad28f66dd32aee1d3ee805ad99007bce5 Mon Sep 17 00:00:00 2001 From: ludc Date: 星期五, 02 六月 2023 21:13:16 +0800 Subject: [PATCH] 代码整合 --- Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml index 4cbd321..9f357d7 100644 --- a/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml +++ b/Source/UBCS/ubcs-service/ubcs-code/src/main/resources/mapper/CommonsMapper.xml @@ -22,5 +22,33 @@ ${inSql} </select> + <insert id="insertByBaseModel" parameterType="java.util.Map"> + insert into ${tableName} + ( + <foreach collection="columnMap" item="value" index="key" separator=","> + ${key} + </foreach> + ) + <foreach collection="mapList" item="columnMap" separator=" union all "> + select <foreach collection="columnMap" item="value" index="key" separator=","> + #{value} + </foreach> + from dual + </foreach> + </insert> + + <update id="updateBatchByBaseModel" parameterType="java.util.List" > + BEGIN + <foreach collection="mapList" item="columnMap" index="index" separator=";"> + update ${tableName} + <set> + <foreach collection="columnMap" item="value" index="key" separator=","> + ${key} = #{value} + </foreach> + </set> + where oid = #{columnMap.oid} + </foreach>; + END; + </update > </mapper> -- Gitblit v1.9.3