From b397edee2be2dfcc3f28eeac50298b4de26b1afa Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期五, 13 十二月 2024 16:53:45 +0800
Subject: [PATCH] 取水口日取水量表中,出现一些大数,明显不正确,发析系统日志,发现一些阀控器会上报一些累计流量为0的数据,且无规律,推测是其不能从水表读取到累计流量时会上报0值。如果间歇上报0值,间歇上报一些非0值,非0值减去0值,就会出现大数,一天中出现几次那么会大数进行累加,数值将更大。为此变更算法,规避这种情况,但也会丢失一些流量值。
---
pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml | 41 +++++++++++++++++++++++++++++++++--------
1 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
index 0814a5d..600d56d 100644
--- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
+++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/IrIrrigateUnitMapper.xml
@@ -6,6 +6,7 @@
<!--@Table ir_irrigate_unit-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="project_id" jdbcType="BIGINT" property="projectId" />
+ <result column="intake_id" jdbcType="BIGINT" property="intakeId" />
<result column="area" jdbcType="FLOAT" property="area" />
<result column="remarks" jdbcType="VARCHAR" property="remarks" />
<result column="operator" jdbcType="BIGINT" property="operator" />
@@ -14,7 +15,7 @@
</resultMap>
<sql id="Base_Column_List">
<!--@mbg.generated-->
- id, project_id, area, remarks, `operator`,
+ id, project_id,intake_id, area, remarks, `operator`,
operate_time, deleted
</sql>
@@ -28,6 +29,9 @@
</if>
<if test="projectId != null">
project_id,
+ </if>
+ <if test="intakeId != null">
+ intake_id,
</if>
<if test="area != null">
area,
@@ -51,6 +55,9 @@
</if>
<if test="projectId != null">
#{projectId,jdbcType=BIGINT},
+ </if>
+ <if test="intakeId != null">
+ #{intakeId,jdbcType=BIGINT},
</if>
<if test="area != null">
#{area,jdbcType=FLOAT},
@@ -84,6 +91,9 @@
<if test="projectId != null">
project_id = #{projectId,jdbcType=BIGINT},
</if>
+ <if test="intakeId != null">
+ intake_id = #{intakeId,jdbcType=BIGINT},
+ </if>
<if test="area != null">
area = #{area,jdbcType=FLOAT},
</if>
@@ -107,15 +117,21 @@
select
CAST(pro.id AS char)AS projectId,
pro.project_name AS projectName,
- CAST(uni.id AS char)AS unitId,
+ CAST(intake.id AS char)AS intakeId,
+ intake.name AS intakeName,
+ CAST(uni.id AS char)AS id,
CAST(uni.operator AS char)AS operator,
cli.name AS operatorName,
+ gru.group_code AS groupCode,
uni.area,
uni.remarks,
uni.operate_time AS operateDt
from ir_irrigate_unit uni
+ left join pr_intake intake on intake.id = uni.intake_id
left join ir_project pro on pro.id = uni.project_id
left join se_client cli on cli.id = uni.operator
+ left join ir_group_unit gu on gu.unit_id = uni.id
+ left join ir_irrigate_group gru on gru.id = gu.group_id
where uni.id = #{id,jdbcType=BIGINT} and uni.deleted = 0
</select>
<!--鍒嗛〉鏌ョ亴婧夊崟鍏�-->
@@ -123,23 +139,29 @@
SELECT
CAST(pro.id AS char)AS projectId,
pro.project_name AS projectName,
+ CAST(intake.id AS char)AS intakeId,
+ intake.name AS intakeName,
CAST(uni.id AS char)AS unitId,
CAST(uni.operator AS char)AS operator,
cli.name AS operatorName,
+ gru.group_code AS groupCode,
uni.area,
uni.remarks,
uni.operate_time AS operateDt
FROM ir_irrigate_unit uni
+ left join pr_intake intake on intake.id = uni.intake_id
left join ir_project pro on pro.id = uni.project_id
left join se_client cli on cli.id = uni.operator
+ left join ir_group_unit gu on gu.unit_id = uni.id
+ left join ir_irrigate_group gru on gru.id = gu.group_id
<where>
uni.deleted = 0
<if test="projectName != null and projectName != ''">
AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
</if>
-<!-- <if test = "groupCode != null and groupCode != ''">-->
-<!-- AND pro.project_state = #{groupCode}-->
-<!-- </if>-->
+ <if test = "groupCode != null and groupCode != ''">
+ AND gru.group_code = #{groupCode}
+ </if>
</where>
ORDER BY uni.operate_time DESC
<if test="pageCurr != null and pageSize != null">
@@ -150,16 +172,19 @@
<select id="getRecordCount" resultType="java.lang.Long">
SELECT COUNT(*) AS recordCount
FROM ir_irrigate_unit uni
+ left join pr_intake intake on intake.id = uni.intake_id
left join ir_project pro on pro.id = uni.project_id
left join se_client cli on cli.id = uni.operator
+ left join ir_group_unit gu on gu.unit_id = uni.id
+ left join ir_irrigate_group gru on gru.id = gu.group_id
<where>
uni.deleted = 0
<if test="projectName != null and projectName != ''">
AND pro.project_name LIKE CONCAT('%', #{projectName}, '%')
</if>
- <!-- <if test = "groupCode != null and groupCode != ''">-->
- <!-- AND pro.project_state = #{groupCode}-->
- <!-- </if>-->
+ <if test = "groupCode != null and groupCode != ''">
+ AND gru.group_code = #{groupCode}
+ </if>
</where>
</select>
</mapper>
\ No newline at end of file
--
Gitblit v1.8.0