liurunyu
2024-01-17 9485d02bc134677dcba63eec0dcf20514cbeb786
增加了取水口取水量实体及数据库映射
3个文件已添加
299 ■■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountMapper.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmount.java 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountMapper.xml 151 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountMapper.java
New file
@@ -0,0 +1,55 @@
package com.dy.pipIrrGlobal.daoRm;
import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Author liurunyu
 * @Date 2024/1/17 9:07
 * @LastEditTime 2024/1/17 9:07
 * @Description
 */
@Mapper
public interface RmIntakeAmountMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long id);
    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(RmIntakeAmount record);
    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(RmIntakeAmount record);
    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    RmIntakeAmount selectByPrimaryKey(Long id);
    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(RmIntakeAmount record);
    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(RmIntakeAmount record);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmount.java
New file
@@ -0,0 +1,93 @@
package com.dy.pipIrrGlobal.pojoRm;
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 lombok.*;
import java.util.Date;
/**
 * @Author liurunyu
 * @Date 2024/1/17 9:07
 * @LastEditTime 2024/1/17 9:07
 * @Description 取水口取水量
 */
@TableName(value="rm_intake_amount", autoResultMap = true)
@Data
@Builder
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Schema(name = "取水口取水量")
public class RmIntakeAmount implements BaseEntity {
    public static final long serialVersionUID = 202401170908001L;
    /**
     * 主键
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    @TableId(type = IdType.INPUT)
    public Long id;
    /**
    * 取水口ID(外键)
    */
    /**
     * 取水口ID(外键)
     */
    @Schema(description = "取水口实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long intakeid;
    /**
    * 累计取水量(不包括漏损水量)
    */
    @Schema(description = "累计取水量(不包括漏损水量)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double amount;
    /**
    * 累计漏损水量
    */
    @Schema(description = "累计漏损水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
   public Double loss;
    /**
    * 最后计水量的控制器ID(外键)
    */
    @Schema(description = "控制器实体外键", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    public Long controlleridlast;
    /**
    * 最后计水量日期
    */
    @Schema(description = "最后计水量日期", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    public Date dtlast;
    /**
    * 最后计水量时控制器取水量
    */
    @Schema(description = "最后计水量时控制器取水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double amountlast;
    /**
    * 最后计水量时控制器累计水量
    */
    @Schema(description = "最后计水量时控制器累计水量", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Double totalamountlast;
    /**
    * 最后计水量来源(1开阀工作报,2关阀报,3自报)
    */
    @Schema(description = "最后计水量来源(1开阀工作报,2关阀报,3自报)", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    public Byte resourcetypelast;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountMapper.xml
New file
@@ -0,0 +1,151 @@
<?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.daoRm.RmIntakeAmountMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount">
    <!--@mbg.generated-->
    <!--@Table rm_intake_amount-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="intakeId" jdbcType="BIGINT" property="intakeid" />
    <result column="amount" jdbcType="DOUBLE" property="amount" />
    <result column="loss" jdbcType="DOUBLE" property="loss" />
    <result column="controllerIdLast" jdbcType="BIGINT" property="controlleridlast" />
    <result column="dtLast" jdbcType="DATE" property="dtlast" />
    <result column="amountLast" jdbcType="DOUBLE" property="amountlast" />
    <result column="totalAmountLast" jdbcType="DOUBLE" property="totalamountlast" />
    <result column="resourceTypeLast" jdbcType="TINYINT" property="resourcetypelast" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, intakeId, amount, loss, controllerIdLast, dtLast, amountLast, totalAmountLast,
    resourceTypeLast
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select
    <include refid="Base_Column_List" />
    from rm_intake_amount
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from rm_intake_amount
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount">
    <!--@mbg.generated-->
    insert into rm_intake_amount (id, intakeId, amount,
      loss, controllerIdLast, dtLast,
      amountLast, totalAmountLast, resourceTypeLast
      )
    values (#{id,jdbcType=BIGINT}, #{intakeid,jdbcType=BIGINT}, #{amount,jdbcType=DOUBLE},
      #{loss,jdbcType=DOUBLE}, #{controlleridlast,jdbcType=BIGINT}, #{dtlast,jdbcType=DATE},
      #{amountlast,jdbcType=DOUBLE}, #{totalamountlast,jdbcType=DOUBLE}, #{resourcetypelast,jdbcType=TINYINT}
      )
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount">
    <!--@mbg.generated-->
    insert into rm_intake_amount
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="intakeid != null">
        intakeId,
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="loss != null">
        loss,
      </if>
      <if test="controlleridlast != null">
        controllerIdLast,
      </if>
      <if test="dtlast != null">
        dtLast,
      </if>
      <if test="amountlast != null">
        amountLast,
      </if>
      <if test="totalamountlast != null">
        totalAmountLast,
      </if>
      <if test="resourcetypelast != null">
        resourceTypeLast,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="intakeid != null">
        #{intakeid,jdbcType=BIGINT},
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DOUBLE},
      </if>
      <if test="loss != null">
        #{loss,jdbcType=DOUBLE},
      </if>
      <if test="controlleridlast != null">
        #{controlleridlast,jdbcType=BIGINT},
      </if>
      <if test="dtlast != null">
        #{dtlast,jdbcType=DATE},
      </if>
      <if test="amountlast != null">
        #{amountlast,jdbcType=DOUBLE},
      </if>
      <if test="totalamountlast != null">
        #{totalamountlast,jdbcType=DOUBLE},
      </if>
      <if test="resourcetypelast != null">
        #{resourcetypelast,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount">
    <!--@mbg.generated-->
    update rm_intake_amount
    <set>
      <if test="intakeid != null">
        intakeId = #{intakeid,jdbcType=BIGINT},
      </if>
      <if test="amount != null">
        amount = #{amount,jdbcType=DOUBLE},
      </if>
      <if test="loss != null">
        loss = #{loss,jdbcType=DOUBLE},
      </if>
      <if test="controlleridlast != null">
        controllerIdLast = #{controlleridlast,jdbcType=BIGINT},
      </if>
      <if test="dtlast != null">
        dtLast = #{dtlast,jdbcType=DATE},
      </if>
      <if test="amountlast != null">
        amountLast = #{amountlast,jdbcType=DOUBLE},
      </if>
      <if test="totalamountlast != null">
        totalAmountLast = #{totalamountlast,jdbcType=DOUBLE},
      </if>
      <if test="resourcetypelast != null">
        resourceTypeLast = #{resourcetypelast,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmount">
    <!--@mbg.generated-->
    update rm_intake_amount
    set intakeId = #{intakeid,jdbcType=BIGINT},
      amount = #{amount,jdbcType=DOUBLE},
      loss = #{loss,jdbcType=DOUBLE},
      controllerIdLast = #{controlleridlast,jdbcType=BIGINT},
      dtLast = #{dtlast,jdbcType=DATE},
      amountLast = #{amountlast,jdbcType=DOUBLE},
      totalAmountLast = #{totalamountlast,jdbcType=DOUBLE},
      resourceTypeLast = #{resourcetypelast,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>