liurunyu
2025-01-09 e059d06932a35d26be1c030dce61964bd04a1488
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmOnHourReportLastMapper.xml
@@ -425,34 +425,38 @@
        SELECT
            count(*)
        FROM  pr_intake pit
        LEFT JOIN `rm_on_hour_report_last` rohrl ON pit.id = rohrl.intake_id
        LEFT JOIN `rm_on_hour_report_last` rohrl
        ON (
            pit.id = rohrl.intake_id
        <if test="timeStart != null and timeStart != '' ">
            AND rohrl.dt  > #{timeStart}
        </if>
        )
        LEFT JOIN ba_block bbl ON bbl.id = pit.blockId
        LEFT JOIN pr_controller pct ON pit.id = pct.intakeId
        WHERE  rohrl.id is NULL
        <if test="timeStart != null and timeStart != '' ">
            OR rohrl.rtu_dt  &lt; #{timeStart}
        </if>
<!--        <if test="timeStop != null and timeStop != '' ">-->
<!--            OR rohrl.rtu_dt &gt; #{timeStop}-->
<!--        </if>-->
        ORDER BY rtu_dt ASC
    </select>
    <!--获取最近未报数的取水口-->
    <select id="getUnReportedIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeUnReported">
        SELECT
            pit.`name` intakeNum,
            pct.rtuAddr,
            rohrl.rtu_dt rtuDt
            pit.id      AS intakeId,
            pit.`name`  AS intakeNum,
            pit.lng     AS lng,
            pit.lat     AS lat,
            bbl.name    AS blockName,
            pct.rtuAddr AS rtuAddr
        FROM  pr_intake pit
        LEFT JOIN `rm_on_hour_report_last` rohrl ON pit.id = rohrl.intake_id
        LEFT JOIN `rm_on_hour_report_last` rohrl
        ON (
            pit.id = rohrl.intake_id
        <if test="timeStart != null and timeStart != '' ">
            AND rohrl.dt  > #{timeStart}
        </if>
        )
        LEFT JOIN ba_block bbl ON bbl.id = pit.blockId
        LEFT JOIN pr_controller pct ON pit.id = pct.intakeId
        WHERE  rohrl.id is NULL
        <if test="timeStart != null">
            OR rohrl.rtu_dt  &lt; #{timeStart}
        </if>
<!--        <if test="timeStop != null">-->
<!--            OR rohrl.rtu_dt &gt; #{timeStop}-->
<!--        </if>-->
        ORDER BY rtu_dt ASC
        ORDER BY pit.id DESC
        <trim prefix="limit ">
            <if test="start != null and count != null">
                #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER}