36052 1 هفته پیش
والد
کامیت
ce36baa0e9

+ 18 - 0
src/main/java/com/zhentao/mapper/GoodsMapper.java

@@ -0,0 +1,18 @@
+package com.zhentao.mapper;
+
+import com.zhentao.pojo.Goods;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author 36052
+* @description 针对表【goods】的数据库操作Mapper
+* @createDate 2025-05-16 09:59:18
+* @Entity com.zhentao.pojo.Goods
+*/
+public interface GoodsMapper extends BaseMapper<Goods> {
+
+}
+
+
+
+

+ 51 - 0
src/main/java/com/zhentao/pojo/Goods.java

@@ -0,0 +1,51 @@
+package com.zhentao.pojo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.io.Serializable;
+import java.util.Date;
+import lombok.Data;
+
+/**
+ * 
+ * @TableName goods
+ */
+@TableName(value ="goods")
+@Data
+public class Goods implements Serializable {
+    /**
+     * 
+     */
+    @TableId(type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 
+     */
+    private String goodsName;
+
+    /**
+     * 
+     */
+    private String descriptions;
+
+    /**
+     * 
+     */
+    private String goodsImg;
+
+    /**
+     * 
+     */
+    private String content;
+
+    /**
+     * 
+     */
+    private Date createdTime;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+}

+ 13 - 0
src/main/java/com/zhentao/service/GoodsService.java

@@ -0,0 +1,13 @@
+package com.zhentao.service;
+
+import com.zhentao.pojo.Goods;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+* @author 36052
+* @description 针对表【goods】的数据库操作Service
+* @createDate 2025-05-16 09:59:18
+*/
+public interface GoodsService extends IService<Goods> {
+
+}

+ 22 - 0
src/main/java/com/zhentao/service/impl/GoodsServiceImpl.java

@@ -0,0 +1,22 @@
+package com.zhentao.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.zhentao.pojo.Goods;
+import com.zhentao.service.GoodsService;
+import com.zhentao.mapper.GoodsMapper;
+import org.springframework.stereotype.Service;
+
+/**
+* @author 36052
+* @description 针对表【goods】的数据库操作Service实现
+* @createDate 2025-05-16 09:59:18
+*/
+@Service
+public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods>
+    implements GoodsService{
+
+}
+
+
+
+

+ 20 - 0
src/main/resources/mapper/GoodsMapper.xml

@@ -0,0 +1,20 @@
+<?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.zhentao.mapper.GoodsMapper">
+
+    <resultMap id="BaseResultMap" type="com.zhentao.pojo.Goods">
+            <id property="id" column="id" jdbcType="INTEGER"/>
+            <result property="goodsName" column="goods_name" jdbcType="VARCHAR"/>
+            <result property="descriptions" column="descriptions" jdbcType="VARCHAR"/>
+            <result property="goodsImg" column="goods_img" jdbcType="VARCHAR"/>
+            <result property="content" column="content" jdbcType="VARCHAR"/>
+            <result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,goods_name,descriptions,
+        goods_img,content,created_time
+    </sql>
+</mapper>