lzy 2 days ago
parent
commit
e48fec638d

+ 76 - 0
Marketplace/src/main/java/com/dt/child/dao/LzyFoodContent.java

@@ -0,0 +1,76 @@
+package com.dt.child.dao;
+
+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 lombok.Data;
+
+/**
+ * 
+ * @TableName lzy_food_content
+ */
+@TableName(value ="lzy_food_content")
+@Data
+public class LzyFoodContent implements Serializable {
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+
+    /**
+     * 内容
+     */
+    private String foodContent;
+
+    /**
+     * 食物id
+     */
+    private Long foodId;
+
+    @TableField(exist = false)
+    private static final long serialVersionUID = 1L;
+
+    @Override
+    public boolean equals(Object that) {
+        if (this == that) {
+            return true;
+        }
+        if (that == null) {
+            return false;
+        }
+        if (getClass() != that.getClass()) {
+            return false;
+        }
+        LzyFoodContent other = (LzyFoodContent) that;
+        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
+            && (this.getFoodContent() == null ? other.getFoodContent() == null : this.getFoodContent().equals(other.getFoodContent()))
+            && (this.getFoodId() == null ? other.getFoodId() == null : this.getFoodId().equals(other.getFoodId()));
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
+        result = prime * result + ((getFoodContent() == null) ? 0 : getFoodContent().hashCode());
+        result = prime * result + ((getFoodId() == null) ? 0 : getFoodId().hashCode());
+        return result;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", foodContent=").append(foodContent);
+        sb.append(", foodId=").append(foodId);
+        sb.append(", serialVersionUID=").append(serialVersionUID);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 18 - 0
Marketplace/src/main/java/com/dt/child/mapper/LzyFoodContentMapper.java

@@ -0,0 +1,18 @@
+package com.dt.child.mapper;
+
+import com.dt.child.dao.LzyFoodContent;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+* @author lzy
+* @description 针对表【lzy_food_content】的数据库操作Mapper
+* @createDate 2025-07-04 15:59:30
+* @Entity com.dt.child.dao.LzyFoodContent
+*/
+public interface LzyFoodContentMapper extends BaseMapper<LzyFoodContent> {
+
+}
+
+
+
+

+ 20 - 0
Marketplace/src/main/java/com/dt/child/service/LzyFoodContentService.java

@@ -0,0 +1,20 @@
+package com.dt.child.service;
+
+import com.dt.child.dao.LzyFoodContent;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.dt.child.dto.SelFoodContentDto;
+import com.dt.vo.Result;
+
+/**
+* @author lzy
+* @description 针对表【lzy_food_content】的数据库操作Service
+* @createDate 2025-07-04 15:59:30
+*/
+public interface LzyFoodContentService extends IService<LzyFoodContent> {
+
+
+//    查询食物详情
+    Result selFoodContent(SelFoodContentDto selFoodContentDto);
+
+
+}

+ 34 - 0
Marketplace/src/main/java/com/dt/child/service/impl/LzyFoodContentServiceImpl.java

@@ -0,0 +1,34 @@
+package com.dt.child.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.dt.child.dao.LzyFoodContent;
+import com.dt.child.dto.SelFoodContentDto;
+import com.dt.child.service.LzyFoodContentService;
+import com.dt.child.mapper.LzyFoodContentMapper;
+import com.dt.vo.Result;
+import org.springframework.stereotype.Service;
+
+/**
+* @author lzy
+* @description 针对表【lzy_food_content】的数据库操作Service实现
+* @createDate 2025-07-04 15:59:30
+*/
+@Service
+public class LzyFoodContentServiceImpl extends ServiceImpl<LzyFoodContentMapper, LzyFoodContent>
+    implements LzyFoodContentService{
+
+//
+    @Override
+    public Result selFoodContent(SelFoodContentDto selFoodContentDto) {
+        LzyFoodContent lzyFoodContent = this.baseMapper.selectOne(new LambdaQueryWrapper<LzyFoodContent>().eq(LzyFoodContent::getFoodId, selFoodContentDto.getId()));
+
+
+
+        return null;
+    }
+}
+
+
+
+

+ 16 - 0
Marketplace/src/main/resources/mapper/LzyFoodContentMapper.xml

@@ -0,0 +1,16 @@
+<?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.dt.child.mapper.LzyFoodContentMapper">
+
+    <resultMap id="BaseResultMap" type="com.dt.child.dao.LzyFoodContent">
+            <id property="id" column="id" jdbcType="BIGINT"/>
+            <result property="foodContent" column="food_content" jdbcType="VARCHAR"/>
+            <result property="foodId" column="food_id" jdbcType="BIGINT"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+        id,food_content,food_id
+    </sql>
+</mapper>