change - 数据

master
yinq 2 years ago
parent 9b38518104
commit 05d4abf88d

@ -5,28 +5,28 @@
<mapper namespace="com.aucma.base.mapper.RecordDnbInstantMapper"> <mapper namespace="com.aucma.base.mapper.RecordDnbInstantMapper">
<resultMap type="RecordDnbInstant" id="RecordDnbInstantResult"> <resultMap type="RecordDnbInstant" id="RecordDnbInstantResult">
<result property="objId" column="obj_id" /> <result property="objId" column="obj_id"/>
<result property="monitorId" column="monitor_id" /> <result property="monitorId" column="monitor_id"/>
<result property="monitorName" column="monitorName" /> <result property="monitorName" column="monitorName"/>
<result property="collectTime" column="collect_time" /> <result property="collectTime" column="collect_time"/>
<result property="va" column="va" /> <result property="va" column="va"/>
<result property="vb" column="vb" /> <result property="vb" column="vb"/>
<result property="vc" column="vc" /> <result property="vc" column="vc"/>
<result property="ia" column="ia" /> <result property="ia" column="ia"/>
<result property="ib" column="ib" /> <result property="ib" column="ib"/>
<result property="ic" column="ic" /> <result property="ic" column="ic"/>
<result property="recordTime" column="record_time" /> <result property="recordTime" column="record_time"/>
<result property="glys" column="glys" /> <result property="glys" column="glys"/>
<result property="zxyg" column="zxyg" /> <result property="zxyg" column="zxyg"/>
<result property="activePower" column="active_power" /> <result property="activePower" column="active_power"/>
<result property="reactivePower" column="reactive_power" /> <result property="reactivePower" column="reactive_power"/>
<result property="collectType" column="collect_type" /> <result property="collectType" column="collect_type"/>
<result property="isFlag" column="is_flag" /> <result property="isFlag" column="is_flag"/>
<result property="createdBy" column="created_by" /> <result property="createdBy" column="created_by"/>
<result property="createdTime" column="created_time" /> <result property="createdTime" column="created_time"/>
<result property="updatedBy" column="updated_by" /> <result property="updatedBy" column="updated_by"/>
<result property="updatedTime" column="updated_time" /> <result property="updatedTime" column="updated_time"/>
<result property="factoryCode" column="factory_code" /> <result property="factoryCode" column="factory_code"/>
</resultMap> </resultMap>
<sql id="selectRecordDnbInstantVo"> <sql id="selectRecordDnbInstantVo">
@ -59,27 +59,29 @@
<select id="selectRecordDnbInstantList" parameterType="RecordDnbInstant" resultMap="RecordDnbInstantResult"> <select id="selectRecordDnbInstantList" parameterType="RecordDnbInstant" resultMap="RecordDnbInstantResult">
<include refid="selectRecordDnbInstantVo"/> <include refid="selectRecordDnbInstantVo"/>
<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
<if test="va != null "> and rdi.va = #{va}</if> to_date(#{params.endCollectTime}, 'yyyy-mm-dd hh24:mi:ss')
<if test="vb != null "> and rdi.vb = #{vb}</if> </if>
<if test="vc != null "> and rdi.vc = #{vc}</if> <if test="va != null ">and rdi.va = #{va}</if>
<if test="ia != null "> and rdi.ia = #{ia}</if> <if test="vb != null ">and rdi.vb = #{vb}</if>
<if test="ib != null "> and rdi.ib = #{ib}</if> <if test="vc != null ">and rdi.vc = #{vc}</if>
<if test="ic != null "> and rdi.ic = #{ic}</if> <if test="ia != null ">and rdi.ia = #{ia}</if>
<if test="recordTime != null "> and rdi.record_time = #{recordTime}</if> <if test="ib != null ">and rdi.ib = #{ib}</if>
<if test="glys != null "> and rdi.glys = #{glys}</if> <if test="ic != null ">and rdi.ic = #{ic}</if>
<if test="zxyg != null "> and rdi.zxyg = #{zxyg}</if> <if test="recordTime != null ">and rdi.record_time = #{recordTime}</if>
<if test="activePower != null "> and rdi.active_power = #{activePower}</if> <if test="glys != null ">and rdi.glys = #{glys}</if>
<if test="reactivePower != null "> and rdi.reactive_power = #{reactivePower}</if> <if test="zxyg != null ">and rdi.zxyg = #{zxyg}</if>
<if test="collectType != null "> and rdi.collect_type = #{collectType}</if> <if test="activePower != null ">and rdi.active_power = #{activePower}</if>
<if test="isFlag != null "> and rdi.is_flag = #{isFlag}</if> <if test="reactivePower != null ">and rdi.reactive_power = #{reactivePower}</if>
<if test="createdBy != null and createdBy != ''"> and rdi.created_by = #{createdBy}</if> <if test="collectType != null ">and rdi.collect_type = #{collectType}</if>
<if test="createdTime != null "> and rdi.created_time = #{createdTime}</if> <if test="isFlag != null ">and rdi.is_flag = #{isFlag}</if>
<if test="updatedBy != null and updatedBy != ''"> and rdi.updated_by = #{updatedBy}</if> <if test="createdBy != null and createdBy != ''">and rdi.created_by = #{createdBy}</if>
<if test="updatedTime != null "> and rdi.updated_time = #{updatedTime}</if> <if test="createdTime != null ">and rdi.created_time = #{createdTime}</if>
<if test="factoryCode != null and factoryCode != ''"> and rdi.factory_code = #{factoryCode}</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> </where>
order by rdi.collect_time desc order by rdi.collect_time desc
</select> </select>
@ -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