|
@@ -3,7 +3,7 @@
|
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.fs.store.mapper.FsStoreCartMapper">
|
|
|
-
|
|
|
+
|
|
|
<resultMap type="FsStoreCart" id="FsStoreCartResult">
|
|
|
<result property="id" column="id" />
|
|
|
<result property="userId" column="user_id" />
|
|
@@ -16,15 +16,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<result property="isPay" column="is_pay" />
|
|
|
<result property="isDel" column="is_del" />
|
|
|
<result property="isBuy" column="is_buy" />
|
|
|
+ <result property="changePrice" column="change_price" />
|
|
|
</resultMap>
|
|
|
|
|
|
<sql id="selectFsStoreCartVo">
|
|
|
- select id, user_id, type, product_id, product_attr_value_id, cart_num, create_time, update_time, is_pay, is_del, is_buy from fs_store_cart
|
|
|
+ select id, user_id, type, product_id, product_attr_value_id, cart_num, create_time, update_time, is_pay, is_del,
|
|
|
+ is_buy,change_price from fs_store_cart
|
|
|
</sql>
|
|
|
|
|
|
<select id="selectFsStoreCartList" parameterType="FsStoreCart" resultMap="FsStoreCartResult">
|
|
|
<include refid="selectFsStoreCartVo"/>
|
|
|
- <where>
|
|
|
+ <where>
|
|
|
<if test="userId != null "> and user_id = #{userId}</if>
|
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
|
<if test="productId != null "> and product_id = #{productId}</if>
|
|
@@ -33,14 +35,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isPay != null "> and is_pay = #{isPay}</if>
|
|
|
<if test="isDel != null "> and is_del = #{isDel}</if>
|
|
|
<if test="isBuy != null "> and is_buy = #{isBuy}</if>
|
|
|
+ <if test="changePrice != null "> and change_price = #{changePrice}</if>
|
|
|
</where>
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<select id="selectFsStoreCartById" parameterType="Long" resultMap="FsStoreCartResult">
|
|
|
<include refid="selectFsStoreCartVo"/>
|
|
|
where id = #{id}
|
|
|
</select>
|
|
|
-
|
|
|
+
|
|
|
<insert id="insertFsStoreCart" parameterType="FsStoreCart" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into fs_store_cart
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
@@ -54,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isPay != null">is_pay,</if>
|
|
|
<if test="isDel != null">is_del,</if>
|
|
|
<if test="isBuy != null">is_buy,</if>
|
|
|
+ <if test="changePrice != null">change_price,</if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="userId != null">#{userId},</if>
|
|
@@ -66,6 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isPay != null">#{isPay},</if>
|
|
|
<if test="isDel != null">#{isDel},</if>
|
|
|
<if test="isBuy != null">#{isBuy},</if>
|
|
|
+ <if test="changePrice != null">#{changePrice},</if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
|
|
@@ -82,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
<if test="isPay != null">is_pay = #{isPay},</if>
|
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
|
<if test="isBuy != null">is_buy = #{isBuy},</if>
|
|
|
+ <if test="changePrice != null">change_price = #{changePrice},</if>
|
|
|
</trim>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -91,10 +97,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
</delete>
|
|
|
|
|
|
<delete id="deleteFsStoreCartByIds" parameterType="String">
|
|
|
- delete from fs_store_cart where id in
|
|
|
+ delete from fs_store_cart where id in
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</delete>
|
|
|
-
|
|
|
-</mapper>
|
|
|
+
|
|
|
+</mapper>
|