From cf0f1f174cd26eb0bba66d5684ccd3b591337e46 Mon Sep 17 00:00:00 2001 From: wuww <252740454@qq.com> Date: 星期三, 16 四月 2025 14:22:31 +0800 Subject: [PATCH] 修改更新和插入方法 --- src/main/resources/mapper/SimuMapper.xml | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mapper/SimuMapper.xml b/src/main/resources/mapper/SimuMapper.xml index f640144..bdf2487 100644 --- a/src/main/resources/mapper/SimuMapper.xml +++ b/src/main/resources/mapper/SimuMapper.xml @@ -17,7 +17,14 @@ now(), #{item.createUser}, #{item.bak}, - ${item.geom} + <choose> + <when test="item.geom != null and item.geom != ''"> + ST_GeomFromText('${item.geom}') + </when> + <otherwise> + null + </otherwise> + </choose> ) </foreach> </insert> @@ -35,7 +42,14 @@ update_time=now(), update_user=#{item.updateUser}, bak=#{item.bak}, - geom=${item.geom} + <choose> + <when test="item.geom != null and item.geom != ''"> + geom = ST_GeomFromText('${item.geom}') + </when> + <otherwise> + geom = null + </otherwise> + </choose> where id = #{item.id} </foreach> </update> -- Gitblit v1.9.3