| | |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | | FROM pr_intake inta |
| | | LEFT JOIN (SELECT * FROM rm_on_hour_report_history WHERE dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN |
| | | (SELECT * FROM rm_on_hour_report_history |
| | | <where> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where>) his |
| | | ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | |
| | | </select> |
| | |
| | | inta.name AS intakeNum, |
| | | blo.name AS blockName |
| | | FROM pr_intake inta |
| | | LEFT JOIN (SELECT * FROM rm_on_hour_report_history WHERE dt BETWEEN #{timeStart} AND #{timeStop}) his ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | LEFT JOIN |
| | | (SELECT * FROM rm_on_hour_report_history |
| | | <where> |
| | | <if test = "timeStart != null and timeStop != null"> |
| | | dt BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where>) his |
| | | ON his.intake_id = inta.id |
| | | INNER JOIN ba_block blo ON blo.id = inta.blockId |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | <!--指定时间段内用水量超过指定值的取水口数量--> |
| | | <select id="getUseWaterGtValueIntakesCount" resultType="java.lang.Long"> |
| | | <!--指定时间段内累积流量超过指定值的取水口数量--> |
| | | <select id="getTotalFlowGtValueIntakesCount" resultType="java.lang.Long"> |
| | | select |
| | | count(*) |
| | | from |
| | |
| | | WHERE IFNULL(b.total_amount, 0)-IFNULL(a.total_amount, 0) > #{value} AND inta.deleted = 0 |
| | | ) c |
| | | </select> |
| | | <!--指定时间段内用水量超过指定值的取水口--> |
| | | <select id="getUseWaterGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | <!--指定时间段内累积流量超过指定值的取水口--> |
| | | <select id="getTotalFlowGtValueIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntakeAccumulateAmount"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | inta.NAME AS intakeNum, |