| | |
| | | WHERE id NOT IN(SELECT intakeId FROM pr_controller) AND deleted = 0 |
| | | </select> |
| | | |
| | | <!--获取取水口数量(在线和不在先)--> |
| | | <!--获取取水口数量(在线和不在先) 废弃--> |
| | | <select id="getOnLineIntakesCount" resultType="java.lang.Long"> |
| | | SELECT |
| | | COUNT(*) AS recordCount |
| | |
| | | </where> |
| | | </select> |
| | | |
| | | <!--获取取水口列表(在线和不在先)--> |
| | | <!--获取取水口列表(在线和不在先) 废弃--> |
| | | <select id="getOnLineIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> |
| | | SELECT |
| | | con.intakeId, |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <!--根据取水口编号获取取水口对象--> |
| | | <select id="getIntakeByName" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> |
| | | SELECT |
| | | con.intakeId, |
| | | con.rtuAddr, |
| | | inta.name AS intakeNum, |
| | | rtus.isOnLine |
| | | FROM pr_controller con |
| | | INNER JOIN pr_intake inta ON con.intakeId = inta.id |
| | | left JOIN JSON_TABLE( |
| | | #{onLineMap}, |
| | | '$[*]' COLUMNS( |
| | | rtuAddr VARCHAR(20) PATH '$.rtuAddr', |
| | | isOnLine BOOLEAN PATH '$.isOnLine' |
| | | ) |
| | | ) rtus ON con.rtuAddr = rtus.rtuAddr |
| | | <where> |
| | | <if test="intakeNum != null and intakeNum != ''"> |
| | | AND LOWER(inta.name) = #{intakeNum} |
| | | </if> |
| | | </where> |
| | | LIMIT 0,1 |
| | | |
| | | </select> |
| | | |
| | | <!--根据操作员获取常用取水口--> |
| | | <select id="getUsedIntakes" resultType="com.dy.pipIrrGlobal.voPr.VoOnLineIntake"> |
| | | SELECT |