| | |
| | | FROM rm_on_hour_report_history oh |
| | | INNER JOIN pr_intake inta ON inta.id = oh.intake_id |
| | | <where> |
| | | <if test="intakeId != null and intakeId >0"> |
| | | AND oh.intake_id = #{intakeId} |
| | | </if> |
| | | <if test = "intakeName != null and intakeName !=''"> |
| | | AND inta.name LIKE CONCAT('%',#{intakeName},'%') |
| | | </if> |
| | |
| | | FROM rm_on_hour_report_history oh |
| | | INNER JOIN pr_intake inta ON inta.id = oh.intake_id |
| | | <where> |
| | | <if test="intakeId != null and intakeId >0"> |
| | | AND oh.intake_id = #{intakeId} |
| | | </if> |
| | | <if test = "intakeNum != null and intakeNum !=''"> |
| | | AND inta.name LIKE CONCAT('%',#{intakeNum},'%') |
| | | </if> |
| | |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | <!--获取指定时间段内未上线取水口数量--> |
| | | <select id="getNotOnlineIntakesCount" resultType="java.lang.Long"> |
| | | 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 |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | |
| | | </select> |
| | | |
| | | <!--获取指定时间段内未上线的取水口--> |
| | | <select id="getNotOnlineIntakes" resultType="com.dy.pipIrrGlobal.voSt.VoIntake"> |
| | | SELECT |
| | | inta.id AS intakeId, |
| | | 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 |
| | | WHERE his.intake_id IS NULL AND inta.deleted = 0 |
| | | ORDER BY inta.id |
| | | <trim prefix="limit " > |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |
| | | </if> |
| | | </trim> |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |