ソースを参照

[101903] 新增上报批次表 domain/mapper/service

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
taosj 2 週間 前
親
コミット
5e885d190b

+ 189 - 0
forecast-backend-server/src/main/java/com/ufo/project/forecast/fileupload/domain/DataPowerForecastReportBatch.java

@@ -0,0 +1,189 @@
+package com.ufo.project.forecast.fileupload.domain;
+
+import java.util.Date;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * 功率预测上报批次对象 data_power_forecast_report_batch
+ *
+ * @author ufo
+ * @date 2026-10-19
+ */
+public class DataPowerForecastReportBatch
+{
+    /** 待确认 */
+    public static final int STATUS_PENDING = 1;
+
+    /** 已确认 */
+    public static final int STATUS_CONFIRMED = 2;
+
+    /** 短期 */
+    public static final String TYPE_SHORT = "short";
+
+    /** 超短期 */
+    public static final String TYPE_ULTRA = "ultra";
+
+    /** 唯一标识 */
+    private Long id;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 场站名称 */
+    private String stationName;
+
+    /** 上报批次号 */
+    private String batchNo;
+
+    /** 类型(short短期,ultra超短期) */
+    private String type;
+
+    /** 上报日(yyyyMMdd,北京时间) */
+    private Integer reportDay;
+
+    /** 预计上报时间(HH:mm:ss,北京时间) */
+    private String estReportTime;
+
+    /** 状态(1待确认,2已确认) */
+    private Integer status;
+
+    /** 生成来源(auto自动,manually手动) */
+    private String generateSource;
+
+    /** 创建时间 */
+    private Date createTime;
+
+    /** 更新时间 */
+    private Date updateTime;
+
+    /** 备注 */
+    private String remark;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+    public void setStationName(String stationName)
+    {
+        this.stationName = stationName;
+    }
+
+    public String getStationName()
+    {
+        return stationName;
+    }
+    public void setBatchNo(String batchNo)
+    {
+        this.batchNo = batchNo;
+    }
+
+    public String getBatchNo()
+    {
+        return batchNo;
+    }
+    public void setType(String type)
+    {
+        this.type = type;
+    }
+
+    public String getType()
+    {
+        return type;
+    }
+    public void setReportDay(Integer reportDay)
+    {
+        this.reportDay = reportDay;
+    }
+
+    public Integer getReportDay()
+    {
+        return reportDay;
+    }
+    public void setEstReportTime(String estReportTime)
+    {
+        this.estReportTime = estReportTime;
+    }
+
+    public String getEstReportTime()
+    {
+        return estReportTime;
+    }
+    public void setStatus(Integer status)
+    {
+        this.status = status;
+    }
+
+    public Integer getStatus()
+    {
+        return status;
+    }
+    public void setGenerateSource(String generateSource)
+    {
+        this.generateSource = generateSource;
+    }
+
+    public String getGenerateSource()
+    {
+        return generateSource;
+    }
+    public void setCreateTime(Date createTime)
+    {
+        this.createTime = createTime;
+    }
+
+    public Date getCreateTime()
+    {
+        return createTime;
+    }
+    public void setUpdateTime(Date updateTime)
+    {
+        this.updateTime = updateTime;
+    }
+
+    public Date getUpdateTime()
+    {
+        return updateTime;
+    }
+    public void setRemark(String remark)
+    {
+        this.remark = remark;
+    }
+
+    public String getRemark()
+    {
+        return remark;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("stationCode", getStationCode())
+            .append("stationName", getStationName())
+            .append("batchNo", getBatchNo())
+            .append("type", getType())
+            .append("reportDay", getReportDay())
+            .append("estReportTime", getEstReportTime())
+            .append("status", getStatus())
+            .append("generateSource", getGenerateSource())
+            .append("createTime", getCreateTime())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 56 - 0
forecast-backend-server/src/main/java/com/ufo/project/forecast/fileupload/mapper/DataPowerForecastReportBatchMapper.java

@@ -0,0 +1,56 @@
+package com.ufo.project.forecast.fileupload.mapper;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+import com.ufo.project.forecast.fileupload.domain.DataPowerForecastReportBatch;
+
+/**
+ * 功率预测上报批次Mapper接口
+ *
+ * @author ufo
+ * @date 2026-10-19
+ */
+public interface DataPowerForecastReportBatchMapper
+{
+    /**
+     * 查询功率预测上报批次
+     *
+     * @param id 功率预测上报批次主键
+     * @return 功率预测上报批次
+     */
+    public DataPowerForecastReportBatch selectById(Long id);
+
+    /**
+     * 查询功率预测上报批次列表
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 功率预测上报批次集合
+     */
+    public List<DataPowerForecastReportBatch> selectDataPowerForecastReportBatchList(DataPowerForecastReportBatch dataPowerForecastReportBatch);
+
+    /**
+     * 按 类型+上报日+预计上报时间 查询上报批次列表
+     *
+     * @param type 类型(short/ultra)
+     * @param reportDay 上报日(yyyyMMdd)
+     * @param estReportTime 预计上报时间(HH:mm:ss)
+     * @return 功率预测上报批次集合
+     */
+    public List<DataPowerForecastReportBatch> selectByTypeDayTime(@Param("type") String type, @Param("reportDay") int reportDay, @Param("estReportTime") String estReportTime);
+
+    /**
+     * 新增功率预测上报批次
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 结果
+     */
+    public int insertDataPowerForecastReportBatch(DataPowerForecastReportBatch dataPowerForecastReportBatch);
+
+    /**
+     * 批量删除功率预测上报批次
+     *
+     * @param ids 需要删除的主键集合
+     * @return 结果
+     */
+    public int deleteByIds(Long[] ids);
+}

+ 39 - 0
forecast-backend-server/src/main/java/com/ufo/project/forecast/fileupload/service/IDataPowerForecastReportBatchService.java

@@ -0,0 +1,39 @@
+package com.ufo.project.forecast.fileupload.service;
+
+import java.util.List;
+import com.ufo.project.forecast.fileupload.domain.DataPowerForecastReportBatch;
+
+/**
+ * 功率预测上报批次Service接口
+ *
+ * @author ufo
+ * @date 2026-10-19
+ */
+public interface IDataPowerForecastReportBatchService
+{
+    /**
+     * 查询功率预测上报批次列表
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 功率预测上报批次集合
+     */
+    public List<DataPowerForecastReportBatch> selectDataPowerForecastReportBatchList(DataPowerForecastReportBatch dataPowerForecastReportBatch);
+
+    /**
+     * 按 类型+上报日+预计上报时间 查询上报批次列表
+     *
+     * @param type 类型(short/ultra)
+     * @param reportDay 上报日(yyyyMMdd)
+     * @param estReportTime 预计上报时间(HH:mm:ss)
+     * @return 功率预测上报批次集合
+     */
+    public List<DataPowerForecastReportBatch> selectByTypeDayTime(String type, int reportDay, String estReportTime);
+
+    /**
+     * 新增功率预测上报批次
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 结果
+     */
+    public int insertDataPowerForecastReportBatch(DataPowerForecastReportBatch dataPowerForecastReportBatch);
+}

+ 59 - 0
forecast-backend-server/src/main/java/com/ufo/project/forecast/fileupload/service/impl/DataPowerForecastReportBatchServiceImpl.java

@@ -0,0 +1,59 @@
+package com.ufo.project.forecast.fileupload.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ufo.project.forecast.fileupload.mapper.DataPowerForecastReportBatchMapper;
+import com.ufo.project.forecast.fileupload.domain.DataPowerForecastReportBatch;
+import com.ufo.project.forecast.fileupload.service.IDataPowerForecastReportBatchService;
+
+/**
+ * 功率预测上报批次Service业务层处理
+ *
+ * @author ufo
+ * @date 2026-10-19
+ */
+@Service
+public class DataPowerForecastReportBatchServiceImpl implements IDataPowerForecastReportBatchService
+{
+    @Autowired
+    private DataPowerForecastReportBatchMapper dataPowerForecastReportBatchMapper;
+
+    /**
+     * 查询功率预测上报批次列表
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 功率预测上报批次集合
+     */
+    @Override
+    public List<DataPowerForecastReportBatch> selectDataPowerForecastReportBatchList(DataPowerForecastReportBatch dataPowerForecastReportBatch)
+    {
+        return dataPowerForecastReportBatchMapper.selectDataPowerForecastReportBatchList(dataPowerForecastReportBatch);
+    }
+
+    /**
+     * 按 类型+上报日+预计上报时间 查询上报批次列表
+     *
+     * @param type 类型(short/ultra)
+     * @param reportDay 上报日(yyyyMMdd)
+     * @param estReportTime 预计上报时间(HH:mm:ss)
+     * @return 功率预测上报批次集合
+     */
+    @Override
+    public List<DataPowerForecastReportBatch> selectByTypeDayTime(String type, int reportDay, String estReportTime)
+    {
+        return dataPowerForecastReportBatchMapper.selectByTypeDayTime(type, reportDay, estReportTime);
+    }
+
+    /**
+     * 新增功率预测上报批次
+     *
+     * @param dataPowerForecastReportBatch 功率预测上报批次
+     * @return 结果
+     */
+    @Override
+    public int insertDataPowerForecastReportBatch(DataPowerForecastReportBatch dataPowerForecastReportBatch)
+    {
+        return dataPowerForecastReportBatchMapper.insertDataPowerForecastReportBatch(dataPowerForecastReportBatch);
+    }
+}

+ 62 - 0
forecast-backend-server/src/main/resources/mybatis/fileupload/DataPowerForecastReportBatchMapper.xml

@@ -0,0 +1,62 @@
+<?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.ufo.project.forecast.fileupload.mapper.DataPowerForecastReportBatchMapper">
+
+    <resultMap type="DataPowerForecastReportBatch" id="DataPowerForecastReportBatchResult">
+        <result property="id"    column="id"    />
+        <result property="stationCode"    column="station_code"    />
+        <result property="stationName"    column="station_name"    />
+        <result property="batchNo"    column="batch_no"    />
+        <result property="type"    column="type"    />
+        <result property="reportDay"    column="report_day"    />
+        <result property="estReportTime"    column="est_report_time"    />
+        <result property="status"    column="status"    />
+        <result property="generateSource"    column="generate_source"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectDataPowerForecastReportBatchVo">
+        select id, station_code, station_name, batch_no, type, report_day, est_report_time, status, generate_source, create_time, update_time, remark from data_power_forecast_report_batch
+    </sql>
+
+    <select id="selectDataPowerForecastReportBatchList" parameterType="DataPowerForecastReportBatch" resultMap="DataPowerForecastReportBatchResult">
+        <include refid="selectDataPowerForecastReportBatchVo"/>
+        <where>
+            <if test="stationCode != null  and stationCode != ''"> and station_code = #{stationCode}</if>
+            <if test="stationName != null  and stationName != ''"> and station_name like concat('%', #{stationName}, '%')</if>
+            <if test="batchNo != null  and batchNo != ''"> and batch_no = #{batchNo}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="reportDay != null "> and report_day = #{reportDay}</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+        order by id desc
+    </select>
+
+    <select id="selectById" parameterType="Long" resultMap="DataPowerForecastReportBatchResult">
+        <include refid="selectDataPowerForecastReportBatchVo"/>
+        where id = #{id}
+    </select>
+
+    <select id="selectByTypeDayTime" resultMap="DataPowerForecastReportBatchResult">
+        <include refid="selectDataPowerForecastReportBatchVo"/>
+        where type = #{type} and report_day = #{reportDay} and est_report_time = #{estReportTime}
+    </select>
+
+    <insert id="insertDataPowerForecastReportBatch" parameterType="DataPowerForecastReportBatch" useGeneratedKeys="true" keyProperty="id">
+        insert into data_power_forecast_report_batch
+            (station_code, station_name, batch_no, type, report_day, est_report_time, status, generate_source, create_time, update_time, remark)
+        values
+            (#{stationCode}, #{stationName}, #{batchNo}, #{type}, #{reportDay}, #{estReportTime}, #{status}, #{generateSource}, now(), now(), #{remark})
+    </insert>
+
+    <delete id="deleteByIds" parameterType="Long">
+        delete from data_power_forecast_report_batch where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>