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

修复主键重名问题

parent d74b7c2b
......@@ -98,21 +98,18 @@
</if>
</delete>
<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()
</selectKey>
insert into ums_member_product_category_relation (id, member_id, product_category_id
)
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{productCategoryId,jdbcType=BIGINT}
)
insert into ums_member_product_category_relation (member_id, product_category_id)
values (#{memberId,jdbcType=BIGINT}, #{productCategoryId,jdbcType=BIGINT})
</insert>
<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()
</selectKey>
insert into ums_member_product_category_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null">
member_id,
</if>
......@@ -121,7 +118,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......
......@@ -102,23 +102,22 @@
</if>
</delete>
<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()
</selectKey>
insert into ums_member_receive_address (id, member_id, name,
phone_number, address, post_code,
default_status)
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
#{phoneNumber,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR},
#{defaultStatus,jdbcType=INTEGER})
insert into ums_member_receive_address (member_id, name, phone_number,
address, post_code, default_status
)
values (#{memberId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{phoneNumber,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{postCode,jdbcType=VARCHAR}, #{defaultStatus,jdbcType=INTEGER}
)
</insert>
<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()
</selectKey>
insert into ums_member_receive_address
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null">
member_id,
</if>
......@@ -139,7 +138,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......
......@@ -103,23 +103,22 @@
</if>
</delete>
<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()
</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,
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},
#{type,jdbcType=INTEGER})
</insert>
<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()
</selectKey>
insert into ums_member_rule_setting
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="continueSignDay != null">
continue_sign_day,
</if>
......@@ -140,7 +139,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="continueSignDay != null">
#{continueSignDay,jdbcType=INTEGER},
</if>
......
......@@ -113,29 +113,28 @@
</if>
</delete>
<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()
</selectKey>
insert into ums_member_statistics_info (id, member_id, consume_amount,
order_count, coupon_count, comment_count,
return_order_count, login_count, attend_count,
fans_count, collect_product_count, collect_subject_count,
insert into ums_member_statistics_info (member_id, consume_amount, order_count,
coupon_count, comment_count, return_order_count,
login_count, attend_count, fans_count,
collect_product_count, collect_subject_count,
collect_topic_count, collect_comment_count,
invite_friend_count, recent_order_time)
values (#{id,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT}, #{consumeAmount,jdbcType=DECIMAL},
#{orderCount,jdbcType=INTEGER}, #{couponCount,jdbcType=INTEGER}, #{commentCount,jdbcType=INTEGER},
#{returnOrderCount,jdbcType=INTEGER}, #{loginCount,jdbcType=INTEGER}, #{attendCount,jdbcType=INTEGER},
#{fansCount,jdbcType=INTEGER}, #{collectProductCount,jdbcType=INTEGER}, #{collectSubjectCount,jdbcType=INTEGER},
values (#{memberId,jdbcType=BIGINT}, #{consumeAmount,jdbcType=DECIMAL}, #{orderCount,jdbcType=INTEGER},
#{couponCount,jdbcType=INTEGER}, #{commentCount,jdbcType=INTEGER}, #{returnOrderCount,jdbcType=INTEGER},
#{loginCount,jdbcType=INTEGER}, #{attendCount,jdbcType=INTEGER}, #{fansCount,jdbcType=INTEGER},
#{collectProductCount,jdbcType=INTEGER}, #{collectSubjectCount,jdbcType=INTEGER},
#{collectTopicCount,jdbcType=INTEGER}, #{collectCommentCount,jdbcType=INTEGER},
#{inviteFriendCount,jdbcType=INTEGER}, #{recentOrderTime,jdbcType=TIMESTAMP})
</insert>
<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()
</selectKey>
insert into ums_member_statistics_info
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="memberId != null">
member_id,
</if>
......@@ -183,7 +182,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="memberId != null">
#{memberId,jdbcType=BIGINT},
</if>
......
......@@ -99,21 +99,20 @@
</if>
</delete>
<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()
</selectKey>
insert into ums_member_tag (id, name, finish_order_count,
finish_order_amount)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{finishOrderCount,jdbcType=INTEGER},
#{finishOrderAmount,jdbcType=DECIMAL})
insert into ums_member_tag (name, finish_order_count, finish_order_amount
)
values (#{name,jdbcType=VARCHAR}, #{finishOrderCount,jdbcType=INTEGER}, #{finishOrderAmount,jdbcType=DECIMAL}
)
</insert>
<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()
</selectKey>
insert into ums_member_tag
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="name != null">
name,
</if>
......@@ -125,7 +124,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
......
......@@ -100,21 +100,20 @@
</if>
</delete>
<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()
</selectKey>
insert into ums_member_task (id, name, growth,
intergration, type)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{growth,jdbcType=INTEGER},
#{intergration,jdbcType=INTEGER}, #{type,jdbcType=INTEGER})
insert into ums_member_task (name, growth, intergration,
type)
values (#{name,jdbcType=VARCHAR}, #{growth,jdbcType=INTEGER}, #{intergration,jdbcType=INTEGER},
#{type,jdbcType=INTEGER})
</insert>
<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()
</selectKey>
insert into ums_member_task
<trim prefix="(" suffix=")" suffixOverrides=",">
id,
<if test="name != null">
name,
</if>
......@@ -129,7 +128,6 @@
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
#{id,jdbcType=BIGINT},
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
......
......@@ -34,7 +34,7 @@
targetProject="mall-mbg\src\main\java"/>
<table tableName="%">
<generatedKey column="id" sqlStatement="MySql"/>
<generatedKey column="id" sqlStatement="MySql" identity="true"/>
</table>
</context>
</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