新增商品类型+商品图片的service和mapper层

This commit is contained in:
clunt 2022-03-15 11:12:47 +08:00
parent 7e8b90370e
commit c590ffae45
10 changed files with 141 additions and 0 deletions

View File

@ -24,6 +24,14 @@ public class GoodsCategory extends BaseEntity {
@Excel(name = "类别名称", cellType = Excel.ColumnType.STRING)
private String goodsCategoryName;
@Excel(name = "父级编码", cellType = Excel.ColumnType.STRING)
private Long parentCategoryId;
@Excel(name = "级别 1级目录 2级目录", cellType = Excel.ColumnType.STRING)
private Long level;
@Excel(name = "类别类型. 1.服务类 2.商品类", cellType = Excel.ColumnType.STRING)
private String type;
}

View File

@ -0,0 +1,25 @@
package com.ghy.goods.domain;
import com.ghy.common.annotation.Excel;
import com.ghy.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 商品图片
* @author clunt
*/
@Data
public class GoodsImgs extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "图片序号", cellType = Excel.ColumnType.NUMERIC)
private Long goodsImgsId;
@Excel(name = "商品id", cellType = Excel.ColumnType.STRING)
private Long goodsId;
@Excel(name = "图片url", cellType = Excel.ColumnType.STRING)
private String imgUrl;
}

View File

@ -0,0 +1,8 @@
package com.ghy.goods.mapper;
/**
* @author clunt
* 商品类别mapper层
*/
public interface GoodsCategoryMapper {
}

View File

@ -0,0 +1,12 @@
package com.ghy.goods.mapper;
/**
* @author clunt
* 商品图片mapper层
*/
public interface GoodsImgsMapper {
}

View File

@ -0,0 +1,8 @@
package com.ghy.goods.service;
/**
* @author clunt
* 商品类别接口
*/
public interface GoodsCategoryService {
}

View File

@ -0,0 +1,7 @@
package com.ghy.goods.service;
/**
* 商品图片接口
*/
public interface GoodsImgsService {
}

View File

@ -0,0 +1,12 @@
package com.ghy.goods.service.impl;
import com.ghy.goods.service.GoodsCategoryService;
/**
* @author clunt
* 商品类别impl
*/
public class GoodsCategoryServiceImpl implements GoodsCategoryService {
}

View File

@ -0,0 +1,12 @@
package com.ghy.goods.service.impl;
import com.ghy.goods.service.GoodsImgsService;
import org.springframework.stereotype.Service;
/**
* @author clunt
* 商品图片impl
*/
@Service
public class GoodsImgsServiceImpl implements GoodsImgsService {
}

View File

@ -0,0 +1,26 @@
<?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.GoodsCategoryMapper">
<resultMap id="GoodsCategoryResult" type="com.ghy.goods.domain.GoodsCategory">
<result property="goodsCategoryId" column="goods_category_id" />
<result property="goodsCategoryCode" column="goods_category_code" />
<result property="goodsCategoryName" column="goods_category_name" />
<result property="parentCategoryId" column="parent_category_id" />
<result property="level" column="level" />
<result property="type" column="type" />
<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="selectGoodsCategory">
SELECT goods_category_id, goods_category_code, goods_category_name, parent_category_id,
level, type, create_by, create_time, remark
FROM goods_category
</sql>
</mapper>

View File

@ -0,0 +1,23 @@
<?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.GoodsImgsMapper">
<resultMap id="GoodsImgsResult" type="com.ghy.goods.domain.GoodsImgs">
<result property="goodsImgsId" column="goods_imgs_id" />
<result property="goodsId" column="goods_id" />
<result property="imgUrl" column="img_url" />
<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="selectGoodsImgs">
SELECT goods_imgs_id, goods_id, img_url, create_by, create_time, remark
FROM goods_imgs
</sql>
</mapper>