From 356331d8401267aa7aeb409d1314537aa25ac5ad Mon Sep 17 00:00:00 2001 From: zhubaomin <zhubaomin> Date: 星期二, 25 二月 2025 14:33:03 +0800 Subject: [PATCH] 解决控制器报警与状态SQL语句的错误 --- pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml index d0fa274..5604c9a 100644 --- a/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml +++ b/pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateHistoryMapper.xml @@ -396,17 +396,17 @@ <if test="valveState != null"> and rash.valve_state = #{valveState,jdbcType=TINYINT} </if> - <if test="intakeId != null"> + <if test="intakeId != null and intakeId != '' "> and rash.intake_id = #{intakeId} </if> - <if test="intakeName != null"> + <if test="intakeName != null and intakeName != '' "> and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') </if> - <if test="startDt != null"> - and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + <if test="startDt != null and startDt != ''"> + and rasl.dt >= #{startDt,jdbcType=TIMESTAMP} </if> - <if test="endDt != null"> - and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + <if test="endDt != null and endDt != ''"> + and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} </if> </where> </select> @@ -480,17 +480,17 @@ <if test="valveState != null"> and rash.valve_state = #{valveState,jdbcType=TINYINT} </if> - <if test="intakeId != null"> + <if test="intakeId != null and intakeId != '' "> and rash.intake_id = #{intakeId} </if> - <if test="intakeName != null"> + <if test="intakeName != null and intakeName != '' "> and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%') </if> - <if test="startDt != null"> - and rash.dt >= #{startDt,jdbcType=TIMESTAMP} + <if test="startDt != null and startDt != ''"> + and rasl.dt >= #{startDt,jdbcType=TIMESTAMP} </if> - <if test="endDt != null"> - and rash.dt <= #{endDt,jdbcType=TIMESTAMP} + <if test="endDt != null and endDt != ''"> + and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} </if> </where> ORDER BY rash.id DESC -- Gitblit v1.8.0