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/RmIntakeAmountDayLastMapper.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml index 25a5872..915a04f 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmIntakeAmountDayLastMapper.xml @@ -167,4 +167,57 @@ rtu_dt_last = #{rtuDtLast,jdbcType=TIMESTAMP} where id = #{id,jdbcType=BIGINT} </update> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍鎬绘暟--> + <select id="getRecordCount" resultType="java.lang.Long"> + select count(*) + from rm_intake_amount_day_last riadl + Left join pr_intake pint on pint.id = riadl.intake_id + <where> + <if test="intakeId != null and intakeId != '' "> + and rash.intake_id = #{intakeId} + </if> + <if test="intakeName != null and intakeName != '' "> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and riadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and riadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + </select> + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇璁板綍--> + <select id="getIntakeAmountDayLast" resultType="com.dy.pipIrrGlobal.voRm.VoIntakeAmountDay"> + select + CAST(riadl.intake_id AS char)AS intakeId, + pint.name as intakeName, + riadl.dt as dt, + riadl.amount as amount, + riadl.dt_last as dtLast, + riadl.rtu_addr_last as rtuAddrLast, + CAST(riadl.controller_id_last AS char)AS controllerIdLast, + riadl.total_amount_last as totalAmountLast, + riadl.rtu_dt_last as rtuDtLast + from rm_intake_amount_day_last riadl + Left join pr_intake pint on pint.id = riadl.intake_id + <where> + <if test="intakeId != null and intakeId != '' "> + and rash.intake_id = #{intakeId} + </if> + <if test="intakeName != null and intakeName != '' "> + and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') + </if> + <if test="startDt != null"> + and riadl.dt >= #{startDt,jdbcType=DATE} + </if> + <if test="endDt != null"> + and riadl.dt <= #{endDt,jdbcType=DATE} + </if> + </where> + ORDER BY riadl.id DESC + <if test="pageCurr != null and pageSize != null"> + LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} + </if> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0