Commit 390132d9 authored by zhh's avatar zhh
Browse files

修复主键重名问题

parent d74b7c2b
...@@ -98,21 +98,18 @@ ...@@ -98,21 +98,18 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberProductCategoryRelation"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberProductCategoryRelation">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_product_category_relation (id, member_id, product_category_id insert into ums_member_product_category_relation (member_id, product_category_id)
) values (#{memberId,jdbcType=BIGINT}, #{productCategoryId,jdbcType=BIGINT})
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{productCategoryId,jdbcType=BIGINT}
)
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberProductCategoryRelation"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberProductCategoryRelation">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_product_category_relation insert into ums_member_product_category_relation
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
...@@ -121,7 +118,6 @@ ...@@ -121,7 +118,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
</if> </if>
......
...@@ -102,23 +102,22 @@ ...@@ -102,23 +102,22 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberReceiveAddress"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberReceiveAddress">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_receive_address (id, member_id, name, insert into ums_member_receive_address (member_id, name, phone_number,
phone_number, address, post_code, address, post_code, default_status
default_status) )
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, values (#{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR}, #{defaultStatus,jdbcType=INTEGER}
#{defaultStatus,jdbcType=INTEGER}) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberReceiveAddress"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberReceiveAddress">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_receive_address insert into ums_member_receive_address
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
...@@ -139,7 +138,6 @@ ...@@ -139,7 +138,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
</if> </if>
......
...@@ -103,23 +103,22 @@ ...@@ -103,23 +103,22 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberRuleSetting"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberRuleSetting">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_rule_setting (id, continue_sign_day, continue_sign_point, insert into ums_member_rule_setting (continue_sign_day, continue_sign_point,
consume_per_point, low_order_amount, max_point_per_order, consume_per_point, low_order_amount, max_point_per_order,
type) type)
values (#{id,jdbcType=BIGINT}, #{continueSignDay,jdbcType=INTEGER}, #{continueSignPoint,jdbcType=INTEGER}, values (#{continueSignDay,jdbcType=INTEGER}, #{continueSignPoint,jdbcType=INTEGER},
#{consumePerPoint,jdbcType=DECIMAL}, #{lowOrderAmount,jdbcType=DECIMAL}, #{maxPointPerOrder,jdbcType=INTEGER}, #{consumePerPoint,jdbcType=DECIMAL}, #{lowOrderAmount,jdbcType=DECIMAL}, #{maxPointPerOrder,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}) #{type,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberRuleSetting"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberRuleSetting">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_rule_setting insert into ums_member_rule_setting
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="continueSignDay != null"> <if test="continueSignDay != null">
continue_sign_day, continue_sign_day,
</if> </if>
...@@ -140,7 +139,6 @@ ...@@ -140,7 +139,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="continueSignDay != null"> <if test="continueSignDay != null">
#{continueSignDay,jdbcType=INTEGER}, #{continueSignDay,jdbcType=INTEGER},
</if> </if>
......
...@@ -113,29 +113,28 @@ ...@@ -113,29 +113,28 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberStatisticsInfo"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberStatisticsInfo">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_statistics_info (id, member_id, consume_amount, insert into ums_member_statistics_info (member_id, consume_amount, order_count,
order_count, coupon_count, comment_count, coupon_count, comment_count, return_order_count,
return_order_count, login_count, attend_count, login_count, attend_count, fans_count,
fans_count, collect_product_count, collect_subject_count, collect_product_count, collect_subject_count,
collect_topic_count, collect_comment_count, collect_topic_count, collect_comment_count,
invite_friend_count, recent_order_time) invite_friend_count, recent_order_time)
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{consumeAmount,jdbcType=DECIMAL}, values (#{memberId,jdbcType=BIGINT}, #{consumeAmount,jdbcType=DECIMAL}, #{orderCount,jdbcType=INTEGER},
#{orderCount,jdbcType=INTEGER}, #{couponCount,jdbcType=INTEGER}, #{commentCount,jdbcType=INTEGER}, #{couponCount,jdbcType=INTEGER}, #{commentCount,jdbcType=INTEGER}, #{returnOrderCount,jdbcType=INTEGER},
#{returnOrderCount,jdbcType=INTEGER}, #{loginCount,jdbcType=INTEGER}, #{attendCount,jdbcType=INTEGER}, #{loginCount,jdbcType=INTEGER}, #{attendCount,jdbcType=INTEGER}, #{fansCount,jdbcType=INTEGER},
#{fansCount,jdbcType=INTEGER}, #{collectProductCount,jdbcType=INTEGER}, #{collectSubjectCount,jdbcType=INTEGER}, #{collectProductCount,jdbcType=INTEGER}, #{collectSubjectCount,jdbcType=INTEGER},
#{collectTopicCount,jdbcType=INTEGER}, #{collectCommentCount,jdbcType=INTEGER}, #{collectTopicCount,jdbcType=INTEGER}, #{collectCommentCount,jdbcType=INTEGER},
#{inviteFriendCount,jdbcType=INTEGER}, #{recentOrderTime,jdbcType=TIMESTAMP}) #{inviteFriendCount,jdbcType=INTEGER}, #{recentOrderTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberStatisticsInfo"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberStatisticsInfo">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_statistics_info insert into ums_member_statistics_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null"> <if test="memberId != null">
member_id, member_id,
</if> </if>
...@@ -183,7 +182,6 @@ ...@@ -183,7 +182,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null"> <if test="memberId != null">
#{memberId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
</if> </if>
......
...@@ -99,21 +99,20 @@ ...@@ -99,21 +99,20 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberTag"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberTag">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_tag (id, name, finish_order_count, insert into ums_member_tag (name, finish_order_count, finish_order_amount
finish_order_amount) )
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{finishOrderCount,jdbcType=INTEGER}, values (#{name,jdbcType=VARCHAR}, #{finishOrderCount,jdbcType=INTEGER}, #{finishOrderAmount,jdbcType=DECIMAL}
#{finishOrderAmount,jdbcType=DECIMAL}) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberTag"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberTag">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_tag insert into ums_member_tag
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
...@@ -125,7 +124,6 @@ ...@@ -125,7 +124,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
......
...@@ -100,21 +100,20 @@ ...@@ -100,21 +100,20 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.macro.mall.model.UmsMemberTask"> <insert id="insert" parameterType="com.macro.mall.model.UmsMemberTask">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_task (id, name, growth, insert into ums_member_task (name, growth, intergration,
intergration, type) type)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{growth,jdbcType=INTEGER}, values (#{name,jdbcType=VARCHAR}, #{growth,jdbcType=INTEGER}, #{intergration,jdbcType=INTEGER},
#{intergration,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}) #{type,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberTask"> <insert id="insertSelective" parameterType="com.macro.mall.model.UmsMemberTask">
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into ums_member_task insert into ums_member_task
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
...@@ -129,7 +128,6 @@ ...@@ -129,7 +128,6 @@
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
targetProject="mall-mbg\src\main\java"/> targetProject="mall-mbg\src\main\java"/>
<table tableName="%"> <table tableName="%">
<generatedKey column="id" sqlStatement="MySql"/> <generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table> </table>
</context> </context>
</generatorConfiguration> </generatorConfiguration>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment