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/BaDistrictMapper.xml | 20 ++++++++++---------- 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml index 0e40757..abf4bc4 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/BaDistrictMapper.xml @@ -7,7 +7,7 @@ <id column="id" jdbcType="BIGINT" property="id" /> <id column="supperId" jdbcType="BIGINT" property="supperId" /> <result column="name" jdbcType="VARCHAR" property="name" /> - <result column="num" jdbcType="TINYINT" property="num" /> + <result column="num" jdbcType="VARCHAR" property="num" /> <result property="level" column="level" typeHandler="com.dy.common.mybatis.envm.EnumCodeTypeHandler" javaType="com.dy.pipIrrGlobal.util.DistrictLevel"/> <result property="deleted" column="deleted" typeHandler="com.dy.common.mybatis.envm.EnumCodeTypeHandler" javaType="com.dy.common.mybatis.envm.Deleted"/> </resultMap> @@ -47,7 +47,7 @@ values (#{id,jdbcType=BIGINT}, #{supperId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, - #{num,jdbcType=TINYINT}, + #{num,jdbcType=VARCHAR}, #{level,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT} ) @@ -87,7 +87,7 @@ #{name,jdbcType=VARCHAR}, </if> <if test="num != null"> - #{num,jdbcType=TINYINT}, + #{num,jdbcType=VARCHAR}, </if> <if test="level != null"> #{level,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, @@ -105,7 +105,7 @@ `name` = #{name,jdbcType=VARCHAR}, </if> <if test="num != null"> - num = #{num,jdbcType=TINYINT}, + num = #{num,jdbcType=VARCHAR}, </if> <if test="supperId != null"> supperId = #{supperId,jdbcType=BIGINT}, @@ -124,7 +124,7 @@ update ba_district set supperId = #{supperId,jdbcType=BIGINT}, `name` = #{name,jdbcType=VARCHAR}, - num = #{num,jdbcType=TINYINT}, + num = #{num,jdbcType=VARCHAR}, `level` = #{level,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT}, deleted = #{deleted,typeHandler=com.dy.common.mybatis.envm.EnumCodeTypeHandler, jdbcType=TINYINT} where id = #{id,jdbcType=BIGINT} @@ -163,22 +163,22 @@ INNER JOIN ba_district con ON tow.supperId = con.id INNER JOIN ba_district cit ON con.supperId = cit.id INNER JOIN ba_district pro ON cit.supperId = pro.id - WHERE vil.id = ${villageId} + WHERE vil.id = #{villageId} </select> <!--鏍规嵁绾у埆鑾峰彇琛屾斂鍖哄垝鍒楄〃--> <select id="getDistrictgsByLevel" resultType="java.util.Map"> SELECT - id, + CAST(id AS char) AS id, name - FROM ba_district WHERE `level` = ${level} + FROM ba_district WHERE `level` = #{level} </select> <!--鏍规嵁鐖禝D鑾峰彇琛屾斂鍖哄垝鍒楄〃--> <select id="getDistrictsBySupperId" resultType="java.util.Map"> SELECT - id, + CAST(id AS char) AS id, name - FROM ba_district WHERE supperId = ${supperId} + FROM ba_district WHERE supperId = #{supperId} </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0