修复主键重名问题
This commit is contained in:
@@ -131,27 +131,24 @@
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.macro.mall.model.CmsTopic">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into cms_topic (id, category_id, name,
|
||||
create_time, start_time, end_time,
|
||||
attend_count, attention_count, read_count,
|
||||
award_name, attend_type, content
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{categoryId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{createTime,jdbcType=TIMESTAMP}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
|
||||
#{attendCount,jdbcType=INTEGER}, #{attentionCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER},
|
||||
#{awardName,jdbcType=VARCHAR}, #{attendType,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
insert into cms_topic (category_id, name, create_time,
|
||||
start_time, end_time, attend_count,
|
||||
attention_count, read_count, award_name,
|
||||
attend_type, content)
|
||||
values (#{categoryId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||
#{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{attendCount,jdbcType=INTEGER},
|
||||
#{attentionCount,jdbcType=INTEGER}, #{readCount,jdbcType=INTEGER}, #{awardName,jdbcType=VARCHAR},
|
||||
#{attendType,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.macro.mall.model.CmsTopic">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into cms_topic
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
<if test="categoryId != null">
|
||||
category_id,
|
||||
</if>
|
||||
@@ -187,7 +184,6 @@
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{id,jdbcType=BIGINT},
|
||||
<if test="categoryId != null">
|
||||
#{categoryId,jdbcType=BIGINT},
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user