Browse Source

增加moonshotAI基础信息存储代码

zjc 9 months ago
parent
commit
613455d1a6
17 changed files with 1406 additions and 33 deletions
  1. 35 33
      ruoyi-common/src/main/java/com/ruoyi/common/utils/moonshot/MoonshotDemoMain.java
  2. 1 0
      ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml
  3. 208 0
      ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecord.java
  4. 82 0
      ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecordFile.java
  5. 124 0
      ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecordInfo.java
  6. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordFileMapper.java
  7. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordInfoMapper.java
  8. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordMapper.java
  9. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordFileService.java
  10. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordInfoService.java
  11. 61 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordService.java
  12. 95 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordFileServiceImpl.java
  13. 96 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordInfoServiceImpl.java
  14. 96 0
      ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordServiceImpl.java
  15. 77 0
      ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordFileMapper.xml
  16. 98 0
      ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordInfoMapper.xml
  17. 128 0
      ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordMapper.xml

+ 35 - 33
ruoyi-common/src/main/java/com/ruoyi/common/utils/moonshot/MoonshotDemoMain.java

@@ -28,13 +28,15 @@ public class MoonshotDemoMain {
         System.out.println(resuat.getError());
         if(null != resuat.getError()){
 
-
-
         }else if(resuat.getStatus().equals("ok")) {
             String fileId = resuat.getId();
 
             String fileContent = MoonshotAiUtils.getFileContent(fileId,client.getApiKey());
             System.out.println(fileContent);
+
+            MoonshotAiUtils.deleteFile(fileId,client.getApiKey());
+
+
             final List<ChatCompletionMessage> messages = Arrays.asList(
                     new ChatCompletionMessage(ChatMessageRole.SYSTEM.value(),
                             "你是计算机行业专业面试官,提供一套面试题,并根据回复的答案进行分析和人员的能力程度"),
@@ -61,37 +63,37 @@ public class MoonshotDemoMain {
 //            e.printStackTrace();
 //        }
 
-//            try {
-//                client.ChatCompletionStream(new ChatCompletionRequest(
-//                        "moonshot-v1-32k",
-//                        messages,
-//                        1024,
-//                        0.3f,
-//                        1
-//                )).subscribe(
-//                        streamResponse -> {
-//                            if (streamResponse.getChoices().isEmpty()) {
-//                                return;
-//                            }
-//                            for (ChatCompletionStreamChoice choice : streamResponse.getChoices()) {
-//                                String finishReason = choice.getFinishReason();
-//                                if (finishReason != null) {
-//                                    System.out.print("finish reason: " + finishReason);
-//                                    continue;
-//                                }
-//                                System.out.print(choice.getDelta().getContent());
-//                            }
-//                        },
-//                        error -> {
-//                            error.printStackTrace();
-//                        },
-//                        () -> {
-//                            System.out.println("complete");
-//                        }
-//                );
-//            } catch (Exception e) {
-//                e.printStackTrace();
-//            }
+            try {
+                client.ChatCompletionStream(new ChatCompletionRequest(
+                        "moonshot-v1-128k",
+                        messages,
+                        1024,
+                        0.3f,
+                        1
+                )).subscribe(
+                        streamResponse -> {
+                            if (streamResponse.getChoices().isEmpty()) {
+                                return;
+                            }
+                            for (ChatCompletionStreamChoice choice : streamResponse.getChoices()) {
+                                String finishReason = choice.getFinishReason();
+                                if (finishReason != null) {
+                                    System.out.print("finish reason: " + finishReason);
+                                    continue;
+                                }
+                                System.out.print(choice.getDelta().getContent());
+                            }
+                        },
+                        error -> {
+                            error.printStackTrace();
+                        },
+                        () -> {
+                            System.out.println("complete");
+                        }
+                );
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
     }
 

+ 1 - 0
ruoyi-generator/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -73,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 				AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
 			</if>
 		</where>
+		order by create_time desc
 	</select>
 
 	<select id="selectDbTableList" parameterType="GenTable" resultMap="GenTableResult">

+ 208 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecord.java

@@ -0,0 +1,208 @@
+package com.ruoyi.tool.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * moonshot AI记录对象 t_moonshot_record
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public class TMoonshotRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    private String id;
+
+    /** 企业ID */
+    @Excel(name = "企业ID")
+    private String corpId;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private String userId;
+
+    /** 模型(8、32、128) */
+    @Excel(name = "模型", readConverterExp = "8=、32、128")
+    private String model;
+
+    /** 聊天完成时生成的最大 token 数。如果到生成了最大 token 数个结果仍然没有结束,finish reason 会是 "length", 否则会是 "stop" */
+    @Excel(name = "聊天完成时生成的最大 token 数。如果到生成了最大 token 数个结果仍然没有结束,finish reason 会是 `length`, 否则会是 `stop`")
+    private Long maxTokens;
+
+    /** 使用什么采样温度,介于 0 和 1 之间。较高的值(如 0.7)将使输出更加随机,而较低的值(如 0.2)将使其更加集中和确定性 */
+    @Excel(name = "使用什么采样温度,介于 0 和 1 之间。较高的值", readConverterExp = "如=,0=.7")
+    private String temperature;
+
+    /** 另一种采样方法 */
+    @Excel(name = "另一种采样方法")
+    private String topP;
+
+    /** 为每条输入消息生成多少个结果 */
+    @Excel(name = "为每条输入消息生成多少个结果")
+    private Long n;
+
+    /** 存在惩罚 */
+    @Excel(name = "存在惩罚")
+    private String presencePenalty;
+
+    /** 频率惩罚 */
+    @Excel(name = "频率惩罚")
+    private String frequencyPenalty;
+
+    /** 停止词 */
+    @Excel(name = "停止词")
+    private String stop;
+
+    /** 是否流式返回 */
+    @Excel(name = "是否流式返回")
+    private String stream;
+
+    /** 状态 */
+    private String delFlag;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setCorpId(String corpId) 
+    {
+        this.corpId = corpId;
+    }
+
+    public String getCorpId() 
+    {
+        return corpId;
+    }
+    public void setUserId(String userId) 
+    {
+        this.userId = userId;
+    }
+
+    public String getUserId() 
+    {
+        return userId;
+    }
+    public void setModel(String model) 
+    {
+        this.model = model;
+    }
+
+    public String getModel() 
+    {
+        return model;
+    }
+    public void setMaxTokens(Long maxTokens) 
+    {
+        this.maxTokens = maxTokens;
+    }
+
+    public Long getMaxTokens() 
+    {
+        return maxTokens;
+    }
+    public void setTemperature(String temperature) 
+    {
+        this.temperature = temperature;
+    }
+
+    public String getTemperature() 
+    {
+        return temperature;
+    }
+    public void setTopP(String topP) 
+    {
+        this.topP = topP;
+    }
+
+    public String getTopP() 
+    {
+        return topP;
+    }
+    public void setN(Long n) 
+    {
+        this.n = n;
+    }
+
+    public Long getN() 
+    {
+        return n;
+    }
+    public void setPresencePenalty(String presencePenalty) 
+    {
+        this.presencePenalty = presencePenalty;
+    }
+
+    public String getPresencePenalty() 
+    {
+        return presencePenalty;
+    }
+    public void setFrequencyPenalty(String frequencyPenalty) 
+    {
+        this.frequencyPenalty = frequencyPenalty;
+    }
+
+    public String getFrequencyPenalty() 
+    {
+        return frequencyPenalty;
+    }
+    public void setStop(String stop) 
+    {
+        this.stop = stop;
+    }
+
+    public String getStop() 
+    {
+        return stop;
+    }
+    public void setStream(String stream) 
+    {
+        this.stream = stream;
+    }
+
+    public String getStream() 
+    {
+        return stream;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("corpId", getCorpId())
+            .append("userId", getUserId())
+            .append("model", getModel())
+            .append("maxTokens", getMaxTokens())
+            .append("temperature", getTemperature())
+            .append("topP", getTopP())
+            .append("n", getN())
+            .append("presencePenalty", getPresencePenalty())
+            .append("frequencyPenalty", getFrequencyPenalty())
+            .append("stop", getStop())
+            .append("stream", getStream())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 82 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecordFile.java

@@ -0,0 +1,82 @@
+package com.ruoyi.tool.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * moonshot关联简历附件对象 t_moonshot_record_file
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public class TMoonshotRecordFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String corpId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String userId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String fileId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String recordId;
+
+    public void setCorpId(String corpId) 
+    {
+        this.corpId = corpId;
+    }
+
+    public String getCorpId() 
+    {
+        return corpId;
+    }
+    public void setUserId(String userId) 
+    {
+        this.userId = userId;
+    }
+
+    public String getUserId() 
+    {
+        return userId;
+    }
+    public void setFileId(String fileId) 
+    {
+        this.fileId = fileId;
+    }
+
+    public String getFileId() 
+    {
+        return fileId;
+    }
+    public void setRecordId(String recordId) 
+    {
+        this.recordId = recordId;
+    }
+
+    public String getRecordId() 
+    {
+        return recordId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("corpId", getCorpId())
+            .append("userId", getUserId())
+            .append("fileId", getFileId())
+            .append("recordId", getRecordId())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .toString();
+    }
+}

+ 124 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/domain/TMoonshotRecordInfo.java

@@ -0,0 +1,124 @@
+package com.ruoyi.tool.domain;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * moonshot AI记录详情对象 t_moonshot_record_info
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public class TMoonshotRecordInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键ID */
+    private String id;
+
+    /** 企业ID */
+    @Excel(name = "企业ID")
+    private String corpId;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private String userId;
+
+    /** 记录ID */
+    @Excel(name = "记录ID")
+    private String recordId;
+
+    /** 角色 */
+    @Excel(name = "角色")
+    private String role;
+
+    /** 内容 */
+    @Excel(name = "内容")
+    private String content;
+
+    /** 状态 */
+    private String delFlag;
+
+    public void setId(String id) 
+    {
+        this.id = id;
+    }
+
+    public String getId() 
+    {
+        return id;
+    }
+    public void setCorpId(String corpId) 
+    {
+        this.corpId = corpId;
+    }
+
+    public String getCorpId() 
+    {
+        return corpId;
+    }
+    public void setUserId(String userId) 
+    {
+        this.userId = userId;
+    }
+
+    public String getUserId() 
+    {
+        return userId;
+    }
+    public void setRecordId(String recordId) 
+    {
+        this.recordId = recordId;
+    }
+
+    public String getRecordId() 
+    {
+        return recordId;
+    }
+    public void setRole(String role) 
+    {
+        this.role = role;
+    }
+
+    public String getRole() 
+    {
+        return role;
+    }
+    public void setContent(String content) 
+    {
+        this.content = content;
+    }
+
+    public String getContent() 
+    {
+        return content;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("corpId", getCorpId())
+            .append("userId", getUserId())
+            .append("recordId", getRecordId())
+            .append("role", getRole())
+            .append("content", getContent())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .toString();
+    }
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordFileMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.mapper;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecordFile;
+
+/**
+ * moonshot关联简历附件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface TMoonshotRecordFileMapper 
+{
+    /**
+     * 查询moonshot关联简历附件
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return moonshot关联简历附件
+     */
+    public TMoonshotRecordFile selectTMoonshotRecordFileByCorpId(String corpId);
+
+    /**
+     * 查询moonshot关联简历附件列表
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return moonshot关联简历附件集合
+     */
+    public List<TMoonshotRecordFile> selectTMoonshotRecordFileList(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 新增moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    public int insertTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 修改moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    public int updateTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 删除moonshot关联简历附件
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordFileByCorpId(String corpId);
+
+    /**
+     * 批量删除moonshot关联简历附件
+     * 
+     * @param corpIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordFileByCorpIds(String[] corpIds);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordInfoMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.mapper;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecordInfo;
+
+/**
+ * moonshot AI记录详情Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface TMoonshotRecordInfoMapper 
+{
+    /**
+     * 查询moonshot AI记录详情
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return moonshot AI记录详情
+     */
+    public TMoonshotRecordInfo selectTMoonshotRecordInfoById(String id);
+
+    /**
+     * 查询moonshot AI记录详情列表
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return moonshot AI记录详情集合
+     */
+    public List<TMoonshotRecordInfo> selectTMoonshotRecordInfoList(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 新增moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    public int insertTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 修改moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    public int updateTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 删除moonshot AI记录详情
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordInfoById(String id);
+
+    /**
+     * 批量删除moonshot AI记录详情
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordInfoByIds(String[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/mapper/TMoonshotRecordMapper.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.mapper;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecord;
+
+/**
+ * moonshot AI记录Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface TMoonshotRecordMapper 
+{
+    /**
+     * 查询moonshot AI记录
+     * 
+     * @param id moonshot AI记录主键
+     * @return moonshot AI记录
+     */
+    public TMoonshotRecord selectTMoonshotRecordById(String id);
+
+    /**
+     * 查询moonshot AI记录列表
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return moonshot AI记录集合
+     */
+    public List<TMoonshotRecord> selectTMoonshotRecordList(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 新增moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    public int insertTMoonshotRecord(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 修改moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    public int updateTMoonshotRecord(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 删除moonshot AI记录
+     * 
+     * @param id moonshot AI记录主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordById(String id);
+
+    /**
+     * 批量删除moonshot AI记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordByIds(String[] ids);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordFileService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.service;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecordFile;
+
+/**
+ * moonshot关联简历附件Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface ITMoonshotRecordFileService 
+{
+    /**
+     * 查询moonshot关联简历附件
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return moonshot关联简历附件
+     */
+    public TMoonshotRecordFile selectTMoonshotRecordFileByCorpId(String corpId);
+
+    /**
+     * 查询moonshot关联简历附件列表
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return moonshot关联简历附件集合
+     */
+    public List<TMoonshotRecordFile> selectTMoonshotRecordFileList(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 新增moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    public int insertTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 修改moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    public int updateTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile);
+
+    /**
+     * 批量删除moonshot关联简历附件
+     * 
+     * @param corpIds 需要删除的moonshot关联简历附件主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordFileByCorpIds(String[] corpIds);
+
+    /**
+     * 删除moonshot关联简历附件信息
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordFileByCorpId(String corpId);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordInfoService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.service;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecordInfo;
+
+/**
+ * moonshot AI记录详情Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface ITMoonshotRecordInfoService 
+{
+    /**
+     * 查询moonshot AI记录详情
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return moonshot AI记录详情
+     */
+    public TMoonshotRecordInfo selectTMoonshotRecordInfoById(String id);
+
+    /**
+     * 查询moonshot AI记录详情列表
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return moonshot AI记录详情集合
+     */
+    public List<TMoonshotRecordInfo> selectTMoonshotRecordInfoList(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 新增moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    public int insertTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 修改moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    public int updateTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo);
+
+    /**
+     * 批量删除moonshot AI记录详情
+     * 
+     * @param ids 需要删除的moonshot AI记录详情主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordInfoByIds(String[] ids);
+
+    /**
+     * 删除moonshot AI记录详情信息
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordInfoById(String id);
+}

+ 61 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/ITMoonshotRecordService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.tool.service;
+
+import java.util.List;
+import com.ruoyi.tool.domain.TMoonshotRecord;
+
+/**
+ * moonshot AI记录Service接口
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+public interface ITMoonshotRecordService 
+{
+    /**
+     * 查询moonshot AI记录
+     * 
+     * @param id moonshot AI记录主键
+     * @return moonshot AI记录
+     */
+    public TMoonshotRecord selectTMoonshotRecordById(String id);
+
+    /**
+     * 查询moonshot AI记录列表
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return moonshot AI记录集合
+     */
+    public List<TMoonshotRecord> selectTMoonshotRecordList(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 新增moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    public int insertTMoonshotRecord(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 修改moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    public int updateTMoonshotRecord(TMoonshotRecord tMoonshotRecord);
+
+    /**
+     * 批量删除moonshot AI记录
+     * 
+     * @param ids 需要删除的moonshot AI记录主键集合
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordByIds(String[] ids);
+
+    /**
+     * 删除moonshot AI记录信息
+     * 
+     * @param id moonshot AI记录主键
+     * @return 结果
+     */
+    public int deleteTMoonshotRecordById(String id);
+}

+ 95 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordFileServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.tool.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.tool.mapper.TMoonshotRecordFileMapper;
+import com.ruoyi.tool.domain.TMoonshotRecordFile;
+import com.ruoyi.tool.service.ITMoonshotRecordFileService;
+
+/**
+ * moonshot关联简历附件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+@Service
+public class TMoonshotRecordFileServiceImpl implements ITMoonshotRecordFileService 
+{
+    @Autowired
+    private TMoonshotRecordFileMapper tMoonshotRecordFileMapper;
+
+    /**
+     * 查询moonshot关联简历附件
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return moonshot关联简历附件
+     */
+    @Override
+    public TMoonshotRecordFile selectTMoonshotRecordFileByCorpId(String corpId)
+    {
+        return tMoonshotRecordFileMapper.selectTMoonshotRecordFileByCorpId(corpId);
+    }
+
+    /**
+     * 查询moonshot关联简历附件列表
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return moonshot关联简历附件
+     */
+    @Override
+    public List<TMoonshotRecordFile> selectTMoonshotRecordFileList(TMoonshotRecordFile tMoonshotRecordFile)
+    {
+        return tMoonshotRecordFileMapper.selectTMoonshotRecordFileList(tMoonshotRecordFile);
+    }
+
+    /**
+     * 新增moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    @Override
+    public int insertTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile)
+    {
+        tMoonshotRecordFile.setCreateTime(DateUtils.getNowDate());
+        return tMoonshotRecordFileMapper.insertTMoonshotRecordFile(tMoonshotRecordFile);
+    }
+
+    /**
+     * 修改moonshot关联简历附件
+     * 
+     * @param tMoonshotRecordFile moonshot关联简历附件
+     * @return 结果
+     */
+    @Override
+    public int updateTMoonshotRecordFile(TMoonshotRecordFile tMoonshotRecordFile)
+    {
+        return tMoonshotRecordFileMapper.updateTMoonshotRecordFile(tMoonshotRecordFile);
+    }
+
+    /**
+     * 批量删除moonshot关联简历附件
+     * 
+     * @param corpIds 需要删除的moonshot关联简历附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordFileByCorpIds(String[] corpIds)
+    {
+        return tMoonshotRecordFileMapper.deleteTMoonshotRecordFileByCorpIds(corpIds);
+    }
+
+    /**
+     * 删除moonshot关联简历附件信息
+     * 
+     * @param corpId moonshot关联简历附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordFileByCorpId(String corpId)
+    {
+        return tMoonshotRecordFileMapper.deleteTMoonshotRecordFileByCorpId(corpId);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordInfoServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.tool.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.tool.mapper.TMoonshotRecordInfoMapper;
+import com.ruoyi.tool.domain.TMoonshotRecordInfo;
+import com.ruoyi.tool.service.ITMoonshotRecordInfoService;
+
+/**
+ * moonshot AI记录详情Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+@Service
+public class TMoonshotRecordInfoServiceImpl implements ITMoonshotRecordInfoService 
+{
+    @Autowired
+    private TMoonshotRecordInfoMapper tMoonshotRecordInfoMapper;
+
+    /**
+     * 查询moonshot AI记录详情
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return moonshot AI记录详情
+     */
+    @Override
+    public TMoonshotRecordInfo selectTMoonshotRecordInfoById(String id)
+    {
+        return tMoonshotRecordInfoMapper.selectTMoonshotRecordInfoById(id);
+    }
+
+    /**
+     * 查询moonshot AI记录详情列表
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return moonshot AI记录详情
+     */
+    @Override
+    public List<TMoonshotRecordInfo> selectTMoonshotRecordInfoList(TMoonshotRecordInfo tMoonshotRecordInfo)
+    {
+        return tMoonshotRecordInfoMapper.selectTMoonshotRecordInfoList(tMoonshotRecordInfo);
+    }
+
+    /**
+     * 新增moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    @Override
+    public int insertTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo)
+    {
+        tMoonshotRecordInfo.setCreateTime(DateUtils.getNowDate());
+        return tMoonshotRecordInfoMapper.insertTMoonshotRecordInfo(tMoonshotRecordInfo);
+    }
+
+    /**
+     * 修改moonshot AI记录详情
+     * 
+     * @param tMoonshotRecordInfo moonshot AI记录详情
+     * @return 结果
+     */
+    @Override
+    public int updateTMoonshotRecordInfo(TMoonshotRecordInfo tMoonshotRecordInfo)
+    {
+        tMoonshotRecordInfo.setUpdateTime(DateUtils.getNowDate());
+        return tMoonshotRecordInfoMapper.updateTMoonshotRecordInfo(tMoonshotRecordInfo);
+    }
+
+    /**
+     * 批量删除moonshot AI记录详情
+     * 
+     * @param ids 需要删除的moonshot AI记录详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordInfoByIds(String[] ids)
+    {
+        return tMoonshotRecordInfoMapper.deleteTMoonshotRecordInfoByIds(ids);
+    }
+
+    /**
+     * 删除moonshot AI记录详情信息
+     * 
+     * @param id moonshot AI记录详情主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordInfoById(String id)
+    {
+        return tMoonshotRecordInfoMapper.deleteTMoonshotRecordInfoById(id);
+    }
+}

+ 96 - 0
ruoyi-system/src/main/java/com/ruoyi/tool/service/impl/TMoonshotRecordServiceImpl.java

@@ -0,0 +1,96 @@
+package com.ruoyi.tool.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.tool.mapper.TMoonshotRecordMapper;
+import com.ruoyi.tool.domain.TMoonshotRecord;
+import com.ruoyi.tool.service.ITMoonshotRecordService;
+
+/**
+ * moonshot AI记录Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2024-06-06
+ */
+@Service
+public class TMoonshotRecordServiceImpl implements ITMoonshotRecordService 
+{
+    @Autowired
+    private TMoonshotRecordMapper tMoonshotRecordMapper;
+
+    /**
+     * 查询moonshot AI记录
+     * 
+     * @param id moonshot AI记录主键
+     * @return moonshot AI记录
+     */
+    @Override
+    public TMoonshotRecord selectTMoonshotRecordById(String id)
+    {
+        return tMoonshotRecordMapper.selectTMoonshotRecordById(id);
+    }
+
+    /**
+     * 查询moonshot AI记录列表
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return moonshot AI记录
+     */
+    @Override
+    public List<TMoonshotRecord> selectTMoonshotRecordList(TMoonshotRecord tMoonshotRecord)
+    {
+        return tMoonshotRecordMapper.selectTMoonshotRecordList(tMoonshotRecord);
+    }
+
+    /**
+     * 新增moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    @Override
+    public int insertTMoonshotRecord(TMoonshotRecord tMoonshotRecord)
+    {
+        tMoonshotRecord.setCreateTime(DateUtils.getNowDate());
+        return tMoonshotRecordMapper.insertTMoonshotRecord(tMoonshotRecord);
+    }
+
+    /**
+     * 修改moonshot AI记录
+     * 
+     * @param tMoonshotRecord moonshot AI记录
+     * @return 结果
+     */
+    @Override
+    public int updateTMoonshotRecord(TMoonshotRecord tMoonshotRecord)
+    {
+        tMoonshotRecord.setUpdateTime(DateUtils.getNowDate());
+        return tMoonshotRecordMapper.updateTMoonshotRecord(tMoonshotRecord);
+    }
+
+    /**
+     * 批量删除moonshot AI记录
+     * 
+     * @param ids 需要删除的moonshot AI记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordByIds(String[] ids)
+    {
+        return tMoonshotRecordMapper.deleteTMoonshotRecordByIds(ids);
+    }
+
+    /**
+     * 删除moonshot AI记录信息
+     * 
+     * @param id moonshot AI记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTMoonshotRecordById(String id)
+    {
+        return tMoonshotRecordMapper.deleteTMoonshotRecordById(id);
+    }
+}

+ 77 - 0
ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordFileMapper.xml

@@ -0,0 +1,77 @@
+<?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.ruoyi.tool.mapper.TMoonshotRecordFileMapper">
+    
+    <resultMap type="TMoonshotRecordFile" id="TMoonshotRecordFileResult">
+        <result property="corpId"    column="corp_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+    </resultMap>
+
+    <sql id="selectTMoonshotRecordFileVo">
+        select corp_id, user_id, file_id, record_id, create_by, create_time from t_moonshot_record_file
+    </sql>
+
+    <select id="selectTMoonshotRecordFileList" parameterType="TMoonshotRecordFile" resultMap="TMoonshotRecordFileResult">
+        <include refid="selectTMoonshotRecordFileVo"/>
+        <where>  
+            <if test="corpId != null  and corpId != ''"> and corp_id = #{corpId}</if>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="fileId != null  and fileId != ''"> and file_id = #{fileId}</if>
+            <if test="recordId != null  and recordId != ''"> and record_id = #{recordId}</if>
+        </where>
+    </select>
+    
+    <select id="selectTMoonshotRecordFileByCorpId" parameterType="String" resultMap="TMoonshotRecordFileResult">
+        <include refid="selectTMoonshotRecordFileVo"/>
+        where corp_id = #{corpId}
+    </select>
+        
+    <insert id="insertTMoonshotRecordFile" parameterType="TMoonshotRecordFile">
+        insert into t_moonshot_record_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="corpId != null">corp_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="fileId != null">file_id,</if>
+            <if test="recordId != null">record_id,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="corpId != null">#{corpId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="fileId != null">#{fileId},</if>
+            <if test="recordId != null">#{recordId},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMoonshotRecordFile" parameterType="TMoonshotRecordFile">
+        update t_moonshot_record_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="fileId != null">file_id = #{fileId},</if>
+            <if test="recordId != null">record_id = #{recordId},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+        </trim>
+        where corp_id = #{corpId}
+    </update>
+
+    <delete id="deleteTMoonshotRecordFileByCorpId" parameterType="String">
+        delete from t_moonshot_record_file where corp_id = #{corpId}
+    </delete>
+
+    <delete id="deleteTMoonshotRecordFileByCorpIds" parameterType="String">
+        delete from t_moonshot_record_file where corp_id in 
+        <foreach item="corpId" collection="array" open="(" separator="," close=")">
+            #{corpId}
+        </foreach>
+    </delete>
+</mapper>

+ 98 - 0
ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordInfoMapper.xml

@@ -0,0 +1,98 @@
+<?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.ruoyi.tool.mapper.TMoonshotRecordInfoMapper">
+    
+    <resultMap type="TMoonshotRecordInfo" id="TMoonshotRecordInfoResult">
+        <result property="id"    column="id"    />
+        <result property="corpId"    column="corp_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="recordId"    column="record_id"    />
+        <result property="role"    column="role"    />
+        <result property="content"    column="content"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTMoonshotRecordInfoVo">
+        select id, corp_id, user_id, record_id, role, content, del_flag, create_by, create_time, update_by, update_time from t_moonshot_record_info
+    </sql>
+
+    <select id="selectTMoonshotRecordInfoList" parameterType="TMoonshotRecordInfo" resultMap="TMoonshotRecordInfoResult">
+        <include refid="selectTMoonshotRecordInfoVo"/>
+        <where>  
+            <if test="corpId != null  and corpId != ''"> and corp_id = #{corpId}</if>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="recordId != null  and recordId != ''"> and record_id = #{recordId}</if>
+            <if test="role != null  and role != ''"> and role = #{role}</if>
+            <if test="content != null  and content != ''"> and content = #{content}</if>
+        </where>
+    </select>
+    
+    <select id="selectTMoonshotRecordInfoById" parameterType="String" resultMap="TMoonshotRecordInfoResult">
+        <include refid="selectTMoonshotRecordInfoVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTMoonshotRecordInfo" parameterType="TMoonshotRecordInfo">
+        insert into t_moonshot_record_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="corpId != null">corp_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="recordId != null">record_id,</if>
+            <if test="role != null">role,</if>
+            <if test="content != null">content,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="corpId != null">#{corpId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="recordId != null">#{recordId},</if>
+            <if test="role != null">#{role},</if>
+            <if test="content != null">#{content},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMoonshotRecordInfo" parameterType="TMoonshotRecordInfo">
+        update t_moonshot_record_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="corpId != null">corp_id = #{corpId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="recordId != null">record_id = #{recordId},</if>
+            <if test="role != null">role = #{role},</if>
+            <if test="content != null">content = #{content},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTMoonshotRecordInfoById" parameterType="String">
+        delete from t_moonshot_record_info where id = #{id}
+    </delete>
+
+    <delete id="deleteTMoonshotRecordInfoByIds" parameterType="String">
+        delete from t_moonshot_record_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 128 - 0
ruoyi-system/src/main/resources/mapper/tool/TMoonshotRecordMapper.xml

@@ -0,0 +1,128 @@
+<?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.ruoyi.tool.mapper.TMoonshotRecordMapper">
+    
+    <resultMap type="TMoonshotRecord" id="TMoonshotRecordResult">
+        <result property="id"    column="id"    />
+        <result property="corpId"    column="corp_id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="model"    column="model"    />
+        <result property="maxTokens"    column="max_tokens"    />
+        <result property="temperature"    column="temperature"    />
+        <result property="topP"    column="top_p"    />
+        <result property="n"    column="n"    />
+        <result property="presencePenalty"    column="presence_penalty"    />
+        <result property="frequencyPenalty"    column="frequency_penalty"    />
+        <result property="stop"    column="stop"    />
+        <result property="stream"    column="stream"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectTMoonshotRecordVo">
+        select id, corp_id, user_id, model, max_tokens, temperature, top_p, n, presence_penalty, frequency_penalty, stop, stream, del_flag, create_by, create_time, update_by, update_time from t_moonshot_record
+    </sql>
+
+    <select id="selectTMoonshotRecordList" parameterType="TMoonshotRecord" resultMap="TMoonshotRecordResult">
+        <include refid="selectTMoonshotRecordVo"/>
+        <where>  
+            <if test="corpId != null  and corpId != ''"> and corp_id = #{corpId}</if>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="model != null  and model != ''"> and model = #{model}</if>
+            <if test="maxTokens != null "> and max_tokens = #{maxTokens}</if>
+            <if test="temperature != null  and temperature != ''"> and temperature = #{temperature}</if>
+            <if test="topP != null  and topP != ''"> and top_p = #{topP}</if>
+            <if test="n != null "> and n = #{n}</if>
+            <if test="presencePenalty != null  and presencePenalty != ''"> and presence_penalty = #{presencePenalty}</if>
+            <if test="frequencyPenalty != null  and frequencyPenalty != ''"> and frequency_penalty = #{frequencyPenalty}</if>
+            <if test="stop != null  and stop != ''"> and stop = #{stop}</if>
+            <if test="stream != null  and stream != ''"> and stream = #{stream}</if>
+        </where>
+    </select>
+    
+    <select id="selectTMoonshotRecordById" parameterType="String" resultMap="TMoonshotRecordResult">
+        <include refid="selectTMoonshotRecordVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTMoonshotRecord" parameterType="TMoonshotRecord">
+        insert into t_moonshot_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="corpId != null">corp_id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="model != null">model,</if>
+            <if test="maxTokens != null">max_tokens,</if>
+            <if test="temperature != null">temperature,</if>
+            <if test="topP != null">top_p,</if>
+            <if test="n != null">n,</if>
+            <if test="presencePenalty != null">presence_penalty,</if>
+            <if test="frequencyPenalty != null">frequency_penalty,</if>
+            <if test="stop != null">stop,</if>
+            <if test="stream != null">stream,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="corpId != null">#{corpId},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="model != null">#{model},</if>
+            <if test="maxTokens != null">#{maxTokens},</if>
+            <if test="temperature != null">#{temperature},</if>
+            <if test="topP != null">#{topP},</if>
+            <if test="n != null">#{n},</if>
+            <if test="presencePenalty != null">#{presencePenalty},</if>
+            <if test="frequencyPenalty != null">#{frequencyPenalty},</if>
+            <if test="stop != null">#{stop},</if>
+            <if test="stream != null">#{stream},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTMoonshotRecord" parameterType="TMoonshotRecord">
+        update t_moonshot_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="corpId != null">corp_id = #{corpId},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="model != null">model = #{model},</if>
+            <if test="maxTokens != null">max_tokens = #{maxTokens},</if>
+            <if test="temperature != null">temperature = #{temperature},</if>
+            <if test="topP != null">top_p = #{topP},</if>
+            <if test="n != null">n = #{n},</if>
+            <if test="presencePenalty != null">presence_penalty = #{presencePenalty},</if>
+            <if test="frequencyPenalty != null">frequency_penalty = #{frequencyPenalty},</if>
+            <if test="stop != null">stop = #{stop},</if>
+            <if test="stream != null">stream = #{stream},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteTMoonshotRecordById" parameterType="String">
+        delete from t_moonshot_record where id = #{id}
+    </delete>
+
+    <delete id="deleteTMoonshotRecordByIds" parameterType="String">
+        delete from t_moonshot_record where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>