From 29807fea73899a5b775eb2c7d8e1c05ea8bc0c3d Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期五, 02 八月 2024 17:00:31 +0800 Subject: [PATCH] 2024-08-02 朱宝民 优化获取全部取水口接口,包含经纬度及12小时之内的报警信息 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWorkReportLastMapper.xml | 79 +++++++++++++++++++++++++++++++++++++++ 1 files changed, 79 insertions(+), 0 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWorkReportLastMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWorkReportLastMapper.xml index dc9d03b..bd2267e 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWorkReportLastMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmWorkReportLastMapper.xml @@ -439,4 +439,83 @@ from rm_work_report_last where intake_id = #{intakeId,jdbcType=BIGINT} </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸ヤ綔鎶ユ渶鏂拌褰曟暟閲�--> + <select id="getWorkReportsCount_last" resultType="java.lang.Long"> + SELECT + COUNT(*) AS recordCount + FROM rm_work_report_last wo + INNER JOIN pr_intake inta ON inta.id = wo.intake_id + <where> + <if test="intakeId != null and intakeId >0"> + AND wo.intake_id = #{intakeId} + </if> + <if test = "intakeNum != null and intakeNum !=''"> + AND inta.name LIKE CONCAT('%',#{intakeNum},'%') + </if> + <if test = "rtuAddr != null and rtuAddr !=''"> + AND wo.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%') + </if> + <if test = "timeStart != null and timeStop != null"> + AND wo.dt BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇宸ヤ綔鎶ユ渶鏂拌褰�--> + <select id="getWorkReports_last" resultType="com.dy.pipIrrGlobal.voRm.VoWork"> + SELECT + wo.intake_id AS intakeId, + inta.name AS intakeNum, + wo.rtu_addr AS rtuAddr, + wo.client_name AS clientName, + wo.ic_card_no AS icNum, + wo.ic_card_addr AS icAddr, + wo.dt AS receiveTime, + wo.order_no AS orderNo, + wo.water_level AS waterLevel, + wo.water_press AS waterPress, + wo.water_instant AS waterInstant, + wo.water_total AS waterTotal, + wo.ele_total AS eleTotal, + wo.money_remain AS moneyRemain, + wo.water_remain AS waterRemain, + wo.this_ele AS thisEle, + wo.this_water AS thisWater, + wo.this_money AS thisMoney, + wo.this_duration AS thisDuration, + wo.water_price AS waterPrice, + wo.ele_price AS elePrice, + wo.a_volt AS aVolt, + wo.b_volt AS bVolt, + wo.c_volt AS cVolt, + wo.a_current AS aCurrent, + wo.b_current AS bCurrent, + wo.c_current AS cCurrent, + wo.battery_volt AS batteryVolt, + wo.water_meter_trans_volt AS waterMeterTransVolt, + wo.water_meter_work_volt AS waterMeterWorkVolt + FROM rm_work_report_last wo + INNER JOIN pr_intake inta ON inta.id = wo.intake_id + <where> + <if test="intakeId != null and intakeId >0"> + AND wo.intake_id = #{intakeId} + </if> + <if test = "intakeNum != null and intakeNum !=''"> + AND inta.name LIKE CONCAT('%',#{intakeNum},'%') + </if> + <if test = "rtuAddr != null and rtuAddr !=''"> + AND wo.rtu_addr LIKE CONCAT('%',#{rtuAddr},'%') + </if> + <if test = "timeStart != null and timeStop != null"> + AND wo.dt BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + ORDER BY wo.dt DESC + <trim prefix="limit " > + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> </mapper> \ No newline at end of file -- Gitblit v1.8.0