导入pms生成代码

pull/1/head
zhaochencheng 3 years ago
parent 534bb9a877
commit 5bdd19bf6f

@ -0,0 +1,93 @@
package com.cyl.pms.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.cyl.pms.convert.BrandConvert;
import com.cyl.pms.domain.Brand;
import com.cyl.pms.pojo.query.BrandQuery;
import com.cyl.pms.service.BrandService;
import com.cyl.pms.pojo.vo.BrandVO;
import com.ruoyi.common.utils.poi.ExcelUtil;
/**
* Controller
*
* @author zcc
* @date 2022-11-18
*/
@Api(description ="品牌管理接口列表")
@RestController
@RequestMapping("/pms/brand")
public class BrandController extends BaseController {
@Autowired
private BrandService service;
@Autowired
private BrandConvert convert;
@ApiOperation("查询品牌管理列表")
@PreAuthorize("@ss.hasPermi('pms:brand:list')")
@PostMapping("/list")
public ResponseEntity<Page<Brand>> list(@RequestBody BrandQuery query, Pageable page) {
List<Brand> list = service.selectList(query, page);
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
}
@ApiOperation("导出品牌管理列表")
@PreAuthorize("@ss.hasPermi('pms:brand:export')")
@Log(title = "品牌管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public ResponseEntity<String> export(BrandQuery query) {
List<Brand> list = service.selectList(query, null);
ExcelUtil<BrandVO> util = new ExcelUtil<>(BrandVO.class);
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "品牌管理数据"));
}
@ApiOperation("获取品牌管理详细信息")
@PreAuthorize("@ss.hasPermi('pms:brand:query')")
@GetMapping(value = "/{id}")
public ResponseEntity<Brand> getInfo(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.selectById(id));
}
@ApiOperation("新增品牌管理")
@PreAuthorize("@ss.hasPermi('pms:brand:add')")
@Log(title = "品牌管理", businessType = BusinessType.INSERT)
@PostMapping
public ResponseEntity<Integer> add(@RequestBody Brand brand) {
return ResponseEntity.ok(service.insert(brand));
}
@ApiOperation("修改品牌管理")
@PreAuthorize("@ss.hasPermi('pms:brand:edit')")
@Log(title = "品牌管理", businessType = BusinessType.UPDATE)
@PutMapping
public ResponseEntity<Integer> edit(@RequestBody Brand brand) {
return ResponseEntity.ok(service.update(brand));
}
@ApiOperation("删除品牌管理")
@PreAuthorize("@ss.hasPermi('pms:brand:remove')")
@Log(title = "品牌管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
return ResponseEntity.ok(service.deleteByIds(ids));
}
}

@ -0,0 +1,93 @@
package com.cyl.pms.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.cyl.pms.convert.ProductCategoryConvert;
import com.cyl.pms.domain.ProductCategory;
import com.cyl.pms.pojo.query.ProductCategoryQuery;
import com.cyl.pms.service.ProductCategoryService;
import com.cyl.pms.pojo.vo.ProductCategoryVO;
import com.ruoyi.common.utils.poi.ExcelUtil;
/**
* Controller
*
* @author zcc
* @date 2022-11-18
*/
@Api(description ="商品分类接口列表")
@RestController
@RequestMapping("/pms/productCategory")
public class ProductCategoryController extends BaseController {
@Autowired
private ProductCategoryService service;
@Autowired
private ProductCategoryConvert convert;
@ApiOperation("查询商品分类列表")
@PreAuthorize("@ss.hasPermi('pms:productCategory:list')")
@PostMapping("/list")
public ResponseEntity<Page<ProductCategory>> list(@RequestBody ProductCategoryQuery query, Pageable page) {
List<ProductCategory> list = service.selectList(query, page);
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
}
@ApiOperation("导出商品分类列表")
@PreAuthorize("@ss.hasPermi('pms:productCategory:export')")
@Log(title = "商品分类", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public ResponseEntity<String> export(ProductCategoryQuery query) {
List<ProductCategory> list = service.selectList(query, null);
ExcelUtil<ProductCategoryVO> util = new ExcelUtil<>(ProductCategoryVO.class);
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "商品分类数据"));
}
@ApiOperation("获取商品分类详细信息")
@PreAuthorize("@ss.hasPermi('pms:productCategory:query')")
@GetMapping(value = "/{id}")
public ResponseEntity<ProductCategory> getInfo(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.selectById(id));
}
@ApiOperation("新增商品分类")
@PreAuthorize("@ss.hasPermi('pms:productCategory:add')")
@Log(title = "商品分类", businessType = BusinessType.INSERT)
@PostMapping
public ResponseEntity<Integer> add(@RequestBody ProductCategory productCategory) {
return ResponseEntity.ok(service.insert(productCategory));
}
@ApiOperation("修改商品分类")
@PreAuthorize("@ss.hasPermi('pms:productCategory:edit')")
@Log(title = "商品分类", businessType = BusinessType.UPDATE)
@PutMapping
public ResponseEntity<Integer> edit(@RequestBody ProductCategory productCategory) {
return ResponseEntity.ok(service.update(productCategory));
}
@ApiOperation("删除商品分类")
@PreAuthorize("@ss.hasPermi('pms:productCategory:remove')")
@Log(title = "商品分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
return ResponseEntity.ok(service.deleteByIds(ids));
}
}

