PC端-商品信息移植

This commit is contained in:
纪寒 2023-09-21 10:22:21 +08:00
parent 9a65e67e61
commit a1748c6efb
16 changed files with 2502 additions and 0 deletions

View File

@ -0,0 +1,91 @@
package com.xinelu.manage.domain.goodsAttribute;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 商品属性对象 goods_attribute
*
* @author xinyilu
* @date 2022-10-17
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品属性对象", description = "goods_attribute")
public class GoodsAttribute extends BaseDomain implements Serializable {
private static final long serialVersionUID = -1783047698554409597L;
/**
* 主键id
*/
private Long id;
/**
* 商品id
*/
@ApiModelProperty(value = "商品id")
@Excel(name = "商品id")
private Long goodsId;
/**
* 商品属性名称
*/
@ApiModelProperty(value = "商品属性名称")
@Excel(name = "商品属性名称")
@NotBlank(message = "商品属性名称不能为空", groups = {Insert.class, Update.class})
@Length(max = 50, message = "商品属性名称不能超过50位", groups = {Insert.class, Update.class})
private String attributeName;
/**
* 商品属性编码
*/
@ApiModelProperty(value = "商品属性编码")
@Excel(name = "商品属性编码")
private String attributeCode;
/**
* 商品属性概述
*/
@ApiModelProperty(value = "商品属性概述")
@Excel(name = "商品属性概述")
private String attributeRemark;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("goodsId", getGoodsId())
.append("attributeName", getAttributeName())
.append("attributeCode", getAttributeCode())
.append("attributeRemark", getAttributeRemark())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,125 @@
package com.xinelu.manage.domain.goodsAttributeDetails;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 商品属性明细对象 goods_attribute_details
*
* @author xinyilu
* @date 2022-10-17
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品属性明细对象", description = "goods_attribute_details")
public class GoodsAttributeDetails extends BaseDomain implements Serializable {
private static final long serialVersionUID = -1338498896375073750L;
/**
* 主键id
*/
private Long id;
/**
* 商品属性id
*/
@ApiModelProperty(value = "商品属性id")
@Excel(name = "商品属性id")
private Long goodsAttributeId;
/**
* 商品属性明细名称
*/
@ApiModelProperty(value = "商品属性明细名称")
@Excel(name = "商品属性明细名称")
@NotBlank(message = "商品属性明细名称不能为空", groups = {Insert.class, Update.class})
@Length(max = 100, message = "商品属性明细名称不能超过100位", groups = {Insert.class, Update.class})
private String attributeDetailsName;
/**
* 库存数量
*/
@ApiModelProperty(value = "库存数量")
@Excel(name = "库存数量")
@NotNull(message = "库存数量不能为空", groups = {Insert.class, Update.class})
private Integer goodsStock;
/**
* 商品单价保留到小数点后两位
*/
@ApiModelProperty(value = "商品单价,保留到小数点后两位")
@Excel(name = "商品单价,保留到小数点后两位")
@NotNull(message = "商品单价不能为空", groups = {Insert.class, Update.class})
private BigDecimal goodsPrice;
/**
* 商品属性图片地址
*/
@ApiModelProperty(value = "商品属性图片地址")
@Excel(name = "商品属性图片地址")
@Length(max = 200, message = "商品属性图片地址不能超过200位", groups = {Insert.class, Update.class})
private String attributePitureUrl;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
private Integer sort;
/**
* 积分兑换标识01
*/
@ApiModelProperty(value = "积分兑换标识01")
@Excel(name = "积分兑换标识01")
private Integer integralExchangeFlag;
/**
* 积分兑换门槛值
*/
@ApiModelProperty(value = "积分兑换门槛值")
@Excel(name = "积分兑换门槛值")
private Integer integralExchangeSill;
/**
* 积分兑换商品数量
*/
@ApiModelProperty(value = "积分兑换商品数量")
@Excel(name = "积分兑换商品数量")
private Integer integralExchangeCount;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("goodsAttributeId", getGoodsAttributeId())
.append("attributeDetailsName", getAttributeDetailsName())
.append("goodsStock", getGoodsStock())
.append("goodsPrice", getGoodsPrice())
.append("attributePitureUrl", getAttributePitureUrl())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,155 @@
package com.xinelu.manage.domain.goodsInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 商品基本信息对象 goods_info
*
* @author xinyilu
* @date 2022-10-17
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品基本信息对象", description = "goods_info")
public class GoodsInfo extends BaseDomain implements Serializable {
private static final long serialVersionUID = 5311374556313294992L;
/**
* 主键id
*/
@NotNull(message = "商品id不能为空", groups = {Update.class})
private Long id;
/**
* 店铺表id
*/
@ApiModelProperty(value = "店铺表id")
@Excel(name = "店铺表id")
private Long storeInfoId;
/**
* 护理站id冗余字段
*/
@ApiModelProperty(value = "护理站id冗余字段")
@Excel(name = "护理站id冗余字段")
private Long nurseStationId;
/**
* 商品分类id
*/
@ApiModelProperty(value = "商品分类id")
@Excel(name = "商品分类id")
@NotNull(message = "商品分类信息不能为空!", groups = {Insert.class, Update.class})
private Long goodsCategoryId;
/**
* 商品名称
*/
@ApiModelProperty(value = "商品名称")
@Excel(name = "商品名称")
@NotBlank(message = "商品名称信息不能为空!", groups = {Insert.class, Update.class})
private String goodsName;
/**
* 商品编码
*/
@ApiModelProperty(value = "商品编码")
@Excel(name = "商品编码")
private String goodsCode;
/**
* 是否上架01
*/
@ApiModelProperty(value = "是否上架01")
@Excel(name = "是否上架01")
private Integer whetherShelf;
/**
* 上架时间yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "上架时间yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "上架时间yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd")
private LocalDateTime shelfTime;
/**
* 商品图片路径
*/
@ApiModelProperty(value = "商品图片路径")
@Excel(name = "商品图片路径")
@NotBlank(message = "商品图片路径不能为空!", groups = {Insert.class, Update.class})
private String goodsPictureUrl;
/**
* 商品概述
*/
@ApiModelProperty(value = "商品概述")
@Excel(name = "商品概述")
private String goodsRemark;
/**
* 商品度量单位
*/
@ApiModelProperty(value = "商品度量单位")
@Excel(name = "商品度量单位")
@NotBlank(message = "商品度量单位不能为空!", groups = {Insert.class, Update.class})
private String goodsUnit;
/**
* 商品用途买卖BUSINESS租赁LEASE
*/
@ApiModelProperty(value = "商品用途买卖BUSINESS租赁LEASE")
@Excel(name = "商品用途买卖BUSINESS租赁LEASE")
@NotBlank(message = "商品用途不能为空!", groups = {Insert.class, Update.class})
private String goodsPurpose;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
@NotNull(message = "商品显示顺序不能为空!", groups = {Insert.class, Update.class})
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("storeInfoId", getStoreInfoId())
.append("nurseStationId", getNurseStationId())
.append("goodsCategoryId", getGoodsCategoryId())
.append("goodsName", getGoodsName())
.append("goodsCode", getGoodsCode())
.append("whetherShelf", getWhetherShelf())
.append("shelfTime", getShelfTime())
.append("goodsPictureUrl", getGoodsPictureUrl())
.append("goodsRemark", getGoodsRemark())
.append("goodsUnit", getGoodsUnit())
.append("goodsPurpose", getGoodsPurpose())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,146 @@
package com.xinelu.manage.domain.storeInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 店铺信息对象 store_info
*
* @author xinyilu
* @date 2022-10-18
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "店铺信息对象", description = "store_info")
public class StoreInfo extends BaseDomain implements Serializable {
private static final long serialVersionUID = -4924160218005137736L;
/**
* 主键id
*/
private Long id;
/**
* 所属护理站id
*/
@ApiModelProperty(value = "所属护理站id")
@Excel(name = "所属护理站id")
private Long nurseStationId;
/**
* 店铺名称
*/
@ApiModelProperty(value = "店铺名称")
@Excel(name = "店铺名称")
private String storeName;
/**
* 店铺编号
*/
@ApiModelProperty(value = "店铺编号")
@Excel(name = "店铺编号")
private String storeCode;
/**
* 店铺地址
*/
@ApiModelProperty(value = "店铺地址")
@Excel(name = "店铺地址")
private String storeAddress;
/**
* 联系电话
*/
@ApiModelProperty(value = "联系电话")
@Excel(name = "联系电话")
private String phone;
/**
* 店铺背景图片地址
*/
@ApiModelProperty(value = "店铺背景图片地址")
@Excel(name = "店铺背景图片地址")
private String storeLogoUrl;
/**
* 店铺经营者即所属人
*/
@ApiModelProperty(value = "店铺经营者,即所属人")
@Excel(name = "店铺经营者,即所属人")
private String storeOperator;
/**
* 店铺开业状态待开业NOT_OPENED已开业OPENED已关闭CLOSED
*/
@ApiModelProperty(value = "店铺开业状态待开业NOT_OPENED已开业OPENED已关闭CLOSED")
@Excel(name = "店铺开业状态待开业NOT_OPENED已开业OPENED已关闭CLOSED")
private String openingStatus;
/**
* 开业时间yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "开业时间yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开业时间yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime openingTime;
/**
* 营业开始时间yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "营业开始时间yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "营业开始时间yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime occupationStartTime;
/**
* 营业结束时间yyyy-MM-dd HH:mm:ss
*/
@ApiModelProperty(value = "营业结束时间yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "营业结束时间yyyy-MM-dd HH:mm:ss", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime occupationEndTime;
/**
* 店铺显示顺序
*/
@ApiModelProperty(value = "店铺显示顺序")
@Excel(name = "店铺显示顺序")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("nurseStationId", getNurseStationId())
.append("storeName", getStoreName())
.append("storeCode", getStoreCode())
.append("storeAddress", getStoreAddress())
.append("phone", getPhone())
.append("storeLogoUrl", getStoreLogoUrl())
.append("storeOperator", getStoreOperator())
.append("openingStatus", getOpeningStatus())
.append("openingTime", getOpeningTime())
.append("occupationStartTime", getOccupationStartTime())
.append("occupationEndTime", getOccupationEndTime())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,149 @@
package com.xinelu.manage.dto.goodsInfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import com.xinelu.manage.domain.goodsAttributeDetails.GoodsAttributeDetails;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/21 9:19
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class GoodsAttributeDTO extends BaseDomain implements Serializable {
private static final long serialVersionUID = -188353299573627882L;
/**
* 商品id
*/
@ApiModelProperty(value = "商品id")
@Excel(name = "商品id")
private Long goodsId;
/**
* 商品id
*/
@ApiModelProperty(value = "商品id")
@Excel(name = "商品id")
private Long id;
/**
* 商品属性名称
*/
@ApiModelProperty(value = "商品属性名称")
@Excel(name = "商品属性名称")
@NotBlank(message = "商品属性名称不能为空", groups = {Insert.class, Update.class})
@Length(max = 50, message = "商品属性名称不能超过50位", groups = {Insert.class, Update.class})
private String attributeName;
/**
* 商品属性编码
*/
@ApiModelProperty(value = "商品属性编码")
@Excel(name = "商品属性编码")
private String attributeCode;
/**
* 商品属性概述
*/
@ApiModelProperty(value = "商品属性概述")
@Excel(name = "商品属性概述")
private String attributeRemark;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
@NotNull(message = "商品属性顺序不能为空!", groups = {Insert.class, Update.class})
private Integer attributeDetailsSort;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
private Integer sort;
/**
* 批量新增商品属性明细
*/
@Valid
private List<GoodsAttributeDetails> goodAttributeDetailsLists;
/**
* 主键id
*/
private Long goodAttributeDetailsId;
/**
* 主键id
*/
private Long attributeDetailsId;
/**
* 商品属性id
*/
private Long goodsAttributeId;
/**
* 商品属性明细名称
*/
private String attributeDetailsName;
/**
* 库存数量
*/
@NotNull(message = "库存数量不能为空", groups = {Insert.class, Update.class})
private Integer goodsStock;
/**
* 商品单价保留到小数点后两位
*/
@NotNull(message = "商品单价不能为空", groups = {Insert.class, Update.class})
private BigDecimal goodsPrice;
/**
* 商品属性图片地址
*/
@NotBlank(message = "商品属性图片地址不能为空", groups = {Insert.class, Update.class})
private String attributePitureUrl;
/**
* 商品图片地址
*/
private String goodsPictureUrl;
/**
* 商品概述
*/
private String goodsRemark;
/**
* 积分兑换标识01
*/
private Integer integralExchangeFlag;
/**
* 积分兑换门槛值
*/
private Integer integralExchangeSill;
/**
* 积分兑换商品数量
*/
private Integer integralExchangeCount;
}

View File

@ -0,0 +1,26 @@
package com.xinelu.manage.dto.goodsInfo;
import com.xinelu.manage.domain.goodsInfo.GoodsInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/20 14:59
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class GoodsInfoDTO extends GoodsInfo implements Serializable {
private static final long serialVersionUID = 7361219514871900274L;
/**
* 批量新增商品属性
*/
@Valid
private List<GoodsAttributeDTO> goodDetailsLists;
}

View File

@ -0,0 +1,98 @@
package com.xinelu.manage.mapper.goodsAttribute;
import com.xinelu.manage.domain.goodsAttribute.GoodsAttribute;
import com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品属性Mapper接口
*
* @author xinyilu
* @date 2022-10-17
*/
public interface GoodsAttributeMapper {
/**
* 查询商品属性
*
* @param id 商品属性主键
* @return 商品属性
*/
GoodsAttribute selectGoodsAttributeById(Long id);
/**
* 查询商品属性列表
*
* @param goodsAttribute 商品属性
* @return 商品属性集合
*/
List<GoodsAttribute> selectGoodsAttributeList(GoodsAttribute goodsAttribute);
/**
* 新增商品属性
*
* @param goodsAttribute 商品属性
* @return 结果
*/
int insertGoodsAttribute(GoodsAttribute goodsAttribute);
/**
* 修改商品属性
*
* @param goodsAttribute 商品属性
* @return 结果
*/
int updateGoodsAttribute(GoodsAttribute goodsAttribute);
/**
* 删除商品属性
*
* @param id 商品属性主键
* @return 结果
*/
int deleteGoodsAttributeById(Long id);
/**
* 批量删除商品属性
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteGoodsAttributeByIds(Long[] ids);
/**
* 批量新增商品属性
*
* @param goodDetailsLists 商品属性
* @return int
**/
int insertGoodsAttributeList(@Param("goodDetailsLists") List<GoodsAttributeDTO> goodDetailsLists);
/**
* 新增商品属性
*
* @param goodsAttribute 商品属性
* @return 结果
*/
int insertGoodsAttributes(GoodsAttributeDTO goodsAttribute);
/**
* 修改商品属性
*
* @param goodsAttribute 商品属性
* @return 结果
*/
int updateGoodsAttributes(GoodsAttributeDTO goodsAttribute);
/**
* 查询商品属性列表
*
* @param goodsId 商品id
* @return 商品属性集合
*/
Long[] selectGoodsAttributeByIdList(Long[] goodsId);
}

View File

@ -0,0 +1,115 @@
package com.xinelu.manage.mapper.goodsAttributeDetails;
import com.xinelu.manage.domain.goodsAttributeDetails.GoodsAttributeDetails;
import com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品属性明细Mapper接口
*
* @author xinyilu
* @date 2022-10-17
*/
public interface GoodsAttributeDetailsMapper {
/**
* 查询商品属性明细
*
* @param id 商品属性明细主键
* @return 商品属性明细
*/
GoodsAttributeDetails selectGoodsAttributeDetailsById(Long id);
/**
* 查询商品属性明细列表
*
* @param goodsAttributeDetails 商品属性明细
* @return 商品属性明细集合
*/
List<GoodsAttributeDetails> selectGoodsAttributeDetailsList(GoodsAttributeDetails goodsAttributeDetails);
/**
* 新增商品属性明细
*
* @param goodsAttributeDetails 商品属性明细
* @return 结果
*/
int insertGoodsAttributeDetails(GoodsAttributeDetails goodsAttributeDetails);
/**
* 修改商品属性明细
*
* @param goodsAttributeDetails 商品属性明细
* @return 结果
*/
int updateGoodsAttributeDetails(GoodsAttributeDetails goodsAttributeDetails);
/**
* 删除商品属性明细
*
* @param id 商品属性明细主键
* @return 结果
*/
int deleteGoodsAttributeDetailsById(Long id);
/**
* 批量删除商品属性明细
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteGoodsAttributeDetailsByIds(Long[] ids);
/**
* 批量新增商品属性明细
*
* @param goodAttributeDetailsLists 新增商品属性明细
* @return int
**/
int insertGoodsAttributeDetailsList(@Param("goodAttributeDetailsLists") List<GoodsAttributeDetails> goodAttributeDetailsLists);
/**
* 查询商品属性明细列表
*
* @param goodsAttributeId 商品属性明细
* @return 商品属性明细集合
*/
Long[] selectGoodsAttributeDetailsByIdList(Long goodsAttributeId);
/**
* 新增商品属性明细
*
* @param goodsAttributeDetails 商品属性明细
* @return 结果
*/
int addGoodsAttributeDetails(GoodsAttributeDTO goodsAttributeDetails);
/**
* 修改商品属性明细
*
* @param goodsAttributeDetails 商品属性明细
* @return 结果
*/
int updateGoodsAttributeDetailss(GoodsAttributeDTO goodsAttributeDetails);
/**
* 增加库存数量
*
* @param id 主键id
* @param goodsCount 库存数量
* @return 影响数量
*/
int addGoodsStockCount(@Param("id") Long id, @Param("goodsCount") Integer goodsCount);
/**
* 减少库存数量
*
* @param id 主键id
* @param goodsCount 库存数量
* @return 影响数量
*/
int reduceGoodsStockCount(@Param("id") Long id, @Param("goodsCount") Integer goodsCount);
}

View File

@ -0,0 +1,354 @@
<?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.xinelu.manage.mapper.goodsAttributeDetails.GoodsAttributeDetailsMapper">
<resultMap type="GoodsAttributeDetails" id="GoodsAttributeDetailsResult">
<result property="id" column="id"/>
<result property="goodsAttributeId" column="goods_attribute_id"/>
<result property="attributeDetailsName" column="attribute_details_name"/>
<result property="goodsStock" column="goods_stock"/>
<result property="goodsPrice" column="goods_price"/>
<result property="attributePitureUrl" column="attribute_piture_url"/>
<result property="sort" column="sort"/>
<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="integralExchangeFlag" column="integral_exchange_flag"/>
<result property="integralExchangeSill" column="integral_exchange_sill"/>
<result property="integralExchangeCount" column="integral_exchange_count"/>
</resultMap>
<sql id="selectGoodsAttributeDetailsVo">
select id,
goods_attribute_id,
attribute_details_name,
goods_stock,
goods_price,
attribute_piture_url,
sort,
create_by,
create_time,
update_by,
update_time,
integral_exchange_flag,
integral_exchange_sill,
integral_exchange_count
from goods_attribute_details
</sql>
<select id="selectGoodsAttributeDetailsList" parameterType="GoodsAttributeDetails"
resultMap="GoodsAttributeDetailsResult">
<include refid="selectGoodsAttributeDetailsVo"/>
<where>
<if test="goodsAttributeId != null ">
and goods_attribute_id = #{goodsAttributeId}
</if>
<if test="attributeDetailsName != null and attributeDetailsName != ''">
and attribute_details_name like concat('%', #{attributeDetailsName}, '%')
</if>
<if test="goodsStock != null ">
and goods_stock = #{goodsStock}
</if>
<if test="goodsPrice != null ">
and goods_price = #{goodsPrice}
</if>
<if test="attributePitureUrl != null and attributePitureUrl != ''">
and attribute_piture_url = #{attributePitureUrl}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
<if test="integralExchangeFlag != null ">
and integral_exchange_flag = #{integralExchangeFlag}
</if>
<if test="integralExchangeSill != null ">
and integral_exchange_sill = #{integralExchangeSill}
</if>
<if test="integralExchangeCount != null ">
and integral_exchange_count = #{integralExchangeCount}
</if>
</where>
</select>
<select id="selectGoodsAttributeDetailsById" parameterType="Long"
resultMap="GoodsAttributeDetailsResult">
<include refid="selectGoodsAttributeDetailsVo"/>
where id = #{id}
</select>
<insert id="insertGoodsAttributeDetails" parameterType="GoodsAttributeDetails" useGeneratedKeys="true"
keyProperty="id">
insert into goods_attribute_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goodsAttributeId != null">goods_attribute_id,
</if>
<if test="attributeDetailsName != null">attribute_details_name,
</if>
<if test="goodsStock != null">goods_stock,
</if>
<if test="goodsPrice != null">goods_price,
</if>
<if test="attributePitureUrl != null">attribute_piture_url,
</if>
<if test="sort != null">sort,
</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="integralExchangeFlag != null">integral_exchange_flag,
</if>
<if test="integralExchangeSill != null">integral_exchange_sill,
</if>
<if test="integralExchangeCount != null">integral_exchange_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goodsAttributeId != null">#{goodsAttributeId},
</if>
<if test="attributeDetailsName != null">#{attributeDetailsName},
</if>
<if test="goodsStock != null">#{goodsStock},
</if>
<if test="goodsPrice != null">#{goodsPrice},
</if>
<if test="attributePitureUrl != null">#{attributePitureUrl},
</if>
<if test="sort != null">#{sort},
</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="integralExchangeFlag != null">#{integralExchangeFlag},
</if>
<if test="integralExchangeSill != null">#{integralExchangeSill},
</if>
<if test="integralExchangeCount != null">#{integralExchangeCount},
</if>
</trim>
</insert>
<update id="updateGoodsAttributeDetails" parameterType="GoodsAttributeDetails">
update goods_attribute_details
<trim prefix="SET" suffixOverrides=",">
<if test="goodsAttributeId != null">goods_attribute_id =
#{goodsAttributeId},
</if>
<if test="attributeDetailsName != null">attribute_details_name =
#{attributeDetailsName},
</if>
<if test="goodsStock != null">goods_stock =
#{goodsStock},
</if>
<if test="goodsPrice != null">goods_price =
#{goodsPrice},
</if>
<if test="attributePitureUrl != null">attribute_piture_url =
#{attributePitureUrl},
</if>
<if test="sort != null">sort =
#{sort},
</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="integralExchangeFlag != null">integral_exchange_flag =
#{integralExchangeFlag},
</if>
<if test="integralExchangeSill != null">integral_exchange_sill =
#{integralExchangeSill},
</if>
<if test="integralExchangeCount != null">integral_exchange_count =
#{integralExchangeCount},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGoodsAttributeDetailsById" parameterType="Long">
delete
from goods_attribute_details
where id = #{id}
</delete>
<delete id="deleteGoodsAttributeDetailsByIds" parameterType="String">
delete from goods_attribute_details where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertGoodsAttributeDetailsList" parameterType="java.util.List">
insert into goods_attribute_details(
goods_attribute_id,
attribute_details_name,
goods_stock,
goods_price,
attribute_piture_url,
sort,
create_by,
create_time,
update_by,
update_time
) values
<foreach item="goodAttributeDetailsLists" index="index" collection="goodAttributeDetailsLists" separator=",">
(
#{goodAttributeDetailsLists.goodsAttributeId},
#{goodAttributeDetailsLists.attributeDetailsName},
#{goodAttributeDetailsLists.goodsStock},
#{goodAttributeDetailsLists.goodsPrice},
#{goodAttributeDetailsLists.attributePitureUrl},
#{goodAttributeDetailsLists.sort},
#{goodAttributeDetailsLists.createBy},
#{goodAttributeDetailsLists.createTime},
#{goodAttributeDetailsLists.updateBy},
#{goodAttributeDetailsLists.updateTime}
)
</foreach>
</insert>
<select id="selectGoodsAttributeDetailsByIdList" parameterType="Long"
resultType="Long">
select id
from goods_attribute_details
<where>
<if test="goodsAttributeId != null ">
and goods_attribute_id = #{goodsAttributeId}
</if>
</where>
</select>
<insert id="addGoodsAttributeDetails" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO"
useGeneratedKeys="true"
keyProperty="id">
insert into goods_attribute_details
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goodsAttributeId != null">goods_attribute_id,
</if>
<if test="attributeDetailsName != null">attribute_details_name,
</if>
<if test="goodsStock != null">goods_stock,
</if>
<if test="goodsPrice != null">goods_price,
</if>
<if test="attributePitureUrl != null">attribute_piture_url,
</if>
<if test="attributeDetailsSort != null">sort,
</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="integralExchangeFlag != null">integral_exchange_flag,
</if>
<if test="integralExchangeSill != null">integral_exchange_sill,
</if>
<if test="integralExchangeCount != null">integral_exchange_count,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="goodsAttributeId != null">#{goodsAttributeId},
</if>
<if test="attributeDetailsName != null">#{attributeDetailsName},
</if>
<if test="goodsStock != null">#{goodsStock},
</if>
<if test="goodsPrice != null">#{goodsPrice},
</if>
<if test="attributePitureUrl != null">#{attributePitureUrl},
</if>
<if test="attributeDetailsSort != null">#{attributeDetailsSort},
</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="integralExchangeFlag != null">#{integralExchangeFlag},
</if>
<if test="integralExchangeSill != null">#{integralExchangeSill},
</if>
<if test="integralExchangeCount != null">#{integralExchangeCount},
</if>
</trim>
</insert>
<update id="updateGoodsAttributeDetailss" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO">
update goods_attribute_details
<trim prefix="SET" suffixOverrides=",">
<if test="goodsAttributeId != null">goods_attribute_id =
#{goodsAttributeId},
</if>
<if test="attributeDetailsName != null">attribute_details_name =
#{attributeDetailsName},
</if>
<if test="goodsStock != null">goods_stock =
#{goodsStock},
</if>
<if test="goodsPrice != null">goods_price =
#{goodsPrice},
</if>
<if test="attributePitureUrl != null">attribute_piture_url =
#{attributePitureUrl},
</if>
<if test="attributeDetailsSort != null">sort =
#{attributeDetailsSort},
</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>
integral_exchange_flag = #{integralExchangeFlag},
integral_exchange_sill = #{integralExchangeSill},
integral_exchange_count = #{integralExchangeCount}
</trim>
where id = #{attributeDetailsId}
</update>
<update id="addGoodsStockCount">
update goods_attribute_details set goods_stock = goods_stock + #{goodsCount}, update_time = now() where id = #{id}
</update>
<update id="reduceGoodsStockCount">
update goods_attribute_details set goods_stock = goods_stock - #{goodsCount}, update_time = now() where id = #{id} and goods_stock &gt; 0
</update>
</mapper>

View File

@ -0,0 +1,139 @@
package com.xinelu.manage.mapper.goodsInfo;
import com.xinelu.manage.domain.goodsInfo.GoodsInfo;
import com.xinelu.manage.domain.nursestation.NurseStation;
import com.xinelu.manage.domain.storeInfo.StoreInfo;
import com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO;
import com.xinelu.manage.vo.goodsInfo.GetGoodDetails;
import com.xinelu.manage.vo.goodsInfo.GoodsInfoVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品基本信息Mapper接口
*
* @author xinyilu
* @date 2022-10-17
*/
public interface GoodsInfoMapper {
/**
* 查询商品基本信息
*
* @param id 商品基本信息主键
* @return 商品基本信息
*/
GoodsInfo selectGoodsInfoById(Long id);
/**
* 查询商品基本信息列表
*
* @param goodsInfo 商品基本信息
* @return 商品基本信息集合
*/
List<GoodsInfo> selectGoodsInfoList(GoodsInfo goodsInfo);
/**
* 新增商品基本信息
*
* @param goodsInfo 商品基本信息
* @return 结果
*/
int insertGoodsInfo(GoodsInfo goodsInfo);
/**
* 修改商品基本信息
*
* @param goodsInfo 商品基本信息
* @return 结果
*/
int updateGoodsInfo(GoodsInfo goodsInfo);
/**
* 删除商品基本信息
*
* @param id 商品基本信息主键
* @return 结果
*/
int deleteGoodsInfoById(Long id);
/**
* 批量删除商品基本信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteGoodsInfoByIds(Long[] ids);
/**
* 查询商品基本信息
*
* @param goodsInfoVO 商品基本信息
* @return java.util.List<com.xinyilu.base.vo.goodsInfo.GoodsInfoVO>
**/
List<GoodsInfoVO> getGoodsInfoList(GoodsInfoVO goodsInfoVO);
/**
* 商品属性信息
*
* @param goodsInfoId 商品详细id
* @return java.util.List<com.xinyilu.nurseapplet.domain.nursingStationGoods.GoodDetailsList>
**/
GetGoodDetails getGoodsDetailsList(Long goodsInfoId);
/**
* 修改商品上架状态基本信息
*
* @param goodsInfo 商品基本信息
* @return 结果
*/
int updateGoodsWhetherShelf(GoodsInfo goodsInfo);
/**
* 查询店铺信息
*
* @param nurseStationId 店铺信息主键
* @return 店铺信息
*/
StoreInfo getStoreInfoById(Long nurseStationId);
/**
* 新增店铺信息
*
* @param storeInfo 店铺信息
* @return 结果
*/
int insertStoreInfo(StoreInfo storeInfo);
/**
* 查询护理站信息
*
* @param id 护理站信息主键
* @return 护理站信息
*/
NurseStation getNurseStationById(Long id);
/**
* 查询商品基本信息id
*
* @param id 商品基本信息id
* @return java.util.List<com.xinyilu.base.vo.goodsInfo.GoodsInfoVO>
**/
List<GoodsAttributeDTO> getGoodsByIdList(Long id);
/**
* 查询商品基本信息id
*
* @param goodsInfoIdList 商品基本信息id
* @return java.util.List<com.xinyilu.base.vo.goodsInfo.GoodsInfoVO>
**/
List<GoodsAttributeDTO> getGoodsByIdLists(@Param("goodsInfoIdList") List<Long> goodsInfoIdList);
/**
* 查询店铺信息
*
* @param storeName 店铺名称
* @return 店铺信息
*/
StoreInfo getStoreInfoByName(@Param("storeName") String storeName);
}

View File

@ -0,0 +1,71 @@
package com.xinelu.manage.vo.goodsInfo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/19 10:08
*/
@Data
public class GetGoodAttributeDetailsList implements Serializable {
private static final long serialVersionUID = 1235925767957012159L;
/**
* 商品属性明细表id
**/
public Long attributeDetailsId;
/**
* 商品属性明细名称
*/
private String attributeDetailsName;
/**
* 商品属性图片地址
*/
private String attributePitureUrl;
/**
* 商品单价保留到小数点后两位
*/
private BigDecimal goodsPrice;
/**
* 商品库存
*/
private Long goodsStock;
/**
* 商品排序
*/
private Integer attributeDetailsSort;
/**
* 商品属性id
*/
private Long goodsAttributeId;
/**
* 商品属性名称
*/
private String attributeName;
/**
* 积分兑换标识01
*/
private Integer integralExchangeFlag;
/**
* 积分兑换门槛值
*/
private Integer integralExchangeSill;
/**
* 积分兑换商品数量
*/
private Integer integralExchangeCount;
}

View File

@ -0,0 +1,87 @@
package com.xinelu.manage.vo.goodsInfo;
import com.xinelu.common.core.domain.BaseDomain;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/17 15:58
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class GetGoodDetails extends BaseDomain implements Serializable {
private static final long serialVersionUID = 8087476368916081295L;
/**
* 商品id
*/
private Long goodsInfoId;
/**
* 商品分类id
*/
private Long goodsCategoryId;
/**
* 商品分类名称
*/
private String goodsCategoryName;
/**
* 商品名称
*/
private String goodsName;
/**
* 商品图片路径
*/
private String goodsPictureUrl;
/**
* 商品度量单位
*/
private String goodsUnit;
/**
* 显示顺序
*/
private Integer sort;
/**
* 商品概述
*/
private String goodsRemark;
/**
* 商品用途
*/
private String goodsPurpose;
/**
* 护理站id
*/
private Long nurseStationId;
/**
* 店铺表id
*/
private Long storeInfoId;
/**
* 商品信息属性
*/
List<GetGoodDetailsList> goodDetailsLists;
/**
* 商品信息属性
*/
List<GetGoodAttributeDetailsList> goodAttributeDetailsLists;
}

View File

@ -0,0 +1,38 @@
package com.xinelu.manage.vo.goodsInfo;
import lombok.Data;
import java.io.Serializable;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/17 16:15
*/
@Data
public class GetGoodDetailsList implements Serializable {
private static final long serialVersionUID = 6468704416946946009L;
/**
* 商品属性id
*/
private Long goodsAttributeId;
/**
* 商品属性名称
*/
private String attributeName;
/**
* 商品属性概述
*/
private String attributeRemark;
/**
* 显示顺序
*/
private Integer goodsAttributeSort;
}

View File

@ -0,0 +1,40 @@
package com.xinelu.manage.vo.goodsInfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.manage.domain.goodsInfo.GoodsInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @author ljh
* @version 1.0
* Create by 2022/10/20 14:29
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class GoodsInfoVO extends GoodsInfo implements Serializable {
private static final long serialVersionUID = 4834341804811917899L;
/**
* 主键id
*/
private Long goodsInfoId;
/**
* 护理站名称
*/
@ApiModelProperty(value = "护理站名称")
@Excel(name = "护理站名称")
private String nurseStationName;
/**
* 商品分类名称
*/
@ApiModelProperty(value = "商品分类名称")
@Excel(name = "商品分类名称")
private String goodsCategoryName;
}

View File

@ -0,0 +1,273 @@
<?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.xinelu.manage.mapper.goodsAttribute.GoodsAttributeMapper">
<resultMap type="GoodsAttribute" id="GoodsAttributeResult">
<result property="id" column="id"/>
<result property="goodsId" column="goods_id"/>
<result property="attributeName" column="attribute_name"/>
<result property="attributeCode" column="attribute_code"/>
<result property="attributeRemark" column="attribute_remark"/>
<result property="sort" column="sort"/>
<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="selectGoodsAttributeVo">
select id,
goods_id,
attribute_name,
attribute_code,
attribute_remark,
sort,
create_by,
create_time,
update_by,
update_time
from goods_attribute
</sql>
<select id="selectGoodsAttributeList" parameterType="GoodsAttribute" resultMap="GoodsAttributeResult">
<include refid="selectGoodsAttributeVo"/>
<where>
<if test="goodsId != null ">
and goods_id = #{goodsId}
</if>
<if test="attributeName != null and attributeName != ''">
and attribute_name like concat('%', #{attributeName}, '%')
</if>
<if test="attributeCode != null and attributeCode != ''">
and attribute_code = #{attributeCode}
</if>
<if test="attributeRemark != null and attributeRemark != ''">
and attribute_remark = #{attributeRemark}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
</where>
</select>
<select id="selectGoodsAttributeById" parameterType="Long"
resultMap="GoodsAttributeResult">
<include refid="selectGoodsAttributeVo"/>
where id = #{id}
</select>
<insert id="insertGoodsAttribute" parameterType="GoodsAttribute" useGeneratedKeys="true"
keyProperty="id">
insert into goods_attribute
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goodsId != null">goods_id,
</if>
<if test="attributeName != null">attribute_name,
</if>
<if test="attributeCode != null">attribute_code,
</if>
<if test="attributeRemark != null">attribute_remark,
</if>
<if test="sort != null">sort,
</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="goodsId != null">#{goodsId},
</if>
<if test="attributeName != null">#{attributeName},
</if>
<if test="attributeCode != null">#{attributeCode},
</if>
<if test="attributeRemark != null">#{attributeRemark},
</if>
<if test="sort != null">#{sort},
</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="updateGoodsAttribute" parameterType="GoodsAttribute">
update goods_attribute
<trim prefix="SET" suffixOverrides=",">
<if test="goodsId != null">goods_id =
#{goodsId},
</if>
<if test="attributeName != null">attribute_name =
#{attributeName},
</if>
<if test="attributeCode != null">attribute_code =
#{attributeCode},
</if>
<if test="attributeRemark != null">attribute_remark =
#{attributeRemark},
</if>
<if test="sort != null">sort =
#{sort},
</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="deleteGoodsAttributeById" parameterType="Long">
delete
from goods_attribute
where id = #{id}
</delete>
<delete id="deleteGoodsAttributeByIds" parameterType="String">
delete from goods_attribute where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertGoodsAttributeList" parameterType="java.util.List">
insert into goods_attribute(
goods_id,
attribute_name,
attribute_code,
attribute_remark,
sort,
create_by,
create_time,
update_by,
update_time
) values
<foreach item="goodDetailsLists" index="index" collection="goodDetailsLists" separator=",">
(
#{goodDetailsLists.goodsId},
#{goodDetailsLists.attributeName},
#{goodDetailsLists.attributeCode},
#{goodDetailsLists.attributeRemark},
#{goodDetailsLists.sort},
#{goodDetailsLists.createBy},
#{goodDetailsLists.createTime},
#{goodDetailsLists.updateBy},
#{goodDetailsLists.updateTime}
)
</foreach>
</insert>
<insert id="insertGoodsAttributes" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO"
useGeneratedKeys="true"
keyProperty="goodsAttributeId">
insert into goods_attribute
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="goodsId != null">goods_id,
</if>
<if test="attributeName != null">attribute_name,
</if>
<if test="attributeCode != null">attribute_code,
</if>
<if test="attributeRemark != null">attribute_remark,
</if>
<if test="attributeDetailsSort != null">sort,
</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="goodsId != null">#{goodsId},
</if>
<if test="attributeName != null">#{attributeName},
</if>
<if test="attributeCode != null">#{attributeCode},
</if>
<if test="attributeRemark != null">#{attributeRemark},
</if>
<if test="attributeDetailsSort != null">#{attributeDetailsSort},
</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="updateGoodsAttributes" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO">
update goods_attribute
<trim prefix="SET" suffixOverrides=",">
<if test="goodsId != null">goods_id =
#{goodsId},
</if>
<if test="attributeName != null">attribute_name =
#{attributeName},
</if>
<if test="attributeCode != null">attribute_code =
#{attributeCode},
</if>
<if test="attributeRemark != null">attribute_remark =
#{attributeRemark},
</if>
<if test="attributeDetailsSort != null">sort =
#{attributeDetailsSort},
</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 = #{goodsAttributeId}
</update>
<select id="selectGoodsAttributeByIdList" parameterType="Long" resultType="Long">
select id
from goods_attribute
<where>
<if test="goodsId != null ">
and goods_id = #{goodsId}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,595 @@
<?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.xinelu.manage.mapper.goodsInfo.GoodsInfoMapper">
<resultMap type="GoodsInfo" id="GoodsInfoResult">
<result property="id" column="id"/>
<result property="storeInfoId" column="store_info_id"/>
<result property="nurseStationId" column="nurse_station_id"/>
<result property="goodsCategoryId" column="goods_category_id"/>
<result property="goodsName" column="goods_name"/>
<result property="goodsCode" column="goods_code"/>
<result property="whetherShelf" column="whether_shelf"/>
<result property="shelfTime" column="shelf_time"/>
<result property="goodsPictureUrl" column="goods_picture_url"/>
<result property="goodsRemark" column="goods_remark"/>
<result property="goodsUnit" column="goods_unit"/>
<result property="goodsPurpose" column="goods_purpose"/>
<result property="sort" column="sort"/>
<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>
<resultMap type="com.xinelu.manage.vo.goodsInfo.GetGoodDetails" id="GoodDetailsResult">
<result property="goodsInfoId" column="goodsInfoId"/>
<result property="goodsCategoryId" column="goods_category_id"/>
<result property="goodsCategoryName" column="goods_category_name"/>
<result property="nurseStationId" column="nurse_station_id"/>
<result property="goodsName" column="goods_name"/>
<result property="goodsPictureUrl" column="goods_picture_url"/>
<result property="goodsUnit" column="goods_unit"/>
<result property="goodsRemark" column="goods_remark"/>
<result property="goodsPurpose" column="goods_purpose"/>
<result property="sort" column="sort"/>
<collection property="goodAttributeDetailsLists" javaType="java.util.List" resultMap="goodDetailsListsResult"/>
</resultMap>
<resultMap type="com.xinelu.manage.vo.goodsInfo.GetGoodAttributeDetailsList" id="goodDetailsListsResult">
<result property="attributeDetailsId" column="attributeDetailsId"/>
<result property="goodsAttributeId" column="goodsAttributeId"/>
<result property="attributeName" column="attribute_name"/>
<result property="attributeDetailsName" column="attribute_details_name"/>
<result property="attributePitureUrl" column="attribute_piture_url"/>
<result property="goodsPrice" column="goods_price"/>
<result property="goodsStock" column="goods_stock"/>
<result property="integralExchangeFlag" column="integral_exchange_flag"/>
<result property="integralExchangeSill" column="integral_exchange_sill"/>
<result property="integralExchangeCount" column="integral_exchange_count"/>
<result property="attributeDetailsSort" column="attributeDetailsSort"/>
</resultMap>
<sql id="selectGoodsInfoVo">
select id,
store_info_id,
nurse_station_id,
goods_category_id,
goods_name,
goods_code,
whether_shelf,
shelf_time,
goods_picture_url,
goods_remark,
goods_unit,
goods_purpose,
sort,
create_by,
create_time,
update_by,
update_time
from goods_info
</sql>
<select id="selectGoodsInfoList" parameterType="GoodsInfo" resultMap="GoodsInfoResult">
<include refid="selectGoodsInfoVo"/>
<where>
<if test="storeInfoId != null ">
and store_info_id = #{storeInfoId}
</if>
<if test="nurseStationId != null ">
and nurse_station_id = #{nurseStationId}
</if>
<if test="goodsCategoryId != null ">
and goods_category_id = #{goodsCategoryId}
</if>
<if test="goodsName != null and goodsName != ''">
and goods_name like concat('%', #{goodsName}, '%')
</if>
<if test="goodsCode != null and goodsCode != ''">
and goods_code = #{goodsCode}
</if>
<if test="whetherShelf != null ">
and whether_shelf = #{whetherShelf}
</if>
<if test="shelfTime != null ">
and shelf_time = #{shelfTime}
</if>
<if test="goodsPictureUrl != null and goodsPictureUrl != ''">
and goods_picture_url = #{goodsPictureUrl}
</if>
<if test="goodsRemark != null and goodsRemark != ''">
and goods_remark = #{goodsRemark}
</if>
<if test="goodsUnit != null and goodsUnit != ''">
and goods_unit = #{goodsUnit}
</if>
<if test="goodsPurpose != null and goodsPurpose != ''">
and goods_purpose = #{goodsPurpose}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
</where>
ORDER BY create_time
</select>
<select id="selectGoodsInfoById" parameterType="Long"
resultMap="GoodsInfoResult">
<include refid="selectGoodsInfoVo"/>
where id = #{id}
</select>
<insert id="insertGoodsInfo" parameterType="GoodsInfo" useGeneratedKeys="true"
keyProperty="id">
insert into goods_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="storeInfoId != null">store_info_id,
</if>
<if test="nurseStationId != null">nurse_station_id,
</if>
<if test="goodsCategoryId != null">goods_category_id,
</if>
<if test="goodsName != null">goods_name,
</if>
<if test="goodsCode != null">goods_code,
</if>
<if test="whetherShelf != null">whether_shelf,
</if>
<if test="shelfTime != null">shelf_time,
</if>
<if test="goodsPictureUrl != null">goods_picture_url,
</if>
<if test="goodsRemark != null">goods_remark,
</if>
<if test="goodsUnit != null">goods_unit,
</if>
<if test="goodsPurpose != null">goods_purpose,
</if>
<if test="sort != null">sort,
</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="storeInfoId != null">#{storeInfoId},
</if>
<if test="nurseStationId != null">#{nurseStationId},
</if>
<if test="goodsCategoryId != null">#{goodsCategoryId},
</if>
<if test="goodsName != null">#{goodsName},
</if>
<if test="goodsCode != null">#{goodsCode},
</if>
<if test="whetherShelf != null">#{whetherShelf},
</if>
<if test="shelfTime != null">#{shelfTime},
</if>
<if test="goodsPictureUrl != null">#{goodsPictureUrl},
</if>
<if test="goodsRemark != null">#{goodsRemark},
</if>
<if test="goodsUnit != null">#{goodsUnit},
</if>
<if test="goodsPurpose != null">#{goodsPurpose},
</if>
<if test="sort != null">#{sort},
</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="updateGoodsInfo" parameterType="GoodsInfo">
update goods_info
<trim prefix="SET" suffixOverrides=",">
<if test="storeInfoId != null">store_info_id =
#{storeInfoId},
</if>
<if test="nurseStationId != null">nurse_station_id =
#{nurseStationId},
</if>
<if test="goodsCategoryId != null">goods_category_id =
#{goodsCategoryId},
</if>
<if test="goodsName != null">goods_name =
#{goodsName},
</if>
<if test="goodsCode != null">goods_code =
#{goodsCode},
</if>
<if test="whetherShelf != null">whether_shelf =
#{whetherShelf},
</if>
<if test="shelfTime != null">shelf_time =
#{shelfTime},
</if>
<if test="goodsPictureUrl != null">goods_picture_url =
#{goodsPictureUrl},
</if>
<if test="goodsRemark != null">goods_remark =
#{goodsRemark},
</if>
<if test="goodsUnit != null">goods_unit =
#{goodsUnit},
</if>
<if test="goodsPurpose != null">goods_purpose =
#{goodsPurpose},
</if>
<if test="sort != null">sort =
#{sort},
</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="deleteGoodsInfoById" parameterType="Long">
delete
from goods_info
where id = #{id}
</delete>
<delete id="deleteGoodsInfoByIds" parameterType="String">
delete from goods_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="getGoodsInfoList" parameterType="com.xinelu.manage.vo.goodsInfo.GoodsInfoVO"
resultType="com.xinelu.manage.vo.goodsInfo.GoodsInfoVO">
SELECT
gi.id goodsInfoId,
gi.goods_category_id,
gi.goods_code,
gi.goods_name,
gc.goods_category_name,
ns.nurse_station_name,
gi.goods_picture_url,
gi.goods_purpose,
gi.whether_shelf,
gi.shelf_time,
gi.create_by,
gi.create_time,
gi.update_by,
gi.update_time,
ns.nurse_station_name
FROM
goods_info gi
LEFT JOIN goods_category gc ON gi.goods_category_id = gc.id
LEFT JOIN nurse_station ns ON gi.nurse_station_id = ns.id
<where>
<if test="goodsName != null and goodsName != ''">
and gi.goods_name like concat('%', #{goodsName}, '%')
</if>
<if test="whetherShelf != null ">
and gi.whether_shelf = #{whetherShelf}
</if>
<if test="goodsPurpose != null and goodsPurpose != ''">
and gi.goods_purpose = #{goodsPurpose}
</if>
<if test="goodsCategoryName != null and goodsCategoryName != ''">
and gc.goods_category_name like concat('%', #{goodsCategoryName}, '%')
</if>
<if test="nurseStationName != null and nurseStationName != ''">
and ns.nurse_station_name like concat('%', #{nurseStationName}, '%')
</if>
<if test="nurseStationId != null ">
and ns.id = #{nurseStationId}
</if>
</where>
ORDER BY gi.create_time DESC
</select>
<select id="getGoodsDetailsList" parameterType="com.xinelu.manage.vo.goodsInfo.GetGoodDetails"
resultMap="GoodDetailsResult">
SELECT
gi.id goodsInfoId,
ga.id goodsAttributeId,
gad.id attributeDetailsId,
gi.store_info_id,
gi.nurse_station_id,
gi.goods_category_id,
gi.goods_name,
gi.goods_picture_url,
gi.goods_unit,
gi.goods_remark,
gi.goods_purpose,
gi.sort,
ga.attribute_name,
ga.attribute_remark,
ga.sort goodsAttributeSort,
gad.attribute_details_name,
gad.attribute_piture_url,
gad.goods_stock,
gad.sort attributeDetailsSort,
gad.goods_price,
gc.goods_category_name,
gad.integral_exchange_flag,
gad.integral_exchange_sill,
gad.integral_exchange_count
FROM
goods_info gi
LEFT JOIN store_info si ON gi.store_info_id = si.id
LEFT JOIN goods_attribute ga ON ga.goods_id = gi.id
LEFT JOIN goods_attribute_details gad ON gad.goods_attribute_id = ga.id
LEFT JOIN goods_category gc ON gi.goods_category_id = gc.id
<where>
<if test="goodsInfoId != null ">
and gi.id = #{goodsInfoId}
</if>
</where>
</select>
<update id="updateGoodsWhetherShelf" parameterType="GoodsInfo">
update goods_info
<trim prefix="SET" suffixOverrides=",">
<if test="storeInfoId != null">store_info_id =
#{storeInfoId},
</if>
<if test="nurseStationId != null">nurse_station_id =
#{nurseStationId},
</if>
<if test="goodsCategoryId != null">goods_category_id =
#{goodsCategoryId},
</if>
<if test="goodsName != null">goods_name =
#{goodsName},
</if>
<if test="goodsCode != null">goods_code =
#{goodsCode},
</if>
<if test="whetherShelf != null">whether_shelf =
#{whetherShelf},
</if>
<if test="shelfTime != null">shelf_time =
#{shelfTime},
</if>
<if test="goodsPictureUrl != null">goods_picture_url =
#{goodsPictureUrl},
</if>
<if test="goodsRemark != null">goods_remark =
#{goodsRemark},
</if>
<if test="goodsUnit != null">goods_unit =
#{goodsUnit},
</if>
<if test="goodsPurpose != null">goods_purpose =
#{goodsPurpose},
</if>
<if test="sort != null">sort =
#{sort},
</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>
<select id="getStoreInfoById" parameterType="Long"
resultType="StoreInfo">
select id,
nurse_station_id,
store_name,
store_code,
store_address,
phone,
store_logo_url,
store_operator,
opening_status,
opening_time,
occupation_start_time,
occupation_end_time,
sort,
create_by,
create_time,
update_by,
update_time
from store_info
where nurse_station_id = #{nurseStationId}
</select>
<insert id="insertStoreInfo" parameterType="StoreInfo" useGeneratedKeys="true"
keyProperty="id">
insert into store_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nurseStationId != null">nurse_station_id,
</if>
<if test="storeName != null">store_name,
</if>
<if test="storeCode != null">store_code,
</if>
<if test="storeAddress != null">store_address,
</if>
<if test="phone != null">phone,
</if>
<if test="storeLogoUrl != null">store_logo_url,
</if>
<if test="storeOperator != null">store_operator,
</if>
<if test="openingStatus != null">opening_status,
</if>
<if test="openingTime != null">opening_time,
</if>
<if test="occupationStartTime != null">occupation_start_time,
</if>
<if test="occupationEndTime != null">occupation_end_time,
</if>
<if test="sort != null">sort,
</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="nurseStationId != null">#{nurseStationId},
</if>
<if test="storeName != null">#{storeName},
</if>
<if test="storeCode != null">#{storeCode},
</if>
<if test="storeAddress != null">#{storeAddress},
</if>
<if test="phone != null">#{phone},
</if>
<if test="storeLogoUrl != null">#{storeLogoUrl},
</if>
<if test="storeOperator != null">#{storeOperator},
</if>
<if test="openingStatus != null">#{openingStatus},
</if>
<if test="openingTime != null">#{openingTime},
</if>
<if test="occupationStartTime != null">#{occupationStartTime},
</if>
<if test="occupationEndTime != null">#{occupationEndTime},
</if>
<if test="sort != null">#{sort},
</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>
<select id="getNurseStationById" parameterType="Long"
resultType="NurseStation">
select id,
area_code,
user_id,
nurse_station_code,
nurse_station_name,
nurse_station_type,
agency_introduce,
nurse_station_description,
longitude,
latitude,
phone,
address,
duty_person,
duty_phone,
station_picture_url,
station_introduce_pciture_url,
sort,
create_by,
create_time,
update_by,
update_time
from nurse_station
where id = #{id}
</select>
<select id="getGoodsByIdList" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO"
resultType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO">
SELECT
gi.id goodsId,
ga.id goodsAttributeId,
gad.id goodAttributeDetailsId,
gi.goods_category_id,
gi.goods_name,
gi.goods_picture_url,
gi.goods_unit,
gi.goods_remark,
gi.goods_purpose,
ga.attribute_name,
ga.attribute_remark,
ga.sort goodsAttributeSort,
gad.attribute_details_name,
gad.attribute_piture_url,
gad.goods_stock,
gad.sort attributeDetailsSort,
gad.goods_price
FROM
goods_info gi
LEFT JOIN store_info si ON gi.store_info_id = si.id
LEFT JOIN goods_attribute ga ON ga.goods_id = gi.id
LEFT JOIN goods_attribute_details gad ON gad.goods_attribute_id = ga.id
<where>
<if test="id != null ">
and gi.id = #{id}
</if>
</where>
</select>
<select id="getGoodsByIdLists" parameterType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO"
resultType="com.xinelu.manage.dto.goodsInfo.GoodsAttributeDTO">
SELECT
gi.id,
ga.id goodsAttributeId,
gad.id goodAttributeDetailsId,
gi.goods_remark,
gi.goods_picture_url,
gad.attribute_piture_url
FROM
goods_info gi
LEFT JOIN goods_attribute ga ON ga.goods_id = gi.id
LEFT JOIN goods_attribute_details gad ON gad.goods_attribute_id = ga.id
<where>
<if test="goodsInfoIdList != null and goodsInfoIdList.size()>0 ">
and gi.id in
<foreach item="goodsInfoId" collection="goodsInfoIdList" open="(" separator="," close=")">
#{goodsInfoId}
</foreach>
</if>
</where>
</select>
<select id="getStoreInfoByName" parameterType="string" resultType="StoreInfo">
select id, store_code, store_name
from store_info
where store_name = #{storeName}
</select>
</mapper>