Commit c5dd98cf authored by muhong's avatar muhong

修改 小程序藏品接口

parent cabdb8f4
......@@ -3,6 +3,7 @@
<mapper namespace="com.wwdz.ch.db.mapper.FavoritesItemsRelationMapper">
<resultMap id="BaseResultMap" type="com.wwdz.ch.db.domain.FavoritesItemsRelation">
<result column="favorites_id" jdbcType="BIGINT" property="favoritesId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="item_id" jdbcType="BIGINT" property="itemId" />
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
</resultMap>
......@@ -65,7 +66,7 @@
</where>
</sql>
<sql id="Base_Column_List">
favorites_id, item_id, add_time
favorites_id, user_id, item_id, add_time
</sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelationExample" resultMap="BaseResultMap">
select
......@@ -94,13 +95,13 @@
distinct
</if>
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
favorites_id, item_id, add_time
favorites_id, user_id, item_id, add_time
</otherwise>
</choose>
from favorites_items_relation
......@@ -118,16 +119,16 @@
</if>
</delete>
<insert id="insert" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
insert into favorites_items_relation (favorites_id, item_id, add_time
)
values (#{favoritesId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT}, #{addTime,jdbcType=TIMESTAMP}
)
insert into favorites_items_relation (favorites_id, user_id, item_id,
add_time)
values (#{favoritesId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{itemId,jdbcType=BIGINT},
#{addTime,jdbcType=TIMESTAMP})
</insert>
<insert id="batchInsert" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
insert into favorites_coins_relation (favorites_id, item_id, add_time)
values
insert into favorites_items_relation (favorites_id, user_id, item_id,
add_time)
<foreach collection="list" item="item" separator=",">
(#{item.favoritesId,jdbcType=BIGINT}, #{item.itemId,jdbcType=BIGINT}, #{item.addTime,jdbcType=TIMESTAMP})
(#{item.favoritesId,jdbcType=BIGINT}, #{item.userId,jdbcType=BIGINT}, #{item.itemId,jdbcType=BIGINT}, #{item.addTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.FavoritesItemsRelation">
......@@ -136,6 +137,9 @@
<if test="favoritesId != null">
favorites_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="itemId != null">
item_id,
</if>
......@@ -147,6 +151,9 @@
<if test="favoritesId != null">
#{favoritesId,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="itemId != null">
#{itemId,jdbcType=BIGINT},
</if>
......@@ -167,6 +174,9 @@
<if test="record.favoritesId != null">
favorites_id = #{record.favoritesId,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.itemId != null">
item_id = #{record.itemId,jdbcType=BIGINT},
</if>
......@@ -181,6 +191,7 @@
<update id="updateByExample" parameterType="map">
update favorites_items_relation
set favorites_id = #{record.favoritesId,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
item_id = #{record.itemId,jdbcType=BIGINT},
add_time = #{record.addTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
......@@ -214,13 +225,13 @@
select
'true' as QUERYID,
<choose>
<when test="selective != null and selective.length > 0">
<when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=",">
${column.escapedColumnName}
</foreach>
</when>
<otherwise>
favorites_id, item_id, add_time
favorites_id, user_id, item_id, add_time
</otherwise>
</choose>
from favorites_items_relation
......
Markdown is supported
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