liurunyu
5 天以前 e5c29d6ac2b210a9385723598d79a42ae5a9679e
pipIrr-platform/pipIrr-global/src/main/resources/mapper/RmAlarmStateLastMapper.xml
@@ -28,13 +28,14 @@
    <result column="alarm_battery_volt" jdbcType="TINYINT" property="alarmBatteryVolt" />
    <result column="alarm_valve" jdbcType="TINYINT" property="alarmValve" />
    <result column="power_type" jdbcType="TINYINT" property="alarmValve" />
    <result column="send_ms_time" jdbcType="BIGINT" property="sendMsTime" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, controller_id, intake_id, rtu_addr, dt, rtu_dt, valve_state, alarm_remain_water,
    alarm0_water_remain, alarm_exceed_year, alarm_water_meter_fault, alarm_loss, alarm_water_meter_break,
    alarm_ele_meter_fault, alarm0_money_remain, alarm_inner_door, alarm_outer_door, alarm_ele_miss, 
    alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable,alarm_battery_volt,alarm_valve,power_type
    alarm_ele_exceed, alarm_ele_low_volt, state_ic_enable,alarm_battery_volt,alarm_valve,power_type,send_ms_time
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
@@ -64,7 +65,8 @@
      alarm_loss, alarm_water_meter_break, alarm_ele_meter_fault, 
      alarm0_money_remain, alarm_inner_door, alarm_outer_door, 
      alarm_ele_miss, alarm_ele_exceed, alarm_ele_low_volt, 
      state_ic_enable,alarm_battery_volt,alarm_valve,power_type)
      state_ic_enable,alarm_battery_volt,alarm_valve,power_type,
      send_ms_time)
    values (#{id,jdbcType=BIGINT}, #{controllerId,jdbcType=BIGINT}, #{intakeId,jdbcType=BIGINT}, 
      #{rtuAddr,jdbcType=VARCHAR}, #{dt,jdbcType=TIMESTAMP}, #{rtuDt,jdbcType=TIMESTAMP}, 
      #{valveState,jdbcType=TINYINT}, #{alarmRemainWater,jdbcType=TINYINT}, #{alarm0WaterRemain,jdbcType=TINYINT}, 
@@ -73,7 +75,7 @@
      #{alarm0MoneyRemain,jdbcType=TINYINT}, #{alarmInnerDoor,jdbcType=TINYINT}, #{alarmOuterDoor,jdbcType=TINYINT}, 
      #{alarmEleMiss,jdbcType=TINYINT}, #{alarmEleExceed,jdbcType=TINYINT}, #{alarmEleLowVolt,jdbcType=TINYINT},
      #{stateIcEnable,jdbcType=TINYINT}, #{alarmBatteryVolt,jdbcType=TINYINT}, #{alarmValve,jdbcType=TINYINT},
      #{powerType,jdbcType=TINYINT})
      #{powerType,jdbcType=TINYINT},#{sendMsTime,jdbcType=BIGINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoRm.RmAlarmStateLast">
    <!--@mbg.generated-->
@@ -151,6 +153,9 @@
     <if test="powerType != null">
        power_type,
      </if>
     <if test="sendMsTime != null">
       send_ms_time,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
@@ -224,6 +229,9 @@
      </if>
     <if test="powerType != null">
        #{powerType,jdbcType=TINYINT},
      </if>
      <if test="sendMsTime != null">
        #{sendMsTime,jdbcType=BIGINT},
      </if>
    </trim>
  </insert>
@@ -300,6 +308,9 @@
      <if test="powerType != null">
        power_type = #{powerType,jdbcType=TINYINT},
      </if>
      <if test="sendMsTime != null">
        send_ms_time = #{sendMsTime,jdbcType=BIGINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
@@ -328,7 +339,8 @@
      state_ic_enable = #{stateIcEnable,jdbcType=TINYINT},
      alarm_battery_volt = #{alarmBatteryVolt,jdbcType=TINYINT},
      alarm_valve = #{alarmValve,jdbcType=TINYINT},
      power_type = #{powerType,jdbcType=TINYINT}
      power_type = #{powerType,jdbcType=TINYINT},
      send_ms_time = #{sendMsTime,jdbcType=BIGINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
  <!--根据指定条件获取记录总数-->
@@ -378,13 +390,16 @@
      <if test="valveState != null">
        and rasl.valve_state = #{valveState,jdbcType=TINYINT}
      </if>
      <if test="intakeName != null">
        and pint.name = #{intakeName,jdbcType=VARCHAR}
      <if test="intakeId != null and intakeId != '' ">
        and rash.intake_id = #{intakeId}
      </if>
      <if test="startDt != null">
      <if test="intakeName != null and intakeName != '' ">
        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null and startDt != ''">
        and rasl.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
      </if>
      <if test="endDt != null">
      <if test="endDt != null and endDt != ''">
        and rasl.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
      </if>
    </where>
@@ -416,7 +431,7 @@
    rasl.alarm_valve as alarmValve,
    rasl.power_type as powerType
    from rm_alarm_state_last rasl
    Left join pr_intake pint on intake_id = pint.id
    Left join pr_intake pint on rasl.intake_id = pint.id
    <where>
      <if test="alarmState == 1">
        and (
@@ -459,17 +474,20 @@
      <if test="valveState != null">
        and rasl.valve_state = #{valveState,jdbcType=TINYINT}
      </if>
      <if test="intakeName != null">
      <if test="intakeId != null and intakeId != '' ">
        and rash.intake_id = #{intakeId}
      </if>
      <if test="intakeName != null and intakeName != '' ">
        and pint.name like CONCAT('%',#{intakeName,jdbcType=VARCHAR},'%')
      </if>
      <if test="startDt != null">
      <if test="startDt != null and startDt != ''">
        and rasl.dt &gt;= #{startDt,jdbcType=TIMESTAMP}
      </if>
      <if test="endDt != null">
      <if test="endDt != null and endDt != ''">
        and rasl.dt &lt;= #{endDt,jdbcType=TIMESTAMP}
      </if>
    </where>
    ORDER BY rasl.dt DESC
    ORDER BY rasl.id DESC
    <if test="pageCurr != null and pageSize != null">
      LIMIT ${(pageCurr-1)*pageSize}, ${pageSize}
    </if>