@ -0,0 +1,93 @@
package com.cyl.pms.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.cyl.pms.convert.ProductConvert;
import com.cyl.pms.domain.Product;
import com.cyl.pms.pojo.query.ProductQuery;
import com.cyl.pms.service.ProductService;
import com.cyl.pms.pojo.vo.ProductVO;
import com.ruoyi.common.utils.poi.ExcelUtil;
/**
* Controller
*
* @author zcc
* @date 2022-11-18
*/
@Api(description ="商品信息接口列表")
@RestController
@RequestMapping("/pms/product")
public class ProductController extends BaseController {
@Autowired
private ProductService service;
@Autowired
private ProductConvert convert;
@ApiOperation("查询商品信息列表")
@PreAuthorize("@ss.hasPermi('pms:product:list')")
@PostMapping("/list")
public ResponseEntity<Page<Product>> list(@RequestBody ProductQuery query, Pageable page) {
List<Product> list = service.selectList(query, page);
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
}
@ApiOperation("导出商品信息列表")
@PreAuthorize("@ss.hasPermi('pms:product:export')")
@Log(title = "商品信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public ResponseEntity<String> export(ProductQuery query) {
List<Product> list = service.selectList(query, null);
ExcelUtil<ProductVO> util = new ExcelUtil<>(ProductVO.class);
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "商品信息数据"));
}
@ApiOperation("获取商品信息详细信息")
@PreAuthorize("@ss.hasPermi('pms:product:query')")
@GetMapping(value = "/{id}")
public ResponseEntity<Product> getInfo(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.selectById(id));
}
@ApiOperation("新增商品信息")
@PreAuthorize("@ss.hasPermi('pms:product:add')")
@Log(title = "商品信息", businessType = BusinessType.INSERT)
@PostMapping
public ResponseEntity<Integer> add(@RequestBody Product product) {
return ResponseEntity.ok(service.insert(product));
}
@ApiOperation("修改商品信息")
@PreAuthorize("@ss.hasPermi('pms:product:edit')")
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
@PutMapping
public ResponseEntity<Integer> edit(@RequestBody Product product) {
return ResponseEntity.ok(service.update(product));
}
@ApiOperation("删除商品信息")
@PreAuthorize("@ss.hasPermi('pms:product:remove')")
@Log(title = "商品信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
return ResponseEntity.ok(service.deleteByIds(ids));
}
}

@ -0,0 +1,93 @@
package com.cyl.pms.controller;
import java.util.List;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Page;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.enums.BusinessType;
import com.cyl.pms.convert.SkuConvert;
import com.cyl.pms.domain.Sku;
import com.cyl.pms.pojo.query.SkuQuery;
import com.cyl.pms.service.SkuService;
import com.cyl.pms.pojo.vo.SkuVO;
import com.ruoyi.common.utils.poi.ExcelUtil;
/**
* skuController
*
* @author zcc
* @date 2022-11-18
*/
@Api(description ="sku信息接口列表")
@RestController
@RequestMapping("/pms/sku")
public class SkuController extends BaseController {
@Autowired
private SkuService service;
@Autowired
private SkuConvert convert;
@ApiOperation("查询sku信息列表")
@PreAuthorize("@ss.hasPermi('pms:sku:list')")
@PostMapping("/list")
public ResponseEntity<Page<Sku>> list(@RequestBody SkuQuery query, Pageable page) {
List<Sku> list = service.selectList(query, page);
return ResponseEntity.ok(new PageImpl<>(list, page, ((com.github.pagehelper.Page)list).getTotal()));
}
@ApiOperation("导出sku信息列表")
@PreAuthorize("@ss.hasPermi('pms:sku:export')")
@Log(title = "sku信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public ResponseEntity<String> export(SkuQuery query) {
List<Sku> list = service.selectList(query, null);
ExcelUtil<SkuVO> util = new ExcelUtil<>(SkuVO.class);
return ResponseEntity.ok(util.writeExcel(convert.dos2vos(list), "sku信息数据"));
}
@ApiOperation("获取sku信息详细信息")
@PreAuthorize("@ss.hasPermi('pms:sku:query')")
@GetMapping(value = "/{id}")
public ResponseEntity<Sku> getInfo(@PathVariable("id") Long id) {
return ResponseEntity.ok(service.selectById(id));
}
@ApiOperation("新增sku信息")
@PreAuthorize("@ss.hasPermi('pms:sku:add')")
@Log(title = "sku信息", businessType = BusinessType.INSERT)
@PostMapping
public ResponseEntity<Integer> add(@RequestBody Sku sku) {
return ResponseEntity.ok(service.insert(sku));
}
@ApiOperation("修改sku信息")
@PreAuthorize("@ss.hasPermi('pms:sku:edit')")
@Log(title = "sku信息", businessType = BusinessType.UPDATE)
@PutMapping
public ResponseEntity<Integer> edit(@RequestBody Sku sku) {
return ResponseEntity.ok(service.update(sku));
}
@ApiOperation("删除sku信息")
@PreAuthorize("@ss.hasPermi('pms:sku:remove')")
@Log(title = "sku信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public ResponseEntity<Integer> remove(@PathVariable Long[] ids) {
return ResponseEntity.ok(service.deleteByIds(ids));
}
}

