| | |
| | | <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--> |
| | |
| | | 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}, |
| | |
| | | #{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--> |
| | |
| | | <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"> |
| | |
| | | </if> |
| | | <if test="powerType != null"> |
| | | #{powerType,jdbcType=TINYINT}, |
| | | </if> |
| | | <if test="sendMsTime != null"> |
| | | #{sendMsTime,jdbcType=BIGINT}, |
| | | </if> |
| | | </trim> |
| | | </insert> |
| | |
| | | <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> |
| | |
| | | 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> |
| | | <!--根据指定条件获取记录总数--> |
| | |
| | | <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 >= #{startDt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | <if test="endDt != null and endDt != ''"> |
| | | and rasl.dt <= #{endDt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | </where> |
| | |
| | | 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 ( |
| | |
| | | <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 >= #{startDt,jdbcType=TIMESTAMP} |
| | | </if> |
| | | <if test="endDt != null"> |
| | | <if test="endDt != null and endDt != ''"> |
| | | and rasl.dt <= #{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> |