@ -21,48 +21,49 @@
</resultMap>
<sql id= "selectDeviceAlarmRecordVo" >
select obj_id,
device_code,
device_name,
device_type,
alarm_info,
alarm_time,
remark,
is_flag,
created_by,
created_time,
batch_id,
param_code,
param_value
from record_alarm_device
select rad.obj_id,
rad.device_code,
bd.DEVICE_NAME,
rad.device_type,
rad.alarm_info,
rad.alarm_time,
rad.remark,
rad.is_flag,
rad.created_by,
rad.created_time,
rad.batch_id,
rad.param_code,
rad.param_value
from record_alarm_device rad
left join BASE_DEVICELEDGER bd on bd.DEVICE_CODE = rad.DEVICE_CODE
</sql>
<select id= "selectDeviceAlarmRecordList" parameterType= "DeviceAlarmRecord" resultMap= "DeviceAlarmRecordResult" >
<include refid= "selectDeviceAlarmRecordVo" />
<where >
<if test= "deviceCode != null and deviceCode != ''" > and device_code = #{deviceCode}</if>
<if test= "deviceName != null and deviceName != ''" > and device_name like concat(concat('%', #{deviceName}),
<if test= "deviceCode != null and deviceCode != ''" > and rad. device_code = #{deviceCode}</if>
<if test= "deviceName != null and deviceName != ''" > and rad. device_name like concat(concat('%', #{deviceName}),
'%')
</if>
<if test= "deviceType != null and deviceType != ''" > and device_type = #{deviceType}</if>
<if test= "alarmInfo != null and alarmInfo != ''" > and alarm_info = #{alarmInfo}</if>
<if test= "deviceType != null and deviceType != ''" > and rad. device_type = #{deviceType}</if>
<if test= "alarmInfo != null and alarmInfo != ''" > and rad. alarm_info = #{alarmInfo}</if>
<if test= "params.beginAlarmTime != null and params.beginAlarmTime != '' and params.endAlarmTime != null and params.endAlarmTime != ''" >
and alarm_time between to_date(#{params.beginAlarmTime}, 'yyyy-mm-dd hh24:mi:ss') and
and rad. alarm_time between to_date(#{params.beginAlarmTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endAlarmTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test= "isFlag != null " > and is_flag = #{isFlag}</if>
<if test= "createdBy != null and createdBy != ''" > and created_by = #{createdBy}</if>
<if test= "createdTime != null " > and created_time = #{createdTime}</if>
<if test= "batchId != null and batchId != ''" > and batch_id = #{batchId}</if>
<if test= "paramCode != null and paramCode != ''" > and param_code = #{paramCode}</if>
<if test= "paramValue != null and paramValue != ''" > and param_value = #{paramValue}</if>
<if test= "isFlag != null " > and rad. is_flag = #{isFlag}</if>
<if test= "createdBy != null and createdBy != ''" > and rad. created_by = #{createdBy}</if>
<if test= "createdTime != null " > and rad. created_time = #{createdTime}</if>
<if test= "batchId != null and batchId != ''" > and rad. batch_id = #{batchId}</if>
<if test= "paramCode != null and paramCode != ''" > and rad. param_code = #{paramCode}</if>
<if test= "paramValue != null and paramValue != ''" > and rad. param_value = #{paramValue}</if>
</where>
order by alarm_time desc
order by rad. alarm_time desc
</select>
<select id= "selectDeviceAlarmRecordByObjId" parameterType= "Long" resultMap= "DeviceAlarmRecordResult" >
<include refid= "selectDeviceAlarmRecordVo" />
where obj_id = #{objId}
where rad. obj_id = #{objId}
</select>
<insert id= "insertDeviceAlarmRecord" parameterType= "DeviceAlarmRecord" >