@ -0,0 +1,16 @@
package com.cyl.pms.convert;
import org.mapstruct.Mapper;
import com.cyl.pms.domain.Brand;
import com.cyl.pms.pojo.vo.BrandVO;
import java.util.List;
/**
* DO <=> DTO <=> VO / BO / Query
*
* @author zcc
*/
@Mapper(componentModel = "spring")
public interface BrandConvert {
List<BrandVO> dos2vos(List<Brand> list);
}

@ -0,0 +1,16 @@
package com.cyl.pms.convert;
import org.mapstruct.Mapper;
import com.cyl.pms.domain.ProductCategory;
import com.cyl.pms.pojo.vo.ProductCategoryVO;
import java.util.List;
/**
* DO <=> DTO <=> VO / BO / Query
*
* @author zcc
*/
@Mapper(componentModel = "spring")
public interface ProductCategoryConvert {
List<ProductCategoryVO> dos2vos(List<ProductCategory> list);
}

@ -0,0 +1,16 @@
package com.cyl.pms.convert;
import org.mapstruct.Mapper;
import com.cyl.pms.domain.Product;
import com.cyl.pms.pojo.vo.ProductVO;
import java.util.List;
/**
* DO <=> DTO <=> VO / BO / Query
*
* @author zcc
*/
@Mapper(componentModel = "spring")
public interface ProductConvert {
List<ProductVO> dos2vos(List<Product> list);
}

@ -0,0 +1,16 @@
package com.cyl.pms.convert;
import org.mapstruct.Mapper;
import com.cyl.pms.domain.Sku;
import com.cyl.pms.pojo.vo.SkuVO;
import java.util.List;
/**
* sku DO <=> DTO <=> VO / BO / Query
*
* @author zcc
*/
@Mapper(componentModel = "spring")
public interface SkuConvert {
List<SkuVO> dos2vos(List<Sku> list);
}

@ -0,0 +1,42 @@
package com.cyl.pms.domain;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* pms_brand
*
* @author zcc
*/
@ApiModel(description="品牌管理对象")
@Data
@TableName("pms_brand")
public class Brand extends BaseAudit {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("NAME")
@Excel(name = "NAME")
private String name;
@ApiModelProperty("SORT")
@Excel(name = "SORT")
private Integer sort;
@ApiModelProperty("SHOW_STATUS")
@Excel(name = "SHOW_STATUS")
private Integer showStatus;
@ApiModelProperty("品牌logo")
@Excel(name = "品牌logo")
private String logo;
@ApiModelProperty("删除标识")
private Integer delFlag;
}

@ -0,0 +1,87 @@
package com.cyl.pms.domain;
import java.math.BigDecimal;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* pms_product
*
* @author zcc
*/
@ApiModel(description="商品信息对象")
@Data
@TableName("pms_product")
public class Product extends BaseAudit {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("BRAND_ID")
@Excel(name = "BRAND_ID")
private Long brandId;
@ApiModelProperty("CATEGORY_ID")
@Excel(name = "CATEGORY_ID")
private Long categoryId;
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String outProductId;
@ApiModelProperty("NAME")
@Excel(name = "NAME")
private String name;
@ApiModelProperty("主图")
@Excel(name = "主图")
private String pic;
@ApiModelProperty("画册图片连产品图片限制为5张以逗号分割")
@Excel(name = "画册图片连产品图片限制为5张以逗号分割")
private String albumPics;
@ApiModelProperty("上架状态0->下架1->上架")
@Excel(name = "上架状态0->下架1->上架")
private Integer publishStatus;
@ApiModelProperty("排序")
@Excel(name = "排序")
private Integer sort;
@ApiModelProperty("PRICE")
@Excel(name = "PRICE")
private BigDecimal price;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("商品重量,默认为克")
@Excel(name = "商品重量,默认为克")
private BigDecimal weight;
@ApiModelProperty("产品详情网页内容")
@Excel(name = "产品详情网页内容")
private String detailHtml;
@ApiModelProperty("移动端网页详情")
@Excel(name = "移动端网页详情")
private String detailMobileHtml;
@ApiModelProperty("品牌名称")
@Excel(name = "品牌名称")
private String brandName;
@ApiModelProperty("商品分类名称")
@Excel(name = "商品分类名称")
private String productCategoryName;
@ApiModelProperty("删除标识")
private Integer delFlag;
}

@ -0,0 +1,50 @@
package com.cyl.pms.domain;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* pms_product_category
*
* @author zcc
*/
@ApiModel(description="商品分类对象")
@Data
@TableName("pms_product_category")
public class ProductCategory extends BaseAudit {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("上机分类的编号0表示一级分类")
@Excel(name = "上机分类的编号0表示一级分类")
private Long parentId;
@ApiModelProperty("NAME")
@Excel(name = "NAME")
private String name;
@ApiModelProperty("分类级别0->1级1->2级")
@Excel(name = "分类级别0->1级1->2级")
private Integer level;
@ApiModelProperty("显示状态0->不显示1->显示")
@Excel(name = "显示状态0->不显示1->显示")
private Integer showStatus;
@ApiModelProperty("SORT")
@Excel(name = "SORT")
private Integer sort;
@ApiModelProperty("图标")
@Excel(name = "图标")
private String icon;
@ApiModelProperty("删除标识")
private Integer delFlag;
}

