change - 数据

master
yinq 2 years ago
parent 9b38518104
commit 05d4abf88d

@ -61,7 +61,9 @@
<where> <where>
<if test="monitorId != null and monitorId != ''">and rdi.monitor_id = #{monitorId}</if> <if test="monitorId != null and monitorId != ''">and rdi.monitor_id = #{monitorId}</if>
<if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''"> <if test="params.beginCollectTime != null and params.beginCollectTime != '' and params.endCollectTime != null and params.endCollectTime != ''">
and rdi.collect_time between to_date(#{params.beginCollectTime}, 'yyyy-mm-dd hh24:mi:ss') and to_date(#{params.endCollectTime}, 'yyyy-mm-dd hh24:mi:ss')</if> and rdi.collect_time between to_date(#{params.beginCollectTime}, 'yyyy-mm-dd hh24:mi:ss') and
to_date(#{params.endCollectTime}, 'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="va != null ">and rdi.va = #{va}</if> <if test="va != null ">and rdi.va = #{va}</if>
<if test="vb != null ">and rdi.vb = #{vb}</if> <if test="vb != null ">and rdi.vb = #{vb}</if>
<if test="vc != null ">and rdi.vc = #{vc}</if> <if test="vc != null ">and rdi.vc = #{vc}</if>
@ -170,7 +172,9 @@
</update> </update>
<delete id="deleteRecordDnbInstantByObjId" parameterType="Long"> <delete id="deleteRecordDnbInstantByObjId" parameterType="Long">
delete from record_dnb_instant where obj_id = #{objId} delete
from record_dnb_instant
where obj_id = #{objId}
</delete> </delete>
<delete id="deleteRecordDnbInstantByObjIds" parameterType="String"> <delete id="deleteRecordDnbInstantByObjIds" parameterType="String">

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

Loading…
Cancel
Save