Преглед на файлове

创哥表 新增字段 对应的实体和xml结构调整

王苗苗 преди 1 седмица
родител
ревизия
d663eda945

+ 13 - 98
slibra-system/src/main/java/com/slibra/business/domain/AutoFeedback.java

@@ -1,5 +1,9 @@
 package com.slibra.business.domain;
 
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 import com.slibra.common.annotation.Excel;
@@ -13,6 +17,11 @@ import java.math.BigDecimal;
  * @author slibra
  * @date 2025-04-22
  */
+
+@Builder
+@Data
+@NoArgsConstructor
+@AllArgsConstructor
 public class AutoFeedback
 {
     private static final long serialVersionUID = 1L;
@@ -24,6 +33,10 @@ public class AutoFeedback
     @Excel(name = "当前请求时间")
     private String reqTime;
 
+    /** 来源#1,#2 */
+    @Excel(name = "来源#1,#2")
+    private Long source;
+
     /** 反馈控制状态 */
     @Excel(name = "反馈控制状态")
     private String feedbackType;
@@ -60,102 +73,4 @@ public class AutoFeedback
     @Excel(name = "当前请求时间")
     private String updateTime;
 
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
-        return id;
-    }
-    public void setReqTime(String reqTime) 
-    {
-        this.reqTime = reqTime;
-    }
-
-    public String getReqTime() 
-    {
-        return reqTime;
-    }
-    public void setFeedbackType(String feedbackType) 
-    {
-        this.feedbackType = feedbackType;
-    }
-
-    public String getFeedbackType() 
-    {
-        return feedbackType;
-    }
-    public void setBasePara(BigDecimal basePara)
-    {
-        this.basePara = basePara;
-    }
-
-    public BigDecimal getBasePara()
-    {
-        return basePara;
-    }
-    public void setControlCoef(Long controlCoef) 
-    {
-        this.controlCoef = controlCoef;
-    }
-
-    public Long getControlCoef() 
-    {
-        return controlCoef;
-    }
-    public void setCate(Long cate) 
-    {
-        this.cate = cate;
-    }
-
-    public Long getCate() 
-    {
-        return cate;
-    }
-    public void setSubcate(Long subcate) 
-    {
-        this.subcate = subcate;
-    }
-
-    public Long getSubcate()
-    {
-        return subcate;
-    }
-    public void setCoef(BigDecimal coef)
-    {
-        this.coef = coef;
-    }
-
-    public BigDecimal getCoef()
-    {
-        return coef;
-    }
-    public void setCf(String cf) 
-    {
-        this.cf = cf;
-    }
-
-    public String getCf() 
-    {
-        return cf;
-    }
-    public void setExt(String ext) 
-    {
-        this.ext = ext;
-    }
-
-    public String getExt() 
-    {
-        return ext;
-    }
-
-    public String getUpdateTime() {
-        return updateTime;
-    }
-
-    public void setUpdateTime(String updateTime) {
-        this.updateTime = updateTime;
-    }
 }

+ 22 - 11
slibra-system/src/main/resources/mapper/business/AutoFeedbackMapper.xml

@@ -1,13 +1,14 @@
 <?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">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.slibra.business.mapper.AutoFeedbackMapper">
-    
+
     <resultMap type="AutoFeedback" id="AutoFeedbackResult">
         <result property="id"    column="id"    />
         <result property="reqTime"    column="req_time"    />
         <result property="updateTime"    column="update_time"    />
+        <result property="source"    column="source"    />
         <result property="feedbackType"    column="feedback_type"    />
         <result property="basePara"    column="base_para"    />
         <result property="controlCoef"    column="control_coef"    />
@@ -19,7 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectAutoFeedbackVo">
-        select id, req_time, update_time, feedback_type, base_para, control_coef, cate, subcate, coef, cf, ext from auto_feedback
+        select id, req_time, update_time, source, feedback_type, base_para, control_coef, cate, subcate, coef, cf, ext from auto_feedback
     </sql>
 
     <select id="selectAutoFeedbackList" parameterType="AutoFeedback" resultMap="AutoFeedbackResult">
@@ -27,6 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
             1 = 1
             <if test="reqTime != null  and reqTime != ''"> and req_time = #{reqTime}</if>
+            <if test="source != null "> and source = #{source}</if>
             <if test="feedbackType != null  and feedbackType != ''"> and feedback_type = #{feedbackType}</if>
             <if test="basePara != null "> and base_para = #{basePara}</if>
             <if test="controlCoef != null "> and control_coef = #{controlCoef}</if>
@@ -36,19 +38,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="cf != null  and cf != ''"> and cf = #{cf}</if>
             <if test="ext != null  and ext != ''"> and ext = #{ext}</if>
         </where>
-        order by id desc
+        and del_flag = 0 order by id desc
     </select>
-    
+
     <select id="selectAutoFeedbackById" parameterType="Long" resultMap="AutoFeedbackResult">
         <include refid="selectAutoFeedbackVo"/>
         where id = #{id} and del_flag = 0
     </select>
-        
+
     <insert id="insertAutoFeedback" parameterType="AutoFeedback" useGeneratedKeys="true" keyProperty="id">
         insert into auto_feedback
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="reqTime != null">req_time,</if>
             <if test="updateTime != null">update_time,</if>
+            <if test="source != null">source,</if>
             <if test="feedbackType != null">feedback_type,</if>
             <if test="basePara != null">base_para,</if>
             <if test="controlCoef != null">control_coef,</if>
@@ -57,10 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="coef != null">coef,</if>
             <if test="cf != null">cf,</if>
             <if test="ext != null">ext,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="reqTime != null">#{reqTime},</if>
             <if test="updateTime != null">#{updateTime},</if>
+            <if test="source != null">#{source},</if>
             <if test="feedbackType != null">#{feedbackType},</if>
             <if test="basePara != null">#{basePara},</if>
             <if test="controlCoef != null">#{controlCoef},</if>
@@ -69,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="coef != null">#{coef},</if>
             <if test="cf != null">#{cf},</if>
             <if test="ext != null">#{ext},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateAutoFeedback" parameterType="AutoFeedback">
@@ -77,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix="SET" suffixOverrides=",">
             <if test="reqTime != null">req_time = #{reqTime},</if>
             <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="source != null">source = #{source},</if>
             <if test="feedbackType != null">feedback_type = #{feedbackType},</if>
             <if test="basePara != null">base_para = #{basePara},</if>
             <if test="controlCoef != null">control_coef = #{controlCoef},</if>
@@ -90,10 +95,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
-    
+
 
     <delete id="deleteAutoFeedbackById" parameterType="Long">
-       delete from auto_feedback where id = #{id}
+        update auto_feedback set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
     </delete>
 
     <delete id="deleteAutoFeedbackByIds" parameterType="String">
@@ -103,8 +108,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
     </delete>
 
+    <!-- 2025年04月27日14:46:01 下面是新增的SQL,不允许删除或者覆盖 -->
     <delete id="deleteAll" >
         <!--truncate table auto_feedback -->
         delete from auto_feedback
     </delete>
+
+    <select id="selectAutoFeedbackLatestByPool" resultMap="AutoFeedbackResult">
+        <include refid="selectAutoFeedbackVo"/>
+        where source = #{type} order by id desc limit 1
+    </select>
 </mapper>