|
|
@@ -0,0 +1,72 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.shkpr.service.customgateway.zydma.mapper.primary.CustomerInfoMapper">
|
|
|
+ <insert id="upsert">
|
|
|
+ <trim prefix="insert into customer_info (" suffix=")" suffixOverrides=",">
|
|
|
+ code,
|
|
|
+ <if test="name != null and name != ''">name,</if>
|
|
|
+ <if test="address != null and address != ''">address,</if>
|
|
|
+ <if test="caliber != null">caliber,</if>
|
|
|
+ <if test="natureName != null and natureName != ''">nature_name,</if>
|
|
|
+ <if test="pressName != null and pressName != ''">press_name,</if>
|
|
|
+ <if test="usedTypeName != null and usedTypeName != ''">used_type_name,</if>
|
|
|
+ <if test="stampInfo != null and stampInfo != ''">stamp_info,</if>
|
|
|
+ created_at,
|
|
|
+ updated_at,
|
|
|
+ <if test="mobile != null and mobile != ''">mobile,</if>
|
|
|
+ <if test="statusCode != null">status_code,</if>
|
|
|
+ <if test="statusName != null and statusName != ''">status_name,</if>
|
|
|
+ <if test="readCycleName != null and readCycleName != ''">read_cycle_name,</if>
|
|
|
+ <if test="readerName != null and readerName != ''">reader_name,</if>
|
|
|
+ <if test="readbookName != null and readbookName != ''">readbook_name,</if>
|
|
|
+ <if test="readCycle != null">read_cycle,</if>
|
|
|
+ <if test="readbookType != null">readbook_type,</if>
|
|
|
+ <if test="gis != null and gis != ''">gis,</if>
|
|
|
+ <if test="geomGis != null">geom_gis,</if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
+ #{code,jdbcType=VARCHAR},
|
|
|
+ <if test="name != null and name != ''">#{name,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="address != null and address != ''">#{address,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="caliber != null">#{caliber,jdbcType=SMALLINT},</if>
|
|
|
+ <if test="natureName != null and natureName != ''">#{natureName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="pressName != null and pressName != ''">#{pressName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="usedTypeName != null and usedTypeName != ''">#{usedTypeName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="stampInfo != null and stampInfo != ''">#{stampInfo,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="createdAt != null">#{createdAt,jdbcType=TIMESTAMP},</if>
|
|
|
+ timezone('utc', localtimestamp(0) at time zone current_setting('timezone')),
|
|
|
+ timezone('utc', localtimestamp(0) at time zone current_setting('timezone')),
|
|
|
+ <if test="mobile != null and mobile != ''">#{mobile,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="statusCode != null">#{statusCode,jdbcType=SMALLINT},</if>
|
|
|
+ <if test="statusName != null and statusName != ''">#{statusName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="readCycleName != null and readCycleName != ''">#{readCycleName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="readerName != null and readerName != ''">#{readerName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="readbookName != null and readbookName != ''">#{readbookName,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="readCycle != null">#{readCycle,jdbcType=SMALLINT},</if>
|
|
|
+ <if test="readbookType != null">#{readbookType,jdbcType=SMALLINT},</if>
|
|
|
+ <if test="gis != null and gis != ''">#{gis,jdbcType=VARCHAR},</if>
|
|
|
+ <if test="geomGis != null">#{geomGis,jdbcType=OTHER},</if>
|
|
|
+ </trim>
|
|
|
+ on conflict (code) do update set
|
|
|
+ <trim suffixOverrides=",">
|
|
|
+ <if test="name != null and name != ''">name = excluded.name,</if>
|
|
|
+ <if test="address != null and address != ''">address = excluded.address,</if>
|
|
|
+ <if test="caliber != null">caliber = excluded.caliber,</if>
|
|
|
+ <if test="natureName != null and natureName != ''">nature_name = excluded.nature_name,</if>
|
|
|
+ <if test="pressName != null and pressName != ''">press_name = excluded.press_name,</if>
|
|
|
+ <if test="usedTypeName != null and usedTypeName != ''">used_type_name = excluded.used_type_name,</if>
|
|
|
+ <if test="stampInfo != null and stampInfo != ''">stamp_info = excluded.stamp_info,</if>
|
|
|
+ updated_at = excluded.updated_at,
|
|
|
+ <if test="mobile != null and mobile != ''">mobile = excluded.mobile,</if>
|
|
|
+ <if test="statusCode != null">status_code = excluded.status_code,</if>
|
|
|
+ <if test="statusName != null and statusName != ''">status_name = excluded.status_name,</if>
|
|
|
+ <if test="readCycleName != null and readCycleName != ''">read_cycle_name = excluded.read_cycle_name,</if>
|
|
|
+ <if test="readerName != null and readerName != ''">reader_name = excluded.reader_name,</if>
|
|
|
+ <if test="readbookName != null and readbookName != ''">readbook_name = excluded.readbook_name,</if>
|
|
|
+ <if test="readCycle != null">read_cycle = excluded.read_cycle,</if>
|
|
|
+ <if test="readbookType != null">readbook_type = excluded.readbook_type,</if>
|
|
|
+ <if test="gis != null and gis != ''">gis = excluded.gis,</if>
|
|
|
+ <if test="geomGis != null">geom_gis = excluded.geom_gis,</if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+</mapper>
|