新增lombok 和 商品基础表

This commit is contained in:
clunt 2022-03-14 11:31:02 +08:00
parent 2eaf01593d
commit 558d25cbd0
6 changed files with 79 additions and 133 deletions

View File

@ -17,6 +17,11 @@
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<!-- Spring框架基本的核心工具 --> <!-- Spring框架基本的核心工具 -->
<dependency> <dependency>
<groupId>org.springframework</groupId> <groupId>org.springframework</groupId>

View File

@ -2,6 +2,7 @@ package com.ghy.goods.domain;
import com.ghy.common.annotation.Excel; import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity; import com.ghy.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -10,6 +11,7 @@ import java.math.BigDecimal;
* *
* @author clunt * @author clunt
*/ */
@Data
public class Goods extends BaseEntity { public class Goods extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -20,8 +22,8 @@ public class Goods extends BaseEntity {
@Excel(name = "编码") @Excel(name = "编码")
private String goodsCode; private String goodsCode;
@Excel(name = "店铺id") @Excel(name = "公司id")
private Long storeId; private Long companyId;
@Excel(name = "名称") @Excel(name = "名称")
private String goodsName; private String goodsName;
@ -40,143 +42,13 @@ public class Goods extends BaseEntity {
@Excel(name = "类别id") @Excel(name = "类别id")
private Long goodsCategoryId; private Long goodsCategoryId;
@Excel(name = "商品位置id")
private Long storeLocalId;
@Excel(name = "商品图片", cellType = Excel.ColumnType.IMAGE) @Excel(name = "商品图片", cellType = Excel.ColumnType.IMAGE)
private String goodsImgUrl; private String goodsImgUrl;
@Excel(name = "商品标签id")
private Long goodsLabelId;
@Excel(name = "商品库存,-1则表示无限制", cellType = Excel.ColumnType.NUMERIC) @Excel(name = "商品库存,-1则表示无限制", cellType = Excel.ColumnType.NUMERIC)
private Integer goodsNumber; private Integer goodsNumber;
@Excel(name = "描述") @Excel(name = "描述")
private String remark; private String remark;
public Long getGoodsId() {
return goodsId;
}
public void setGoodsId(Long goodsId) {
this.goodsId = goodsId;
}
public String getGoodsCode() {
return goodsCode;
}
public void setGoodsCode(String goodsCode) {
this.goodsCode = goodsCode;
}
public String getGoodsName() {
return goodsName;
}
public void setGoodsName(String goodsName) {
this.goodsName = goodsName;
}
public BigDecimal getGoodsPrice() {
return goodsPrice;
}
public void setGoodsPrice(BigDecimal goodsPrice) {
this.goodsPrice = goodsPrice;
}
public String getGoodsSort() {
return goodsSort;
}
public void setGoodsSort(String goodsSort) {
this.goodsSort = goodsSort;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public Long getGoodsCategoryId() {
return goodsCategoryId;
}
public void setGoodsCategoryId(Long goodsCategoryId) {
this.goodsCategoryId = goodsCategoryId;
}
public String getGoodsImgUrl() {
return goodsImgUrl;
}
public void setGoodsImgUrl(String goodsImgUrl) {
this.goodsImgUrl = goodsImgUrl;
}
public Long getGoodsLabelId() {
return goodsLabelId;
}
public void setGoodsLabelId(Long goodsLabelId) {
this.goodsLabelId = goodsLabelId;
}
public Integer getGoodsNumber() {
return goodsNumber;
}
public void setGoodsNumber(Integer goodsNumber) {
this.goodsNumber = goodsNumber;
}
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
public Long getStoreId() {
return storeId;
}
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public Long getStoreLocalId() {
return storeLocalId;
}
public void setStoreLocalId(Long storeLocalId) {
this.storeLocalId = storeLocalId;
}
@Override
public String toString() {
return "Goods{" +
"goodsId=" + goodsId +
", goodsCode='" + goodsCode + '\'' +
", storeId=" + storeId +
", goodsName='" + goodsName + '\'' +
", goodsPrice=" + goodsPrice +
", goodsSort='" + goodsSort + '\'' +
", status='" + status + '\'' +
", goodsCategoryId=" + goodsCategoryId +
", storeLocalId=" + storeLocalId +
", goodsImgUrl='" + goodsImgUrl + '\'' +
", goodsLabelId=" + goodsLabelId +
", goodsNumber=" + goodsNumber +
", remark='" + remark + '\'' +
'}';
}
} }

View File

@ -3,12 +3,14 @@ package com.ghy.goods.domain;
import com.ghy.common.annotation.Excel; import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity; import com.ghy.common.core.domain.BaseEntity;
import lombok.Data;
/** /**
* 商品类别表 * 商品类别表
* *
* @author clunt * @author clunt
*/ */
@Data
public class GoodsCategory extends BaseEntity { public class GoodsCategory extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -0,0 +1,23 @@
package com.ghy.goods.mapper;
import com.ghy.goods.domain.Goods;
import java.util.List;
/**
* @author clunt
* 商品的mapper层
*/
public interface GoodsMapper {
/**
* @param goods 商品入参
* @return 商品集合
*/
public List<Goods> selectGoodsList(Goods goods);
}

View File

@ -0,0 +1,39 @@
<?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.ghy.goods.mapper.GoodsMapper">
<resultMap id="GoodsResult" type="Goods">
<id property="goodsId" column="goods_id" />
<result property="goodsCode" column="goods_code" />
<result property="companyId" column="company_id" />
<result property="goodsName" column="goods_name" />
<result property="goodsPrice" column="goods_price" />
<result property="goodsSort" column="goods_sort"/>
<result property="goodsCategoryId" column="goods_category_id"/>
<result property="goodsImgUrl" column="goods_img_url"/>
<result property="goodsNumber" column="goods_number"/>
<result property="status" column="status"/>
<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="remark" column="remark" />
</resultMap>
<sql id="selectGoodsVo">
select goods_id, goods_code, company_id, goods_name, goods_price, goods_sort, goods_category_id,
goods_img_url, goods_number, status, create_by, create_time, remark
from sys_post
</sql>
<select id="selectGoodsList" parameterType="Goods" resultMap="GoodsResult">
<include refid="selectGoodsVo" />
<where>
<if test="goodsCode != null and goodsCode != ''">
AND goods_code like concat('%', #{goodsCode}, '%')
</if>
</where>
</select>
</mapper>

View File

@ -33,12 +33,17 @@
<poi.version>4.1.2</poi.version> <poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version> <velocity.version>2.3</velocity.version>
<log4j2.version>2.17.1</log4j2.version> <log4j2.version>2.17.1</log4j2.version>
<lombok.version>1.18.12</lombok.version>
</properties> </properties>
<!-- 依赖声明 --> <!-- 依赖声明 -->
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<!-- SpringBoot的依赖配置--> <!-- SpringBoot的依赖配置-->
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>