change - 数据

master
yinq 8 months ago
parent 9b38518104
commit 05d4abf88d

@ -5,28 +5,28 @@
<mapper namespace="com.aucma.base.mapper.RecordDnbInstantMapper">
<resultMap type="RecordDnbInstant" id="RecordDnbInstantResult">
<result property="objId" column="obj_id" />
<result property="monitorId" column="monitor_id" />
<result property="monitorName" column="monitorName" />
<result property="collectTime" column="collect_time" />
<result property="va" column="va" />
<result property="vb" column="vb" />
<result property="vc" column="vc" />
<result property="ia" column="ia" />
<result property="ib" column="ib" />
<result property="ic" column="ic" />
<result property="recordTime" column="record_time" />
<result property="glys" column="glys" />
<result property="zxyg" column="zxyg" />
<result property="activePower" column="active_power" />
<result property="reactivePower" column="reactive_power" />
<result property="collectType" column="collect_type" />
<result property="isFlag" column="is_flag" />
<result property="createdBy" column="created_by" />
<result property="createdTime" column="created_time" />
<result property="updatedBy" column="updated_by" />
<result property="updatedTime" column="updated_time" />
<result property="factoryCode" column="factory_code" />
<result property="objId" column="obj_id"/>
<result property="monitorId" column="monitor_id"/>
<result property="monitorName" column="monitorName"/>
<result property="collectTime" column="collect_time"/>
<result property="va" column="va"/>
<result property="vb" column="vb"/>
<result property="vc" column="vc"/>
<result property="ia" column="ia"/>
<result property="ib" column="ib"/>
<result property="ic" column="ic"/>
<result property="recordTime" column="record_time"/>
<result property="glys" column="glys"/>
<result property="zxyg" column="zxyg"/>
<result property="activePower" column="active_power"/>
<result property="reactivePower" column="reactive_power"/>
<result property="collectType" column="collect_type"/>
<result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time"/>
<result property="factoryCode" column="factory_code"/>
</resultMap>
<sql id="selectRecordDnbInstantVo">
@ -59,118 +59,122 @@
<select id="selectRecordDnbInstantList" parameterType="RecordDnbInstant" resultMap="RecordDnbInstantResult">
<include refid="selectRecordDnbInstantVo"/>
<where>
<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 != ''">
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="vb != null "> and rdi.vb = #{vb}</if>
<if test="vc != null "> and rdi.vc = #{vc}</if>
<if test="ia != null "> and rdi.ia = #{ia}</if>
<if test="ib != null "> and rdi.ib = #{ib}</if>
<if test="ic != null "> and rdi.ic = #{ic}</if>
<if test="recordTime != null "> and rdi.record_time = #{recordTime}</if>
<if test="glys != null "> and rdi.glys = #{glys}</if>
<if test="zxyg != null "> and rdi.zxyg = #{zxyg}</if>
<if test="activePower != null "> and rdi.active_power = #{activePower}</if>
<if test="reactivePower != null "> and rdi.reactive_power = #{reactivePower}</if>
<if test="collectType != null "> and rdi.collect_type = #{collectType}</if>
<if test="isFlag != null "> and rdi.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''"> and rdi.created_by = #{createdBy}</if>
<if test="createdTime != null "> and rdi.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''"> and rdi.updated_by = #{updatedBy}</if>
<if test="updatedTime != null "> and rdi.updated_time = #{updatedTime}</if>
<if test="factoryCode != null and factoryCode != ''"> and rdi.factory_code = #{factoryCode}</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 != ''">
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="vb != null ">and rdi.vb = #{vb}</if>
<if test="vc != null ">and rdi.vc = #{vc}</if>
<if test="ia != null ">and rdi.ia = #{ia}</if>
<if test="ib != null ">and rdi.ib = #{ib}</if>
<if test="ic != null ">and rdi.ic = #{ic}</if>
<if test="recordTime != null ">and rdi.record_time = #{recordTime}</if>
<if test="glys != null ">and rdi.glys = #{glys}</if>
<if test="zxyg != null ">and rdi.zxyg = #{zxyg}</if>
<if test="activePower != null ">and rdi.active_power = #{activePower}</if>
<if test="reactivePower != null ">and rdi.reactive_power = #{reactivePower}</if>
<if test="collectType != null ">and rdi.collect_type = #{collectType}</if>
<if test="isFlag != null ">and rdi.is_flag = #{isFlag}</if>
<if test="createdBy != null and createdBy != ''">and rdi.created_by = #{createdBy}</if>
<if test="createdTime != null ">and rdi.created_time = #{createdTime}</if>
<if test="updatedBy != null and updatedBy != ''">and rdi.updated_by = #{updatedBy}</if>
<if test="updatedTime != null ">and rdi.updated_time = #{updatedTime}</if>
<if test="factoryCode != null and factoryCode != ''">and rdi.factory_code = #{factoryCode}</if>
</where>
order by rdi.collect_time desc
</select>
<select id="selectRecordDnbInstantByObjId" parameterType="Long" resultMap="RecordDnbInstantResult">
<include refid="selectRecordDnbInstantVo"/>
where rdi.obj_id = #{objId}
<include refid="selectRecordDnbInstantVo"/>
where rdi.obj_id = #{objId}
</select>
<insert id="insertRecordDnbInstant" parameterType="RecordDnbInstant">
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_record_dnb_instant.NEXTVAL as objId FROM DUAL
</selectKey>
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
SELECT seq_record_dnb_instant.NEXTVAL as objId FROM DUAL
</selectKey>
insert into record_dnb_instant
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="objId != null">obj_id,</if>
<if test="monitorId != null">monitor_id,</if>
<if test="collectTime != null">collect_time,</if>
<if test="va != null">va,</if>
<if test="vb != null">vb,</if>
<if test="vc != null">vc,</if>
<if test="ia != null">ia,</if>
<if test="ib != null">ib,</if>
<if test="ic != null">ic,</if>
<if test="recordTime != null">record_time,</if>
<if test="glys != null">glys,</if>
<if test="zxyg != null">zxyg,</if>
<if test="activePower != null">active_power,</if>
<if test="reactivePower != null">reactive_power,</if>
<if test="collectType != null">collect_type,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="factoryCode != null">factory_code,</if>
<if test="objId != null">obj_id,</if>
<if test="monitorId != null">monitor_id,</if>
<if test="collectTime != null">collect_time,</if>
<if test="va != null">va,</if>
<if test="vb != null">vb,</if>
<if test="vc != null">vc,</if>
<if test="ia != null">ia,</if>
<if test="ib != null">ib,</if>
<if test="ic != null">ic,</if>
<if test="recordTime != null">record_time,</if>
<if test="glys != null">glys,</if>
<if test="zxyg != null">zxyg,</if>
<if test="activePower != null">active_power,</if>
<if test="reactivePower != null">reactive_power,</if>
<if test="collectType != null">collect_type,</if>
<if test="isFlag != null">is_flag,</if>
<if test="createdBy != null">created_by,</if>
<if test="createdTime != null">created_time,</if>
<if test="updatedBy != null">updated_by,</if>
<if test="updatedTime != null">updated_time,</if>
<if test="factoryCode != null">factory_code,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="objId != null">#{objId},</if>
<if test="monitorId != null">#{monitorId},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="va != null">#{va},</if>
<if test="vb != null">#{vb},</if>
<if test="vc != null">#{vc},</if>
<if test="ia != null">#{ia},</if>
<if test="ib != null">#{ib},</if>
<if test="ic != null">#{ic},</if>
<if test="recordTime != null">#{recordTime},</if>
<if test="glys != null">#{glys},</if>
<if test="zxyg != null">#{zxyg},</if>
<if test="activePower != null">#{activePower},</if>
<if test="reactivePower != null">#{reactivePower},</if>
<if test="collectType != null">#{collectType},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
<if test="objId != null">#{objId},</if>
<if test="monitorId != null">#{monitorId},</if>
<if test="collectTime != null">#{collectTime},</if>
<if test="va != null">#{va},</if>
<if test="vb != null">#{vb},</if>
<if test="vc != null">#{vc},</if>
<if test="ia != null">#{ia},</if>
<if test="ib != null">#{ib},</if>
<if test="ic != null">#{ic},</if>
<if test="recordTime != null">#{recordTime},</if>
<if test="glys != null">#{glys},</if>
<if test="zxyg != null">#{zxyg},</if>
<if test="activePower != null">#{activePower},</if>
<if test="reactivePower != null">#{reactivePower},</if>
<if test="collectType != null">#{collectType},</if>
<if test="isFlag != null">#{isFlag},</if>
<if test="createdBy != null">#{createdBy},</if>
<if test="createdTime != null">#{createdTime},</if>
<if test="updatedBy != null">#{updatedBy},</if>
<if test="updatedTime != null">#{updatedTime},</if>
<if test="factoryCode != null">#{factoryCode},</if>
</trim>
</insert>
<update id="updateRecordDnbInstant" parameterType="RecordDnbInstant">
update record_dnb_instant
<trim prefix="SET" suffixOverrides=",">
<if test="monitorId != null">monitor_id = #{monitorId},</if>
<if test="collectTime != null">collect_time = #{collectTime},</if>
<if test="va != null">va = #{va},</if>
<if test="vb != null">vb = #{vb},</if>
<if test="vc != null">vc = #{vc},</if>
<if test="ia != null">ia = #{ia},</if>
<if test="ib != null">ib = #{ib},</if>
<if test="ic != null">ic = #{ic},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="glys != null">glys = #{glys},</if>
<if test="zxyg != null">zxyg = #{zxyg},</if>
<if test="activePower != null">active_power = #{activePower},</if>
<if test="reactivePower != null">reactive_power = #{reactivePower},</if>
<if test="collectType != null">collect_type = #{collectType},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
<if test="monitorId != null">monitor_id = #{monitorId},</if>
<if test="collectTime != null">collect_time = #{collectTime},</if>
<if test="va != null">va = #{va},</if>
<if test="vb != null">vb = #{vb},</if>
<if test="vc != null">vc = #{vc},</if>
<if test="ia != null">ia = #{ia},</if>
<if test="ib != null">ib = #{ib},</if>
<if test="ic != null">ic = #{ic},</if>
<if test="recordTime != null">record_time = #{recordTime},</if>
<if test="glys != null">glys = #{glys},</if>
<if test="zxyg != null">zxyg = #{zxyg},</if>
<if test="activePower != null">active_power = #{activePower},</if>
<if test="reactivePower != null">reactive_power = #{reactivePower},</if>
<if test="collectType != null">collect_type = #{collectType},</if>
<if test="isFlag != null">is_flag = #{isFlag},</if>
<if test="createdBy != null">created_by = #{createdBy},</if>
<if test="createdTime != null">created_time = #{createdTime},</if>
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
</trim>
where obj_id = #{objId}
</update>
<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 id="deleteRecordDnbInstantByObjIds" parameterType="String">

@ -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">

Loading…
Cancel
Save