@ -0,0 +1,47 @@
package com.cyl.pms.domain;
import java.math.BigDecimal;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
/**
* sku pms_sku
*
* @author zcc
*/
@ApiModel(description="sku信息对象")
@Data
@TableName("pms_sku")
public class Sku extends BaseAudit {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
private Long id;
@ApiModelProperty("PRODUCT_ID")
@Excel(name = "PRODUCT_ID")
private Long productId;
@ApiModelProperty("sku编码")
@Excel(name = "sku编码")
private String outSkuId;
@ApiModelProperty("PRICE")
@Excel(name = "PRICE")
private BigDecimal price;
@ApiModelProperty("展示图片")
@Excel(name = "展示图片")
private String pic;
@ApiModelProperty("商品销售属性json格式")
@Excel(name = "商品销售属性json格式")
private String spData;
@ApiModelProperty("删除标识")
private Integer delFlag;
}

@ -0,0 +1,28 @@
package com.cyl.pms.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.cyl.pms.domain.Brand;
/**
* Mapper
*
* @author zcc
*/
public interface BrandMapper extends BaseMapper<Brand> {
/**
*
*
* @param brand
* @return
*/
List<Brand> selectByEntity(Brand brand);
/**
*
* @param ids
* @return
*/
int updateDelFlagByIds(@Param("ids") Long[] ids);
}

@ -0,0 +1,28 @@
package com.cyl.pms.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.cyl.pms.domain.ProductCategory;
/**
* Mapper
*
* @author zcc
*/
public interface ProductCategoryMapper extends BaseMapper<ProductCategory> {
/**
*
*
* @param productCategory
* @return
*/
List<ProductCategory> selectByEntity(ProductCategory productCategory);
/**
*
* @param ids
* @return
*/
int updateDelFlagByIds(@Param("ids") Long[] ids);
}

@ -0,0 +1,28 @@
package com.cyl.pms.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.cyl.pms.domain.Product;
/**
* Mapper
*
* @author zcc
*/
public interface ProductMapper extends BaseMapper<Product> {
/**
*
*
* @param product
* @return
*/
List<Product> selectByEntity(Product product);
/**
*
* @param ids
* @return
*/
int updateDelFlagByIds(@Param("ids") Long[] ids);
}

@ -0,0 +1,28 @@
package com.cyl.pms.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import com.cyl.pms.domain.Sku;
/**
* skuMapper
*
* @author zcc
*/
public interface SkuMapper extends BaseMapper<Sku> {
/**
* sku
*
* @param sku sku
* @return sku
*/
List<Sku> selectByEntity(Sku sku);
/**
*
* @param ids
* @return
*/
int updateDelFlagByIds(@Param("ids") Long[] ids);
}

@ -0,0 +1,27 @@
package com.cyl.pms.pojo.query;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author zcc
*/
@ApiModel(description="品牌管理 查询 对象")
@Data
public class BrandQuery {
@ApiModelProperty("NAME 精确匹配")
private String nameLike;
@ApiModelProperty("SORT 精确匹配")
private Integer sort;
@ApiModelProperty("SHOW_STATUS 精确匹配")
private Integer showStatus;
@ApiModelProperty("品牌logo 精确匹配")
private String logo;
}

@ -0,0 +1,33 @@
package com.cyl.pms.pojo.query;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author zcc
*/
@ApiModel(description="商品分类 查询 对象")
@Data
public class ProductCategoryQuery {
@ApiModelProperty("上机分类的编号0表示一级分类 精确匹配")
private Long parentId;
@ApiModelProperty("NAME 精确匹配")
private String nameLike;
@ApiModelProperty("分类级别0->1级1->2级 精确匹配")
private Integer level;
@ApiModelProperty("显示状态0->不显示1->显示 精确匹配")
private Integer showStatus;
@ApiModelProperty("SORT 精确匹配")
private Integer sort;
@ApiModelProperty("图标 精确匹配")
private String icon;
}

@ -0,0 +1,61 @@
package com.cyl.pms.pojo.query;
import java.math.BigDecimal;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
*
*
* @author zcc
*/
@ApiModel(description="商品信息 查询 对象")
@Data
public class ProductQuery {
@ApiModelProperty("BRAND_ID 精确匹配")
private Long brandId;
@ApiModelProperty("CATEGORY_ID 精确匹配")
private Long categoryId;
@ApiModelProperty("商品编码 精确匹配")
private String outProductId;
@ApiModelProperty("NAME 精确匹配")
private String nameLike;
@ApiModelProperty("主图 精确匹配")
private String pic;
@ApiModelProperty("画册图片连产品图片限制为5张以逗号分割 精确匹配")
private String albumPics;
@ApiModelProperty("上架状态0->下架1->上架 精确匹配")
private Integer publishStatus;
@ApiModelProperty("排序 精确匹配")
private Integer sort;
@ApiModelProperty("PRICE 精确匹配")
private BigDecimal price;
@ApiModelProperty("单位 精确匹配")
private String unit;
@ApiModelProperty("商品重量,默认为克 精确匹配")
private BigDecimal weight;
@ApiModelProperty("产品详情网页内容 精确匹配")
private String detailHtml;
@ApiModelProperty("移动端网页详情 精确匹配")
private String detailMobileHtml;
@ApiModelProperty("品牌名称 精确匹配")
private String brandNameLike;
@ApiModelProperty("商品分类名称 精确匹配")
private String productCategoryNameLike;
}

