From e3d71e6211ada723d38dbb73479c458465391103 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期二, 19 八月 2025 08:56:41 +0800
Subject: [PATCH] 1、程序化哈格里夫斯(Hargreaves)公式; 2、实现每日定时任务,计算作物蒸腾量,并存储数据库
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdEt0Mapper.xml | 146 +++++++++++++++++++++++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoMd/MdEt0.java | 83 ++++++++++++++++
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoMd/MdEt0Mapper.java | 37 +++++++
3 files changed, 266 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoMd/MdEt0Mapper.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoMd/MdEt0Mapper.java
new file mode 100644
index 0000000..a24b5d6
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoMd/MdEt0Mapper.java
@@ -0,0 +1,37 @@
+package com.dy.pipIrrGlobal.daoMd;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.dy.pipIrrGlobal.pojoMd.MdEt0;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.Date;
+
+/**: This is a mapper interface for database operations on the MdEt0 entity.
+ * It provides basic CRUD (Create, Read, Update, Delete) functionality.
+ * @Author: liurunyu
+ * @Date: 2025/8/19 8:35
+ // Deletes a record from the database using its primary key
+ * @Descripton
+ */
+ // Inserts a new MdEt0 record into the database
+@Mapper
+public interface MdEt0Mapper extends BaseMapper< MdEt0> {
+ // Inserts a new MdEt0 record into the database, only including non-null fields
+ int deleteByPrimaryKey(Long id);
+
+ // Selects and retrieves a MdEt0 record from the database using its primary key
+ int insert(MdEt0 record);
+
+ // Updates an existing MdEt0 record in the database, only updating fields that are not null
+ int insertSelective(MdEt0 record);
+
+ // Updates an existing MdEt0 record in the database with all fields
+ MdEt0 selectByPrimaryKey(Long id);
+
+ MdEt0 selectByCropWeatherDt(@Param("cropId") Long cropId, @Param("weatherId") Long weatherId, @Param("dt") String dt);
+
+ int updateByPrimaryKeySelective(MdEt0 record);
+
+ int updateByPrimaryKey(MdEt0 record);
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoMd/MdEt0.java b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoMd/MdEt0.java
new file mode 100644
index 0000000..b46d01e
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoMd/MdEt0.java
@@ -0,0 +1,83 @@
+package com.dy.pipIrrGlobal.pojoMd;
+
+import com.alibaba.fastjson2.annotation.JSONField;
+import com.alibaba.fastjson2.writer.ObjectWriterImplToString;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.dy.common.po.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.*;
+
+import java.util.Date;
+
+/**
+ * @Author: liurunyu
+ * @Date: 2025/8/19 8:35
+ * @Description 浣滅墿钂歌吘閲�
+ */
+@TableName(value="md_et0", autoResultMap = true)
+@Data
+@Builder
+@ToString
+@NoArgsConstructor
+@AllArgsConstructor
+@Schema(name = "浣滅墿钂歌吘閲�")
+public class MdEt0 implements BaseEntity {
+
+ public static final long serialVersionUID = 202508190840001L;
+ /**
+ * 涓婚敭
+ */
+ @JSONField(serializeUsing= ObjectWriterImplToString.class)
+ @TableId(type = IdType.INPUT)
+ @Schema(description = "瀹炰綋id", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ public Long id;
+
+ /**
+ * 浣滅墿澶栭敭
+ */
+ @Schema(description = "鎵�灞炵殑浣滅墿", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "鎵�灞炵殑浣滅墿涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null
+ public Long cropId;
+
+ /**
+ * 姘旇薄绔檌d
+ */
+ @Schema(description = "鍏宠仈鐨勬皵璞$珯", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "鍏宠仈鐨勬皵璞$珯涓嶈兘涓虹┖") //涓嶈兘涓虹┖涔熶笉鑳戒负null
+ public Long weatherId;
+
+ /**
+ * 浣滅墿绯绘暟
+ */
+ @Schema(description = "鍙備簬璁$畻鐨勪綔鐗╃郴鏁�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ public Double factor;
+
+ /**
+ * 鏈�楂樻俯搴�
+ */
+ @Schema(description = "璇ユ棩鏈�楂樻俯搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ public Double maxTmp;
+
+ /**
+ * 鏈�浣庢俯搴�
+ */
+ @Schema(description = "璇ユ棩鏈�浣庢俯搴�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ public Double minTmp;
+
+ /**
+ * 鏃ユ湡
+ */
+ @JsonFormat(pattern = "yyyy-MM-dd")
+ public Date dt;
+
+ /**
+ * 钂歌吘閲�
+ */
+ @Schema(description = "鏈棩浣滅墿钂歌吘閲�", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
+ public Double et0;
+
+}
\ No newline at end of file
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdEt0Mapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdEt0Mapper.xml
new file mode 100644
index 0000000..0109084
--- /dev/null
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/MdEt0Mapper.xml
@@ -0,0 +1,146 @@
+<?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.dy.pipIrrGlobal.daoMd.MdEt0Mapper">
+ <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ <!--@mbg.generated-->
+ <!--@Table md_et0-->
+ <id column="id" jdbcType="BIGINT" property="id" />
+ <result column="crop_id" jdbcType="BIGINT" property="cropId" />
+ <result column="weather_id" jdbcType="BIGINT" property="weatherId" />
+ <result column="factor" jdbcType="DOUBLE" property="factor" />
+ <result column="max_tmp" jdbcType="DOUBLE" property="maxTmp" />
+ <result column="min_tmp" jdbcType="DOUBLE" property="minTmp" />
+ <result column="dt" jdbcType="DATE" property="dt" />
+ <result column="et0" jdbcType="DOUBLE" property="et0" />
+ </resultMap>
+ <sql id="Base_Column_List">
+ <!--@mbg.generated-->
+ id, crop_id, weather_id, factor, max_tmp, min_tmp, dt, et0
+ </sql>
+ <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from md_et0
+ where id = #{id,jdbcType=BIGINT}
+ </select>
+ <select id="selectByCropWeatherDt" resultMap="BaseResultMap">
+ <!--@mbg.generated-->
+ select
+ <include refid="Base_Column_List" />
+ from md_et0
+ where crop_id = #{cropId,jdbcType=BIGINT}
+ and weather_id = #{weatherId,jdbcType=BIGINT}
+ and dt = #{dt,jdbcType=DATE}
+ </select>
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+ <!--@mbg.generated-->
+ delete from md_et0
+ where id = #{id,jdbcType=BIGINT}
+ </delete>
+ <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ <!--@mbg.generated-->
+ insert into md_et0 (id, crop_id, weather_id,
+ factor, max_tmp, min_tmp,
+ dt, et0)
+ values (#{id,jdbcType=BIGINT}, #{cropId,jdbcType=BIGINT}, #{weatherId,jdbcType=BIGINT},
+ #{factor,jdbcType=DOUBLE}, #{maxTmp,jdbcType=DOUBLE}, #{minTmp,jdbcType=DOUBLE},
+ #{dt,jdbcType=DATE}, #{et0,jdbcType=DOUBLE})
+ </insert>
+ <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ <!--@mbg.generated-->
+ insert into md_et0
+ <trim prefix="(" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ id,
+ </if>
+ <if test="cropId != null">
+ crop_id,
+ </if>
+ <if test="weatherId != null">
+ weather_id,
+ </if>
+ <if test="factor != null">
+ factor,
+ </if>
+ <if test="maxTmp != null">
+ max_tmp,
+ </if>
+ <if test="minTmp != null">
+ min_tmp,
+ </if>
+ <if test="dt != null">
+ dt,
+ </if>
+ <if test="et0 != null">
+ et0,
+ </if>
+ </trim>
+ <trim prefix="values (" suffix=")" suffixOverrides=",">
+ <if test="id != null">
+ #{id,jdbcType=BIGINT},
+ </if>
+ <if test="cropId != null">
+ #{cropId,jdbcType=BIGINT},
+ </if>
+ <if test="weatherId != null">
+ #{weatherId,jdbcType=BIGINT},
+ </if>
+ <if test="factor != null">
+ #{factor,jdbcType=DOUBLE},
+ </if>
+ <if test="maxTmp != null">
+ #{maxTmp,jdbcType=DOUBLE},
+ </if>
+ <if test="minTmp != null">
+ #{minTmp,jdbcType=DOUBLE},
+ </if>
+ <if test="dt != null">
+ #{dt,jdbcType=DATE},
+ </if>
+ <if test="et0 != null">
+ #{et0,jdbcType=DOUBLE},
+ </if>
+ </trim>
+ </insert>
+ <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ <!--@mbg.generated-->
+ update md_et0
+ <set>
+ <if test="cropId != null">
+ crop_id = #{cropId,jdbcType=BIGINT},
+ </if>
+ <if test="weatherId != null">
+ weather_id = #{weatherId,jdbcType=BIGINT},
+ </if>
+ <if test="factor != null">
+ factor = #{factor,jdbcType=DOUBLE},
+ </if>
+ <if test="maxTmp != null">
+ max_tmp = #{maxTmp,jdbcType=DOUBLE},
+ </if>
+ <if test="minTmp != null">
+ min_tmp = #{minTmp,jdbcType=DOUBLE},
+ </if>
+ <if test="dt != null">
+ dt = #{dt,jdbcType=DATE},
+ </if>
+ <if test="et0 != null">
+ et0 = #{et0,jdbcType=DOUBLE},
+ </if>
+ </set>
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+ <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoMd.MdEt0">
+ <!--@mbg.generated-->
+ update md_et0
+ set crop_id = #{cropId,jdbcType=BIGINT},
+ weather_id = #{weatherId,jdbcType=BIGINT},
+ factor = #{factor,jdbcType=DOUBLE},
+ max_tmp = #{maxTmp,jdbcType=DOUBLE},
+ min_tmp = #{minTmp,jdbcType=DOUBLE},
+ dt = #{dt,jdbcType=DATE},
+ et0 = #{et0,jdbcType=DOUBLE}
+ where id = #{id,jdbcType=BIGINT}
+ </update>
+</mapper>
\ No newline at end of file
--
Gitblit v1.8.0