14 changed files with 4291 additions and 0 deletions
@ -0,0 +1,98 @@ |
|||||
|
package cc.hiver.mall.controller; |
||||
|
|
||||
|
import cc.hiver.core.common.utils.ResultUtil; |
||||
|
import cc.hiver.core.common.vo.Result; |
||||
|
import cc.hiver.mall.entity.Recommend; |
||||
|
import cc.hiver.mall.entity.RecommendDetail; |
||||
|
import cc.hiver.mall.pojo.vo.RecommendVo; |
||||
|
import cc.hiver.mall.service.mybatis.RecommendDetailService; |
||||
|
import cc.hiver.mall.service.mybatis.RecommendService; |
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import io.swagger.annotations.ApiParam; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMethod; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Slf4j |
||||
|
@RestController |
||||
|
@Api(tags = "推荐单接口") |
||||
|
@RequestMapping(value = "/hiver/app/recommend/") |
||||
|
@Transactional |
||||
|
public class RecommendController { |
||||
|
|
||||
|
@Autowired |
||||
|
private RecommendService recommendService; |
||||
|
|
||||
|
@Autowired |
||||
|
private RecommendDetailService recommendDetailService; |
||||
|
|
||||
|
@RequestMapping(value = "/save", method = RequestMethod.POST) |
||||
|
@ApiOperation(value = "新增推荐单") |
||||
|
@Transactional |
||||
|
public Result save(RecommendVo recommendVo) { |
||||
|
Recommend recommend = recommendVo.getRecommend(); |
||||
|
List<RecommendDetail> recommendDetailList = recommendVo.getRecommendDetailList(); |
||||
|
boolean result = recommendService.save(recommend); |
||||
|
if (result && recommendDetailList != null && recommendDetailList.size() > 0) { |
||||
|
for (RecommendDetail recommendDetail : recommendDetailList) { |
||||
|
recommendDetail.setRecommendId(recommend.getId()); |
||||
|
} |
||||
|
result = recommendDetailService.saveBatch(recommendDetailList); |
||||
|
if (result){ |
||||
|
return ResultUtil.success("添加成功"); |
||||
|
} |
||||
|
} |
||||
|
return ResultUtil.error("添加失败"); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/edit", method = RequestMethod.POST) |
||||
|
@ApiOperation(value = "根据id修改推荐单") |
||||
|
public Result updateSpuById(RecommendVo recommendVo) { |
||||
|
Recommend recommend = recommendVo.getRecommend(); |
||||
|
List<RecommendDetail> recommendDetailList = recommendVo.getRecommendDetailList(); |
||||
|
boolean result = recommendService.updateById(recommend); |
||||
|
if (result && recommendDetailList != null && recommendDetailList.size() > 0) { |
||||
|
QueryWrapper<RecommendDetail> queryWrapper = new QueryWrapper<>(); |
||||
|
queryWrapper.eq("recommend_id",recommend.getId()); |
||||
|
recommendDetailService.remove(queryWrapper); |
||||
|
for (RecommendDetail recommendDetail : recommendDetailList) { |
||||
|
recommendDetail.setRecommendId(recommend.getId()); |
||||
|
} |
||||
|
result = recommendDetailService.saveBatch(recommendDetailList); |
||||
|
} |
||||
|
if (result){ |
||||
|
return ResultUtil.success("修改成功"); |
||||
|
}else { |
||||
|
return ResultUtil.error("修改失败"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/delById", method = RequestMethod.POST) |
||||
|
@ApiOperation(value = "根据id删除推荐单") |
||||
|
public Result delete(String id) { |
||||
|
recommendService.removeById(id); |
||||
|
QueryWrapper<RecommendDetail> queryWrapper = new QueryWrapper<>(); |
||||
|
queryWrapper.eq("recommend_id", id); |
||||
|
recommendDetailService.remove(queryWrapper); |
||||
|
return ResultUtil.success("删除成功"); |
||||
|
} |
||||
|
|
||||
|
@RequestMapping(value = "/list", method = RequestMethod.GET) |
||||
|
@ApiOperation(value = "查询列表") |
||||
|
public Result list() { |
||||
|
QueryWrapper<Recommend> queryWrapper = new QueryWrapper<>(); |
||||
|
List<Recommend> list = recommendService.list(queryWrapper); |
||||
|
return new ResultUtil<List<Recommend>>().setData(list); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package cc.hiver.mall.dao.mapper; |
||||
|
|
||||
|
import cc.hiver.mall.entity.RecommendDetail; |
||||
|
import cc.hiver.mall.entity.RecommendDetailExample; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
@Repository |
||||
|
public interface RecommendDetailMapper extends BaseMapper<RecommendDetail> { |
||||
|
long countByExample(RecommendDetailExample example); |
||||
|
|
||||
|
int deleteByExample(RecommendDetailExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(String id); |
||||
|
|
||||
|
int insert(RecommendDetail record); |
||||
|
|
||||
|
int insertSelective(RecommendDetail record); |
||||
|
|
||||
|
List<RecommendDetail> selectByExample(RecommendDetailExample example); |
||||
|
|
||||
|
RecommendDetail selectByPrimaryKey(String id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") RecommendDetail record, @Param("example") RecommendDetailExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") RecommendDetail record, @Param("example") RecommendDetailExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(RecommendDetail record); |
||||
|
|
||||
|
int updateByPrimaryKey(RecommendDetail record); |
||||
|
} |
||||
@ -0,0 +1,33 @@ |
|||||
|
package cc.hiver.mall.dao.mapper; |
||||
|
|
||||
|
import cc.hiver.mall.entity.Recommend; |
||||
|
import cc.hiver.mall.entity.RecommendExample; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
import java.util.List; |
||||
|
@Repository |
||||
|
public interface RecommendMapper extends BaseMapper<Recommend> { |
||||
|
long countByExample(RecommendExample example); |
||||
|
|
||||
|
int deleteByExample(RecommendExample example); |
||||
|
|
||||
|
int deleteByPrimaryKey(String id); |
||||
|
|
||||
|
int insert(Recommend record); |
||||
|
|
||||
|
int insertSelective(Recommend record); |
||||
|
|
||||
|
List<Recommend> selectByExample(RecommendExample example); |
||||
|
|
||||
|
Recommend selectByPrimaryKey(String id); |
||||
|
|
||||
|
int updateByExampleSelective(@Param("record") Recommend record, @Param("example") RecommendExample example); |
||||
|
|
||||
|
int updateByExample(@Param("record") Recommend record, @Param("example") RecommendExample example); |
||||
|
|
||||
|
int updateByPrimaryKeySelective(Recommend record); |
||||
|
|
||||
|
int updateByPrimaryKey(Recommend record); |
||||
|
} |
||||
@ -0,0 +1,212 @@ |
|||||
|
package cc.hiver.mall.entity; |
||||
|
|
||||
|
import cc.hiver.core.common.utils.SnowFlakeUtil; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
@ApiModel(value = "推荐单主表") |
||||
|
@TableName(value = "t_recommend", autoResultMap = true) |
||||
|
public class Recommend implements Serializable { |
||||
|
private String id = "TJ" + SnowFlakeUtil.nextId().toString(); |
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "客户ID") |
||||
|
private String userId; |
||||
|
|
||||
|
@ApiModelProperty(value = "店铺ID") |
||||
|
private String shopId; |
||||
|
|
||||
|
@ApiModelProperty(value = "订单金额") |
||||
|
private BigDecimal totalAmount; |
||||
|
|
||||
|
@ApiModelProperty(value = "折扣") |
||||
|
private BigDecimal discount; |
||||
|
|
||||
|
@ApiModelProperty(value = "优惠金额") |
||||
|
private BigDecimal discountAmount; |
||||
|
|
||||
|
@ApiModelProperty(value = "实收金额") |
||||
|
private BigDecimal realAmount; |
||||
|
|
||||
|
@ApiModelProperty(value = "收货地址") |
||||
|
private String receiveAddress; |
||||
|
|
||||
|
@ApiModelProperty(value = "省") |
||||
|
private String province; |
||||
|
|
||||
|
@ApiModelProperty(value = "市") |
||||
|
private String city; |
||||
|
|
||||
|
@ApiModelProperty(value = "区县") |
||||
|
private String area; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Date createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public Integer getDelFlag() { |
||||
|
return delFlag; |
||||
|
} |
||||
|
|
||||
|
public void setDelFlag(Integer delFlag) { |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateTime() { |
||||
|
return updateTime; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateTime(Date updateTime) { |
||||
|
this.updateTime = updateTime; |
||||
|
} |
||||
|
|
||||
|
public String getUserId() { |
||||
|
return userId; |
||||
|
} |
||||
|
|
||||
|
public void setUserId(String userId) { |
||||
|
this.userId = userId; |
||||
|
} |
||||
|
|
||||
|
public String getShopId() { |
||||
|
return shopId; |
||||
|
} |
||||
|
|
||||
|
public void setShopId(String shopId) { |
||||
|
this.shopId = shopId; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getTotalAmount() { |
||||
|
return totalAmount; |
||||
|
} |
||||
|
|
||||
|
public void setTotalAmount(BigDecimal totalAmount) { |
||||
|
this.totalAmount = totalAmount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getDiscount() { |
||||
|
return discount; |
||||
|
} |
||||
|
|
||||
|
public void setDiscount(BigDecimal discount) { |
||||
|
this.discount = discount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getDiscountAmount() { |
||||
|
return discountAmount; |
||||
|
} |
||||
|
|
||||
|
public void setDiscountAmount(BigDecimal discountAmount) { |
||||
|
this.discountAmount = discountAmount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getRealAmount() { |
||||
|
return realAmount; |
||||
|
} |
||||
|
|
||||
|
public void setRealAmount(BigDecimal realAmount) { |
||||
|
this.realAmount = realAmount; |
||||
|
} |
||||
|
|
||||
|
public String getReceiveAddress() { |
||||
|
return receiveAddress; |
||||
|
} |
||||
|
|
||||
|
public void setReceiveAddress(String receiveAddress) { |
||||
|
this.receiveAddress = receiveAddress; |
||||
|
} |
||||
|
|
||||
|
public String getProvince() { |
||||
|
return province; |
||||
|
} |
||||
|
|
||||
|
public void setProvince(String province) { |
||||
|
this.province = province; |
||||
|
} |
||||
|
|
||||
|
public String getCity() { |
||||
|
return city; |
||||
|
} |
||||
|
|
||||
|
public void setCity(String city) { |
||||
|
this.city = city; |
||||
|
} |
||||
|
|
||||
|
public String getArea() { |
||||
|
return area; |
||||
|
} |
||||
|
|
||||
|
public void setArea(String area) { |
||||
|
this.area = area; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", createBy=").append(createBy); |
||||
|
sb.append(", createTime=").append(createTime); |
||||
|
sb.append(", delFlag=").append(delFlag); |
||||
|
sb.append(", updateBy=").append(updateBy); |
||||
|
sb.append(", updateTime=").append(updateTime); |
||||
|
sb.append(", userId=").append(userId); |
||||
|
sb.append(", shopId=").append(shopId); |
||||
|
sb.append(", totalAmount=").append(totalAmount); |
||||
|
sb.append(", discount=").append(discount); |
||||
|
sb.append(", discountAmount=").append(discountAmount); |
||||
|
sb.append(", realAmount=").append(realAmount); |
||||
|
sb.append(", receiveAddress=").append(receiveAddress); |
||||
|
sb.append(", province=").append(province); |
||||
|
sb.append(", city=").append(city); |
||||
|
sb.append(", area=").append(area); |
||||
|
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,260 @@ |
|||||
|
package cc.hiver.mall.entity; |
||||
|
|
||||
|
import cc.hiver.core.common.utils.SnowFlakeUtil; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.Date; |
||||
|
@ApiModel(value = "推荐单明细表") |
||||
|
@TableName(value = "t_recommend_detail", autoResultMap = true) |
||||
|
public class RecommendDetail implements Serializable { |
||||
|
private String id = SnowFlakeUtil.nextId().toString(); |
||||
|
|
||||
|
private String createBy; |
||||
|
|
||||
|
private Date createTime; |
||||
|
|
||||
|
private Integer delFlag; |
||||
|
|
||||
|
private String updateBy; |
||||
|
|
||||
|
private Date updateTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "推荐单ID") |
||||
|
private String recommendId; |
||||
|
|
||||
|
@ApiModelProperty(value = "商品ID") |
||||
|
private String productId; |
||||
|
|
||||
|
@ApiModelProperty(value = "商品名称") |
||||
|
private String productName; |
||||
|
|
||||
|
@ApiModelProperty(value = "单位") |
||||
|
private String unit; |
||||
|
|
||||
|
@ApiModelProperty(value = "店铺ID") |
||||
|
private String shopId; |
||||
|
|
||||
|
@ApiModelProperty(value = "商品分类") |
||||
|
private String categoryId; |
||||
|
|
||||
|
@ApiModelProperty(value = "商品属性列表") |
||||
|
private String attributeList; |
||||
|
|
||||
|
@ApiModelProperty(value = "市场价") |
||||
|
private BigDecimal price; |
||||
|
|
||||
|
@ApiModelProperty(value = "采购价") |
||||
|
private BigDecimal purchasePrice; |
||||
|
|
||||
|
@ApiModelProperty(value = "批发价") |
||||
|
private BigDecimal wholesalePrice; |
||||
|
|
||||
|
@ApiModelProperty(value = "销售数量") |
||||
|
private Integer productCount; |
||||
|
|
||||
|
@ApiModelProperty(value = "折扣") |
||||
|
private BigDecimal discount; |
||||
|
|
||||
|
@ApiModelProperty(value = "优惠金额") |
||||
|
private BigDecimal discountAmount; |
||||
|
|
||||
|
@ApiModelProperty(value = "实际价格") |
||||
|
private BigDecimal realPrice; |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
public String getId() { |
||||
|
return id; |
||||
|
} |
||||
|
|
||||
|
public void setId(String id) { |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public String getCreateBy() { |
||||
|
return createBy; |
||||
|
} |
||||
|
|
||||
|
public void setCreateBy(String createBy) { |
||||
|
this.createBy = createBy; |
||||
|
} |
||||
|
|
||||
|
public Date getCreateTime() { |
||||
|
return createTime; |
||||
|
} |
||||
|
|
||||
|
public void setCreateTime(Date createTime) { |
||||
|
this.createTime = createTime; |
||||
|
} |
||||
|
|
||||
|
public Integer getDelFlag() { |
||||
|
return delFlag; |
||||
|
} |
||||
|
|
||||
|
public void setDelFlag(Integer delFlag) { |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public String getUpdateBy() { |
||||
|
return updateBy; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateBy(String updateBy) { |
||||
|
this.updateBy = updateBy; |
||||
|
} |
||||
|
|
||||
|
public Date getUpdateTime() { |
||||
|
return updateTime; |
||||
|
} |
||||
|
|
||||
|
public void setUpdateTime(Date updateTime) { |
||||
|
this.updateTime = updateTime; |
||||
|
} |
||||
|
|
||||
|
public String getRecommendId() { |
||||
|
return recommendId; |
||||
|
} |
||||
|
|
||||
|
public void setRecommendId(String recommendId) { |
||||
|
this.recommendId = recommendId; |
||||
|
} |
||||
|
|
||||
|
public String getProductId() { |
||||
|
return productId; |
||||
|
} |
||||
|
|
||||
|
public void setProductId(String productId) { |
||||
|
this.productId = productId; |
||||
|
} |
||||
|
|
||||
|
public String getProductName() { |
||||
|
return productName; |
||||
|
} |
||||
|
|
||||
|
public void setProductName(String productName) { |
||||
|
this.productName = productName; |
||||
|
} |
||||
|
|
||||
|
public String getUnit() { |
||||
|
return unit; |
||||
|
} |
||||
|
|
||||
|
public void setUnit(String unit) { |
||||
|
this.unit = unit; |
||||
|
} |
||||
|
|
||||
|
public String getShopId() { |
||||
|
return shopId; |
||||
|
} |
||||
|
|
||||
|
public void setShopId(String shopId) { |
||||
|
this.shopId = shopId; |
||||
|
} |
||||
|
|
||||
|
public String getCategoryId() { |
||||
|
return categoryId; |
||||
|
} |
||||
|
|
||||
|
public void setCategoryId(String categoryId) { |
||||
|
this.categoryId = categoryId; |
||||
|
} |
||||
|
|
||||
|
public String getAttributeList() { |
||||
|
return attributeList; |
||||
|
} |
||||
|
|
||||
|
public void setAttributeList(String attributeList) { |
||||
|
this.attributeList = attributeList; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getPrice() { |
||||
|
return price; |
||||
|
} |
||||
|
|
||||
|
public void setPrice(BigDecimal price) { |
||||
|
this.price = price; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getPurchasePrice() { |
||||
|
return purchasePrice; |
||||
|
} |
||||
|
|
||||
|
public void setPurchasePrice(BigDecimal purchasePrice) { |
||||
|
this.purchasePrice = purchasePrice; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getWholesalePrice() { |
||||
|
return wholesalePrice; |
||||
|
} |
||||
|
|
||||
|
public void setWholesalePrice(BigDecimal wholesalePrice) { |
||||
|
this.wholesalePrice = wholesalePrice; |
||||
|
} |
||||
|
|
||||
|
public Integer getProductCount() { |
||||
|
return productCount; |
||||
|
} |
||||
|
|
||||
|
public void setProductCount(Integer productCount) { |
||||
|
this.productCount = productCount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getDiscount() { |
||||
|
return discount; |
||||
|
} |
||||
|
|
||||
|
public void setDiscount(BigDecimal discount) { |
||||
|
this.discount = discount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getDiscountAmount() { |
||||
|
return discountAmount; |
||||
|
} |
||||
|
|
||||
|
public void setDiscountAmount(BigDecimal discountAmount) { |
||||
|
this.discountAmount = discountAmount; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getRealPrice() { |
||||
|
return realPrice; |
||||
|
} |
||||
|
|
||||
|
public void setRealPrice(BigDecimal realPrice) { |
||||
|
this.realPrice = realPrice; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
StringBuilder sb = new StringBuilder(); |
||||
|
sb.append(getClass().getSimpleName()); |
||||
|
sb.append(" ["); |
||||
|
sb.append("Hash = ").append(hashCode()); |
||||
|
sb.append(", id=").append(id); |
||||
|
sb.append(", createBy=").append(createBy); |
||||
|
sb.append(", createTime=").append(createTime); |
||||
|
sb.append(", delFlag=").append(delFlag); |
||||
|
sb.append(", updateBy=").append(updateBy); |
||||
|
sb.append(", updateTime=").append(updateTime); |
||||
|
sb.append(", recommendId=").append(recommendId); |
||||
|
sb.append(", productId=").append(productId); |
||||
|
sb.append(", productName=").append(productName); |
||||
|
sb.append(", unit=").append(unit); |
||||
|
sb.append(", shopId=").append(shopId); |
||||
|
sb.append(", categoryId=").append(categoryId); |
||||
|
sb.append(", attributeList=").append(attributeList); |
||||
|
sb.append(", price=").append(price); |
||||
|
sb.append(", purchasePrice=").append(purchasePrice); |
||||
|
sb.append(", wholesalePrice=").append(wholesalePrice); |
||||
|
sb.append(", productCount=").append(productCount); |
||||
|
sb.append(", discount=").append(discount); |
||||
|
sb.append(", discountAmount=").append(discountAmount); |
||||
|
sb.append(", realPrice=").append(realPrice); |
||||
|
sb.append(", serialVersionUID=").append(serialVersionUID); |
||||
|
sb.append("]"); |
||||
|
return sb.toString(); |
||||
|
} |
||||
|
} |
||||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,20 @@ |
|||||
|
package cc.hiver.mall.pojo.vo; |
||||
|
|
||||
|
import cc.hiver.mall.entity.Recommend; |
||||
|
import cc.hiver.mall.entity.RecommendDetail; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.experimental.Accessors; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
@Data |
||||
|
@Accessors(chain = true) |
||||
|
public class RecommendVo { |
||||
|
@ApiModelProperty(value = "推荐单主表") |
||||
|
private Recommend recommend; |
||||
|
|
||||
|
@ApiModelProperty(value = "推荐单明细") |
||||
|
private List<RecommendDetail> recommendDetailList; |
||||
|
|
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package cc.hiver.mall.service.mybatis; |
||||
|
|
||||
|
import cc.hiver.mall.entity.RecommendDetail; |
||||
|
import cc.hiver.mall.entity.SaleDetail; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
public interface RecommendDetailService extends IService<RecommendDetail> { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package cc.hiver.mall.service.mybatis; |
||||
|
|
||||
|
import cc.hiver.mall.entity.Recommend; |
||||
|
import cc.hiver.mall.entity.Sale; |
||||
|
import com.baomidou.mybatisplus.extension.service.IService; |
||||
|
|
||||
|
public interface RecommendService extends IService<Recommend> { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package cc.hiver.mall.serviceimpl.mybatis; |
||||
|
|
||||
|
import cc.hiver.mall.dao.mapper.RecommendDetailMapper; |
||||
|
import cc.hiver.mall.entity.RecommendDetail; |
||||
|
import cc.hiver.mall.service.mybatis.RecommendDetailService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class RecommendDetailServiceImpl extends ServiceImpl<RecommendDetailMapper, RecommendDetail> implements RecommendDetailService { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
package cc.hiver.mall.serviceimpl.mybatis; |
||||
|
|
||||
|
import cc.hiver.mall.dao.mapper.RecommendMapper; |
||||
|
import cc.hiver.mall.entity.Recommend; |
||||
|
import cc.hiver.mall.service.mybatis.RecommendService; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
@Service |
||||
|
public class RecommendServiceImpl extends ServiceImpl<RecommendMapper, Recommend> implements RecommendService { |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,448 @@ |
|||||
|
<?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="cc.hiver.mall.dao.mapper.RecommendDetailMapper"> |
||||
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.RecommendDetail"> |
||||
|
<id column="id" jdbcType="VARCHAR" property="id" /> |
||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="del_flag" jdbcType="INTEGER" property="delFlag" /> |
||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="recommend_id" jdbcType="VARCHAR" property="recommendId" /> |
||||
|
<result column="product_id" jdbcType="VARCHAR" property="productId" /> |
||||
|
<result column="product_name" jdbcType="VARCHAR" property="productName" /> |
||||
|
<result column="unit" jdbcType="VARCHAR" property="unit" /> |
||||
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" /> |
||||
|
<result column="category_id" jdbcType="VARCHAR" property="categoryId" /> |
||||
|
<result column="attribute_list" jdbcType="VARCHAR" property="attributeList" /> |
||||
|
<result column="price" jdbcType="DECIMAL" property="price" /> |
||||
|
<result column="purchase_price" jdbcType="DECIMAL" property="purchasePrice" /> |
||||
|
<result column="wholesale_price" jdbcType="DECIMAL" property="wholesalePrice" /> |
||||
|
<result column="product_count" jdbcType="INTEGER" property="productCount" /> |
||||
|
<result column="discount" jdbcType="DECIMAL" property="discount" /> |
||||
|
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount" /> |
||||
|
<result column="real_price" jdbcType="DECIMAL" property="realPrice" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, create_by, create_time, del_flag, update_by, update_time, recommend_id, product_id, |
||||
|
product_name, unit, shop_id, category_id, attribute_list, price, purchase_price, |
||||
|
wholesale_price, product_count, discount, discount_amount, real_price |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.RecommendDetailExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_recommend_detail |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_recommend_detail |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
||||
|
delete from t_recommend_detail |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="cc.hiver.mall.entity.RecommendDetailExample"> |
||||
|
delete from t_recommend_detail |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="cc.hiver.mall.entity.RecommendDetail"> |
||||
|
insert into t_recommend_detail (id, create_by, create_time, |
||||
|
del_flag, update_by, update_time, |
||||
|
recommend_id, product_id, product_name, |
||||
|
unit, shop_id, category_id, |
||||
|
attribute_list, price, purchase_price, |
||||
|
wholesale_price, product_count, discount, |
||||
|
discount_amount, real_price) |
||||
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
||||
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
#{recommendId,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, #{productName,jdbcType=VARCHAR}, |
||||
|
#{unit,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{categoryId,jdbcType=VARCHAR}, |
||||
|
#{attributeList,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{purchasePrice,jdbcType=DECIMAL}, |
||||
|
#{wholesalePrice,jdbcType=DECIMAL}, #{productCount,jdbcType=INTEGER}, #{discount,jdbcType=DECIMAL}, |
||||
|
#{discountAmount,jdbcType=DECIMAL}, #{realPrice,jdbcType=DECIMAL}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.RecommendDetail"> |
||||
|
insert into t_recommend_detail |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time, |
||||
|
</if> |
||||
|
<if test="recommendId != null"> |
||||
|
recommend_id, |
||||
|
</if> |
||||
|
<if test="productId != null"> |
||||
|
product_id, |
||||
|
</if> |
||||
|
<if test="productName != null"> |
||||
|
product_name, |
||||
|
</if> |
||||
|
<if test="unit != null"> |
||||
|
unit, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
shop_id, |
||||
|
</if> |
||||
|
<if test="categoryId != null"> |
||||
|
category_id, |
||||
|
</if> |
||||
|
<if test="attributeList != null"> |
||||
|
attribute_list, |
||||
|
</if> |
||||
|
<if test="price != null"> |
||||
|
price, |
||||
|
</if> |
||||
|
<if test="purchasePrice != null"> |
||||
|
purchase_price, |
||||
|
</if> |
||||
|
<if test="wholesalePrice != null"> |
||||
|
wholesale_price, |
||||
|
</if> |
||||
|
<if test="productCount != null"> |
||||
|
product_count, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
discount, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
discount_amount, |
||||
|
</if> |
||||
|
<if test="realPrice != null"> |
||||
|
real_price, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
#{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
#{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
#{delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
#{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
#{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recommendId != null"> |
||||
|
#{recommendId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="productId != null"> |
||||
|
#{productId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="productName != null"> |
||||
|
#{productName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="unit != null"> |
||||
|
#{unit,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
#{shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="categoryId != null"> |
||||
|
#{categoryId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="attributeList != null"> |
||||
|
#{attributeList,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="price != null"> |
||||
|
#{price,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="purchasePrice != null"> |
||||
|
#{purchasePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="wholesalePrice != null"> |
||||
|
#{wholesalePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="productCount != null"> |
||||
|
#{productCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
#{discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
#{discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="realPrice != null"> |
||||
|
#{realPrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.RecommendDetailExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_recommend_detail |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_recommend_detail |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createBy != null"> |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createTime != null"> |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.delFlag != null"> |
||||
|
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.updateBy != null"> |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.updateTime != null"> |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.recommendId != null"> |
||||
|
recommend_id = #{record.recommendId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.productId != null"> |
||||
|
product_id = #{record.productId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.productName != null"> |
||||
|
product_name = #{record.productName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.unit != null"> |
||||
|
unit = #{record.unit,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.shopId != null"> |
||||
|
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.categoryId != null"> |
||||
|
category_id = #{record.categoryId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.attributeList != null"> |
||||
|
attribute_list = #{record.attributeList,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.price != null"> |
||||
|
price = #{record.price,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.purchasePrice != null"> |
||||
|
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.wholesalePrice != null"> |
||||
|
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.productCount != null"> |
||||
|
product_count = #{record.productCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.discount != null"> |
||||
|
discount = #{record.discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.discountAmount != null"> |
||||
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.realPrice != null"> |
||||
|
real_price = #{record.realPrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_recommend_detail |
||||
|
set id = #{record.id,jdbcType=VARCHAR}, |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
recommend_id = #{record.recommendId,jdbcType=VARCHAR}, |
||||
|
product_id = #{record.productId,jdbcType=VARCHAR}, |
||||
|
product_name = #{record.productName,jdbcType=VARCHAR}, |
||||
|
unit = #{record.unit,jdbcType=VARCHAR}, |
||||
|
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
||||
|
category_id = #{record.categoryId,jdbcType=VARCHAR}, |
||||
|
attribute_list = #{record.attributeList,jdbcType=VARCHAR}, |
||||
|
price = #{record.price,jdbcType=DECIMAL}, |
||||
|
purchase_price = #{record.purchasePrice,jdbcType=DECIMAL}, |
||||
|
wholesale_price = #{record.wholesalePrice,jdbcType=DECIMAL}, |
||||
|
product_count = #{record.productCount,jdbcType=INTEGER}, |
||||
|
discount = #{record.discount,jdbcType=DECIMAL}, |
||||
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
||||
|
real_price = #{record.realPrice,jdbcType=DECIMAL} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.RecommendDetail"> |
||||
|
update t_recommend_detail |
||||
|
<set> |
||||
|
<if test="createBy != null"> |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag = #{delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="recommendId != null"> |
||||
|
recommend_id = #{recommendId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="productId != null"> |
||||
|
product_id = #{productId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="productName != null"> |
||||
|
product_name = #{productName,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="unit != null"> |
||||
|
unit = #{unit,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
shop_id = #{shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="categoryId != null"> |
||||
|
category_id = #{categoryId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="attributeList != null"> |
||||
|
attribute_list = #{attributeList,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="price != null"> |
||||
|
price = #{price,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="purchasePrice != null"> |
||||
|
purchase_price = #{purchasePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="wholesalePrice != null"> |
||||
|
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="productCount != null"> |
||||
|
product_count = #{productCount,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
discount = #{discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="realPrice != null"> |
||||
|
real_price = #{realPrice,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.RecommendDetail"> |
||||
|
update t_recommend_detail |
||||
|
set create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{delFlag,jdbcType=INTEGER}, |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
recommend_id = #{recommendId,jdbcType=VARCHAR}, |
||||
|
product_id = #{productId,jdbcType=VARCHAR}, |
||||
|
product_name = #{productName,jdbcType=VARCHAR}, |
||||
|
unit = #{unit,jdbcType=VARCHAR}, |
||||
|
shop_id = #{shopId,jdbcType=VARCHAR}, |
||||
|
category_id = #{categoryId,jdbcType=VARCHAR}, |
||||
|
attribute_list = #{attributeList,jdbcType=VARCHAR}, |
||||
|
price = #{price,jdbcType=DECIMAL}, |
||||
|
purchase_price = #{purchasePrice,jdbcType=DECIMAL}, |
||||
|
wholesale_price = #{wholesalePrice,jdbcType=DECIMAL}, |
||||
|
product_count = #{productCount,jdbcType=INTEGER}, |
||||
|
discount = #{discount,jdbcType=DECIMAL}, |
||||
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
||||
|
real_price = #{realPrice,jdbcType=DECIMAL} |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
</mapper> |
||||
@ -0,0 +1,385 @@ |
|||||
|
<?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="cc.hiver.mall.dao.mapper.RecommendMapper"> |
||||
|
<resultMap id="BaseResultMap" type="cc.hiver.mall.entity.Recommend"> |
||||
|
<id column="id" jdbcType="VARCHAR" property="id" /> |
||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" /> |
||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> |
||||
|
<result column="del_flag" jdbcType="INTEGER" property="delFlag" /> |
||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> |
||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> |
||||
|
<result column="user_id" jdbcType="VARCHAR" property="userId" /> |
||||
|
<result column="shop_id" jdbcType="VARCHAR" property="shopId" /> |
||||
|
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" /> |
||||
|
<result column="discount" jdbcType="DECIMAL" property="discount" /> |
||||
|
<result column="discount_amount" jdbcType="DECIMAL" property="discountAmount" /> |
||||
|
<result column="real_amount" jdbcType="DECIMAL" property="realAmount" /> |
||||
|
<result column="receive_address" jdbcType="VARCHAR" property="receiveAddress" /> |
||||
|
<result column="province" jdbcType="VARCHAR" property="province" /> |
||||
|
<result column="city" jdbcType="VARCHAR" property="city" /> |
||||
|
<result column="area" jdbcType="VARCHAR" property="area" /> |
||||
|
</resultMap> |
||||
|
<sql id="Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Update_By_Example_Where_Clause"> |
||||
|
<where> |
||||
|
<foreach collection="example.oredCriteria" item="criteria" separator="or"> |
||||
|
<if test="criteria.valid"> |
||||
|
<trim prefix="(" prefixOverrides="and" suffix=")"> |
||||
|
<foreach collection="criteria.criteria" item="criterion"> |
||||
|
<choose> |
||||
|
<when test="criterion.noValue"> |
||||
|
and ${criterion.condition} |
||||
|
</when> |
||||
|
<when test="criterion.singleValue"> |
||||
|
and ${criterion.condition} #{criterion.value} |
||||
|
</when> |
||||
|
<when test="criterion.betweenValue"> |
||||
|
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} |
||||
|
</when> |
||||
|
<when test="criterion.listValue"> |
||||
|
and ${criterion.condition} |
||||
|
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=","> |
||||
|
#{listItem} |
||||
|
</foreach> |
||||
|
</when> |
||||
|
</choose> |
||||
|
</foreach> |
||||
|
</trim> |
||||
|
</if> |
||||
|
</foreach> |
||||
|
</where> |
||||
|
</sql> |
||||
|
<sql id="Base_Column_List"> |
||||
|
id, create_by, create_time, del_flag, update_by, update_time, user_id, shop_id, total_amount, |
||||
|
discount, discount_amount, real_amount, receive_address, province, city, area |
||||
|
</sql> |
||||
|
<select id="selectByExample" parameterType="cc.hiver.mall.entity.RecommendExample" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<if test="distinct"> |
||||
|
distinct |
||||
|
</if> |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_recommend |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
<if test="orderByClause != null"> |
||||
|
order by ${orderByClause} |
||||
|
</if> |
||||
|
</select> |
||||
|
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> |
||||
|
select |
||||
|
<include refid="Base_Column_List" /> |
||||
|
from t_recommend |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</select> |
||||
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.String"> |
||||
|
delete from t_recommend |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</delete> |
||||
|
<delete id="deleteByExample" parameterType="cc.hiver.mall.entity.RecommendExample"> |
||||
|
delete from t_recommend |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</delete> |
||||
|
<insert id="insert" parameterType="cc.hiver.mall.entity.Recommend"> |
||||
|
insert into t_recommend (id, create_by, create_time, |
||||
|
del_flag, update_by, update_time, |
||||
|
user_id, shop_id, total_amount, |
||||
|
discount, discount_amount, real_amount, |
||||
|
receive_address, province, city, |
||||
|
area) |
||||
|
values (#{id,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, |
||||
|
#{delFlag,jdbcType=INTEGER}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
#{userId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, |
||||
|
#{discount,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{realAmount,jdbcType=DECIMAL}, |
||||
|
#{receiveAddress,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, |
||||
|
#{area,jdbcType=VARCHAR}) |
||||
|
</insert> |
||||
|
<insert id="insertSelective" parameterType="cc.hiver.mall.entity.Recommend"> |
||||
|
insert into t_recommend |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
id, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
create_by, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
user_id, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
shop_id, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
total_amount, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
discount, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
discount_amount, |
||||
|
</if> |
||||
|
<if test="realAmount != null"> |
||||
|
real_amount, |
||||
|
</if> |
||||
|
<if test="receiveAddress != null"> |
||||
|
receive_address, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
province, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
city, |
||||
|
</if> |
||||
|
<if test="area != null"> |
||||
|
area, |
||||
|
</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="id != null"> |
||||
|
#{id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createBy != null"> |
||||
|
#{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
#{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
#{delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
#{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
#{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
#{userId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
#{shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
#{totalAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
#{discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
#{discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="realAmount != null"> |
||||
|
#{realAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="receiveAddress != null"> |
||||
|
#{receiveAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
#{province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
#{city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="area != null"> |
||||
|
#{area,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
<select id="countByExample" parameterType="cc.hiver.mall.entity.RecommendExample" resultType="java.lang.Long"> |
||||
|
select count(*) from t_recommend |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</select> |
||||
|
<update id="updateByExampleSelective" parameterType="map"> |
||||
|
update t_recommend |
||||
|
<set> |
||||
|
<if test="record.id != null"> |
||||
|
id = #{record.id,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createBy != null"> |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.createTime != null"> |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.delFlag != null"> |
||||
|
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="record.updateBy != null"> |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.updateTime != null"> |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="record.userId != null"> |
||||
|
user_id = #{record.userId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.shopId != null"> |
||||
|
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.totalAmount != null"> |
||||
|
total_amount = #{record.totalAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.discount != null"> |
||||
|
discount = #{record.discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.discountAmount != null"> |
||||
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.realAmount != null"> |
||||
|
real_amount = #{record.realAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="record.receiveAddress != null"> |
||||
|
receive_address = #{record.receiveAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.province != null"> |
||||
|
province = #{record.province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.city != null"> |
||||
|
city = #{record.city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="record.area != null"> |
||||
|
area = #{record.area,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
</set> |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByExample" parameterType="map"> |
||||
|
update t_recommend |
||||
|
set id = #{record.id,jdbcType=VARCHAR}, |
||||
|
create_by = #{record.createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{record.createTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{record.delFlag,jdbcType=INTEGER}, |
||||
|
update_by = #{record.updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, |
||||
|
user_id = #{record.userId,jdbcType=VARCHAR}, |
||||
|
shop_id = #{record.shopId,jdbcType=VARCHAR}, |
||||
|
total_amount = #{record.totalAmount,jdbcType=DECIMAL}, |
||||
|
discount = #{record.discount,jdbcType=DECIMAL}, |
||||
|
discount_amount = #{record.discountAmount,jdbcType=DECIMAL}, |
||||
|
real_amount = #{record.realAmount,jdbcType=DECIMAL}, |
||||
|
receive_address = #{record.receiveAddress,jdbcType=VARCHAR}, |
||||
|
province = #{record.province,jdbcType=VARCHAR}, |
||||
|
city = #{record.city,jdbcType=VARCHAR}, |
||||
|
area = #{record.area,jdbcType=VARCHAR} |
||||
|
<if test="_parameter != null"> |
||||
|
<include refid="Update_By_Example_Where_Clause" /> |
||||
|
</if> |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKeySelective" parameterType="cc.hiver.mall.entity.Recommend"> |
||||
|
update t_recommend |
||||
|
<set> |
||||
|
<if test="createBy != null"> |
||||
|
create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="createTime != null"> |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="delFlag != null"> |
||||
|
del_flag = #{delFlag,jdbcType=INTEGER}, |
||||
|
</if> |
||||
|
<if test="updateBy != null"> |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="updateTime != null"> |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
</if> |
||||
|
<if test="userId != null"> |
||||
|
user_id = #{userId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="shopId != null"> |
||||
|
shop_id = #{shopId,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="totalAmount != null"> |
||||
|
total_amount = #{totalAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discount != null"> |
||||
|
discount = #{discount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="discountAmount != null"> |
||||
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="realAmount != null"> |
||||
|
real_amount = #{realAmount,jdbcType=DECIMAL}, |
||||
|
</if> |
||||
|
<if test="receiveAddress != null"> |
||||
|
receive_address = #{receiveAddress,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="province != null"> |
||||
|
province = #{province,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="city != null"> |
||||
|
city = #{city,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
<if test="area != null"> |
||||
|
area = #{area,jdbcType=VARCHAR}, |
||||
|
</if> |
||||
|
</set> |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
<update id="updateByPrimaryKey" parameterType="cc.hiver.mall.entity.Recommend"> |
||||
|
update t_recommend |
||||
|
set create_by = #{createBy,jdbcType=VARCHAR}, |
||||
|
create_time = #{createTime,jdbcType=TIMESTAMP}, |
||||
|
del_flag = #{delFlag,jdbcType=INTEGER}, |
||||
|
update_by = #{updateBy,jdbcType=VARCHAR}, |
||||
|
update_time = #{updateTime,jdbcType=TIMESTAMP}, |
||||
|
user_id = #{userId,jdbcType=VARCHAR}, |
||||
|
shop_id = #{shopId,jdbcType=VARCHAR}, |
||||
|
total_amount = #{totalAmount,jdbcType=DECIMAL}, |
||||
|
discount = #{discount,jdbcType=DECIMAL}, |
||||
|
discount_amount = #{discountAmount,jdbcType=DECIMAL}, |
||||
|
real_amount = #{realAmount,jdbcType=DECIMAL}, |
||||
|
receive_address = #{receiveAddress,jdbcType=VARCHAR}, |
||||
|
province = #{province,jdbcType=VARCHAR}, |
||||
|
city = #{city,jdbcType=VARCHAR}, |
||||
|
area = #{area,jdbcType=VARCHAR} |
||||
|
where id = #{id,jdbcType=VARCHAR} |
||||
|
</update> |
||||
|
</mapper> |
||||
Loading…
Reference in new issue