@ -0,0 +1,31 @@
package com.cyl.pms.pojo.query;
import java.math.BigDecimal;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* sku
*
* @author zcc
*/
@ApiModel(description="sku信息 查询 对象")
@Data
public class SkuQuery {
@ApiModelProperty("PRODUCT_ID 精确匹配")
private Long productId;
@ApiModelProperty("sku编码 精确匹配")
private String outSkuId;
@ApiModelProperty("PRICE 精确匹配")
private BigDecimal price;
@ApiModelProperty("展示图片 精确匹配")
private String pic;
@ApiModelProperty("商品销售属性json格式 精确匹配")
private String spData;
}

@ -0,0 +1,28 @@
package com.cyl.pms.pojo.vo;
import com.ruoyi.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
/**
*
*
* @author zcc
*/
@Data
public class BrandVO extends BaseAudit {
/** ID */
private Long id;
/** NAME */
@Excel(name = "NAME")
private String name;
/** SORT */
@Excel(name = "SORT")
private Integer sort;
/** SHOW_STATUS */
@Excel(name = "SHOW_STATUS")
private Integer showStatus;
/** 品牌logo */
@Excel(name = "品牌logo")
private String logo;
}

@ -0,0 +1,34 @@
package com.cyl.pms.pojo.vo;
import com.ruoyi.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
/**
*
*
* @author zcc
*/
@Data
public class ProductCategoryVO extends BaseAudit {
/** ID */
private Long id;
/** 上机分类的编号0表示一级分类 */
@Excel(name = "上机分类的编号0表示一级分类")
private Long parentId;
/** NAME */
@Excel(name = "NAME")
private String name;
/** 分类级别0->1级1->2级 */
@Excel(name = "分类级别0->1级1->2级")
private Integer level;
/** 显示状态0->不显示1->显示 */
@Excel(name = "显示状态0->不显示1->显示")
private Integer showStatus;
/** SORT */
@Excel(name = "SORT")
private Integer sort;
/** 图标 */
@Excel(name = "图标")
private String icon;
}

@ -0,0 +1,62 @@
package com.cyl.pms.pojo.vo;
import java.math.BigDecimal;
import com.ruoyi.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
/**
*
*
* @author zcc
*/
@Data
public class ProductVO extends BaseAudit {
/** ID */
private Long id;
/** BRAND_ID */
@Excel(name = "BRAND_ID")
private Long brandId;
/** CATEGORY_ID */
@Excel(name = "CATEGORY_ID")
private Long categoryId;
/** 商品编码 */
@Excel(name = "商品编码")
private String outProductId;
/** NAME */
@Excel(name = "NAME")
private String name;
/** 主图 */
@Excel(name = "主图")
private String pic;
/** 画册图片连产品图片限制为5张以逗号分割 */
@Excel(name = "画册图片连产品图片限制为5张以逗号分割")
private String albumPics;
/** 上架状态0->下架1->上架 */
@Excel(name = "上架状态0->下架1->上架")
private Integer publishStatus;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** PRICE */
@Excel(name = "PRICE")
private BigDecimal price;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 商品重量,默认为克 */
@Excel(name = "商品重量,默认为克")
private BigDecimal weight;
/** 产品详情网页内容 */
@Excel(name = "产品详情网页内容")
private String detailHtml;
/** 移动端网页详情 */
@Excel(name = "移动端网页详情")
private String detailMobileHtml;
/** 品牌名称 */
@Excel(name = "品牌名称")
private String brandName;
/** 商品分类名称 */
@Excel(name = "商品分类名称")
private String productCategoryName;
}

@ -0,0 +1,32 @@
package com.cyl.pms.pojo.vo;
import java.math.BigDecimal;
import com.ruoyi.common.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseAudit;
import lombok.Data;
/**
* sku
*
* @author zcc
*/
@Data
public class SkuVO extends BaseAudit {
/** ID */
private Long id;
/** PRODUCT_ID */
@Excel(name = "PRODUCT_ID")
private Long productId;
/** sku编码 */
@Excel(name = "sku编码")
private String outSkuId;
/** PRICE */
@Excel(name = "PRICE")
private BigDecimal price;
/** 展示图片 */
@Excel(name = "展示图片")
private String pic;
/** 商品销售属性json格式 */
@Excel(name = "商品销售属性json格式")
private String spData;
}

