Sfoglia il codice sorgente

新增报警记录和关闭弹出相关接口

王苗苗 1 mese fa
parent
commit
37530f2aca

BIN
.DS_Store


BIN
slibra-admin/.DS_Store


+ 120 - 0
slibra-admin/src/main/java/com/slibra/web/controller/business/TWarningRecordController.java

@@ -0,0 +1,120 @@
+package com.slibra.web.controller.business;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.slibra.business.domain.TCloseTime;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.slibra.common.annotation.Log;
+import com.slibra.common.core.controller.BaseController;
+import com.slibra.common.core.domain.AjaxResult;
+import com.slibra.common.enums.BusinessType;
+import com.slibra.business.domain.TWarningRecord;
+import com.slibra.business.service.ITWarningRecordService;
+import com.slibra.common.utils.poi.ExcelUtil;
+import com.slibra.common.core.page.TableDataInfo;
+
+/**
+ * 告警记录Controller
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+@RestController
+@RequestMapping("/business/warningRecord")
+public class TWarningRecordController extends BaseController
+{
+    @Autowired
+    private ITWarningRecordService tWarningRecordService;
+
+    /**
+     * 查询告警记录列表
+     */
+    @GetMapping("/list")
+    public TableDataInfo list(TWarningRecord tWarningRecord)
+    {
+        startPage();
+        List<TWarningRecord> list = tWarningRecordService.selectTWarningRecordList(tWarningRecord);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出告警记录列表
+     */
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, TWarningRecord tWarningRecord)
+    {
+        List<TWarningRecord> list = tWarningRecordService.selectTWarningRecordList(tWarningRecord);
+        ExcelUtil<TWarningRecord> util = new ExcelUtil<TWarningRecord>(TWarningRecord.class);
+        util.exportExcel(response, list, "告警记录数据");
+    }
+
+    /**
+     * 获取告警记录详细信息
+     */
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(tWarningRecordService.selectTWarningRecordById(id));
+    }
+
+    /**
+     * 新增告警记录
+     */
+    @PostMapping
+    public AjaxResult add(@RequestBody TWarningRecord tWarningRecord)
+    {
+        tWarningRecord.setCreateBy(getUsername());
+        return toAjax(tWarningRecordService.insertTWarningRecord(tWarningRecord));
+    }
+
+    /**
+     * 修改告警记录
+     */
+    @PutMapping
+    public AjaxResult edit(@RequestBody TWarningRecord tWarningRecord)
+    {
+        tWarningRecord.setUpdateBy(getUsername());
+        return toAjax(tWarningRecordService.updateTWarningRecord(tWarningRecord));
+    }
+
+    /**
+     * 删除告警记录
+     */
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(tWarningRecordService.deleteTWarningRecordByIds(ids));
+    }
+
+
+    //------------下面是 用户关闭弹出记录时间接口  和   通过查询关闭弹出记录,获取最新的还未读的报警记录的条数
+
+    /**
+     * 用户关闭弹出记录时间接口
+     */
+    @PostMapping
+    public AjaxResult addCloseRecord()
+    {
+        return success(tWarningRecordService.addCloseRecord());
+    }
+
+
+    /**
+     * 获取上次关闭报警弹出以后,最新的还未读的报警记录的条数
+     */
+    @GetMapping(value = "/getNewestWarningCount")
+    public AjaxResult getNewestWarningCount()
+    {
+        return success(tWarningRecordService.getNewestWarningCount());
+    }
+}

+ 43 - 0
slibra-system/src/main/java/com/slibra/business/domain/TCloseTime.java

@@ -0,0 +1,43 @@
+package com.slibra.business.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+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;
+import com.slibra.common.core.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 t_close_time
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class TCloseTime extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 用户关闭报警弹出时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @Excel(name = "用户关闭报警弹出时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
+    private Date closeTime;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private Long delFlag;
+
+    /** 乐观锁 */
+    @Excel(name = "乐观锁")
+    private Long revision;
+
+}

