乐优商城_商品查询
1.商品查询
1.1.基本代码实现
-
实体类
Spu实体类:
@Table(name = "tb_spu")@Datapublic class Spu {@Id@KeySql(useGeneratedKeys = true)private Long id;private Long BrandId;private Long cid1; //一级类目private Long cid2; //二级类目private Long cid3; //三级类目private String title; //标题private String SubTitle; //子标题private Boolean saleable; //是否上架private Boolean valid; //是否有效,逻辑删除用private Date createTime; //创建时间private Date lastUpdateTime; //最后修改时间}SpuDetail实体类:
@Data@Table(name = "tb_spu_detail")public class SpuDetail {private Long spuId; //对应SPU的idprivate String description; //商品描述private String specialSpec; //商品特殊规格的名称及可选值模板private String genericSpec; //商品的全局规格属性private String packingList; //包装清单private String afterService; //售后服务} -
mapper
public interface SpuMapper extends Mapper{}public interface SpuDetailMapper extends Mapper {} -
service
@Servicepublic class GoodsService {@Autowiredprivate SpuMapper spuMapper;@Autowiredprivate SpuDetailMapper spuDetailMapper;} -
controller
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