@ -0,0 +1,111 @@
package com.cyl.pms.service;
import java.util.Arrays;
import java.util.List;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.cyl.pms.mapper.BrandMapper;
import com.cyl.pms.domain.Brand;
import com.cyl.pms.pojo.query.BrandQuery;
/**
* Service
*
*
* @author zcc
*/
@Service
public class BrandService {
@Autowired
private BrandMapper brandMapper;
/**
*
*
* @param id
* @return
*/
public Brand selectById(Long id) {
return brandMapper.selectById(id);
}
/**
*
*
* @param query
* @param page
* @return
*/
public List<Brand> selectList(BrandQuery query, Pageable page) {
if (page != null) {
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
}
QueryWrapper<Brand> qw = new QueryWrapper<>();
qw.eq("del_flag",0);
String nameLike = query.getNameLike();
if (!StringUtils.isEmpty(nameLike)) {
qw.like("name", nameLike);
}
Integer sort = query.getSort();
if (sort != null) {
qw.eq("sort", sort);
}
Integer showStatus = query.getShowStatus();
if (showStatus != null) {
qw.eq("show_status", showStatus);
}
String logo = query.getLogo();
if (!StringUtils.isEmpty(logo)) {
qw.eq("logo", logo);
}
return brandMapper.selectList(qw);
}
/**
*
*
* @param brand
* @return
*/
public int insert(Brand brand) {
brand.setDelFlag(0);
brand.setCreateTime(LocalDateTime.now());
return brandMapper.insert(brand);
}
/**
*
*
* @param brand
* @return
*/
public int update(Brand brand) {
return brandMapper.updateById(brand);
}
/**
*
*
* @param ids
* @return
*/
public int deleteByIds(Long[] ids) {
return brandMapper.updateDelFlagByIds(ids);
}
/**
*
*
* @param id
* @return
*/
public int deleteById(Long id) {
Long[] ids = {id};
return brandMapper.updateDelFlagByIds(ids);
}
}

@ -0,0 +1,119 @@
package com.cyl.pms.service;
import java.util.Arrays;
import java.util.List;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.cyl.pms.mapper.ProductCategoryMapper;
import com.cyl.pms.domain.ProductCategory;
import com.cyl.pms.pojo.query.ProductCategoryQuery;
/**
* Service
*
*
* @author zcc
*/
@Service
public class ProductCategoryService {
@Autowired
private ProductCategoryMapper productCategoryMapper;
/**
*
*
* @param id
* @return
*/
public ProductCategory selectById(Long id) {
return productCategoryMapper.selectById(id);
}
/**
*
*
* @param query
* @param page
* @return
*/
public List<ProductCategory> selectList(ProductCategoryQuery query, Pageable page) {
if (page != null) {
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
}
QueryWrapper<ProductCategory> qw = new QueryWrapper<>();
qw.eq("del_flag",0);
Long parentId = query.getParentId();
if (parentId != null) {
qw.eq("parent_id", parentId);
}
String nameLike = query.getNameLike();
if (!StringUtils.isEmpty(nameLike)) {
qw.like("name", nameLike);
}
Integer level = query.getLevel();
if (level != null) {
qw.eq("level", level);
}
Integer showStatus = query.getShowStatus();
if (showStatus != null) {
qw.eq("show_status", showStatus);
}
Integer sort = query.getSort();
if (sort != null) {
qw.eq("sort", sort);
}
String icon = query.getIcon();
if (!StringUtils.isEmpty(icon)) {
qw.eq("icon", icon);
}
return productCategoryMapper.selectList(qw);
}
/**
*
*
* @param productCategory
* @return
*/
public int insert(ProductCategory productCategory) {
productCategory.setDelFlag(0);
productCategory.setCreateTime(LocalDateTime.now());
return productCategoryMapper.insert(productCategory);
}
/**
*
*
* @param productCategory
* @return
*/
public int update(ProductCategory productCategory) {
return productCategoryMapper.updateById(productCategory);
}
/**
*
*
* @param ids
* @return
*/
public int deleteByIds(Long[] ids) {
return productCategoryMapper.updateDelFlagByIds(ids);
}
/**
*
*
* @param id
* @return
*/
public int deleteById(Long id) {
Long[] ids = {id};
return productCategoryMapper.updateDelFlagByIds(ids);
}
}

@ -0,0 +1,156 @@
package com.cyl.pms.service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.cyl.pms.mapper.ProductMapper;
import com.cyl.pms.domain.Product;
import com.cyl.pms.pojo.query.ProductQuery;
/**
* Service
*
*
* @author zcc
*/
@Service
public class ProductService {
@Autowired
private ProductMapper productMapper;
/**
*
*
* @param id
* @return
*/
public Product selectById(Long id) {
return productMapper.selectById(id);
}
/**
*
*
* @param query
* @param page
* @return
*/
public List<Product> selectList(ProductQuery query, Pageable page) {
if (page != null) {
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
}
QueryWrapper<Product> qw = new QueryWrapper<>();
qw.eq("del_flag",0);
Long brandId = query.getBrandId();
if (brandId != null) {
qw.eq("brand_id", brandId);
}
Long categoryId = query.getCategoryId();
if (categoryId != null) {
qw.eq("category_id", categoryId);
}
String outProductId = query.getOutProductId();
if (!StringUtils.isEmpty(outProductId)) {
qw.eq("out_product_id", outProductId);
}
String nameLike = query.getNameLike();
if (!StringUtils.isEmpty(nameLike)) {
qw.like("name", nameLike);
}
String pic = query.getPic();
if (!StringUtils.isEmpty(pic)) {
qw.eq("pic", pic);
}
String albumPics = query.getAlbumPics();
if (!StringUtils.isEmpty(albumPics)) {
qw.eq("album_pics", albumPics);
}
Integer publishStatus = query.getPublishStatus();
if (publishStatus != null) {
qw.eq("publish_status", publishStatus);
}
Integer sort = query.getSort();
if (sort != null) {
qw.eq("sort", sort);
}
BigDecimal price = query.getPrice();
if (price != null) {
qw.eq("price", price);
}
String unit = query.getUnit();
if (!StringUtils.isEmpty(unit)) {
qw.eq("unit", unit);
}
BigDecimal weight = query.getWeight();
if (weight != null) {
qw.eq("weight", weight);
}
String detailHtml = query.getDetailHtml();
if (!StringUtils.isEmpty(detailHtml)) {
qw.eq("detail_html", detailHtml);
}
String detailMobileHtml = query.getDetailMobileHtml();
if (!StringUtils.isEmpty(detailMobileHtml)) {
qw.eq("detail_mobile_html", detailMobileHtml);
}
String brandNameLike = query.getBrandNameLike();
if (!StringUtils.isEmpty(brandNameLike)) {
qw.like("brand_name", brandNameLike);
}
String productCategoryNameLike = query.getProductCategoryNameLike();
if (!StringUtils.isEmpty(productCategoryNameLike)) {
qw.like("product_category_name", productCategoryNameLike);
}
return productMapper.selectList(qw);
}
/**
*
*
* @param product
* @return
*/
public int insert(Product product) {
product.setDelFlag(0);
product.setCreateTime(LocalDateTime.now());
return productMapper.insert(product);
}
/**
*
*
* @param product
* @return
*/
public int update(Product product) {
return productMapper.updateById(product);
}
/**
*
*
* @param ids
* @return
*/
public int deleteByIds(Long[] ids) {
return productMapper.updateDelFlagByIds(ids);
}
/**
*
*
* @param id
* @return
*/
public int deleteById(Long id) {
Long[] ids = {id};
return productMapper.updateDelFlagByIds(ids);
}
}