+ 48 - 0
slibra-system/src/main/java/com/slibra/business/domain/TWarningRecord.java

@@ -0,0 +1,48 @@
+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;
+import com.slibra.common.core.domain.BaseEntity;
+
+/**
+ * 告警记录对象 t_warning_record
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+@Data
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class TWarningRecord extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 主键 */
+    private Long id;
+
+    /** 类型(0:连续5个未接  1:10分钟空岗报警  2:连续3个5s内挂断) */
+    @Excel(name = "类型", readConverterExp = "0=:连续5个未接,1=:10分钟空岗报警,2=:连续3个5s内挂断")
+    private Long type;
+
+    /** 报警描述 */
+    @Excel(name = "报警描述")
+    private String desc;
+
+    /** 是否已读(0否 1是) */
+    @Excel(name = "是否已读", readConverterExp = "0=否,1=是")
+    private Long read;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private Long delFlag;
+
+    /** 乐观锁 */
+    @Excel(name = "乐观锁")
+    private Long revision;
+
+}

+ 64 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TCloseTimeMapper.java

@@ -0,0 +1,64 @@
+package com.slibra.business.mapper;
+
+import java.util.Date;
+import java.util.List;
+import com.slibra.business.domain.TCloseTime;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+public interface TCloseTimeMapper 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TCloseTime selectTCloseTimeById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TCloseTime> selectTCloseTimeList(TCloseTime tCloseTime);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTCloseTime(TCloseTime tCloseTime);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTCloseTime(TCloseTime tCloseTime);
+
+    /**
+     * 删除【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTCloseTimeById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTCloseTimeByIds(Long[] ids);
+
+    Date selectNewestRecord();
+}

+ 64 - 0
slibra-system/src/main/java/com/slibra/business/mapper/TWarningRecordMapper.java

@@ -0,0 +1,64 @@
+package com.slibra.business.mapper;
+
+import java.util.Date;
+import java.util.List;
+import com.slibra.business.domain.TWarningRecord;
+
+/**
+ * 告警记录Mapper接口
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+public interface TWarningRecordMapper 
+{
+    /**
+     * 查询告警记录
+     * 
+     * @param id 告警记录主键
+     * @return 告警记录
+     */
+    public TWarningRecord selectTWarningRecordById(Long id);
+
+    /**
+     * 查询告警记录列表
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 告警记录集合
+     */
+    public List<TWarningRecord> selectTWarningRecordList(TWarningRecord tWarningRecord);
+
+    /**
+     * 新增告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    public int insertTWarningRecord(TWarningRecord tWarningRecord);
+
+    /**
+     * 修改告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    public int updateTWarningRecord(TWarningRecord tWarningRecord);
+
+    /**
+     * 删除告警记录
+     * 
+     * @param id 告警记录主键
+     * @return 结果
+     */
+    public int deleteTWarningRecordById(Long id);
+
+    /**
+     * 批量删除告警记录
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteTWarningRecordByIds(Long[] ids);
+
+    Integer getNewestWarningCount(Date date);
+}

+ 61 - 0
slibra-system/src/main/java/com/slibra/business/service/ITCloseTimeService.java

@@ -0,0 +1,61 @@
+package com.slibra.business.service;
+
+import java.util.List;
+import com.slibra.business.domain.TCloseTime;
+
+/**
+ * 【请填写功能名称】Service接口
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+public interface ITCloseTimeService 
+{
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    public TCloseTime selectTCloseTimeById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    public List<TCloseTime> selectTCloseTimeList(TCloseTime tCloseTime);
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    public int insertTCloseTime(TCloseTime tCloseTime);
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    public int updateTCloseTime(TCloseTime tCloseTime);
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    public int deleteTCloseTimeByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    public int deleteTCloseTimeById(Long id);
+}

+ 67 - 0
slibra-system/src/main/java/com/slibra/business/service/ITWarningRecordService.java

@@ -0,0 +1,67 @@
+package com.slibra.business.service;
+
+import java.util.List;
+
+import com.slibra.business.domain.TCloseTime;
+import com.slibra.business.domain.TWarningRecord;
+
+/**
+ * 告警记录Service接口
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+public interface ITWarningRecordService 
+{
+    /**
+     * 查询告警记录
+     * 
+     * @param id 告警记录主键
+     * @return 告警记录
+     */
+    public TWarningRecord selectTWarningRecordById(Long id);
+
+    /**
+     * 查询告警记录列表
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 告警记录集合
+     */
+    public List<TWarningRecord> selectTWarningRecordList(TWarningRecord tWarningRecord);
+
+    /**
+     * 新增告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    public int insertTWarningRecord(TWarningRecord tWarningRecord);
+
+    /**
+     * 修改告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    public int updateTWarningRecord(TWarningRecord tWarningRecord);
+
+    /**
+     * 批量删除告警记录
+     * 
+     * @param ids 需要删除的告警记录主键集合
+     * @return 结果
+     */
+    public int deleteTWarningRecordByIds(Long[] ids);
+
+    /**
+     * 删除告警记录信息
+     * 
+     * @param id 告警记录主键
+     * @return 结果
+     */
+    public int deleteTWarningRecordById(Long id);
+
+    String addCloseRecord();
+
+    Integer getNewestWarningCount();
+}

