dev798
wxy 2024-03-29 17:23:55 +08:00
parent 84867a27a2
commit 42d21106be
11 changed files with 147 additions and 123 deletions

View File

@ -1,13 +1,12 @@
package com.muyu.common.core.domain;
import com.muyu.common.core.constant.HttpStatus;
import com.muyu.common.core.utils.StringUtils;
import java.util.HashMap;
import java.util.Objects;
/**
*
*

View File

@ -0,0 +1,16 @@
package com.muyu.product.controller;
import io.swagger.annotations.Api;
import lombok.extern.log4j.Log4j2;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:09
*/
@RestController
@RequestMapping("argument")
@Api(value = "下拉框管理")
public class ArgumentController {
}

View File

@ -0,0 +1,41 @@
package com.muyu.product.controller;
import com.github.pagehelper.PageInfo;
import com.muyu.common.core.domain.AjaxResult;
import com.muyu.common.system.remote.RemoteFileService;
import com.muyu.product.domain.DTO.Product;
import com.muyu.product.domain.req.ProductReq;
import com.muyu.product.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static com.muyu.common.core.domain.AjaxResult.success;
/**
* @Author: wangxinyuan
* @Date: 2024/3/29 17:09
*/
@RestController
@RequestMapping("/product")
@Api(value = "商品管理")
public class ProductController {
@Autowired
private ProductService productService;
@Autowired
private RemoteFileService remoteFileService;
@ApiModelProperty("查询商品信息")
@GetMapping("/queryProduct")
public AjaxResult queryProduct(@RequestBody ProductReq req){
PageInfo<Product> list = productService.queryProduct(req);
return success(list);
}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -3,4 +3,6 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.ArgumentMapper">
</mapper>

View File

@ -1,26 +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.ProductBrandMapper">
<resultMap type="com.muyu.product.domain.ProductBrand" id="ProductBrandResult">
<id property="id" column="id" />
<result property="name" column="product_name" />
<result property="brandFirstLetter" column="product_subhead" />
<result property="sort" column="product_brand_id" />
<result property="brandManufacturer" column="product_introduce" />
<result property="brandStory" column="product_no" />
<result property="brandLogo" column="product_unit" />
<result property="brandSpecialArea" column="product_weight" />
<result property="isShow" column="is_show" />
<result property="isDelete" column="is_delete" />
</resultMap>
<select id="selectTProductList" resultMap="ProductBrandResult">
select id, product_name, product_subhead, product_brand_id, product_introduce, product_no, product_unit, product_weight, is_show, is_delete from t_product_brand
</select>
</mapper>

View File

@ -1,24 +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.ProductClassifyMapper">
<resultMap type="com.muyu.product.domain.ProductClassify" id="ProductClassifyResultMap">
<id property="id" column="id" />
<result property="classifyLevel" column="classify_level" />
<result property="classifyUnit" column="classify_unit" />
<result property="classifyNavigation" column="classify_navigation" />
<result property="isShow" column="is_show" />
<result property="sort" column="sort" />
<result property="parentId" column="parent_id" />
<result property="classifyIco" column="classify_ico" />
</resultMap>
<select id="selectProductClassifyById" resultMap="ProductClassifyResultMap">
SELECT id, classify_level, classify_unit, classify_navigation, is_show, sort, parent_id, classify_ico
FROM t_product_classify
</select>
</mapper>

View File

@ -4,80 +4,60 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.product.mapper.ProductMapper">
<resultMap type="com.muyu.product.domain.Product" id="ProductResultMap">
<id property="id" column="id" />
<result property="productName" column="product_name" />
<result property="productNumber" column="product_number" />
<result property="productExamine" column="product_examine" />
<result property="brandId" column="brand_id" />
<result property="typeId" column="type_id" />
<result property="productSubheading" column="product_subheading" />
<result property="productInformation" column="product_information" />
<result property="productUnit" column="product_unit" />
<result property="productWeight" column="product_weight" />
<result property="productSort" column="product_sort" />
<result property="promotionId" column="promotion_id" />
<result property="productPoints" column="product_points" />
<result property="productGrowth" column="product_growth" />
<result property="productMaxPoints" column="product_max_points" />
<result property="productForeknow" column="product_foreknow" />
<result property="productStatus" column="product_status" />
<result property="productNew" column="product_new" />
<result property="productRecommended" column="product_recommended" />
<result property="detailsTitle" column="details_title" />
<result property="detailsInformation" column="details_information" />
<result property="detailsKeyWord" column="details_key_word" />
<result property="detailsRemark" column="details_remark" />
<result property="methodType" column="method_type" />
<result property="methodId" column="method_id" />
<result property="moveInformation" column="move_information" />
<result property="pcInformation" column="pc_information" />
</resultMap>
<insert id="insertProcuduct">
INSERT INTO t_product (product_name, product_number, product_examine, brand_id, type_id,
product_subheading, product_information, product_unit, product_weight, product_sort,
promotion_id, product_points, product_growth, product_max_points, product_foreknow,
product_status, product_new, product_recommended, details_title, details_information,
details_key_word, details_remark, method_type, method_id, move_information, pc_information)
VALUES (#{productName}, #{productNumber}, #{productExamine}, #{brandId}, #{typeId}, #{productSubheading},
#{productInformation}, #{productUnit}, #{productWeight}, #{productSort}, #{promotionId},
#{productPoints}, #{productGrowth}, #{productMaxPoints}, #{productForeknow}, #{productStatus},
#{productNew}, #{productRecommended}, #{detailsTitle}, #{detailsInformation}, #{detailsKeyWord},
#{detailsRemark}, #{methodType}, #{methodId}, #{moveInformation}, #{pcInformation})
<insert id="insertProcuduct" useGeneratedKeys="true" keyProperty="id">
INSERT INTO `cargo`.`t_product` (
`product_name`,
`product_number`,
`brand_id`,
`type_id`,
`product_subheading`,
`product_information`,
`product_unit`,
`product_weight`,
`product_sort`,
`product_points`,
`product_growth`,
`product_max_points`,
`product_foreknow`,
`product_staus`,
`product_new`,
`product_recommended`,
`details_title`,
`details_information`,
`details_key_word`,
`details_remark`,
`method_type`,
`create_by`,
`create_time`
)
VALUES
(
#{productName},
#{productNumber},
#{brandId},
#{typeId},
#{productSubheading},
#{productInformation},
#{productUnit},
#{productWeight},
#{productSort},
#{productPoints},
#{productGrowth},
#{productForeknow},
#{productStatus},
#{productNew},
#{productRecommended},
#{detailsTitle},
#{detailsInformation},
#{detailsKeyWord},
#{detailsRemark},
#{methodType},
#{createBy},
now()
);
</insert>
<select id="selectProductById" resultMap="ProductResultMap">
SELECT id, product_name, product_number, product_examine, brand_id, type_id, product_subheading,
product_information, product_unit, product_weight, product_sort, promotion_id, product_points,
product_growth, product_max_points, product_foreknow, product_status, product_new, product_recommended,
details_title, details_information, details_key_word, details_remark, method_type, method_id,
move_information, pc_information
FROM t_product
WHERE id = #{id}
</select>
<select id="findProductNumber" resultType="java.lang.Integer">
SELECT id, product_name, product_number, product_examine, brand_id, type_id, product_subheading,
product_information, product_unit, product_weight, product_sort, promotion_id, product_points,
product_growth, product_max_points, product_foreknow, product_status, product_new, product_recommended,
details_title, details_information, details_key_word, details_remark, method_type, method_id,
move_information, pc_information
FROM t_product
WHERE id = #{id}
</select>
<select id="queryProduct" resultType="com.muyu.product.domain.Product">
SELECT id, product_name, product_number, product_examine, brand_id, type_id, product_subheading,
product_information, product_unit, product_weight, product_sort, promotion_id, product_points,
product_growth, product_max_points, product_foreknow, product_status, product_new, product_recommended,
details_title, details_information, details_key_word, details_remark, method_type, method_id,
move_information, pc_information
FROM t_product
WHERE id = #{id}
</select>
<!-- 添加其他操作方法如插入、更新、删除等 -->
</mapper>