@ -20,6 +20,7 @@
<result column= "barcode" jdbcType= "VARCHAR" property= "barcode" />
<result column= "barcode" jdbcType= "VARCHAR" property= "barcode" />
<result column= "price" jdbcType= "DECIMAL" property= "price" />
<result column= "price" jdbcType= "DECIMAL" property= "price" />
<result column= "purchase_price" jdbcType= "DECIMAL" property= "purchasePrice" />
<result column= "purchase_price" jdbcType= "DECIMAL" property= "purchasePrice" />
<result column= "commission" jdbcType= "DECIMAL" property= "commission" />
<result column= "wholesale_price" jdbcType= "DECIMAL" property= "wholesalePrice" />
<result column= "wholesale_price" jdbcType= "DECIMAL" property= "wholesalePrice" />
<result column= "product_picture" jdbcType= "VARCHAR" property= "productPicture" />
<result column= "product_picture" jdbcType= "VARCHAR" property= "productPicture" />
<result column= "product_video" jdbcType= "VARCHAR" property= "productVideo" />
<result column= "product_video" jdbcType= "VARCHAR" property= "productVideo" />
@ -92,7 +93,7 @@
</sql>
</sql>
<sql id= "Base_Column_List" >
<sql id= "Base_Column_List" >
id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,commission,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
tail_warn,in_storage_status,customer_category_rule
tail_warn,in_storage_status,customer_category_rule
</sql>
</sql>
@ -133,7 +134,7 @@
product_name, unit, shop_id,
product_name, unit, shop_id,
category_id,attr_id, attribute_list, supplier_id,
category_id,attr_id, attribute_list, supplier_id,
product_sn, barcode, price,
product_sn, barcode, price,
purchase_price, wholesale_price, product_picture,
purchase_price, commission, wholesale_price, product_picture,
product_video, product_intro, sales_week,
product_video, product_intro, sales_week,
print_barcode, tail_warn,in_storage_status,customer_category_rule)
print_barcode, tail_warn,in_storage_status,customer_category_rule)
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
@ -141,7 +142,7 @@
#{productName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
#{productName,jdbcType=VARCHAR}, #{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
#{categoryId,jdbcType=VARCHAR},#{attrId,jdbcType=VARCHAR}, #{attributeList,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR},
#{categoryId,jdbcType=VARCHAR},#{attrId,jdbcType=VARCHAR}, #{attributeList,jdbcType=VARCHAR}, #{supplierId,jdbcType=VARCHAR},
#{productSn,jdbcType=VARCHAR}, #{barcode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{productSn,jdbcType=VARCHAR}, #{barcode,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL}, #{wholesalePrice,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL}, #{commission}, #{ wholesalePrice,jdbcType=DECIMAL},
#{productPicture,jdbcType=VARCHAR},
#{productPicture,jdbcType=VARCHAR},
#{productVideo,jdbcType=VARCHAR}, #{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP},
#{productVideo,jdbcType=VARCHAR}, #{productIntro,jdbcType=VARCHAR}, #{salesWeek,jdbcType=TIMESTAMP},
#{printBarcode,jdbcType=VARCHAR}, #{tailWarn,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER},
#{printBarcode,jdbcType=VARCHAR}, #{tailWarn,jdbcType=INTEGER}, #{inStorageStatus,jdbcType=INTEGER},
@ -201,6 +202,9 @@
<if test= "purchasePrice != null" >
<if test= "purchasePrice != null" >
purchase_price,
purchase_price,
</if>
</if>
<if test= "commission != null" >
commission,
</if>
<if test= "wholesalePrice != null" >
<if test= "wholesalePrice != null" >
wholesale_price,
wholesale_price,
</if>
</if>
@ -281,6 +285,9 @@
<if test= "purchasePrice != null" >
<if test= "purchasePrice != null" >
#{purchasePrice,jdbcType=DECIMAL},
#{purchasePrice,jdbcType=DECIMAL},
</if>
</if>
<if test= "commission != null" >
#{commission},
</if>
<if test= "wholesalePrice != null" >
<if test= "wholesalePrice != null" >
#{wholesalePrice,jdbcType=DECIMAL},
#{wholesalePrice,jdbcType=DECIMAL},
</if>
</if>
@ -370,6 +377,9 @@
<if test= "record.purchasePrice != null" >
<if test= "record.purchasePrice != null" >
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
</if>
</if>
<if test= "record.commission != null" >
commission = #{record.commission,jdbcType=DECIMAL},
</if>
<if test= "record.wholesalePrice != null" >
<if test= "record.wholesalePrice != null" >
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
</if>
</if>
@ -421,6 +431,7 @@
barcode = #{record.barcode,jdbcType=VARCHAR},
barcode = #{record.barcode,jdbcType=VARCHAR},
price = #{record.price,jdbcType=DECIMAL},
price = #{record.price,jdbcType=DECIMAL},
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL},
commission = #{record.commission,jdbcType=DECIMAL},
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL},
product_picture = #{record.productPicture,jdbcType=VARCHAR},
product_picture = #{record.productPicture,jdbcType=VARCHAR},
product_video = #{record.productVideo,jdbcType=VARCHAR},
product_video = #{record.productVideo,jdbcType=VARCHAR},
@ -485,6 +496,9 @@
<if test= "purchasePrice != null" >
<if test= "purchasePrice != null" >
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
</if>
</if>
<if test= "commission != null" >
commission = #{commission,jdbcType=DECIMAL},
</if>
<if test= "wholesalePrice != null" >
<if test= "wholesalePrice != null" >
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
</if>
</if>
@ -533,6 +547,7 @@
barcode = #{barcode,jdbcType=VARCHAR},
barcode = #{barcode,jdbcType=VARCHAR},
price = #{price,jdbcType=DECIMAL},
price = #{price,jdbcType=DECIMAL},
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
purchase_price = #{purchasePrice,jdbcType=DECIMAL},
commission = #{commission,jdbcType=DECIMAL},
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL},
product_picture = #{productPicture,jdbcType=VARCHAR},
product_picture = #{productPicture,jdbcType=VARCHAR},
product_video = #{productVideo,jdbcType=VARCHAR},
product_video = #{productVideo,jdbcType=VARCHAR},
@ -566,6 +581,7 @@
t.barcode,
t.barcode,
t.price,
t.price,
t.purchase_price,
t.purchase_price,
t.commission,
t.wholesale_price,
t.wholesale_price,
t.product_picture,
t.product_picture,
t.product_video,
t.product_video,
@ -780,6 +796,11 @@
where id = #{id,jdbcType=VARCHAR} or barcode =#{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR} or barcode =#{id,jdbcType=VARCHAR}
</select>
</select>
<select id= "getProductSaleCount" parameterType= "java.lang.String" resultType= "java.lang.Integer" >
select SUM(dd.product_count) from t_sale_detail dd
right join t_sale aa on aa.id = dd.sale_id and aa.status = 4 where dd.product_id = #{id,jdbcType=VARCHAR}
</select>
<select id= "getProductByProductSnList" resultType= "cc.hiver.mall.entity.Product" >
<select id= "getProductByProductSnList" resultType= "cc.hiver.mall.entity.Product" >
select
select
<include refid= "Base_Column_List" />
<include refid= "Base_Column_List" />
@ -821,7 +842,7 @@
<!-- 批量新增商品子图 -->
<!-- 批量新增商品子图 -->
<insert id= "batchSaveProduct" parameterType= "java.util.List" >
<insert id= "batchSaveProduct" parameterType= "java.util.List" >
insert into t_product (id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
insert into t_product (id, create_by, create_time, del_flag, update_by, update_time, product_name, unit,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,
shop_id, category_id,attr_id, attribute_list, supplier_id,supplier_name, product_sn, barcode, price, purchase_price,commission,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
wholesale_price, product_picture, product_video, product_intro, sales_week, print_barcode,
tail_warn,in_storage_status) values
tail_warn,in_storage_status) values
<foreach item= "product" collection= "addProductList" index= "index" separator= "," >
<foreach item= "product" collection= "addProductList" index= "index" separator= "," >
@ -830,7 +851,7 @@
#{product.productName,jdbcType=VARCHAR},#{product.unit,jdbcType=VARCHAR},#{product.shopId,jdbcType=VARCHAR},
#{product.productName,jdbcType=VARCHAR},#{product.unit,jdbcType=VARCHAR},#{product.shopId,jdbcType=VARCHAR},
#{product.categoryId,jdbcType=VARCHAR},#{product.attrId,jdbcType=VARCHAR},#{product.attributeList,jdbcType=VARCHAR},
#{product.categoryId,jdbcType=VARCHAR},#{product.attrId,jdbcType=VARCHAR},#{product.attributeList,jdbcType=VARCHAR},
#{product.supplierId,jdbcType=VARCHAR},#{product.supplierName,jdbcType=VARCHAR},#{product.productSn,jdbcType=VARCHAR},
#{product.supplierId,jdbcType=VARCHAR},#{product.supplierName,jdbcType=VARCHAR},#{product.productSn,jdbcType=VARCHAR},
#{product.barcode,jdbcType=VARCHAR},#{product.price,jdbcType=DECIMAL},#{product.purchasePrice,jdbcType=DECIMAL},
#{product.barcode,jdbcType=VARCHAR},#{product.price,jdbcType=DECIMAL},#{product.purchasePrice,jdbcType=DECIMAL},#{product.commission,jdbcType=DECIMAL},
#{product.wholesalePrice,jdbcType=DECIMAL},#{product.productPicture,jdbcType=VARCHAR},#{product.productVideo,jdbcType=VARCHAR},
#{product.wholesalePrice,jdbcType=DECIMAL},#{product.productPicture,jdbcType=VARCHAR},#{product.productVideo,jdbcType=VARCHAR},
#{product.productIntro,jdbcType=VARCHAR},#{product.salesWeek,jdbcType=DATE},#{product.printBarcode,jdbcType=VARCHAR},
#{product.productIntro,jdbcType=VARCHAR},#{product.salesWeek,jdbcType=DATE},#{product.printBarcode,jdbcType=VARCHAR},
#{product.tailWarn,jdbcType=INTEGER},#{product.inStorageStatus,jdbcType=INTEGER})
#{product.tailWarn,jdbcType=INTEGER},#{product.inStorageStatus,jdbcType=INTEGER})