| | |
| | | FROM pr_common_intakes com |
| | | INNER JOIN pr_intake inta ON inta.id = com.intake_id |
| | | INNER JOIN pr_controller con ON con.intakeId = com.intake_id |
| | | INNER JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"620201000030","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> |
| | | LEFT JOIN JSON_TABLE( |
| | | <!--'[{"rtuAddr":"530115059980","isOnLine":true},{"rtuAddr":"620201000030","isOnLine":true}]',--> |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS ( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | |
| | | ) |
| | | ) rtus ON con.rtuAddr = rtus.rtuAddr |
| | | <where> |
| | | <if test="operator != null"> |
| | | com.operator_id = #{operator} |
| | | <if test="operatorId != null"> |
| | | AND com.operator_id = #{operatorId} |
| | | </if> |
| | | </where> |
| | | ORDER BY com.last_used_time DESC,com.usage_count DESC |