| | |
| | | COUNT(*) AS recordCount |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | INNER JOIN JSON_TABLE( |
| | | left JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | |
| | | rtus.isOnLine |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | INNER JOIN JSON_TABLE( |
| | | left JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"37142501020100215","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | |
| | | rtus.isOnLine = #{isOnLine} |
| | | </if> |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND inta.name LIKE CONCAT('%', #{intakeNum}, '%') |
| | | AND inta.name = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | order by con.id ASC |
| | | <if test="pageCurr != null and pageSize != null"> |
| | | LIMIT ${(pageCurr-1)*pageSize}, ${pageSize} |
| | | </if> |
| | |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <!--取水口名称换取水口ID,扫码开阀使用--> |
| | | <select id="getIntakeIdByName" resultType="java.lang.Long"> |
| | | SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName} |
| | | </select> |
| | | |
| | | <!--取水口名称换取水口ID,验证是否重复名称使用--> |
| | | <select id="getIntakeIdsByName" resultType="java.lang.Long"> |
| | | SELECT id AS intakeId FROM pr_intake WHERE `name` = #{intakeName} |
| | | </select> |
| | | |
| | | <!--取水口名称换取水口ID,验证是否重复名称使用--> |
| | | <select id="getIntakeIdByNameExcludeId" resultType="java.lang.Long"> |
| | | SELECT id AS intakeId FROM pr_intake WHERE id != #{id} and `name` = #{intakeName} |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |