1、取水口用水日统计表中增加金额、次数字段;
2、优化或重写“累计流量超过指定值的取水口”、“累计流量低于指定值的取水口”、“指定时间段内用水量超过指定值的取水口”、“指定时间段内消费金额超过指定值的取水口”几个统计查询;
3、改“指定时间段内用水时长超过指定值的取水口”为“指定时间段内用水次数超过指定值的取水口”
15个文件已修改
575 ■■■■ 已修改文件
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmountDay.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmountDayLast.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoCumulativeFlow.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntake.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml 148 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealIntakeAmountDay.java 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeCountValueQO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmIntakeAmountDayMapper.java
@@ -3,10 +3,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay;
import com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay;
import com.dy.pipIrrGlobal.voSt.VoDayIntakeAmount;
import com.dy.pipIrrGlobal.voSt.VoDayLoss;
import com.dy.pipIrrGlobal.voSt.VoIntakeAmountStatistics;
import com.dy.pipIrrGlobal.voSt.VoMonthAmount;
import com.dy.pipIrrGlobal.voSt.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -151,4 +148,47 @@
    List<VoDayIntakeAmount> selectIntakeAmountOfDay16_20(Map<?, ?> params);
    List<VoDayIntakeAmount> selectIntakeAmountOfDay21_25(Map<?, ?> params);
    List<VoDayIntakeAmount> selectIntakeAmountOfDay26_31(Map<?, ?> params);
    /**
     * 指定时间段用水量超过指定值的取水口数量
     * @param params
     * @return
     */
    Long getUseWaterGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段用水量超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getUseWaterGtValueIntakes(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口的数量
     * @param params
     * @return
     */
    Long getExpenseGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getExpenseGtValueIntakes(Map<String, Object> params);
   /**
     * 指定时间段内取水次数超过指定值的取水口的数量
     * @param params
     * @return
     */
    Long getUseWaterTimesGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段内取水次数超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getUseWaterTimesGtValueIntakes(Map<String, Object> params);
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/daoRm/RmOpenCloseValveHistoryMapper.java
@@ -238,34 +238,6 @@
    List<VoClient> getSmallWaterDurationClients(Map<String, Object> params);
    /**
     * 指定时间段用水量超过指定值的取水口数量
     * @param params
     * @return
     */
    Long getUseWaterGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段用水量超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getUseWaterGtValueIntakes(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口的数量
     * @param params
     * @return
     */
    Long getExpenseGtValueIntakesCount(Map<String, Object> params);
    /**
     * 指定时间段内消费金额超过指定值的取水口
     * @param params
     * @return
     */
    List<VoIntakeAccumulateAmount> getExpenseGtValueIntakes(Map<String, Object> params);
    /**
     * 指定时间段内用水时长超过指定值的取水口数量
     * @param params
     * @return
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmountDay.java
@@ -56,6 +56,17 @@
    public Double amount;
    /**
     * 日取消费金额
     */
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double money;
    /**
     * 日取水次数
     */
    public Integer times;
    /**
     * 累计日漏损水量
     */
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/pojoRm/RmIntakeAmountDayLast.java
@@ -63,6 +63,17 @@
    public Double amount;
    /**
     * 日取消费金额
     */
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    public Double money;
    /**
     * 日取水次数
     */
    public Integer times;
    /**
     * 最后计水量上报数据接收时间(yyyy-mm-dd hh:mm:ss)
     */
    @Schema(description = "最后计水量上报数据接收时间", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoCumulativeFlow.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrGlobal.voSt;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -14,17 +15,20 @@
 */
@Data
@JsonPropertyOrder({ "intakeId", "intakeNum", "blockName", "lng", "lat"
        ,"cumulativeFlow" , "getDate"
})
@EqualsAndHashCode(callSuper=false)
public class VoCumulativeFlow extends VoIntake {
    /**
     * 累计流量
     */
    private Double cumulativeFlow;
    public Double cumulativeFlow;
    /**
     * 数据获取日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date getDate;
    public Date getDate;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntake.java
@@ -19,16 +19,24 @@
     * 取水口ID
     */
    @JSONField(serializeUsing= ObjectWriterImplToString.class)
    private Long intakeId;
    public Long intakeId;
    /**
     * 取水口编号
     */
    private String intakeNum;
    public String intakeNum;
    /**
     * 取水口所属片区
     */
    private String blockName;
    public String blockName;
    /**
     * 取水口经度
     */
    public Double lng ;
    /**
     * 取水口纬度
     */
    public Double lat ;
}
pipIrr-platform/pipIrr-global/src/main/java/com/dy/pipIrrGlobal/voSt/VoIntakeAccumulateAmount.java
@@ -1,6 +1,7 @@
package com.dy.pipIrrGlobal.voSt;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -13,6 +14,9 @@
 *                    消费金额 大于 指定值
 */
@Data
@JsonPropertyOrder({ "intakeId", "intakeNum", "blockName", "lng", "lat"
        ,"value", "valueInt"
})
@EqualsAndHashCode(callSuper=false)
public class VoIntakeAccumulateAmount extends VoIntake{
    private static final long serialVersionUID = 202408051046001L;
@@ -22,4 +26,9 @@
     */
    @JsonFormat(shape = JsonFormat.Shape.NUMBER_FLOAT, pattern="0.00" )
    private Double value;
    /**
     * 指定值
     */
    private Integer valueInt;
}
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml
@@ -9,6 +9,8 @@
    <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
    <result column="dt" jdbcType="DATE" property="dt" />
    <result column="amount" jdbcType="DOUBLE" property="amount" />
    <result column="money" jdbcType="DOUBLE" property="money" />
    <result column="times" jdbcType="INTEGER" property="times" />
    <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast" />
    <result column="rtu_addr_last" jdbcType="VARCHAR" property="rtuAddrLast" />
    <result column="controller_id_last" jdbcType="BIGINT" property="controllerIdLast" />
@@ -17,7 +19,7 @@
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, last_history_id, intake_id, dt, amount, dt_last, rtu_addr_last, controller_id_last, total_amount_last,
    id, last_history_id, intake_id, dt, amount, money, times, dt_last, rtu_addr_last, controller_id_last, total_amount_last,
    rtu_dt_last
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
@@ -43,11 +45,12 @@
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDayLast">
    <!--@mbg.generated-->
    insert into rm_intake_amount_day_last (id, last_history_id, intake_id, dt,
      amount, dt_last,
      amount, money, times, dt_last,
      rtu_addr_last, controller_id_last, total_amount_last, 
      rtu_dt_last)
    values (#{id,jdbcType=BIGINT}, #{lastHistoryId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{dt,jdbcType=DATE},
      #{amount,jdbcType=DOUBLE}, #{dtLast,jdbcType=TIMESTAMP},
      #{amount,jdbcType=DOUBLE}, #{money,jdbcType=DOUBLE},#{times,jdbcType=INTEGER},
      #{dtLast,jdbcType=TIMESTAMP},
      #{rtuAddrLast,jdbcType=VARCHAR}, #{controllerIdLast,jdbcType=BIGINT}, #{totalAmountLast,jdbcType=FLOAT}, 
      #{rtuDtLast,jdbcType=TIMESTAMP})
  </insert>
@@ -69,6 +72,12 @@
      </if>
      <if test="amount != null">
        amount,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="times != null">
        times,
      </if>
      <if test="dtLast != null">
        dt_last,
@@ -101,6 +110,12 @@
      </if>
      <if test="amount != null">
        #{amount,jdbcType=DOUBLE},
      </if>
      <if test="money != null">
        #{money,jdbcType=DOUBLE},
      </if>
      <if test="times != null">
        #{times,jdbcType=INTEGER},
      </if>
      <if test="dtLast != null">
        #{dtLast,jdbcType=TIMESTAMP},
@@ -135,6 +150,12 @@
      <if test="amount != null">
        amount = #{amount,jdbcType=DOUBLE},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=DOUBLE},
      </if>
      <if test="times != null">
        times = #{times,jdbcType=INTEGER},
      </if>
      <if test="dtLast != null">
        dt_last = #{dtLast,jdbcType=TIMESTAMP},
      </if>
@@ -160,6 +181,8 @@
      intake_id = #{intakeId,jdbcType=BIGINT},
      dt = #{dt,jdbcType=DATE},
      amount = #{amount,jdbcType=DOUBLE},
      money = #{money,jdbcType=DOUBLE},
      times = #{times,jdbcType=INTEGER},
      dt_last = #{dtLast,jdbcType=TIMESTAMP},
      rtu_addr_last = #{rtuAddrLast,jdbcType=VARCHAR},
      controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
@@ -174,7 +197,7 @@
    Left join pr_intake pint on pint.id = riadl.intake_id
    <where>
      <if test="intakeId != null and intakeId != '' ">
        and rash.intake_id = #{intakeId}
        riadl.intake_id = #{intakeId}
      </if>
      <if test="intakeName != null and intakeName != '' ">
        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
@@ -194,6 +217,8 @@
    pint.name as intakeName,
    riadl.dt as dt,
    riadl.amount as amount,
    riadl.money as money,
    riadl.times as times,
    riadl.dt_last as dtLast,
    riadl.rtu_addr_last as rtuAddrLast,
    CAST(riadl.controller_id_last AS char)AS controllerIdLast,
@@ -203,7 +228,7 @@
    Left join pr_intake pint on pint.id = riadl.intake_id
    <where>
      <if test="intakeId != null and intakeId != '' ">
        and rash.intake_id = #{intakeId}
        riadl.intake_id = #{intakeId}
      </if>
      <if test="intakeName != null and intakeName != '' ">
        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayMapper.xml
@@ -8,6 +8,8 @@
        <result column="intake_id" jdbcType="BIGINT" property="intakeId"/>
        <result column="dt" jdbcType="DATE" property="dt"/>
        <result column="amount" jdbcType="DOUBLE" property="amount"/>
        <result column="money" jdbcType="DOUBLE" property="money" />
        <result column="times" jdbcType="INTEGER" property="times" />
        <result column="dt_last" jdbcType="TIMESTAMP" property="dtLast"/>
        <result column="rtu_addr_last" jdbcType="VARCHAR" property="rtuAddrLast"/>
        <result column="controller_id_last" jdbcType="BIGINT" property="controllerIdLast"/>
@@ -19,7 +21,7 @@
        id,
        intake_id,
        dt,
        amount,
        amount, money, times,
        dt_last,
        rtu_addr_last,
        controller_id_last,
@@ -49,11 +51,11 @@
    <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoRm.RmIntakeAmountDay">
        <!--@mbg.generated-->
        insert into rm_intake_amount_day (id, intake_id, dt,
                                          amount, dt_last,
                                          amount, money, times, dt_last,
                                          rtu_addr_last, controller_id_last, total_amount_last,
                                          rtu_dt_last)
        values (#{id,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, #{dt,jdbcType=DATE},
                #{amount,jdbcType=DOUBLE}, #{dtLast,jdbcType=TIMESTAMP},
                #{amount,jdbcType=DOUBLE}, #{money,jdbcType=DOUBLE}, #{times,jdbcType=INTEGER}, #{dtLast,jdbcType=TIMESTAMP},
                #{rtuAddrLast,jdbcType=VARCHAR}, #{controllerIdLast,jdbcType=BIGINT}, #{totalAmountLast,jdbcType=FLOAT},
                #{rtuDtLast,jdbcType=TIMESTAMP})
    </insert>
@@ -72,6 +74,12 @@
            </if>
            <if test="amount != null">
                amount,
            </if>
           <if test="money != null">
               money,
            </if>
           <if test="times != null">
               times,
            </if>
            <if test="dtLast != null">
                dt_last,
@@ -101,6 +109,12 @@
            </if>
            <if test="amount != null">
                #{amount,jdbcType=DOUBLE},
            </if>
            <if test="money != null">
                #{money,jdbcType=DOUBLE},
            </if>
            <if test="times != null">
                #{times,jdbcType=INTEGER},
            </if>
            <if test="dtLast != null">
                #{dtLast,jdbcType=TIMESTAMP},
@@ -132,6 +146,12 @@
            <if test="amount != null">
                amount = #{amount,jdbcType=DOUBLE},
            </if>
            <if test="money != null">
                money = #{money,jdbcType=DOUBLE},
            </if>
            <if test="times != null">
                times = #{times,jdbcType=INTEGER},
            </if>
            <if test="dtLast != null">
                dt_last = #{dtLast,jdbcType=TIMESTAMP},
            </if>
@@ -156,6 +176,8 @@
        set intake_id          = #{intakeId,jdbcType=BIGINT},
            dt                 = #{dt,jdbcType=DATE},
            amount             = #{amount,jdbcType=DOUBLE},
            money              = #{money,jdbcType=DOUBLE},
            times              = #{times,jdbcType=INTEGER},
            dt_last            = #{dtLast,jdbcType=TIMESTAMP},
            rtu_addr_last      = #{rtuAddrLast,jdbcType=VARCHAR},
            controller_id_last = #{controllerIdLast,jdbcType=BIGINT},
@@ -189,6 +211,8 @@
               pint.name                             as intakeName,
               riad.dt                               as dt,
               riad.amount                           as amount,
               riad.money                            as money,
               riad.times                            as times,
               riad.dt_last                          as dtLast,
               riad.rtu_addr_last                    as rtuAddrLast,
               CAST(riad.controller_id_last AS char) AS controllerIdLast,
@@ -995,5 +1019,121 @@
    ) as tb31 on tb31.intakeId = inta.intakeId
  </select>
    <!--指定时间段用水量超过指定值的取水口数量-->
    <select id="getUseWaterGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from (
        SELECT
        SUM(riad.amount) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ) c
    </select>
    <!--指定时间段用水量超过指定值的取水口-->
    <select id="getUseWaterGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        inta.lng  AS lng,
        inta.lat  AS lat,
        blo.NAME AS blockName ,
        SUM(riad.amount) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ORDER BY inta.id
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
    <!--指定时间段内消费金额超过指定值的取水口的数量-->
    <select id="getExpenseGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from (
        SELECT
        SUM(riad.money) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ) c
    </select>
    <!--指定时间段内消费金额超过指定值的取水口-->
    <select id="getExpenseGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        inta.lng  AS lng,
        inta.lat  AS lat,
        blo.NAME AS blockName ,
        SUM(riad.money) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ORDER BY inta.id
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
    <!--指定时间段内取水次数超过指定值的取水口的数量-->
    <select id="getUseWaterTimesGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from (
        SELECT
        SUM(riad.times) AS valueInt
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ) c
    </select>
    <!--指定时间段内取水次数超过指定值的取水口-->
    <select id="getUseWaterTimesGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        inta.lng  AS lng,
        inta.lat  AS lat,
        blo.NAME AS blockName ,
        SUM(riad.times) AS valueInt
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        INNER JOIN rm_intake_amount_day riad ON riad.intake_id = inta.id
        WHERE inta.deleted = 0 and riad.dt &gt;= #{timeStart} AND riad.dt &lt;= #{timeStop}
        GROUP BY inta.id
        HAVING value &gt; #{value}
        ORDER BY inta.id
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
</mapper>
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
@@ -285,11 +285,13 @@
    <!--获取累计流量超过指定值的取水口-->
    <select id="getLargeFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow">
        SELECT inta.id                                  AS intakeId,
               inta.name                                AS intakeNum,
               blo.name                                 AS blockName,
               CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow,
               hou.dt                                   AS getDate
        SELECT inta.id            AS intakeId,
               inta.name          AS intakeNum,
               inta.lng           AS lng,
               inta.lat           AS lat,
               blo.name           AS blockName,
               hou.total_amount   AS cumulativeFlow,
               hou.dt             AS getDate
        FROM pr_intake inta
                 INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id
                 INNER JOIN ba_block blo ON blo.id = inta.blockId
@@ -317,10 +319,11 @@
    <select id="getSmallFlowIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoCumulativeFlow">
        SELECT inta.id   AS intakeId,
               inta.name AS intakeNum,
               inta.lng  AS lng,
               inta.lat  AS lat,
               blo.name  AS blockName,
        <!--    FORMAT(hou.total_amount,2) AS cumulativeFlow,-->
        CAST(hou.total_amount AS DECIMAL(10, 2)) AS cumulativeFlow,
        hou.dt                                   AS getDate
               hou.total_amount AS cumulativeFlow,
               hou.dt    AS getDate
        FROM pr_intake inta
                 INNER JOIN rm_on_hour_report_last hou ON hou.intake_id = inta.id
                 INNER JOIN ba_block blo ON blo.id = inta.blockId
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOpenCloseValveHistoryMapper.xml
@@ -1037,84 +1037,7 @@
            </if>
        </trim>
    </select>
    <!--指定时间段用水量超过指定值的取水口数量-->
    <select id="getUseWaterGtValueIntakesCount" resultType="java.lang.Long">
        select
            count(*)
        from
            (        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_amount),0) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_amount),0) &gt; #{value}) c
    </select>
    <!--指定时间段用水量超过指定值的取水口-->
    <select id="getUseWaterGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
            inta.id AS intakeId,
            inta.NAME AS intakeNum,
            blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_amount),0) AS value
        FROM
            pr_intake inta
            INNER JOIN ba_block blo ON blo.id = inta.blockId
            LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_amount),0) &gt; #{value}
        ORDER BY inta.id
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
    <!--指定时间段内消费金额超过指定值的取水口的数量-->
    <select id="getExpenseGtValueIntakesCount" resultType="java.lang.Long">
        select
        count(*)
        from
        (        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_money),0) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_money),0) &gt; #{value}) c
    </select>
    <!--指定时间段内消费金额超过指定值的取水口-->
    <select id="getExpenseGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount">
        SELECT
        inta.id AS intakeId,
        inta.NAME AS intakeNum,
        blo.NAME AS blockName ,
        IFNULL(SUM(rocvh.cl_this_money),0) AS value
        FROM
        pr_intake inta
        INNER JOIN ba_block blo ON blo.id = inta.blockId
        LEFT JOIN rm_open_close_valve_history rocvh ON rocvh.intake_id = inta.id
        WHERE rocvh.op_dt &gt;= #{timeStart} AND rocvh.cl_dt &lt;= #{timeStop} AND inta.deleted = 0
        GROUP BY inta.id
        HAVING IFNULL(SUM(rocvh.cl_this_money),0) &gt; #{value}
        ORDER BY inta.id
        <trim prefix="limit " >
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}
            </if>
        </trim>
    </select>
    <!--指定时间段内用水时长超过指定值的取水口数量-->
    <select id="getUseWaterDurationGtValueIntakesCount" resultType="java.lang.Long">
        select
pipIrr-platform/pipIrr-mw/pipIrr-mw-rtu/src/main/java/com/dy/rtuMw/server/rtuData/p206V1/TkDealIntakeAmountDay.java
@@ -153,7 +153,15 @@
        po.dt = DateTime.dateFrom_yyyy_MM_dd1(dV1.dt);
        po.dtLast = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(dV1.dt);
        po.rtuDtLast = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt);
        po.amount = 0.0D ;
        if(cdData.isCloseValve != null && cdData.isCloseValve){
            po.amount = cdData.amount ;
            po.money = cdData.money ;
            po.times = 1 ;
        }else{
            po.amount = 0.0D ;
            po.money = 0.0D ;
            po.times = 0 ;
        }
        po.rtuAddrLast = rtuAddr;
        return po ;
    }
@@ -177,8 +185,12 @@
        po.rtuDtLast = DateTime.dateFrom_yyyy_MM_dd_HH_mm_ss(cdData.rtuDt);
        if(lastPo != null){
            po.amount = lastPo.amount ;
            po.money = lastPo.money ;
            po.times = lastPo.times ;
        }else{
            po.amount = 0.0D ;
            po.money = 0.0D ;
            po.times = 0 ;
        }
        po.totalAmountLast = cdData.totalAmount ;
        return po ;
@@ -206,7 +218,7 @@
    /**
     * 生成新的控制器漏损日统计最新记录
     * 取水口更换了控制器在,此时只更新部分属性
     * @param controller
     * @param rtuAddr
     * @param dV1
@@ -262,6 +274,22 @@
                //本次置量值不变,下次再上报时,就能正常计算了。
                //lastPo.amount = lastPo.amount ; //日累计取水量不变
            }
            if(cdData.isCloseValve != null && cdData.isCloseValve.booleanValue()){
                //是从关阀报中得到的数据
                if(lastPo.money == null){
                    lastPo.money = cdData.money ;
                }else{
                    lastPo.money += cdData.money ;
                }
                if(lastPo.times == null){
                    lastPo.times = 1 ;
                }else{
                    lastPo.times += 1 ;
                }
            }else{
                lastPo.money = 0.0D ;
                lastPo.times = 1 ;
            }
            lastPo.totalAmountLast = cdData.totalAmount ;
        }
@@ -304,12 +332,20 @@
            lastPo.totalAmountLast = cdData.totalAmount ;
        }
        if(cdData.isCloseValve != null && cdData.isCloseValve.booleanValue()){
            //是从关阀报中得到的数据
            lastPo.money = cdData.money ;
            lastPo.times = 1 ;
        }else{
            lastPo.money = 0.0D ;
            lastPo.times = 0 ;
        }
        return lastPo ;
    }
    /**
     * 生成新的控制器漏损日统计最新记录
     * 取水口更换了控制器在,此时只更新部分属性
     * @param controller
     * @param rtuAddr
     * @param dV1
@@ -326,6 +362,8 @@
        po.rtuDtLast = lastPo.rtuDtLast;
        po.amount = lastPo.amount ;
        po.money = lastPo.money ;
        po.times = lastPo.times ;
        po.totalAmountLast = lastPo.totalAmountLast ;
        return po ;
@@ -349,6 +387,8 @@
        po.rtuDtLast = lastPo.rtuDtLast;
        po.amount = lastPo.amount ;//此时lastPo.amount已经增加上了增量
        po.money = lastPo.money ;//此时lastPo.money已经增加上了增量
        po.times = lastPo.times ;//此时lastPo.times已经增加上了增量
        po.totalAmountLast = lastPo.totalAmountLast ;
        return po ;
@@ -357,6 +397,9 @@
    public class UpDataVo{
        public Double totalAmount; //累计流量:5字节BCD码,取值范围0~9999999999,单位为m3。
        public Double amount; //农户用水量
        public Double money ;//农户消费金额
        public Boolean isCloseValve ;//是否是关阀上报
        public String rtuDt ;//控制器时钟
        public void valueFrom(DataCdC0Vo voC0, DataCd84Vo vo84, DataCd83OpenVo vo83Op, DataCd83CloseVo vo83Cl){
@@ -371,6 +414,9 @@
                this.rtuDt = vo83Op.rtuDt ;
            }else if(vo83Cl != null){
                this.totalAmount = vo83Cl.totalAmount ;
                this.amount = vo83Cl.thisAmount ;
                this.money = vo83Cl.thisMoney ;
                this.isCloseValve = true ;
                this.rtuDt = vo83Cl.rtuDt ;
            }
        }
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntakeSv.java
@@ -1,5 +1,6 @@
package com.dy.pipIrrStatistics.intake;
import com.dy.common.util.DateTime;
import com.dy.common.webUtil.QueryResultVo;
import com.dy.pipIrrGlobal.daoRm.*;
import com.dy.pipIrrGlobal.voSt.*;
@@ -94,7 +95,7 @@
        return rsVo ;
    }
    /**
    /** ok 1
     * 获取累计流量超过指定值的取水口
     * @param qo
     * @return
@@ -116,7 +117,7 @@
        return rsVo ;
    }
    /**
    /** ok 2
     * 获取累计流量低于指定值的取水口
     * @param qo
     * @return
@@ -476,7 +477,7 @@
        return rsVo ;
    }
    /**
    /** ok 3
     * 指定时间段内用水量超过指定值的取水口
     * @param qo
     * @return
@@ -484,37 +485,31 @@
    public QueryResultVo<List<VoIntakeAccumulateAmount>> getUseWaterGtValueIntakes(IntakeAmountValueQO qo) {
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        if(timeStart != null && timeStart != "") {
            timeStart = timeStart + " 00:00:00";
        } else {
            timeStart = LocalDate.now() + " 00:00:00";
        if(timeStart == null || timeStart.trim().equals("")) {
            timeStart = DateTime.yyyy_MM_dd() ;
            qo.setTimeStart(timeStart);
        }
        qo.setTimeStart(timeStart);
        if(timeStop != null && timeStop != "") {
            timeStop = timeStop + " 23:59:59";
        }else {
            timeStop = LocalDate.now() + " 23:59:59";
        if(timeStop == null || timeStop.trim().equals("")) {
            timeStop = DateTime.yyyy_MM_dd() ;
            qo.setTimeStop(timeStop);
        }
        qo.setTimeStop(timeStop);
        if (qo.getValue() == null){
            qo.setValue(0.0);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
        Long itemTotal = rmOpenCloseValveHistoryMapper.getUseWaterGtValueIntakesCount(params);
        Long itemTotal = rmIntakeAmountDayMapper.getUseWaterGtValueIntakesCount(params);
        QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmOpenCloseValveHistoryMapper.getUseWaterGtValueIntakes(params);
        rsVo.obj = rmIntakeAmountDayMapper.getUseWaterGtValueIntakes(params);
        return rsVo ;
    }
    /**
    /** ok 4
     * 指定时间段内消费金额超过指定值的取水口
     * @param qo
     * @return
@@ -522,36 +517,64 @@
    public QueryResultVo<List<VoIntakeAccumulateAmount>> getExpenseGtValueIntakes(IntakeAmountValueQO qo) {
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        if(timeStart != null && timeStart != "") {
            timeStart = timeStart + " 00:00:00";
        } else {
            timeStart = LocalDate.now() + " 00:00:00";
        if(timeStart == null || timeStart.trim().equals("")) {
            timeStart = DateTime.yyyy_MM_dd() ;
            qo.setTimeStart(timeStart);
        }
        qo.setTimeStart(timeStart);
        if(timeStop != null && timeStop != "") {
            timeStop = timeStop + " 23:59:59";
        }else {
            timeStop = LocalDate.now() + " 23:59:59";
        if(timeStop == null || timeStop.trim().equals("")) {
            timeStop = DateTime.yyyy_MM_dd() ;
            qo.setTimeStop(timeStop);
        }
        qo.setTimeStop(timeStop);
        if (qo.getValue() == null){
            qo.setValue(0.0);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
        Long itemTotal = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakesCount(params);
        Long itemTotal = rmIntakeAmountDayMapper.getExpenseGtValueIntakesCount(params);
        QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmOpenCloseValveHistoryMapper.getExpenseGtValueIntakes(params);
        rsVo.obj = rmIntakeAmountDayMapper.getExpenseGtValueIntakes(params);
        return rsVo ;
    }
    /** ok 4
     * 指定时间段内消费金额超过指定值的取水口
     * @param qo
     * @return
     */
    public QueryResultVo<List<VoIntakeAccumulateAmount>> getUseWaterTimesGtValueIntakes(IntakeCountValueQO qo) {
        String timeStart = qo.getTimeStart();
        String timeStop = qo.getTimeStop();
        if(timeStart == null || timeStart.trim().equals("")) {
            timeStart = DateTime.yyyy_MM_dd() ;
            qo.setTimeStart(timeStart);
        }
        if(timeStop == null || timeStop.trim().equals("")) {
            timeStop = DateTime.yyyy_MM_dd() ;
            qo.setTimeStop(timeStop);
        }
        if (qo.getValue() == null){
            qo.setValue(0);
        }
        Map<String, Object> params = (Map<String, Object>) PojoUtils.generalize(qo);
        Long itemTotal = rmIntakeAmountDayMapper.getUseWaterTimesGtValueIntakesCount(params);
        QueryResultVo<List<VoIntakeAccumulateAmount>> rsVo = new QueryResultVo<>() ;
        rsVo.pageSize = qo.pageSize ;
        rsVo.pageCurr = qo.pageCurr ;
        rsVo.calculateAndSet(itemTotal, params);
        rsVo.obj = rmIntakeAmountDayMapper.getUseWaterTimesGtValueIntakes(params);
        return rsVo ;
    }
    /**
     * 指定时间段内用水时长超过指定值的取水口
     * @param qo
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/IntkeCtrl.java
@@ -55,7 +55,7 @@
        }
    }
    /**
    /** ok 1
     * 获取累计流量超过指定值的取水口
     * @param qo
     * @return
@@ -74,7 +74,7 @@
        }
    }
    /**
    /** ok 2
     * 获取累计流量低于指定值的取水口
     * @param qo
     * @return
@@ -238,7 +238,7 @@
        }
    }
    /**
    /** ok 3
     * 指定时间段内用水量超过指定值的取水口
     * @param
     * @return
@@ -255,7 +255,7 @@
        }
    }
    /**
    /** ok 4
     * 指定时间段内消费金额超过指定值的取水口
     * @param
     * @return
@@ -272,6 +272,22 @@
        }
    }
    /**
     * 指定时间段内用水次数超过指定值的取水口
     * @param
     * @return
     */
    @GetMapping(path = "/getUseWaterTimesGtValueIntakes")
    @SsoAop()
    public BaseResponse<QueryResultVo<List<VoIntakeAccumulateAmount>>> getUseWaterTimesGtValueIntakes(IntakeCountValueQO qo) {
        try {
            QueryResultVo<List<VoIntakeAccumulateAmount>> res = intakeSv.getUseWaterTimesGtValueIntakes(qo);
            return BaseResponseUtils.buildSuccess(res);
        } catch (Exception e) {
            log.error("获取记录异常", e);
            return BaseResponseUtils.buildException(e.getMessage()) ;
        }
    }
    /**
     * 指定时间段内用水时长超过指定值的取水口
pipIrr-platform/pipIrr-web/pipIrr-web-statistics/src/main/java/com/dy/pipIrrStatistics/intake/qo/IntakeCountValueQO.java
@@ -19,5 +19,5 @@
     * 值
     */
    @NotBlank(message = "值不能为空")
    private int value;
    private Integer value;
}