From cd76bf2d4597168c6e495ce35bab022351e515be Mon Sep 17 00:00:00 2001 From: guyue <1721849008@qq.com> Date: 星期一, 21 七月 2025 15:20:55 +0800 Subject: [PATCH] 新表 --- src/main/java/com/linghu/model/entity/QuestionResultList.java | 143 +++++++++++++++++++++++++++++++++++ src/main/java/com/linghu/service/impl/QuestionResultServiceImpl.java | 22 +++++ src/main/resources/mapper/QuestionResultMapper.xml | 28 +++++++ src/main/java/com/linghu/mapper/QuestionResultMapper.java | 18 ++++ src/main/java/com/linghu/service/QuestionResultService.java | 13 +++ 5 files changed, 224 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/linghu/mapper/QuestionResultMapper.java b/src/main/java/com/linghu/mapper/QuestionResultMapper.java new file mode 100644 index 0000000..bcabab5 --- /dev/null +++ b/src/main/java/com/linghu/mapper/QuestionResultMapper.java @@ -0,0 +1,18 @@ +package com.linghu.mapper; + +import com.linghu.model.entity.QuestionResultList; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author xy +* @description 针对表【question_result(提问结果子表)】的数据库操作Mapper +* @createDate 2025-07-21 12:43:09 +* @Entity com.linghu.model.entity.QuestionResult +*/ +public interface QuestionResultMapper extends BaseMapper<QuestionResultList> { + +} + + + + diff --git a/src/main/java/com/linghu/model/entity/QuestionResultList.java b/src/main/java/com/linghu/model/entity/QuestionResultList.java new file mode 100644 index 0000000..d5a226c --- /dev/null +++ b/src/main/java/com/linghu/model/entity/QuestionResultList.java @@ -0,0 +1,143 @@ +package com.linghu.model.entity; + +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.time.LocalDateTime; +import java.util.Date; +import lombok.Data; + +/** + * 提问结果子表 + * @TableName question_result + */ +@TableName(value ="question_result") +@Data +public class QuestionResultList implements Serializable { + /** + * 自增主键 + */ + @TableId(type = IdType.AUTO) + private Long id; + + /** + * 关联关键词任务ID + */ + private String keyword_task_id; + + /** + * 提问内容 + */ + private String question; + + /** + * 回答内容 + */ + private String response; + + /** + * 提取的结果数 + */ + private Integer extracted_count; + + /** + * 提问时间戳 + */ + private LocalDateTime timestamp; + + /** + * 提问状态(success/failed) + */ + private String status; + + /** + * 提问错误信息 + */ + private String error; + + /** + * 轮次编号 + */ + private Integer num; + + /** + * 批次编号 + */ + private Integer batch_num; + + /** + * 记录创建时间 + */ + private Date create_time; + private Integer keyword_id; + + @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; + } + QuestionResultList other = (QuestionResultList) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getKeyword_task_id() == null ? other.getKeyword_task_id() == null : this.getKeyword_task_id().equals(other.getKeyword_task_id())) + && (this.getQuestion() == null ? other.getQuestion() == null : this.getQuestion().equals(other.getQuestion())) + && (this.getResponse() == null ? other.getResponse() == null : this.getResponse().equals(other.getResponse())) + && (this.getExtracted_count() == null ? other.getExtracted_count() == null : this.getExtracted_count().equals(other.getExtracted_count())) + && (this.getTimestamp() == null ? other.getTimestamp() == null : this.getTimestamp().equals(other.getTimestamp())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getError() == null ? other.getError() == null : this.getError().equals(other.getError())) + && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum())) + && (this.getBatch_num() == null ? other.getBatch_num() == null : this.getBatch_num().equals(other.getBatch_num())) + && (this.getCreate_time() == null ? other.getCreate_time() == null : this.getCreate_time().equals(other.getCreate_time())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getKeyword_task_id() == null) ? 0 : getKeyword_task_id().hashCode()); + result = prime * result + ((getQuestion() == null) ? 0 : getQuestion().hashCode()); + result = prime * result + ((getResponse() == null) ? 0 : getResponse().hashCode()); + result = prime * result + ((getExtracted_count() == null) ? 0 : getExtracted_count().hashCode()); + result = prime * result + ((getTimestamp() == null) ? 0 : getTimestamp().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getError() == null) ? 0 : getError().hashCode()); + result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode()); + result = prime * result + ((getBatch_num() == null) ? 0 : getBatch_num().hashCode()); + result = prime * result + ((getCreate_time() == null) ? 0 : getCreate_time().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(", keyword_task_id=").append(keyword_task_id); + sb.append(", question=").append(question); + sb.append(", response=").append(response); + sb.append(", extracted_count=").append(extracted_count); + sb.append(", timestamp=").append(timestamp); + sb.append(", status=").append(status); + sb.append(", error=").append(error); + sb.append(", num=").append(num); + sb.append(", batch_num=").append(batch_num); + sb.append(", create_time=").append(create_time); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/linghu/service/QuestionResultService.java b/src/main/java/com/linghu/service/QuestionResultService.java new file mode 100644 index 0000000..cbe7bd3 --- /dev/null +++ b/src/main/java/com/linghu/service/QuestionResultService.java @@ -0,0 +1,13 @@ +package com.linghu.service; + +import com.linghu.model.entity.QuestionResultList; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author xy +* @description 针对表【question_result(提问结果子表)】的数据库操作Service +* @createDate 2025-07-21 12:43:09 +*/ +public interface QuestionResultService extends IService<QuestionResultList> { + +} diff --git a/src/main/java/com/linghu/service/impl/QuestionResultServiceImpl.java b/src/main/java/com/linghu/service/impl/QuestionResultServiceImpl.java new file mode 100644 index 0000000..3e1f6c3 --- /dev/null +++ b/src/main/java/com/linghu/service/impl/QuestionResultServiceImpl.java @@ -0,0 +1,22 @@ +package com.linghu.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.linghu.model.entity.QuestionResultList; +import com.linghu.service.QuestionResultService; +import com.linghu.mapper.QuestionResultMapper; +import org.springframework.stereotype.Service; + +/** +* @author xy +* @description 针对表【question_result(提问结果子表)】的数据库操作Service实现 +* @createDate 2025-07-21 12:43:09 +*/ +@Service +public class QuestionResultServiceImpl extends ServiceImpl<QuestionResultMapper, QuestionResultList> + implements QuestionResultService{ + +} + + + + diff --git a/src/main/resources/mapper/QuestionResultMapper.xml b/src/main/resources/mapper/QuestionResultMapper.xml new file mode 100644 index 0000000..d800ad8 --- /dev/null +++ b/src/main/resources/mapper/QuestionResultMapper.xml @@ -0,0 +1,28 @@ +<?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.linghu.mapper.QuestionResultMapper"> + + <resultMap id="BaseResultMap" type="com.linghu.model.entity.QuestionResultList"> + <id property="id" column="id" jdbcType="BIGINT"/> + <result property="keyword_task_id" column="keyword_task_id" jdbcType="VARCHAR"/> + <result property="question" column="question" jdbcType="VARCHAR"/> + <result property="response" column="response" jdbcType="VARCHAR"/> + <result property="extracted_count" column="extracted_count" jdbcType="INTEGER"/> + <result property="timestamp" column="timestamp" jdbcType="TIMESTAMP"/> + <result property="status" column="status" jdbcType="VARCHAR"/> + <result property="error" column="error" jdbcType="VARCHAR"/> + <result property="num" column="num" jdbcType="INTEGER"/> + <result property="batch_num" column="batch_num" jdbcType="INTEGER"/> + <result property="create_time" column="create_time" jdbcType="TIMESTAMP"/> + <result property="keyword_id" column="keyword_id" jdbcType="INTEGER"/> + </resultMap> + + <sql id="Base_Column_List"> + id,keyword_task_id,question, + response,extracted_count,timestamp, + status,error,num, + batch_num,create_time,keyword_id + </sql> +</mapper> -- Gitblit v1.7.1