dev798
wxy 2024-03-29 17:23:30 +08:00
parent 2639b72dd5
commit 84867a27a2
11 changed files with 83 additions and 93 deletions

View File

@ -2,6 +2,7 @@ package com.muyu.product.domain.req;
import com.muyu.product.domain.*;
import com.muyu.product.domain.DTO.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -0,0 +1,8 @@
package com.muyu.product.mapper;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:07
*/
public interface PromotionMapper {
}

View File

@ -0,0 +1,8 @@
package com.muyu.product.mapper;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:07
*/
public interface ServicesMapper {
}

View File

@ -0,0 +1,13 @@
package com.muyu.product.service;
import com.github.pagehelper.PageInfo;
import com.muyu.product.domain.DTO.Product;
import com.muyu.product.domain.req.ProductReq;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:05
*/
public interface ProductService {
PageInfo<Product> queryProduct(ProductReq req);
}

View File

@ -0,0 +1,8 @@
package com.muyu.product.service;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:05
*/
public interface ProductTypeService {
}

View File

@ -0,0 +1,8 @@
package com.muyu.product.service;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:05
*/
public interface ServiceService {
}

View File

@ -0,0 +1,25 @@
package com.muyu.product.service.impl;
import com.github.pagehelper.PageInfo;
import com.muyu.product.domain.DTO.Product;
import com.muyu.product.domain.req.ProductReq;
import com.muyu.product.service.ProductService;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:06
*/
@Service
@Log4j2
public class ProductServiceImpl implements ProductService {
private final Integer min = 0;
private final Integer max = 5;
@Override
public PageInfo<Product> queryProduct(ProductReq req) {
return null;
}
}

View File

@ -0,0 +1,12 @@
package com.muyu.product.service.impl;
import com.muyu.product.service.ServiceService;
import org.springframework.stereotype.Service;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:05
*/
@Service
public class ServiceServiceImpl implements ServiceService {
}

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.ProductSkuAttrMapper">
<resultMap id="BaseResultMap" type="com.muyu.product.domain.ProductSkuAttr">
<id column="id" property="id"/>
<result column="sku_id" property="skuId"/>
<result column="attr_id" property="attrId"/>
<result column="attr_value_id" property="attrValueId"/>
<result column="attr_value" property="attrValue"/>
<result column="flag" property="flag"/>
<result column="is_delete" property="isDelete"/>
</resultMap>
<sql id="Base_Column_List">
id, sku_id, attr_id, attr_value_id, attr_value, flag, is_delete
</sql>
<select id="selectById" resultMap="BaseResultMap">
SELECT
<include refid="Base_Column_List"/>
FROM t_product_sku_attr
WHERE id = #{id}
</select>
<!-- 可以根据需要定义更多的 SQL 查询、插入、更新、删除等操作 -->
</mapper>

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.ProductSkuMapper">
<resultMap type="com.muyu.product.domain.ProductSku" id="ProductSkuResult" extends="com.muyu.common.core.web.domain.BaseEntity">
<id property="id" column="id" />
<result property="salePrice" column="sale_price" />
<result property="promotionPrice" column="promotion_price" />
<result property="stock" column="stock" />
<result property="stockAlert" column="stock_alert" />
<result property="productId" column="product_id" />
<result property="bgImg" column="bg_img" />
<result property="isDelete" column="is_delete" />
</resultMap>
<insert id="insertProductSku" parameterType="com.muyu.product.domain.ProductSku" useGeneratedKeys="true" keyProperty="id">
INSERT INTO t_product_sku (sale_price, promotion_price, stock, stock_alert, product_id, bg_img, is_delete)
VALUES (#{salePrice}, #{promotionPrice}, #{stock}, #{stockAlert}, #{productId}, #{bgImg}, #{isDelete})
</insert>
<update id="updateProductSku" parameterType="com.muyu.product.domain.ProductSku">
UPDATE t_product_sku
<set>
<if test="salePrice != null">sale_price = #{salePrice},</if>
<if test="promotionPrice != null">promotion_price = #{promotionPrice},</if>
<if test="stock != null">stock = #{stock},</if>
<if test="stockAlert != null">stock_alert = #{stockAlert},</if>
<if test="productId != null">product_id = #{productId},</if>
<if test="bgImg != null">bg_img = #{bgImg},</if>
<if test="isDelete != null">is_delete = #{isDelete},</if>
</set>
WHERE id = #{id}
</update>
<delete id="deleteProductSkuById">
DELETE FROM t_product_sku WHERE id = #{id}
</delete>
<select id="selectProductSkuById" resultType="com.muyu.product.domain.ProductSku">
SELECT id, sale_price, promotion_price, stock, stock_alert, product_id, bg_img, is_delete FROM t_product_sku WHERE id = #{id}
</select>
<select id="findSkuId" resultType="java.lang.Integer">
</select>
</mapper>

View File

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.ServiceMapper">
<insert id="insertProductService">
insert t_product_service(product_id,service_id)
values
<foreach collection="serviceIds" item="id" separator=",">
(#{productId},#{id})
</foreach>
</insert>
</mapper>