@ -0,0 +1,116 @@
package com.cyl.pms.service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import com.cyl.pms.mapper.SkuMapper;
import com.cyl.pms.domain.Sku;
import com.cyl.pms.pojo.query.SkuQuery;
/**
* skuService
*
*
* @author zcc
*/
@Service
public class SkuService {
@Autowired
private SkuMapper skuMapper;
/**
* sku
*
* @param id sku
* @return sku
*/
public Sku selectById(Long id) {
return skuMapper.selectById(id);
}
/**
* sku
*
* @param query
* @param page
* @return sku
*/
public List<Sku> selectList(SkuQuery query, Pageable page) {
if (page != null) {
PageHelper.startPage(page.getPageNumber() + 1, page.getPageSize());
}
QueryWrapper<Sku> qw = new QueryWrapper<>();
qw.eq("del_flag",0);
Long productId = query.getProductId();
if (productId != null) {
qw.eq("product_id", productId);
}
String outSkuId = query.getOutSkuId();
if (!StringUtils.isEmpty(outSkuId)) {
qw.eq("out_sku_id", outSkuId);
}
BigDecimal price = query.getPrice();
if (price != null) {
qw.eq("price", price);
}
String pic = query.getPic();
if (!StringUtils.isEmpty(pic)) {
qw.eq("pic", pic);
}
String spData = query.getSpData();
if (!StringUtils.isEmpty(spData)) {
qw.eq("sp_data", spData);
}
return skuMapper.selectList(qw);
}
/**
* sku
*
* @param sku sku
* @return
*/
public int insert(Sku sku) {
sku.setDelFlag(0);
sku.setCreateTime(LocalDateTime.now());
return skuMapper.insert(sku);
}
/**
* sku
*
* @param sku sku
* @return
*/
public int update(Sku sku) {
return skuMapper.updateById(sku);
}
/**
* sku
*
* @param ids sku
* @return
*/
public int deleteByIds(Long[] ids) {
return skuMapper.updateDelFlagByIds(ids);
}
/**
* sku
*
* @param id sku
* @return
*/
public int deleteById(Long id) {
Long[] ids = {id};
return skuMapper.updateDelFlagByIds(ids);
}
}

@ -0,0 +1,44 @@
<?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.cyl.pms.mapper.BrandMapper">
<resultMap type="Brand" id="BrandResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="sort" column="sort"/>
<result property="showStatus" column="show_status"/>
<result property="logo" column="logo"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBrandVo">
select id, name, sort, show_status, logo, del_flag, create_by, create_time, update_by, update_time from pms_brand
</sql>
<select id="selectByEntity" parameterType="Brand" resultMap="BrandResult">
<include refid="selectBrandVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="showStatus != null "> and show_status = #{showStatus}</if>
<if test="logo != null and logo != ''"> and logo = #{logo}</if>
</where>
</select>
<update id="updateDelFlagByIds">
update pms_brand set del_flag=1
<where>
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
</where>
</update>
</mapper>

@ -0,0 +1,48 @@
<?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.cyl.pms.mapper.ProductCategoryMapper">
<resultMap type="ProductCategory" id="ProductCategoryResult">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="name" column="name"/>
<result property="level" column="level"/>
<result property="showStatus" column="show_status"/>
<result property="sort" column="sort"/>
<result property="icon" column="icon"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectProductCategoryVo">
select id, parent_id, name, level, show_status, sort, icon, del_flag, create_by, create_time, update_by, update_time from pms_product_category
</sql>
<select id="selectByEntity" parameterType="ProductCategory" resultMap="ProductCategoryResult">
<include refid="selectProductCategoryVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="level != null "> and level = #{level}</if>
<if test="showStatus != null "> and show_status = #{showStatus}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="icon != null and icon != ''"> and icon = #{icon}</if>
</where>
</select>
<update id="updateDelFlagByIds">
update pms_product_category set del_flag=1
<where>
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
</where>
</update>
</mapper>

