| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?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.core.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>
- <if test="meterType != null">meter_type,</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>
- <if test="publicServType != null">public_serv_type,</if>
- <if test="billingType != null">billing_type,</if>
- <if test="meteringType != null">metering_type,</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="meterType != null">#{meterType,jdbcType=SMALLINT},</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>
- <if test="publicServType != null">#{publicServType,jdbcType=SMALLINT},</if>
- <if test="billingType != null">#{billingType,jdbcType=SMALLINT},</if>
- <if test="meteringType != null">#{meteringType,jdbcType=SMALLINT},</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>
- <if test="meterType != null">meter_type = excluded.meter_type,</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>
- <if test="publicServType != null">public_serv_type = excluded.public_serv_type,</if>
- <if test="billingType != null">billing_type = excluded.billing_type,</if>
- <if test="meteringType != null">metering_type = excluded.metering_type,</if>
- </trim>
- </insert>
- </mapper>
|