dev798
parent
3e688b8fb4
commit
8db83ee2fb
|
@ -1,39 +1,261 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:54
|
||||
* 商品信息对象 mall_product_info
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class MallProductInfo extends BaseEntity {
|
||||
|
||||
@NoArgsConstructor
|
||||
public class MallProductInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 商品id */
|
||||
private Long productId;
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 商品名称 */
|
||||
@Excel(name = "商品名称")
|
||||
private String productName;
|
||||
private String name;
|
||||
|
||||
/** 商品货号 */
|
||||
@Excel(name = "商品货号")
|
||||
private String productNumber;
|
||||
/** 商品描述 */
|
||||
@Excel(name = "商品描述")
|
||||
private String productDesc;
|
||||
|
||||
/** 商品类型 */
|
||||
@Excel(name = "商品类型")
|
||||
private String type;
|
||||
|
||||
/** 冗余字段 */
|
||||
@Excel(name = "冗余字段")
|
||||
private String typeIds;
|
||||
|
||||
/** 商品主图 */
|
||||
@Excel(name = "商品主图")
|
||||
private String img;
|
||||
|
||||
/** 商品轮播图 */
|
||||
@Excel(name = "商品轮播图")
|
||||
private String carouselImages;
|
||||
|
||||
/** 商品评论数 */
|
||||
@Excel(name = "商品评论数")
|
||||
private Long commentCount;
|
||||
|
||||
/** 商品收藏人气 */
|
||||
@Excel(name = "商品收藏人气")
|
||||
private Long collectCount;
|
||||
|
||||
/** 品牌信息 */
|
||||
@Excel(name = "品牌信息")
|
||||
private String brand;
|
||||
|
||||
/** 商品状态 */
|
||||
@Excel(name = "商品状态")
|
||||
private String status;
|
||||
|
||||
/** 单位 */
|
||||
@Excel(name = "单位")
|
||||
private String productUnit;
|
||||
private String unit;
|
||||
|
||||
/** 搜索关键字 */
|
||||
@Excel(name = "搜索关键字")
|
||||
private String keywords;
|
||||
|
||||
/** 规格信息 */
|
||||
@Excel(name = "规格信息")
|
||||
private Long ruleId;
|
||||
|
||||
/** 乐观锁 */
|
||||
@Excel(name = "乐观锁")
|
||||
private Long revision;
|
||||
|
||||
private Integer pageSize=10;
|
||||
|
||||
private Integer pageNum=1;
|
||||
|
||||
/** 0:添加商品信息 1:添加规格信息 2:添加描述信息 */
|
||||
@Excel(name = "0:添加商品信息 1:添加规格信息 2:添加描述信息")
|
||||
private String step;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setProductDesc(String productDesc)
|
||||
{
|
||||
this.productDesc = productDesc;
|
||||
}
|
||||
|
||||
public String getProductDesc()
|
||||
{
|
||||
return productDesc;
|
||||
}
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
public void setTypeIds(String typeIds)
|
||||
{
|
||||
this.typeIds = typeIds;
|
||||
}
|
||||
|
||||
public String getTypeIds()
|
||||
{
|
||||
return typeIds;
|
||||
}
|
||||
public void setImg(String img)
|
||||
{
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getImg()
|
||||
{
|
||||
return img;
|
||||
}
|
||||
public void setCarouselImages(String carouselImages)
|
||||
{
|
||||
this.carouselImages = carouselImages;
|
||||
}
|
||||
|
||||
public String getCarouselImages()
|
||||
{
|
||||
return carouselImages;
|
||||
}
|
||||
public void setCommentCount(Long commentCount)
|
||||
{
|
||||
this.commentCount = commentCount;
|
||||
}
|
||||
|
||||
public Long getCommentCount()
|
||||
{
|
||||
return commentCount;
|
||||
}
|
||||
public void setCollectCount(Long collectCount)
|
||||
{
|
||||
this.collectCount = collectCount;
|
||||
}
|
||||
|
||||
public Long getCollectCount()
|
||||
{
|
||||
return collectCount;
|
||||
}
|
||||
public void setBrand(String brand)
|
||||
{
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getBrand()
|
||||
{
|
||||
return brand;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
public void setUnit(String unit)
|
||||
{
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getUnit()
|
||||
{
|
||||
return unit;
|
||||
}
|
||||
public void setKeywords(String keywords)
|
||||
{
|
||||
this.keywords = keywords;
|
||||
}
|
||||
|
||||
public String getKeywords()
|
||||
{
|
||||
return keywords;
|
||||
}
|
||||
public void setRuleId(Long ruleId)
|
||||
{
|
||||
this.ruleId = ruleId;
|
||||
}
|
||||
|
||||
public Long getRuleId()
|
||||
{
|
||||
return ruleId;
|
||||
}
|
||||
public void setRevision(Long revision)
|
||||
{
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public Long getRevision()
|
||||
{
|
||||
return revision;
|
||||
}
|
||||
public void setStep(String step)
|
||||
{
|
||||
this.step = step;
|
||||
}
|
||||
|
||||
public String getStep()
|
||||
{
|
||||
return step;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("productDesc", getProductDesc())
|
||||
.append("type", getType())
|
||||
.append("typeIds", getTypeIds())
|
||||
.append("img", getImg())
|
||||
.append("carouselImages", getCarouselImages())
|
||||
.append("commentCount", getCommentCount())
|
||||
.append("collectCount", getCollectCount())
|
||||
.append("brand", getBrand())
|
||||
.append("status", getStatus())
|
||||
.append("unit", getUnit())
|
||||
.append("keywords", getKeywords())
|
||||
.append("ruleId", getRuleId())
|
||||
.append("revision", getRevision())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("step", getStep())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
package com.nuyu.product.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 商品规格详情对象 mall_product_rule_attr_info
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MallProductRuleAttrInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 规格 */
|
||||
@Excel(name = "规格")
|
||||
private Long ruleId;
|
||||
|
||||
/** 类目名称 */
|
||||
@Excel(name = "类目名称")
|
||||
private String name;
|
||||
|
||||
/** 规格值 */
|
||||
@Excel(name = "规格值")
|
||||
private String attrValue;
|
||||
|
||||
/** 乐观锁 */
|
||||
@Excel(name = "乐观锁")
|
||||
private Long revision;
|
||||
|
||||
public void setId(Long id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setRuleId(Long ruleId)
|
||||
{
|
||||
this.ruleId = ruleId;
|
||||
}
|
||||
|
||||
public Long getRuleId()
|
||||
{
|
||||
return ruleId;
|
||||
}
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
public void setAttrValue(String attrValue)
|
||||
{
|
||||
this.attrValue = attrValue;
|
||||
}
|
||||
|
||||
public String getAttrValue()
|
||||
{
|
||||
return attrValue;
|
||||
}
|
||||
public void setRevision(Long revision)
|
||||
{
|
||||
this.revision = revision;
|
||||
}
|
||||
|
||||
public Long getRevision()
|
||||
{
|
||||
return revision;
|
||||
}
|
||||
|
||||
private Integer pageSize=10;
|
||||
|
||||
private Integer pageNum=1;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("ruleId", getRuleId())
|
||||
.append("name", getName())
|
||||
.append("attrValue", getAttrValue())
|
||||
.append("revision", getRevision())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,53 +1,108 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
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 javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
* 商品信息Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/info")
|
||||
public class MallProductInfoController {
|
||||
|
||||
public class MallProductInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private MallProductInfoService mallProductInfoService;
|
||||
|
||||
|
||||
@ApiOperation("查询商品列表")
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:list")
|
||||
@GetMapping("/list")
|
||||
@RequiresPermissions("product:info:list")
|
||||
public AjaxResult list(BookReq bookReq){
|
||||
PageInfo<MallProductInfo> info=mallProductInfoService.list(bookReq);
|
||||
public AjaxResult list(MallProductInfo mallProductRuleAttrInfo){
|
||||
PageInfo<MallProductInfo> info=mallProductInfoService.list(mallProductRuleAttrInfo);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
@ApiOperation("导出商品列表")
|
||||
|
||||
/**
|
||||
* 导出商品信息列表
|
||||
*/
|
||||
@RequiresPermissions("product:info:export")
|
||||
@Log(title = "商品",businessType = BusinessType.EXPORT)
|
||||
@Log(title = "商品信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MallProductInfo mallProductInfo){
|
||||
List<MallProductInfo> list=mallProductInfoService.selectMallProductInfoList(mallProductInfo);
|
||||
public void export(HttpServletResponse response, MallProductInfo mallProductInfo)
|
||||
{
|
||||
List<MallProductInfo> list = mallProductInfoService.selectMallProductInfoList(mallProductInfo);
|
||||
ExcelUtil<MallProductInfo> util = new ExcelUtil<MallProductInfo>(MallProductInfo.class);
|
||||
util.exportExcel(response, list, "商品品牌数据");
|
||||
util.exportExcel(response, list, "商品信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品信息详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(mallProductInfoService.selectMallProductInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品信息
|
||||
*/
|
||||
@RequiresPermissions("product:info:add")
|
||||
@Log(title = "商品信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody MallProductInfo mallProductInfo)
|
||||
{
|
||||
return toAjax(mallProductInfoService.insertMallProductInfo(mallProductInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*/
|
||||
@RequiresPermissions("product:info:edit")
|
||||
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody MallProductInfo mallProductInfo)
|
||||
{
|
||||
return toAjax(mallProductInfoService.updateMallProductInfo(mallProductInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*/
|
||||
@RequiresPermissions("product:info:remove")
|
||||
@Log(title = "商品信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(mallProductInfoService.deleteMallProductInfoByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.domain.AjaxResult;
|
||||
import com.muyu.product.service.MallProductRuleAttrInfoService;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
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.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 商品规格详情Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attrInfo")
|
||||
public class MallProductRuleAttrInfoController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private MallProductRuleAttrInfoService mallProductRuleAttrInfoService;
|
||||
|
||||
/**
|
||||
* 查询商品规格详情列表
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:list")
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(MallProductRuleAttrInfo mallProductRuleAttrInfo){
|
||||
PageInfo<MallProductRuleAttrInfo> info=mallProductRuleAttrInfoService.list(mallProductRuleAttrInfo);
|
||||
return AjaxResult.success(info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出商品规格详情列表
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:export")
|
||||
@Log(title = "商品规格详情", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
List<MallProductRuleAttrInfo> list = mallProductRuleAttrInfoService.selectMallProductRuleAttrInfoList(mallProductRuleAttrInfo);
|
||||
ExcelUtil<MallProductRuleAttrInfo> util = new ExcelUtil<MallProductRuleAttrInfo>(MallProductRuleAttrInfo.class);
|
||||
util.exportExcel(response, list, "商品规格详情数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品规格详情详细信息
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(mallProductRuleAttrInfoService.selectMallProductRuleAttrInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品规格详情
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:add")
|
||||
@Log(title = "商品规格详情", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public Result add(@RequestBody MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
return toAjax(mallProductRuleAttrInfoService.insertMallProductRuleAttrInfo(mallProductRuleAttrInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格详情
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:edit")
|
||||
@Log(title = "商品规格详情", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public Result edit(@RequestBody MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
return toAjax(mallProductRuleAttrInfoService.updateMallProductRuleAttrInfo(mallProductRuleAttrInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格详情
|
||||
*/
|
||||
@RequiresPermissions("product:attrInfo:remove")
|
||||
@Log(title = "商品规格详情", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public Result remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(mallProductRuleAttrInfoService.deleteMallProductRuleAttrInfoByIds(ids));
|
||||
}
|
||||
}
|
|
@ -1,19 +1,65 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
* 商品信息Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductInfoMapper {
|
||||
public interface MallProductInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询商品信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 商品信息
|
||||
*/
|
||||
public MallProductInfo selectMallProductInfoById(Long id);
|
||||
|
||||
List<MallProductInfo> list(BookReq bookReq);
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 商品信息集合
|
||||
*/
|
||||
public List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
|
||||
List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
/**
|
||||
* 新增商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductInfo(MallProductInfo mallProductInfo);
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductInfo(MallProductInfo mallProductInfo);
|
||||
|
||||
/**
|
||||
* 删除商品信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除商品信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductInfo> list(MallProductInfo mallProductRuleAttrInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 商品规格详情Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-29
|
||||
*/
|
||||
@Mapper
|
||||
public interface MallProductRuleAttrInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询商品规格详情
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 商品规格详情
|
||||
*/
|
||||
public MallProductRuleAttrInfo selectMallProductRuleAttrInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商品规格详情列表
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 商品规格详情集合
|
||||
*/
|
||||
public List<MallProductRuleAttrInfo> selectMallProductRuleAttrInfoList(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 新增商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 修改商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 删除商品规格详情
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductRuleAttrInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除商品规格详情
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductRuleAttrInfoByIds(Long[] ids);
|
||||
|
||||
List<MallProductRuleAttrInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
}
|
|
@ -1,36 +1,110 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.product.mapper.MallProductInfoMapper;
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.product.service.MallProductInfoService;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.domain.MallProductTypeInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.MallProductInfoMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
* 商品信息Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
@Service
|
||||
public class MallProductInfoServiceImpl implements MallProductInfoService {
|
||||
|
||||
public class MallProductInfoServiceImpl implements MallProductInfoService
|
||||
{
|
||||
@Autowired
|
||||
private MallProductInfoMapper mallProductInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 商品信息
|
||||
*/
|
||||
@Override
|
||||
public PageInfo<MallProductInfo> list(BookReq bookReq) {
|
||||
PageHelper.startPage(bookReq.getPageNum(), bookReq.getPageSize());
|
||||
List<MallProductInfo>list=mallProductInfoMapper.list(bookReq);
|
||||
PageInfo<MallProductInfo>pageInfo=new PageInfo<>(list);
|
||||
return pageInfo;
|
||||
public MallProductInfo selectMallProductInfoById(Long id)
|
||||
{
|
||||
return mallProductInfoMapper.selectMallProductInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 商品信息
|
||||
*/
|
||||
@Override
|
||||
public List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo)
|
||||
{
|
||||
return mallProductInfoMapper.selectMallProductInfoList(mallProductInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMallProductInfo(MallProductInfo mallProductInfo)
|
||||
{
|
||||
mallProductInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return mallProductInfoMapper.insertMallProductInfo(mallProductInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMallProductInfo(MallProductInfo mallProductInfo)
|
||||
{
|
||||
mallProductInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return mallProductInfoMapper.updateMallProductInfo(mallProductInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品信息
|
||||
*
|
||||
* @param ids 需要删除的商品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductInfoByIds(Long[] ids)
|
||||
{
|
||||
return mallProductInfoMapper.deleteMallProductInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品信息信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductInfoById(Long id)
|
||||
{
|
||||
return mallProductInfoMapper.deleteMallProductInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo) {
|
||||
return mallProductInfoMapper.selectMallProductInfoList(mallProductInfo);
|
||||
public PageInfo<MallProductInfo> list(MallProductInfo mallProductRuleAttrInfo) {
|
||||
PageHelper.startPage(mallProductRuleAttrInfo.getPageNum(),mallProductRuleAttrInfo.getPageSize());
|
||||
List<MallProductInfo> products = mallProductInfoMapper.list(mallProductRuleAttrInfo);
|
||||
PageInfo<MallProductInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,110 @@
|
|||
package com.muyu.product.service.Impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.utils.DateUtils;
|
||||
import com.muyu.product.service.MallProductRuleAttrInfoService;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.domain.MallProductRuleInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.MallProductRuleAttrInfoMapper;
|
||||
|
||||
/**
|
||||
* 商品规格详情Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-29
|
||||
*/
|
||||
@Service
|
||||
public class MallProductRuleAttrInfoServiceImpl implements MallProductRuleAttrInfoService
|
||||
{
|
||||
@Autowired
|
||||
private MallProductRuleAttrInfoMapper mallProductRuleAttrInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询商品规格详情
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 商品规格详情
|
||||
*/
|
||||
@Override
|
||||
public MallProductRuleAttrInfo selectMallProductRuleAttrInfoById(Long id)
|
||||
{
|
||||
return mallProductRuleAttrInfoMapper.selectMallProductRuleAttrInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品规格详情列表
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 商品规格详情
|
||||
*/
|
||||
@Override
|
||||
public List<MallProductRuleAttrInfo> selectMallProductRuleAttrInfoList(MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
return mallProductRuleAttrInfoMapper.selectMallProductRuleAttrInfoList(mallProductRuleAttrInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
mallProductRuleAttrInfo.setCreateTime(DateUtils.getNowDate());
|
||||
return mallProductRuleAttrInfoMapper.insertMallProductRuleAttrInfo(mallProductRuleAttrInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo)
|
||||
{
|
||||
mallProductRuleAttrInfo.setUpdateTime(DateUtils.getNowDate());
|
||||
return mallProductRuleAttrInfoMapper.updateMallProductRuleAttrInfo(mallProductRuleAttrInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品规格详情
|
||||
*
|
||||
* @param ids 需要删除的商品规格详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductRuleAttrInfoByIds(Long[] ids)
|
||||
{
|
||||
return mallProductRuleAttrInfoMapper.deleteMallProductRuleAttrInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品规格详情信息
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMallProductRuleAttrInfoById(Long id)
|
||||
{
|
||||
return mallProductRuleAttrInfoMapper.deleteMallProductRuleAttrInfoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MallProductRuleAttrInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo) {
|
||||
PageHelper.startPage(mallProductRuleAttrInfo.getPageNum(),mallProductRuleAttrInfo.getPageSize());
|
||||
List<MallProductRuleAttrInfo> products = mallProductRuleAttrInfoMapper.list(mallProductRuleAttrInfo);
|
||||
PageInfo<MallProductRuleAttrInfo> pageInfo = new PageInfo<>(products);
|
||||
return pageInfo;
|
||||
}
|
||||
}
|
|
@ -1,19 +1,68 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.domain.MallProductBrandInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author: wangxinyuan
|
||||
* @Date: 2024/4/28 下午7:22
|
||||
* 商品信息Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-05-06
|
||||
*/
|
||||
public interface MallProductInfoService {
|
||||
public interface MallProductInfoService
|
||||
{
|
||||
/**
|
||||
* 查询商品信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 商品信息
|
||||
*/
|
||||
public MallProductInfo selectMallProductInfoById(Long id);
|
||||
|
||||
PageInfo<MallProductInfo> list(BookReq bookReq);
|
||||
/**
|
||||
* 查询商品信息列表
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 商品信息集合
|
||||
*/
|
||||
public List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
|
||||
/**
|
||||
* 新增商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductInfo(MallProductInfo mallProductInfo);
|
||||
|
||||
/**
|
||||
* 修改商品信息
|
||||
*
|
||||
* @param mallProductInfo 商品信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductInfo(MallProductInfo mallProductInfo);
|
||||
|
||||
/**
|
||||
* 批量删除商品信息
|
||||
*
|
||||
* @param ids 需要删除的商品信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除商品信息信息
|
||||
*
|
||||
* @param id 商品信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductInfoById(Long id);
|
||||
|
||||
//列表
|
||||
PageInfo<MallProductInfo> list(MallProductInfo mallProductRuleAttrInfo);
|
||||
|
||||
List<MallProductInfo> selectMallProductInfoList(MallProductInfo mallProductInfo);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,68 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.nuyu.product.domain.MallProductInfo;
|
||||
import com.nuyu.product.domain.MallProductRuleAttrInfo;
|
||||
import com.nuyu.product.req.BookReq;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 商品规格详情Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-04-29
|
||||
*/
|
||||
public interface MallProductRuleAttrInfoService
|
||||
{
|
||||
/**
|
||||
* 查询商品规格详情
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 商品规格详情
|
||||
*/
|
||||
public MallProductRuleAttrInfo selectMallProductRuleAttrInfoById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商品规格详情列表
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 商品规格详情集合
|
||||
*/
|
||||
public List<MallProductRuleAttrInfo> selectMallProductRuleAttrInfoList(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 新增商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 修改商品规格详情
|
||||
*
|
||||
* @param mallProductRuleAttrInfo 商品规格详情
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMallProductRuleAttrInfo(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
|
||||
/**
|
||||
* 批量删除商品规格详情
|
||||
*
|
||||
* @param ids 需要删除的商品规格详情主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductRuleAttrInfoByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除商品规格详情信息
|
||||
*
|
||||
* @param id 商品规格详情主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMallProductRuleAttrInfoById(Long id);
|
||||
|
||||
PageInfo<MallProductRuleAttrInfo> list(MallProductRuleAttrInfo mallProductRuleAttrInfo);
|
||||
}
|
|
@ -1,20 +1,129 @@
|
|||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.MallProductInfoMapper">
|
||||
|
||||
<sql id="selectMallProductTypeInfoVo">
|
||||
select id, product_name , product_number , product_unit from t_product
|
||||
<resultMap type="com.nuyu.product.domain.MallProductInfo" id="MallProductInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="productDesc" column="product_desc" />
|
||||
<result property="type" column="type" />
|
||||
<result property="typeIds" column="type_ids" />
|
||||
<result property="img" column="img" />
|
||||
<result property="carouselImages" column="carousel_images" />
|
||||
<result property="commentCount" column="comment_count" />
|
||||
<result property="collectCount" column="collect_count" />
|
||||
<result property="brand" column="brand" />
|
||||
<result property="status" column="status" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="keywords" column="keywords" />
|
||||
<result property="ruleId" column="rule_id" />
|
||||
<result property="revision" column="revision" />
|
||||
<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="step" column="step" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMallProductInfoVo">
|
||||
select id, name, product_desc, type, type_ids, img, carousel_images, comment_count, collect_count, brand, status, unit, keywords, rule_id, revision, create_by, create_time, update_by, update_time, step from mall_product_info
|
||||
</sql>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.domain.MallProductInfo">
|
||||
<include refid="selectMallProductTypeInfoVo"/>
|
||||
<select id="selectMallProductInfoList" parameterType="com.nuyu.product.domain.MallProductInfo" resultMap="MallProductInfoResult">
|
||||
<include refid="selectMallProductInfoVo"/>
|
||||
<where>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="step != null and step != ''"> and step = #{step}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMallProductInfoList" resultType="com.nuyu.product.domain.MallProductInfo">
|
||||
<include refid="selectMallProductTypeInfoVo"/>
|
||||
<select id="selectMallProductInfoById" parameterType="Long" resultMap="MallProductInfoResult">
|
||||
<include refid="selectMallProductInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertMallProductInfo" parameterType="com.nuyu.product.domain.MallProductInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mall_product_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="productDesc != null">product_desc,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="typeIds != null">type_ids,</if>
|
||||
<if test="img != null">img,</if>
|
||||
<if test="carouselImages != null">carousel_images,</if>
|
||||
<if test="commentCount != null">comment_count,</if>
|
||||
<if test="collectCount != null">collect_count,</if>
|
||||
<if test="brand != null">brand,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="keywords != null">keywords,</if>
|
||||
<if test="ruleId != null">rule_id,</if>
|
||||
<if test="revision != null">revision,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="step != null">step,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="productDesc != null">#{productDesc},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="typeIds != null">#{typeIds},</if>
|
||||
<if test="img != null">#{img},</if>
|
||||
<if test="carouselImages != null">#{carouselImages},</if>
|
||||
<if test="commentCount != null">#{commentCount},</if>
|
||||
<if test="collectCount != null">#{collectCount},</if>
|
||||
<if test="brand != null">#{brand},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="keywords != null">#{keywords},</if>
|
||||
<if test="ruleId != null">#{ruleId},</if>
|
||||
<if test="revision != null">#{revision},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="step != null">#{step},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMallProductInfo" parameterType="com.nuyu.product.domain.MallProductInfo">
|
||||
update mall_product_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="productDesc != null">product_desc = #{productDesc},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="typeIds != null">type_ids = #{typeIds},</if>
|
||||
<if test="img != null">img = #{img},</if>
|
||||
<if test="carouselImages != null">carousel_images = #{carouselImages},</if>
|
||||
<if test="commentCount != null">comment_count = #{commentCount},</if>
|
||||
<if test="collectCount != null">collect_count = #{collectCount},</if>
|
||||
<if test="brand != null">brand = #{brand},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="keywords != null">keywords = #{keywords},</if>
|
||||
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||
<if test="revision != null">revision = #{revision},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="step != null">step = #{step},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMallProductInfoById" parameterType="Long">
|
||||
delete from mall_product_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMallProductInfoByIds" parameterType="String">
|
||||
delete from mall_product_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
<?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.MallProductRuleAttrInfoMapper">
|
||||
|
||||
<resultMap type="com.nuyu.product.domain.MallProductRuleAttrInfo" id="MallProductRuleAttrInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="ruleId" column="rule_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="attrValue" column="attr_value" />
|
||||
<result property="revision" column="revision" />
|
||||
<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="selectMallProductRuleAttrInfoVo">
|
||||
select id, rule_id, name, attr_value, revision, create_by, create_time, update_by, update_time from mall_product_rule_attr_info
|
||||
</sql>
|
||||
|
||||
<select id="selectMallProductRuleAttrInfoList" parameterType="com.nuyu.product.domain.MallProductRuleAttrInfo" resultMap="MallProductRuleAttrInfoResult">
|
||||
<include refid="selectMallProductRuleAttrInfoVo"/>
|
||||
<where>
|
||||
<if test="ruleId != null "> and rule_id = #{ruleId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="attrValue != null and attrValue != ''"> and attr_value = #{attrValue}</if>
|
||||
<if test="revision != null "> and revision = #{revision}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMallProductRuleAttrInfoById" parameterType="Long" resultMap="MallProductRuleAttrInfoResult">
|
||||
<include refid="selectMallProductRuleAttrInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="com.nuyu.product.domain.MallProductRuleAttrInfo">
|
||||
<include refid="selectMallProductRuleAttrInfoVo"/>
|
||||
<where>
|
||||
<if test="ruleId != null "> and rule_id = #{ruleId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="attrValue != null and attrValue != ''"> and attr_value = #{attrValue}</if>
|
||||
<if test="revision != null "> and revision = #{revision}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<insert id="insertMallProductRuleAttrInfo" parameterType="com.nuyu.product.domain.MallProductRuleAttrInfo" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into mall_product_rule_attr_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleId != null">rule_id,</if>
|
||||
<if test="name != null">name,</if>
|
||||
<if test="attrValue != null">attr_value,</if>
|
||||
<if test="revision != null">revision,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="ruleId != null">#{ruleId},</if>
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="attrValue != null">#{attrValue},</if>
|
||||
<if test="revision != null">#{revision},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMallProductRuleAttrInfo" parameterType="com.nuyu.product.domain.MallProductRuleAttrInfo">
|
||||
update mall_product_rule_attr_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="ruleId != null">rule_id = #{ruleId},</if>
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="attrValue != null">attr_value = #{attrValue},</if>
|
||||
<if test="revision != null">revision = #{revision},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMallProductRuleAttrInfoById" parameterType="Long">
|
||||
delete from mall_product_rule_attr_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMallProductRuleAttrInfoByIds" parameterType="String">
|
||||
delete from mall_product_rule_attr_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue