提交最终代码

This commit is contained in:
chenxin
2025-02-26 10:34:54 +08:00
parent 0a2e13c428
commit 419f7c9886
18 changed files with 466 additions and 210 deletions

View File

@@ -27,4 +27,6 @@ public interface OmsOrderItemMapper {
int updateByPrimaryKeySelective(OmsOrderItem record);
int updateByPrimaryKey(OmsOrderItem record);
OmsOrderItem selectByOrderId(Long orderId);
}

View File

@@ -7,6 +7,7 @@ import com.buy507.mall.model.PmsProductFullReduction;
import java.util.HashMap;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
public interface PmsProductMapper {
long countByExample(PmsProductExample example);
@@ -23,7 +24,9 @@ public interface PmsProductMapper {
List<PmsProduct> selectByExample(PmsProductExample example);
// @Select("select * from pms_product where id = #{id}")
PmsProduct selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") PmsProduct record, @Param("example") PmsProductExample example);
int updateByExampleWithBLOBs(@Param("record") PmsProduct record, @Param("example") PmsProductExample example);
@@ -40,7 +43,8 @@ public interface PmsProductMapper {
PmsProduct getProductByOrderSn(String orderSn);
PmsProduct getPrimaryKey(Long id);
int insertAll(PmsProduct product);
}

View File

@@ -29,4 +29,5 @@ public interface PmsSkuStockMapper {
int updateByPrimaryKey(PmsSkuStock record);
List<PmsSkuStock> getPmsSkuStock(Long id);
}

View File

@@ -69,6 +69,8 @@ public class OmsOrderItem implements Serializable {
@ApiModelProperty(value = "商品销售属性:[{'key':'颜色','value':'颜色'},{'key':'容量','value':'4G'}]")
private String productAttr;
private static final long serialVersionUID = 1L;
public Long getId() {

View File

@@ -664,7 +664,7 @@ public class PmsProduct implements Serializable {
public void setVipCenter(Integer vipCenter) {this.vipCenter = vipCenter;}
public Integer getintergrationPrice() {return intergrationPrice;}
public Integer getIntergrationPrice() {return intergrationPrice;}
public void setIntergrationPrice(Integer intergrationPrice) {this.intergrationPrice = intergrationPrice;}

View File

@@ -89,7 +89,7 @@
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
real_amount, gift_integration, gift_growth, product_attr,intergrationPrice,intergrationExchange
</sql>
<select id="selectByExample" parameterType="com.buy507.mall.model.OmsOrderItemExample" resultMap="BaseResultMap">
select
@@ -508,4 +508,9 @@
product_attr = #{productAttr,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="selectByOrderId" resultType="com.buy507.mall.model.OmsOrderItem">
select * from mall.oms_order_item where order_id = #{orderId}
</select>
</mapper>

View File

@@ -112,7 +112,7 @@
verify_status, sort, sale, price, promotion_price, gift_growth, gift_point, use_point_limit,
sub_title, original_price, stock, low_stock, unit, weight, preview_status, service_ids,
keywords, note, album_pics, detail_title, promotion_start_time, promotion_end_time,
promotion_per_limit, promotion_type, brand_name, product_category_name, distribution_flag
promotion_per_limit, promotion_type, brand_name, product_category_name, distribution_flag,vip_status,points_area_status,points_exchange_status,intergration_price
</sql>
<sql id="Blob_Column_List">
description, detail_desc, detail_html, detail_mobile_html
@@ -336,6 +336,9 @@
<if test="detailMobileHtml != null">
detail_mobile_html,
</if>
<if test="intergrationPrice != null">
intergration_price,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="brandId != null">
@@ -461,6 +464,9 @@
<if test="detailMobileHtml != null">
#{detailMobileHtml,jdbcType=LONGVARCHAR},
</if>
<if test="intergrationPrice != null">
#{intergration_price},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.buy507.mall.model.PmsProductExample" resultType="java.lang.Long">
@@ -934,10 +940,118 @@
SELECT p.*
FROM pms_product p
WHERE p.product_sn = (
SELECT oi.product_sn
SELECT DISTINCT oi.product_sn
FROM oms_order_item oi
WHERE oi.order_sn = #{orderSn}
LIMIT 1
)
AND oi.product_sn IS NOT NULL
limit 1
);
</select>
<select id="getPrimaryKey" resultType="com.buy507.mall.model.PmsProduct">
SELECT p.id,
p.brand_id,
p.product_category_id,
p.feight_template_id,
p.product_attribute_category_id,
p.name,
p.pic,
p.product_sn,
p.delete_status,
p.publish_status,
p.new_status,
p.recommand_status,
p.verify_status,
p.sort,
p.sale,
p.price,
p.promotion_price,
p.gift_growth,
p.gift_point,
p.use_point_limit,
p.sub_title,
p.description,
p.original_price,
p.stock,
p.low_stock,
p.unit,
p.weight,
p.preview_status,
p.service_ids,
p.keywords,
p.note,
p.album_pics,
p.detail_title,
p.detail_desc,
p.detail_html,
p.detail_mobile_html,
p.promotion_start_time,
p.promotion_end_time,
p.promotion_per_limit,
p.promotion_type,
p.brand_name,
p.product_category_name,
p.distribution_flag,
p.vip_status,
p.points_area_status,
p.points_exchange_status,
p.intergration_price
FROM pms_product p
WHERE id = #{id}
</select>
<insert id="insertAll" useGeneratedKeys="true" parameterType="com.buy507.mall.model.PmsProduct">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
SELECT LAST_INSERT_ID()
</selectKey>
INSERT INTO pms_product
SET
brand_id = #{brandId},
product_category_id = #{productCategoryId},
feight_template_id = #{feightTemplateId},
product_attribute_category_id = #{productAttributeCategoryId},
name = #{name},
pic = #{pic},
product_sn = #{productSn},
delete_status = #{deleteStatus},
publish_status = #{publishStatus},
new_status = #{newStatus},
vip_status = #{vipStatus},
points_area_status = #{pointsAreaStatus},
points_exchange_status = #{pointsExchangeStatus},
recommand_status = #{recommandStatus},
verify_status = #{verifyStatus},
sort = #{sort},
sale = #{sale},
price = #{price},
promotion_price = #{promotionPrice},
gift_growth = #{giftGrowth},
gift_point = #{giftPoint},
use_point_limit = #{usePointLimit},
sub_title = #{subTitle},
original_price = #{originalPrice},
stock = #{stock},
low_stock = #{lowStock},
unit = #{unit},
weight = #{weight},
preview_status = #{previewStatus},
service_ids = #{serviceIds},
keywords = #{keywords},
note = #{note},
album_pics = #{albumPics},
detail_title = #{detailTitle},
promotion_start_time = #{promotionStartTime},
promotion_end_time = #{promotionEndTime},
promotion_per_limit = #{promotionPerLimit},
promotion_type = #{promotionType},
brand_name = #{brandName},
product_category_name = #{productCategoryName},
description = #{description},
detail_desc = #{detailDesc},
detail_html = #{detailHtml},
detail_mobile_html = #{detailMobileHtml},
intergration_price = #{intergrationPrice};
</insert>
</mapper>

View File

@@ -341,4 +341,5 @@
on ppa.id=ppav.product_attribute_id
where pst.product_id=#{id,jdbcType=BIGINT}
</select>
</mapper>