From 04aa44d5b89f705a9bcfc44d7dccc60f6b69f21d Mon Sep 17 00:00:00 2001 From: Administrator <zhubaomin> Date: 星期三, 03 七月 2024 14:58:19 +0800 Subject: [PATCH] 2024-07-03 朱宝民 获取充值记录接口添加返回值 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml | 100 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 97 insertions(+), 3 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml index 207afc7..2ef9373 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmCommandHistoryMapper.xml @@ -203,14 +203,108 @@ isOnLine BOOLEAN PATH '$.isOnLine' ) ) rtus ON com.rtu_addr = rtus.rtuAddr - WHERE (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') AND com.operator = #{operator} - AND NOT EXISTS ( + <where> + AND (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') + AND com.operator = #{operator} + AND NOT EXISTS ( SELECT * FROM rm_command_history WHERE (result IS NULL OR result = 1 ) AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') AND param ->>'$.orderNo' = com.param ->>'$.orderNo' - ) + ) + </where> ORDER BY com.send_time DESC </select> + + <!--鏍规嵁鍙栨按鍙D鑾峰彇璇ュ彇姘村彛鏈叧闃�鍙傛暟--> + <select id="getUncloseParam" resultType="com.dy.pipIrrGlobal.voRm.VoUnclosedParam"> + SELECT + com.rtu_addr AS rtuAddr, + com.param ->>'$.orderNo' AS orderNo, + com.param ->>'$.icCardNo' AS vcNum + FROM rm_command_history com + INNER JOIN pr_controller con ON com.rtu_addr = con.rtuAddr + INNER JOIN pr_intake inta ON con.intakeId = inta.id + INNER JOIN JSON_TABLE( +<!-- '[{"rtuAddr":"620201000029","isOnLine":true},{"rtuAddr":"4000004","isOnLine":true},{"rtuAddr":"dy20240325","isOnLine":false}]',--> + #{onLineMap}, + '$[*]' COLUMNS( + rtuAddr VARCHAR(20) PATH '$.rtuAddr', + isOnLine BOOLEAN PATH '$.isOnLine' + ) + ) rtus ON com.rtu_addr = rtus.rtuAddr + WHERE (com.command_code = '92' OR com.command_code = 'A2' OR com.command_code = '97') AND con.intakeId = #{intakeId} + AND NOT EXISTS ( + SELECT * + FROM rm_command_history + WHERE (result IS NULL OR result = 1 ) + AND (command_code = '93' OR command_code = 'A3' OR command_code = '98') + AND param ->>'$.orderNo' = com.param ->>'$.orderNo' + ) + ORDER BY com.send_time DESC + LIMIT 0,1 + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍鎬绘暟--> + <select id="getCommandHistoriesCount" resultType="java.lang.Long"> + 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 = "commandName != null and commandName !=''"> + AND his.command_name LIKE CONCAT('%',#{commandName},'%') + </if> + <if test = "result != null"> + AND his.result = #{result} + </if> + <if test = "timeStart != null and timeStop != null"> + AND his.send_time BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + </select> + + <!--鏍规嵁鎸囧畾鏉′欢鑾峰彇鍛戒护鏃ュ織鍘嗗彶璁板綍--> + <select id="getCommandHistories" resultType="com.dy.pipIrrGlobal.voRm.VoCommand"> + SELECT + his.id, + his.command_name AS commandName, + inta.name AS intakeName, + his.rtu_addr AS rtuAddr, + his.protocol, + his.send_time AS sendTime, + his.result_time AS resultTime, + (CASE + WHEN his.result = 1 THEN "鎴愬姛" + ELSE "澶辫触" + END) AS result, + his.result_text, + IFNULL(cli.name, user.name) AS userName + 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 = "commandName != null and commandName !=''"> + AND his.command_name LIKE CONCAT('%',#{commandName},'%') + </if> + <if test = "result != null"> + AND his.result = #{result} + </if> + + <if test = "timeStart != null and timeStop != null"> + AND his.send_time BETWEEN #{timeStart} AND #{timeStop} + </if> + </where> + ORDER BY his.send_time DESC + <trim prefix="limit " > + <if test="start != null and count != null"> + #{start,javaType=Integer,jdbcType=INTEGER}, #{count,javaType=Integer,jdbcType=INTEGER} + </if> + </trim> + </select> + </mapper> \ No newline at end of file -- Gitblit v1.8.0