商品SKU功能优化

This commit is contained in:
macro
2020-02-29 16:35:39 +08:00
parent 765affaa27
commit a308c69968
19 changed files with 2629 additions and 3584 deletions

View File

@@ -8,9 +8,6 @@
<result column="member_id" jdbcType="BIGINT" property="memberId" />
<result column="quantity" jdbcType="INTEGER" property="quantity" />
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="product_pic" jdbcType="VARCHAR" property="productPic" />
<result column="product_name" jdbcType="VARCHAR" property="productName" />
<result column="product_sub_title" jdbcType="VARCHAR" property="productSubTitle" />
@@ -83,9 +80,9 @@
</where>
</sql>
<sql id="Base_Column_List">
id, product_id, product_sku_id, member_id, quantity, price, sp1, sp2, sp3, product_pic,
product_name, product_sub_title, product_sku_code, member_nickname, create_date,
modify_date, delete_status, product_category_id, product_brand, product_sn, product_attr
id, product_id, product_sku_id, member_id, quantity, price, product_pic, product_name,
product_sub_title, product_sku_code, member_nickname, create_date, modify_date, delete_status,
product_category_id, product_brand, product_sn, product_attr
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsCartItemExample" resultMap="BaseResultMap">
select
@@ -122,15 +119,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into oms_cart_item (product_id, product_sku_id, member_id,
quantity, price, sp1,
sp2, sp3, product_pic,
quantity, price, product_pic,
product_name, product_sub_title, product_sku_code,
member_nickname, create_date, modify_date,
delete_status, product_category_id, product_brand,
product_sn, product_attr)
values (#{productId,jdbcType=BIGINT}, #{productSkuId,jdbcType=BIGINT}, #{memberId,jdbcType=BIGINT},
#{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{sp1,jdbcType=VARCHAR},
#{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{productPic,jdbcType=VARCHAR},
#{quantity,jdbcType=INTEGER}, #{price,jdbcType=DECIMAL}, #{productPic,jdbcType=VARCHAR},
#{productName,jdbcType=VARCHAR}, #{productSubTitle,jdbcType=VARCHAR}, #{productSkuCode,jdbcType=VARCHAR},
#{memberNickname,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{modifyDate,jdbcType=TIMESTAMP},
#{deleteStatus,jdbcType=INTEGER}, #{productCategoryId,jdbcType=BIGINT}, #{productBrand,jdbcType=VARCHAR},
@@ -157,15 +152,6 @@
<if test="price != null">
price,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="productPic != null">
product_pic,
</if>
@@ -219,15 +205,6 @@
<if test="price != null">
#{price,jdbcType=DECIMAL},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="productPic != null">
#{productPic,jdbcType=VARCHAR},
</if>
@@ -293,15 +270,6 @@
<if test="record.price != null">
price = #{record.price,jdbcType=DECIMAL},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.productPic != null">
product_pic = #{record.productPic,jdbcType=VARCHAR},
</if>
@@ -351,9 +319,6 @@
member_id = #{record.memberId,jdbcType=BIGINT},
quantity = #{record.quantity,jdbcType=INTEGER},
price = #{record.price,jdbcType=DECIMAL},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
product_pic = #{record.productPic,jdbcType=VARCHAR},
product_name = #{record.productName,jdbcType=VARCHAR},
product_sub_title = #{record.productSubTitle,jdbcType=VARCHAR},
@@ -388,15 +353,6 @@
<if test="price != null">
price = #{price,jdbcType=DECIMAL},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="productPic != null">
product_pic = #{productPic,jdbcType=VARCHAR},
</if>
@@ -443,9 +399,6 @@
member_id = #{memberId,jdbcType=BIGINT},
quantity = #{quantity,jdbcType=INTEGER},
price = #{price,jdbcType=DECIMAL},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
product_pic = #{productPic,jdbcType=VARCHAR},
product_name = #{productName,jdbcType=VARCHAR},
product_sub_title = #{productSubTitle,jdbcType=VARCHAR},

View File

@@ -15,9 +15,6 @@
<result column="product_sku_id" jdbcType="BIGINT" property="productSkuId" />
<result column="product_sku_code" jdbcType="VARCHAR" property="productSkuCode" />
<result column="product_category_id" jdbcType="BIGINT" property="productCategoryId" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="promotion_name" jdbcType="VARCHAR" property="promotionName" />
<result column="promotion_amount" jdbcType="DECIMAL" property="promotionAmount" />
<result column="coupon_amount" jdbcType="DECIMAL" property="couponAmount" />
@@ -88,8 +85,8 @@
<sql id="Base_Column_List">
id, order_id, order_sn, product_id, product_pic, product_name, product_brand, product_sn,
product_price, product_quantity, product_sku_id, product_sku_code, product_category_id,
sp1, sp2, sp3, promotion_name, promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth, product_attr
promotion_name, promotion_amount, coupon_amount, integration_amount, real_amount,
gift_integration, gift_growth, product_attr
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.OmsOrderItemExample" resultMap="BaseResultMap">
select
@@ -129,18 +126,16 @@
product_pic, product_name, product_brand,
product_sn, product_price, product_quantity,
product_sku_id, product_sku_code, product_category_id,
sp1, sp2, sp3, promotion_name,
promotion_amount, coupon_amount, integration_amount,
real_amount, gift_integration, gift_growth,
product_attr)
promotion_name, promotion_amount, coupon_amount,
integration_amount, real_amount, gift_integration,
gift_growth, product_attr)
values (#{orderId,jdbcType=BIGINT}, #{orderSn,jdbcType=VARCHAR}, #{productId,jdbcType=BIGINT},
#{productPic,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, #{productBrand,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR}, #{productPrice,jdbcType=DECIMAL}, #{productQuantity,jdbcType=INTEGER},
#{productSkuId,jdbcType=BIGINT}, #{productSkuCode,jdbcType=VARCHAR}, #{productCategoryId,jdbcType=BIGINT},
#{sp1,jdbcType=VARCHAR}, #{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{promotionName,jdbcType=VARCHAR},
#{promotionAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL}, #{integrationAmount,jdbcType=DECIMAL},
#{realAmount,jdbcType=DECIMAL}, #{giftIntegration,jdbcType=INTEGER}, #{giftGrowth,jdbcType=INTEGER},
#{productAttr,jdbcType=VARCHAR})
#{promotionName,jdbcType=VARCHAR}, #{promotionAmount,jdbcType=DECIMAL}, #{couponAmount,jdbcType=DECIMAL},
#{integrationAmount,jdbcType=DECIMAL}, #{realAmount,jdbcType=DECIMAL}, #{giftIntegration,jdbcType=INTEGER},
#{giftGrowth,jdbcType=INTEGER}, #{productAttr,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.OmsOrderItem">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -184,15 +179,6 @@
<if test="productCategoryId != null">
product_category_id,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="promotionName != null">
promotion_name,
</if>
@@ -255,15 +241,6 @@
<if test="productCategoryId != null">
#{productCategoryId,jdbcType=BIGINT},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="promotionName != null">
#{promotionName,jdbcType=VARCHAR},
</if>
@@ -338,15 +315,6 @@
<if test="record.productCategoryId != null">
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.promotionName != null">
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
</if>
@@ -391,9 +359,6 @@
product_sku_id = #{record.productSkuId,jdbcType=BIGINT},
product_sku_code = #{record.productSkuCode,jdbcType=VARCHAR},
product_category_id = #{record.productCategoryId,jdbcType=BIGINT},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
promotion_name = #{record.promotionName,jdbcType=VARCHAR},
promotion_amount = #{record.promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{record.couponAmount,jdbcType=DECIMAL},
@@ -445,15 +410,6 @@
<if test="productCategoryId != null">
product_category_id = #{productCategoryId,jdbcType=BIGINT},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="promotionName != null">
promotion_name = #{promotionName,jdbcType=VARCHAR},
</if>
@@ -495,9 +451,6 @@
product_sku_id = #{productSkuId,jdbcType=BIGINT},
product_sku_code = #{productSkuCode,jdbcType=VARCHAR},
product_category_id = #{productCategoryId,jdbcType=BIGINT},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
promotion_name = #{promotionName,jdbcType=VARCHAR},
promotion_amount = #{promotionAmount,jdbcType=DECIMAL},
coupon_amount = #{couponAmount,jdbcType=DECIMAL},

View File

@@ -8,13 +8,11 @@
<result column="price" jdbcType="DECIMAL" property="price" />
<result column="stock" jdbcType="INTEGER" property="stock" />
<result column="low_stock" jdbcType="INTEGER" property="lowStock" />
<result column="sp1" jdbcType="VARCHAR" property="sp1" />
<result column="sp2" jdbcType="VARCHAR" property="sp2" />
<result column="sp3" jdbcType="VARCHAR" property="sp3" />
<result column="pic" jdbcType="VARCHAR" property="pic" />
<result column="sale" jdbcType="INTEGER" property="sale" />
<result column="promotion_price" jdbcType="DECIMAL" property="promotionPrice" />
<result column="lock_stock" jdbcType="INTEGER" property="lockStock" />
<result column="sp_data" jdbcType="VARCHAR" property="spData" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -75,8 +73,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, product_id, sku_code, price, stock, low_stock, sp1, sp2, sp3, pic, sale, promotion_price,
lock_stock
id, product_id, sku_code, price, stock, low_stock, pic, sale, promotion_price, lock_stock,
sp_data
</sql>
<select id="selectByExample" parameterType="com.macro.mall.model.PmsSkuStockExample" resultMap="BaseResultMap">
select
@@ -113,13 +111,13 @@
SELECT LAST_INSERT_ID()
</selectKey>
insert into pms_sku_stock (product_id, sku_code, price,
stock, low_stock, sp1,
sp2, sp3, pic, sale,
promotion_price, lock_stock)
stock, low_stock, pic,
sale, promotion_price, lock_stock,
sp_data)
values (#{productId,jdbcType=BIGINT}, #{skuCode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{stock,jdbcType=INTEGER}, #{lowStock,jdbcType=INTEGER}, #{sp1,jdbcType=VARCHAR},
#{sp2,jdbcType=VARCHAR}, #{sp3,jdbcType=VARCHAR}, #{pic,jdbcType=VARCHAR}, #{sale,jdbcType=INTEGER},
#{promotionPrice,jdbcType=DECIMAL}, #{lockStock,jdbcType=INTEGER})
#{stock,jdbcType=INTEGER}, #{lowStock,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR},
#{sale,jdbcType=INTEGER}, #{promotionPrice,jdbcType=DECIMAL}, #{lockStock,jdbcType=INTEGER},
#{spData,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.macro.mall.model.PmsSkuStock">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -142,15 +140,6 @@
<if test="lowStock != null">
low_stock,
</if>
<if test="sp1 != null">
sp1,
</if>
<if test="sp2 != null">
sp2,
</if>
<if test="sp3 != null">
sp3,
</if>
<if test="pic != null">
pic,
</if>
@@ -163,6 +152,9 @@
<if test="lockStock != null">
lock_stock,
</if>
<if test="spData != null">
sp_data,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="productId != null">
@@ -180,15 +172,6 @@
<if test="lowStock != null">
#{lowStock,jdbcType=INTEGER},
</if>
<if test="sp1 != null">
#{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
#{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
#{sp3,jdbcType=VARCHAR},
</if>
<if test="pic != null">
#{pic,jdbcType=VARCHAR},
</if>
@@ -201,6 +184,9 @@
<if test="lockStock != null">
#{lockStock,jdbcType=INTEGER},
</if>
<if test="spData != null">
#{spData,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.macro.mall.model.PmsSkuStockExample" resultType="java.lang.Long">
@@ -230,15 +216,6 @@
<if test="record.lowStock != null">
low_stock = #{record.lowStock,jdbcType=INTEGER},
</if>
<if test="record.sp1 != null">
sp1 = #{record.sp1,jdbcType=VARCHAR},
</if>
<if test="record.sp2 != null">
sp2 = #{record.sp2,jdbcType=VARCHAR},
</if>
<if test="record.sp3 != null">
sp3 = #{record.sp3,jdbcType=VARCHAR},
</if>
<if test="record.pic != null">
pic = #{record.pic,jdbcType=VARCHAR},
</if>
@@ -251,6 +228,9 @@
<if test="record.lockStock != null">
lock_stock = #{record.lockStock,jdbcType=INTEGER},
</if>
<if test="record.spData != null">
sp_data = #{record.spData,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -264,13 +244,11 @@
price = #{record.price,jdbcType=DECIMAL},
stock = #{record.stock,jdbcType=INTEGER},
low_stock = #{record.lowStock,jdbcType=INTEGER},
sp1 = #{record.sp1,jdbcType=VARCHAR},
sp2 = #{record.sp2,jdbcType=VARCHAR},
sp3 = #{record.sp3,jdbcType=VARCHAR},
pic = #{record.pic,jdbcType=VARCHAR},
sale = #{record.sale,jdbcType=INTEGER},
promotion_price = #{record.promotionPrice,jdbcType=DECIMAL},
lock_stock = #{record.lockStock,jdbcType=INTEGER}
lock_stock = #{record.lockStock,jdbcType=INTEGER},
sp_data = #{record.spData,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -293,15 +271,6 @@
<if test="lowStock != null">
low_stock = #{lowStock,jdbcType=INTEGER},
</if>
<if test="sp1 != null">
sp1 = #{sp1,jdbcType=VARCHAR},
</if>
<if test="sp2 != null">
sp2 = #{sp2,jdbcType=VARCHAR},
</if>
<if test="sp3 != null">
sp3 = #{sp3,jdbcType=VARCHAR},
</if>
<if test="pic != null">
pic = #{pic,jdbcType=VARCHAR},
</if>
@@ -314,6 +283,9 @@
<if test="lockStock != null">
lock_stock = #{lockStock,jdbcType=INTEGER},
</if>
<if test="spData != null">
sp_data = #{spData,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@@ -324,13 +296,11 @@
price = #{price,jdbcType=DECIMAL},
stock = #{stock,jdbcType=INTEGER},
low_stock = #{lowStock,jdbcType=INTEGER},
sp1 = #{sp1,jdbcType=VARCHAR},
sp2 = #{sp2,jdbcType=VARCHAR},
sp3 = #{sp3,jdbcType=VARCHAR},
pic = #{pic,jdbcType=VARCHAR},
sale = #{sale,jdbcType=INTEGER},
promotion_price = #{promotionPrice,jdbcType=DECIMAL},
lock_stock = #{lockStock,jdbcType=INTEGER}
lock_stock = #{lockStock,jdbcType=INTEGER},
sp_data = #{spData,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>