@ -0,0 +1,66 @@
<?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.cyl.pms.mapper.ProductMapper">
<resultMap type="Product" id="ProductResult">
<result property="id" column="id"/>
<result property="brandId" column="brand_id"/>
<result property="categoryId" column="category_id"/>
<result property="outProductId" column="out_product_id"/>
<result property="name" column="name"/>
<result property="pic" column="pic"/>
<result property="albumPics" column="album_pics"/>
<result property="publishStatus" column="publish_status"/>
<result property="sort" column="sort"/>
<result property="price" column="price"/>
<result property="unit" column="unit"/>
<result property="weight" column="weight"/>
<result property="detailHtml" column="detail_html"/>
<result property="detailMobileHtml" column="detail_mobile_html"/>
<result property="brandName" column="brand_name"/>
<result property="productCategoryName" column="product_category_name"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectProductVo">
select id, brand_id, category_id, out_product_id, name, pic, album_pics, publish_status, sort, price, unit, weight, detail_html, detail_mobile_html, brand_name, product_category_name, del_flag, create_by, create_time, update_by, update_time from pms_product
</sql>
<select id="selectByEntity" parameterType="Product" resultMap="ProductResult">
<include refid="selectProductVo"/>
<where>
<if test="brandId != null "> and brand_id = #{brandId}</if>
<if test="categoryId != null "> and category_id = #{categoryId}</if>
<if test="outProductId != null and outProductId != ''"> and out_product_id = #{outProductId}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
<if test="albumPics != null and albumPics != ''"> and album_pics = #{albumPics}</if>
<if test="publishStatus != null "> and publish_status = #{publishStatus}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="price != null "> and price = #{price}</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="weight != null "> and weight = #{weight}</if>
<if test="detailHtml != null and detailHtml != ''"> and detail_html = #{detailHtml}</if>
<if test="detailMobileHtml != null and detailMobileHtml != ''"> and detail_mobile_html = #{detailMobileHtml}</if>
<if test="brandName != null and brandName != ''"> and brand_name like concat('%', #{brandName}, '%')</if>
<if test="productCategoryName != null and productCategoryName != ''"> and product_category_name like concat('%', #{productCategoryName}, '%')</if>
</where>
</select>
<update id="updateDelFlagByIds">
update pms_product set del_flag=1
<where>
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
</where>
</update>
</mapper>

@ -0,0 +1,46 @@
<?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.cyl.pms.mapper.SkuMapper">
<resultMap type="Sku" id="SkuResult">
<result property="id" column="id"/>
<result property="productId" column="product_id"/>
<result property="outSkuId" column="out_sku_id"/>
<result property="price" column="price"/>
<result property="pic" column="pic"/>
<result property="spData" column="sp_data"/>
<result property="delFlag" column="del_flag"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSkuVo">
select id, product_id, out_sku_id, price, pic, sp_data, del_flag, create_by, create_time, update_by, update_time from pms_sku
</sql>
<select id="selectByEntity" parameterType="Sku" resultMap="SkuResult">
<include refid="selectSkuVo"/>
<where>
<if test="productId != null "> and product_id = #{productId}</if>
<if test="outSkuId != null and outSkuId != ''"> and out_sku_id = #{outSkuId}</if>
<if test="price != null "> and price = #{price}</if>
<if test="pic != null and pic != ''"> and pic = #{pic}</if>
<if test="spData != null and spData != ''"> and sp_data = #{spData}</if>
</where>
</select>
<update id="updateDelFlagByIds">
update pms_sku set del_flag=1
<where>
id in <foreach collection="ids" open="(" item="it" close=")" separator=",">#{it}</foreach>
</where>
</update>
</mapper>

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理', '3', '1', 'brand', 'pms/brand/index', 1, 0, 'C', '0', '0', 'pms:brand:list', '#', 1, sysdate(), '', null, '品牌管理菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:query', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:add', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:edit', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:remove', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品牌管理导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:brand:export', '#', 1, sysdate(), '', null, '');

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息', '3', '1', 'product', 'pms/product/index', 1, 0, 'C', '0', '0', 'pms:product:list', '#', 1, sysdate(), '', null, '商品信息菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:product:query', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:product:add', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:product:edit', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:product:remove', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品信息导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:product:export', '#', 1, sysdate(), '', null, '');

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类', '3', '1', 'productCategory', 'pms/productCategory/index', 1, 0, 'C', '0', '0', 'pms:productCategory:list', '#', 1, sysdate(), '', null, '商品分类菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:query', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:add', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:edit', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:remove', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('商品分类导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:productCategory:export', '#', 1, sysdate(), '', null, '');

@ -0,0 +1,22 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息', '3', '1', 'sku', 'pms/sku/index', 1, 0, 'C', '0', '0', 'pms:sku:list', '#', 1, sysdate(), '', null, 'sku信息菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:query', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:add', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:edit', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:remove', '#', 1, sysdate(), '', null, '');
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
values('sku信息导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'pms:sku:export', '#', 1, sysdate(), '', null, '');
Loading…
Cancel
Save