mybatis插入时间类型的数据
程序员文章站
2022-06-12 20:00:06
...
数据库indbTime字段类型:date
实体中类型是:Date
mybatis的插入类型应该设置成:#{indbTime,jdbcType=TIMESTAMP}
mybatis的插入类型应该设置成: #{indbTime,jdbcType=DATE}
insert into CDS_DATA_PLAT_TRANS_INFO
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="indbTime != null">
INDB_TIME,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="indbTime != null">
#{indbTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>