|
@@ -14,16 +14,28 @@
|
|
|
<result property="goods_name" column="goods_name"/>
|
|
|
<result property="market_price" column="market_price"/>
|
|
|
<result property="retail_price" column="retail_price"/>
|
|
|
- <result property="retail_product_price" column="retail_product_price"/>
|
|
|
<result property="number" column="number"/>
|
|
|
<result property="goods_specification_name_value" column="goods_specification_name_value"/>
|
|
|
<result property="goods_specification_ids" column="goods_specification_ids"/>
|
|
|
<result property="checked" column="checked"/>
|
|
|
<result property="list_pic_url" column="list_pic_url"/>
|
|
|
+ <result column="sku" property="sku" jdbcType="VARCHAR" />
|
|
|
+ <result column="goods_biz_type" property="goodsBizType" jdbcType="CHAR" />
|
|
|
+ <result column="creater_sn" property="createrSn" jdbcType="VARCHAR" />
|
|
|
+ <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="moder_sn" property="moderSn" jdbcType="VARCHAR" />
|
|
|
+ <result column="mod_time" property="modTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="tstm" property="tstm" jdbcType="TIMESTAMP" />
|
|
|
</resultMap>
|
|
|
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ id, user_id, goods_id, sku, goods_sn, product_id, goods_name, market_price, retail_price,
|
|
|
+ number, goods_specification_ids, checked, list_pic_url, store_id, goods_biz_type,
|
|
|
+ creater_sn, create_time, moder_sn, mod_time, tstm,goods_specification_name_value
|
|
|
+ </sql>
|
|
|
<select id="queryObject" resultMap="cartMap">
|
|
|
- select * from mall_cart where id = #{value}
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" /> from mall_cart where id = #{value}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryList" resultMap="cartMap">
|
|
@@ -81,58 +93,196 @@
|
|
|
</select>
|
|
|
|
|
|
<insert id="save" parameterType="com.kmall.api.entity.CartVo" useGeneratedKeys="true" keyProperty="id">
|
|
|
- insert into mall_cart
|
|
|
- (
|
|
|
- `user_id`,
|
|
|
- `store_id`,
|
|
|
- `goods_id`,
|
|
|
- `goods_sn`,
|
|
|
- `product_id`,
|
|
|
- `goods_name`,
|
|
|
- `market_price`,
|
|
|
- `retail_price`,
|
|
|
- `number`,
|
|
|
- `goods_specification_name_value`,
|
|
|
- `goods_specification_ids`,
|
|
|
- `checked`,
|
|
|
- `list_pic_url`
|
|
|
- )
|
|
|
- values
|
|
|
- (
|
|
|
- #{user_id},
|
|
|
- #{store_id},
|
|
|
- #{goods_id},
|
|
|
- #{goods_sn},
|
|
|
- #{product_id},
|
|
|
- #{goods_name},
|
|
|
- #{market_price},
|
|
|
- #{retail_price},
|
|
|
- #{number},
|
|
|
- #{goods_specification_name_value},
|
|
|
- #{goods_specification_ids},
|
|
|
- #{checked},
|
|
|
- #{list_pic_url}
|
|
|
- )
|
|
|
+ INSERT INTO mall_cart
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="user_id != null" >
|
|
|
+ user_id,
|
|
|
+ </if>
|
|
|
+ <if test="goods_id != null" >
|
|
|
+ goods_id,
|
|
|
+ </if>
|
|
|
+ <if test="sku != null" >
|
|
|
+ sku,
|
|
|
+ </if>
|
|
|
+ <if test="goods_sn != null" >
|
|
|
+ goods_sn,
|
|
|
+ </if>
|
|
|
+ <if test="product_id != null" >
|
|
|
+ product_id,
|
|
|
+ </if>
|
|
|
+ <if test="goods_name != null" >
|
|
|
+ goods_name,
|
|
|
+ </if>
|
|
|
+ <if test="market_price != null" >
|
|
|
+ market_price,
|
|
|
+ </if>
|
|
|
+ <if test="retail_price != null" >
|
|
|
+ retail_price,
|
|
|
+ </if>
|
|
|
+ <if test="number != null" >
|
|
|
+ number,
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_ids != null" >
|
|
|
+ goods_specification_ids,
|
|
|
+ </if>
|
|
|
+ <if test="checked != null" >
|
|
|
+ checked,
|
|
|
+ </if>
|
|
|
+ <if test="list_pic_url != null" >
|
|
|
+ list_pic_url,
|
|
|
+ </if>
|
|
|
+ <if test="store_id != null" >
|
|
|
+ store_id,
|
|
|
+ </if>
|
|
|
+ <if test="goodsBizType != null" >
|
|
|
+ goods_biz_type,
|
|
|
+ </if>
|
|
|
+ <if test="createrSn != null" >
|
|
|
+ creater_sn,
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
+ <if test="moderSn != null" >
|
|
|
+ moder_sn,
|
|
|
+ </if>
|
|
|
+ <if test="modTime != null" >
|
|
|
+ mod_time,
|
|
|
+ </if>
|
|
|
+ <if test="tstm != null" >
|
|
|
+ tstm,
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_name_value != null" >
|
|
|
+ goods_specification_name_value,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="user_id != null" >
|
|
|
+ #{user_id},
|
|
|
+ </if>
|
|
|
+ <if test="goods_id != null" >
|
|
|
+ #{goods_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sku != null" >
|
|
|
+ #{sku,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="goods_sn != null" >
|
|
|
+ #{goods_sn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="product_id != null" >
|
|
|
+ #{product_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="goods_name != null" >
|
|
|
+ #{goods_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="market_price != null" >
|
|
|
+ #{market_price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="retail_price != null" >
|
|
|
+ #{retail_price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="number != null" >
|
|
|
+ #{number,jdbcType=SMALLINT},
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_ids != null" >
|
|
|
+ #{goods_specification_ids,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checked != null" >
|
|
|
+ #{checked,jdbcType=BIT},
|
|
|
+ </if>
|
|
|
+ <if test="list_pic_url != null" >
|
|
|
+ #{list_pic_url,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="store_id != null" >
|
|
|
+ #{store_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="goodsBizType != null" >
|
|
|
+ #{goodsBizType,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createrSn != null" >
|
|
|
+ #{createrSn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="moderSn != null" >
|
|
|
+ #{moderSn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modTime != null" >
|
|
|
+ #{modTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="tstm != null" >
|
|
|
+ #{tstm,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_name_value != null" >
|
|
|
+ #{goods_specification_name_value,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
</insert>
|
|
|
|
|
|
<update id="update" parameterType="com.kmall.api.entity.CartVo">
|
|
|
update mall_cart
|
|
|
- <set>
|
|
|
- <if test="user_id != null">`user_id` = #{user_id},</if>
|
|
|
- <if test="store_id != null">`store_id` = #{store_id},</if>
|
|
|
- <if test="goods_id != null">`goods_id` = #{goods_id},</if>
|
|
|
- <if test="goods_sn != null">`goods_sn` = #{goods_sn},</if>
|
|
|
- <if test="product_id != null">`product_id` = #{product_id},</if>
|
|
|
- <if test="goods_name != null">`goods_name` = #{goods_name},</if>
|
|
|
- <if test="market_price != null">`market_price` = #{market_price},</if>
|
|
|
- <if test="retail_price != null">`retail_price` = #{retail_price},</if>
|
|
|
- <if test="number != null">`number` = #{number},</if>
|
|
|
- <if test="goods_specification_name_value != null">`goods_specification_name_value` =
|
|
|
- #{goods_specification_name_value},
|
|
|
- </if>
|
|
|
- <if test="goods_specification_ids != null">`goods_specification_ids` = #{goods_specification_ids},</if>
|
|
|
- <if test="checked != null">`checked` = #{checked},</if>
|
|
|
- <if test="list_pic_url != null">`list_pic_url` = #{list_pic_url}</if>
|
|
|
+ <set >
|
|
|
+ <if test="user_id != null" >
|
|
|
+ user_id = #{user_id},
|
|
|
+ </if>
|
|
|
+ <if test="goods_id != null" >
|
|
|
+ goods_id = #{goods_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="sku != null" >
|
|
|
+ sku = #{sku,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="goods_sn != null" >
|
|
|
+ goods_sn = #{goods_sn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="product_id != null" >
|
|
|
+ product_id = #{product_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="goods_name != null" >
|
|
|
+ goods_name = #{goods_name,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="market_price != null" >
|
|
|
+ market_price = #{market_price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="retail_price != null" >
|
|
|
+ retail_price = #{retail_price,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
+ <if test="number != null" >
|
|
|
+ number = #{number,jdbcType=SMALLINT},
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_ids != null" >
|
|
|
+ goods_specification_ids = #{goods_specification_ids,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="checked != null" >
|
|
|
+ checked = #{checked,jdbcType=BIT},
|
|
|
+ </if>
|
|
|
+ <if test="list_pic_url != null" >
|
|
|
+ list_pic_url = #{list_pic_url,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="store_id != null" >
|
|
|
+ store_id = #{store_id,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="goodsBizType != null" >
|
|
|
+ goods_biz_type = #{goodsBizType,jdbcType=CHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createrSn != null" >
|
|
|
+ creater_sn = #{createrSn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="createTime != null" >
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="moderSn != null" >
|
|
|
+ moder_sn = #{moderSn,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="modTime != null" >
|
|
|
+ mod_time = #{modTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="tstm != null" >
|
|
|
+ tstm = #{tstm,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="goods_specification_name_value != null" >
|
|
|
+ goods_specification_name_value = #{goods_specification_name_value,jdbcType=LONGVARCHAR},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id}
|
|
|
</update>
|
|
@@ -144,7 +294,7 @@
|
|
|
<foreach item="product_id" collection="productIds" open="(" separator="," close=")">
|
|
|
#{product_id}
|
|
|
</foreach>
|
|
|
- and user_id = #{userId} and store_id = #{store_id}
|
|
|
+ and user_id = #{user_id} and store_id = #{store_id}
|
|
|
</update>
|
|
|
|
|
|
<delete id="delete">
|