+ 96 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TCloseTimeServiceImpl.java

@@ -0,0 +1,96 @@
+package com.slibra.business.service.impl;
+
+import java.util.List;
+import com.slibra.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.slibra.business.mapper.TCloseTimeMapper;
+import com.slibra.business.domain.TCloseTime;
+import com.slibra.business.service.ITCloseTimeService;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+@Service
+public class TCloseTimeServiceImpl implements ITCloseTimeService 
+{
+    @Autowired
+    private TCloseTimeMapper tCloseTimeMapper;
+
+    /**
+     * 查询【请填写功能名称】
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public TCloseTime selectTCloseTimeById(Long id)
+    {
+        return tCloseTimeMapper.selectTCloseTimeById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<TCloseTime> selectTCloseTimeList(TCloseTime tCloseTime)
+    {
+        return tCloseTimeMapper.selectTCloseTimeList(tCloseTime);
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertTCloseTime(TCloseTime tCloseTime)
+    {
+        tCloseTime.setCreateTime(DateUtils.getNowDate());
+        return tCloseTimeMapper.insertTCloseTime(tCloseTime);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     * 
+     * @param tCloseTime 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateTCloseTime(TCloseTime tCloseTime)
+    {
+        tCloseTime.setUpdateTime(DateUtils.getNowDate());
+        return tCloseTimeMapper.updateTCloseTime(tCloseTime);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     * 
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCloseTimeByIds(Long[] ids)
+    {
+        return tCloseTimeMapper.deleteTCloseTimeByIds(ids);
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     * 
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTCloseTimeById(Long id)
+    {
+        return tCloseTimeMapper.deleteTCloseTimeById(id);
+    }
+}

+ 121 - 0
slibra-system/src/main/java/com/slibra/business/service/impl/TWarningRecordServiceImpl.java

@@ -0,0 +1,121 @@
+package com.slibra.business.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import com.slibra.business.domain.TCloseTime;
+import com.slibra.business.mapper.TCloseTimeMapper;
+import com.slibra.common.utils.DateUtils;
+import com.slibra.common.utils.SecurityUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.slibra.business.mapper.TWarningRecordMapper;
+import com.slibra.business.domain.TWarningRecord;
+import com.slibra.business.service.ITWarningRecordService;
+
+/**
+ * 告警记录Service业务层处理
+ * 
+ * @author slibra
+ * @date 2025-01-16
+ */
+@Service
+public class TWarningRecordServiceImpl implements ITWarningRecordService 
+{
+    @Autowired
+    private TWarningRecordMapper tWarningRecordMapper;
+
+    @Autowired
+    private TCloseTimeMapper tCloseTimeMapper;
+
+    /**
+     * 查询告警记录
+     * 
+     * @param id 告警记录主键
+     * @return 告警记录
+     */
+    @Override
+    public TWarningRecord selectTWarningRecordById(Long id)
+    {
+        return tWarningRecordMapper.selectTWarningRecordById(id);
+    }
+
+    /**
+     * 查询告警记录列表
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 告警记录
+     */
+    @Override
+    public List<TWarningRecord> selectTWarningRecordList(TWarningRecord tWarningRecord)
+    {
+        return tWarningRecordMapper.selectTWarningRecordList(tWarningRecord);
+    }
+
+    /**
+     * 新增告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    @Override
+    public int insertTWarningRecord(TWarningRecord tWarningRecord)
+    {
+        tWarningRecord.setCreateTime(DateUtils.getNowDate());
+        return tWarningRecordMapper.insertTWarningRecord(tWarningRecord);
+    }
+
+    /**
+     * 修改告警记录
+     * 
+     * @param tWarningRecord 告警记录
+     * @return 结果
+     */
+    @Override
+    public int updateTWarningRecord(TWarningRecord tWarningRecord)
+    {
+        tWarningRecord.setUpdateTime(DateUtils.getNowDate());
+        return tWarningRecordMapper.updateTWarningRecord(tWarningRecord);
+    }
+
+    /**
+     * 批量删除告警记录
+     * 
+     * @param ids 需要删除的告警记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTWarningRecordByIds(Long[] ids)
+    {
+        return tWarningRecordMapper.deleteTWarningRecordByIds(ids);
+    }
+
+    /**
+     * 删除告警记录信息
+     * 
+     * @param id 告警记录主键
+     * @return 结果
+     */
+    @Override
+    public int deleteTWarningRecordById(Long id)
+    {
+        return tWarningRecordMapper.deleteTWarningRecordById(id);
+    }
+
+    @Override
+    public String addCloseRecord() {
+        TCloseTime tCloseTime = new TCloseTime();
+        Date nowDate = DateUtils.getNowDate();
+        tCloseTime.setCreateTime(nowDate);
+        tCloseTime.setCreateTime(nowDate);
+        tCloseTime.setCreateBy(SecurityUtils.getUsername());
+        this.tCloseTimeMapper.insertTCloseTime(tCloseTime);
+        return "记录成功";
+    }
+
+    @Override
+    public Integer getNewestWarningCount() {
+        //获取最新的一条关闭报警记录的时间 并 查询
+        return this.tWarningRecordMapper.getNewestWarningCount(this.tCloseTimeMapper.selectNewestRecord());
+    }
+}

+ 96 - 0
slibra-system/src/main/resources/mapper/business/TCloseTimeMapper.xml

@@ -0,0 +1,96 @@
+<?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.slibra.business.mapper.TCloseTimeMapper">
+    
+    <resultMap type="TCloseTime" id="TCloseTimeResult">
+        <result property="id"    column="id"    />
+        <result property="closeTime"    column="close_time"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="revision"    column="revision"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectTCloseTimeVo">
+        select id, close_time, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_close_time
+    </sql>
+
+    <select id="selectTCloseTimeList" parameterType="TCloseTime" resultMap="TCloseTimeResult">
+        <include refid="selectTCloseTimeVo"/>
+        <where>
+            1 = 1
+            <if test="closeTime != null "> and close_time = #{closeTime}</if>
+            <if test="revision != null "> and revision = #{revision}</if>
+        </where>
+        and del_flag = 0 order by id desc
+    </select>
+    
+    <select id="selectTCloseTimeById" parameterType="Long" resultMap="TCloseTimeResult">
+        <include refid="selectTCloseTimeVo"/>
+        where id = #{id} and del_flag = 0
+    </select>
+        
+    <insert id="insertTCloseTime" parameterType="TCloseTime" useGeneratedKeys="true" keyProperty="id">
+        insert into t_close_time
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="closeTime != null">close_time,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="revision != null">revision,</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>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="closeTime != null">#{closeTime},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="revision != null">#{revision},</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>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTCloseTime" parameterType="TCloseTime">
+        update t_close_time
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="closeTime != null">close_time = #{closeTime},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="revision != null">revision = #{revision},</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>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        ,revision = revision + 1
+        where id = #{id}
+    </update>
+
+    
+
+    <delete id="deleteTCloseTimeById" parameterType="Long">
+        update t_close_time set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
+    </delete>
+
+    <delete id="deleteTCloseTimeByIds" parameterType="String">
+        update t_close_time set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+    <!-- 下面是新增的SQL,不允许删除或者覆盖 -->
+    <select id="selectNewestRecord" resultType="java.util.Date">
+        SELECT close_time FROM t_close_time ORDER BY id DESC LIMIT 1
+    </select>
+</mapper>

+ 107 - 0
slibra-system/src/main/resources/mapper/business/TWarningRecordMapper.xml

@@ -0,0 +1,107 @@
+<?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.slibra.business.mapper.TWarningRecordMapper">
+    
+    <resultMap type="TWarningRecord" id="TWarningRecordResult">
+        <result property="id"    column="id"    />
+        <result property="type"    column="type"    />
+        <result property="desc"    column="desc"    />
+        <result property="read"    column="read"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="revision"    column="revision"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectTWarningRecordVo">
+        select id, type, desc, read, del_flag, revision, create_by, create_time, update_by, update_time, remark from t_warning_record
+    </sql>
+
+    <select id="selectTWarningRecordList" parameterType="TWarningRecord" resultMap="TWarningRecordResult">
+        <include refid="selectTWarningRecordVo"/>
+        <where>
+            1 = 1
+            <if test="type != null "> and type = #{type}</if>
+            <if test="desc != null  and desc != ''"> and desc = #{desc}</if>
+            <if test="read != null "> and read = #{read}</if>
+            <if test="revision != null "> and revision = #{revision}</if>
+        </where>
+        and del_flag = 0 order by id desc
+    </select>
+    
+    <select id="selectTWarningRecordById" parameterType="Long" resultMap="TWarningRecordResult">
+        <include refid="selectTWarningRecordVo"/>
+        where id = #{id} and del_flag = 0
+    </select>
+        
+    <insert id="insertTWarningRecord" parameterType="TWarningRecord" useGeneratedKeys="true" keyProperty="id">
+        insert into t_warning_record
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="type != null">type,</if>
+            <if test="desc != null">desc,</if>
+            <if test="read != null">read,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="revision != null">revision,</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>
+            <if test="remark != null">remark,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="type != null">#{type},</if>
+            <if test="desc != null">#{desc},</if>
+            <if test="read != null">#{read},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="revision != null">#{revision},</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>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTWarningRecord" parameterType="TWarningRecord">
+        update t_warning_record
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="type != null">type = #{type},</if>
+            <if test="desc != null">desc = #{desc},</if>
+            <if test="read != null">read = #{read},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="revision != null">revision = #{revision},</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>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        ,revision = revision + 1
+        where id = #{id}
+    </update>
+
+    
+
+    <delete id="deleteTWarningRecordById" parameterType="Long">
+        update t_warning_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id = #{id}
+    </delete>
+
+    <delete id="deleteTWarningRecordByIds" parameterType="String">
+        update t_warning_record set del_flag = 2,revision = revision + 1 where del_flag = 0 and id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+
+    <!-- 2025年01月16日16:35:21 下面是新增的SQL,不允许删除或者覆盖 -->
+    <select id="getNewestWarningCount" parameterType="java.util.Date" resultType="int">
+        SELECT COUNT(*) FROM t_warning_record WHERE del_flag = 0 AND `read` = 0
+        <if test="date != null "> and create_time >= #{date}</if>
+    </select>
+</mapper>