| | |
| | | <select id="getUnclosedValves" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedValve"> |
| | | SELECT |
| | | inta.name AS intakeNum, |
| | | rtus.isOnLine, |
| | | <!-- rtus.isOnLine,--> |
| | | IFNULL(rtus.isOnLine,'未知') AS isOnLine, |
| | | com.rtu_addr AS rtuAddr, |
| | | com.param ->> '$.icCardNo' AS vcNum, |
| | | ( |
| | |
| | | <where> |
| | | AND com.operator = #{operator} |
| | | AND (com.protocol = 'p206V1_0_1' AND (com.command_code = '92' OR com.command_code = '97' OR com.command_code = '99' OR com.command_code = 'A0' OR com.command_code = 'A1' OR com.command_code = 'A2')) |
| | | AND ( |
| | | SELECT op_dt FROM rm_open_close_valve_last |
| | | WHERE rtu_addr = com.rtu_addr AND op_ic_card_no = com.param ->> '$.icCardNo' |
| | | ORDER BY op_dt DESC |
| | | LIMIT 1 |
| | | ) IS NOT NULL |
| | | AND ( |
| | | SELECT cl_dt FROM rm_open_close_valve_last |
| | | WHERE rtu_addr = com.rtu_addr AND op_ic_card_no = com.param ->> '$.icCardNo' |
| | |
| | | SELECT COUNT(*) AS recordCount |
| | | FROM rm_command_history his |
| | | INNER JOIN pr_intake inta ON inta.id = his.intake_id |
| | | LEFT JOIN se_client cli ON cli.id = his.operator |
| | | LEFT JOIN ba_user user ON user.id = his.operator |
| | | <where> |
| | | <if test="intakeId != null"> |
| | | AND his.intake_id = #{intakeId} |
| | |
| | | <!--根据指定条件获取命令日志历史记录--> |
| | | <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand"> |
| | | SELECT his.com_id AS comId, |
| | | his.command_name AS commandName, |
| | | CONCAT(his.command_name, '(', his.command_code, ')') AS commandName, |
| | | inta.name AS intakeName, |
| | | his.rtu_addr AS rtuAddr, |
| | | his.protocol, |
| | | his.protocol AS protocol, |
| | | his.send_time AS sendTime, |
| | | his.result_time AS resultTime, |
| | | (CASE |
| | | WHEN his.result = 1 THEN '成功' |
| | | ELSE '失败' |
| | | END) AS result, |
| | | his.result_text, |
| | | END) AS state, |
| | | his.result_text AS result, |
| | | IFNULL(cli.name, user.name) AS userName |
| | | FROM rm_command_history his |
| | | INNER JOIN pr_intake inta ON inta.id = his.intake_id |
| | |
| | | AND his.send_time BETWEEN #{timeStart} AND #{timeStop} |
| | | </if> |
| | | </where> |
| | | ORDER BY his.send_time DESC |
| | | ORDER BY his.com_id DESC |
| | | <trim prefix="limit "> |
| | | <if test="start != null and count != null"> |
| | | #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} |