增加List类型转换成Varchar工具类(有bug)
This commit is contained in:
@@ -5,7 +5,7 @@ spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://114.55.250.24:3306/dating?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: root
|
||||
password: rJ6DBTYrFCpjdsxy2sBV
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
|
||||
# MyBatis 配置
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?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.bao.dating.mapper.PostMapper">
|
||||
|
||||
<mapper namespace="com.bao.dating.mapper.PostMapper">
|
||||
<!-- 动态添加 -->
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO post
|
||||
@@ -16,7 +16,10 @@
|
||||
</if>
|
||||
is_public, like_count, favorite_count, created_at, updated_at)
|
||||
VALUES
|
||||
(#{userId}, #{content}, #{mediaOssKeys}, #{tags}, #{location}, #{isPublic}, 0, 0, #{created_at}, #{updated_at})
|
||||
(#{userId}, #{content},
|
||||
#{mediaOssKeys, typeHandler=com.bao.dating.handler.ListToVarcharTypeHandler},
|
||||
#{tags, typeHandler=com.bao.dating.handler.ListToVarcharTypeHandler},
|
||||
#{location}, #{isPublic}, 0, 0, #{createdAt}, #{updatedAt})
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user