383 lines
17 KiB
XML
383 lines
17 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.zhwl.gate.mapper.ZdyDeviceGateHeartLogMapper">
|
|
|
|
<resultMap type="ZdyDeviceGateHeartLog" id="ZdyDeviceGateHeartLogResult">
|
|
<result property="id" column="id"/>
|
|
<result property="type" column="type"/>
|
|
<result property="model" column="model"/>
|
|
<result property="serial" column="serial"/>
|
|
<result property="mac" column="mac"/>
|
|
<result property="dateTime" column="date_time"/>
|
|
<result property="ipAddress" column="ip_address"/>
|
|
<result property="ipv6Address" column="ipv6_address"/>
|
|
<result property="portNo" column="port_no"/>
|
|
<result property="protocolType" column="protocol_type"/>
|
|
<result property="eventType" column="event_type"/>
|
|
<result property="eventDescription" column="event_description"/>
|
|
<result property="direction" column="direction"/>
|
|
<result property="verifyType" column="verify_type"/>
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="createBy" column="create_by"/>
|
|
<result property="updateTime" column="update_time"/>
|
|
<result property="updateBy" column="update_by"/>
|
|
<result property="remark" column="remark"/>
|
|
<result property="configStatus" column="config_status"/>
|
|
<result property="deviceId" column="device_id"/>
|
|
<result property="deviceKey" column="device_key"/>
|
|
<result property="orderCode" column="order_code"/>
|
|
<result property="status" column="status"/>
|
|
<result property="input" column="input"/>
|
|
<result property="now" column="now"/>
|
|
<result property="deviceIndex" column="device_index"/>
|
|
<result property="ver" column="ver"/>
|
|
<result property="willPass" column="will_pass"/>
|
|
<result property="passed" column="passed"/>
|
|
<result property="modbus" column="modbus"/>
|
|
<result property="voice" column="voice"/>
|
|
<result property="reqResult" column="req_result"/>
|
|
<result property="respResult" column="resp_result"/>
|
|
<result property="deptId" column="dept_id"/>
|
|
<result property="deviceName" column="device_name"/>
|
|
</resultMap>
|
|
|
|
<sql id="selectZdyDeviceGateHeartLogVo">
|
|
select id, type, model, serial, mac, date_time, ip_address, ipv6_address, port_no, protocol_type, event_type, event_description, direction, verify_type, create_time, create_by, update_time, update_by, remark, config_status, device_id, device_key, order_code, status, input, now, T1, H1, T2, H2, device_index, ver, will_pass, passed, modbus, voice, req_result, resp_result, dept_id
|
|
from zdy_device_gate_heart_log
|
|
</sql>
|
|
|
|
<sql id="selectZdyDeviceGateHeartLogDeptIdVo">
|
|
select l.id, l.type, l.model, l.serial, l.mac, l.date_time, l.ip_address, l.ipv6_address, l.port_no, l.protocol_type, l.event_type, l.event_description, l.direction, l.verify_type, l.create_time, l.create_by, l.update_time, l.update_by, l.remark, l.config_status, l.device_id, l.device_key, l.order_code, l.status, l.input, l.now, l.T1, l.H1, l.T2, l.H2, l.device_index, l.ver, l.will_pass, passed, l.modbus, l.voice, l.req_result, l.resp_result, l.dept_id, g.device_name
|
|
from zdy_device_gate_heart_log l
|
|
left join sys_dept d on d.dept_id = l.dept_id
|
|
left join zdy_device_gate g on g.serial_no = l.serial and g.del_flag != 1
|
|
</sql>
|
|
|
|
<select id="selectZdyDeviceGateHeartLogList" parameterType="ZdyDeviceGateHeartLog" resultMap="ZdyDeviceGateHeartLogResult">
|
|
<include refid="selectZdyDeviceGateHeartLogDeptIdVo"/>
|
|
<where>
|
|
<if test="type != null and type != ''">
|
|
and l.type = #{type}
|
|
</if>
|
|
<if test="deviceId != null and deviceId != ''">
|
|
and l.device_id = #{deviceId}
|
|
</if>
|
|
<if test="status != null and status != ''">
|
|
and l.status = #{status}
|
|
</if>
|
|
<if test="serial != null and serial != ''">
|
|
and l.serial = #{serial}
|
|
</if>
|
|
<if test="configStatus != null and configStatus != ''">
|
|
and l.config_status = #{configStatus}
|
|
</if>
|
|
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
|
|
and l.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
|
|
</if>
|
|
${params.dataScope}
|
|
</where>
|
|
order by l.id desc
|
|
</select>
|
|
|
|
<select id="selectZdyDeviceGateHeartLogById" parameterType="Long"
|
|
resultMap="ZdyDeviceGateHeartLogResult">
|
|
<include refid="selectZdyDeviceGateHeartLogVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertZdyDeviceGateHeartLog" parameterType="ZdyDeviceGateHeartLog" useGeneratedKeys="true"
|
|
keyProperty="id">
|
|
insert into zdy_device_gate_heart_log
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="type != null">type,
|
|
</if>
|
|
<if test="model != null">model,
|
|
</if>
|
|
<if test="serial != null">serial,
|
|
</if>
|
|
<if test="mac != null">mac,
|
|
</if>
|
|
<if test="dateTime != null">date_time,
|
|
</if>
|
|
<if test="ipAddress != null">ip_address,
|
|
</if>
|
|
<if test="ipv6Address != null">ipv6_address,
|
|
</if>
|
|
<if test="portNo != null">port_no,
|
|
</if>
|
|
<if test="protocolType != null">protocol_type,
|
|
</if>
|
|
<if test="eventType != null">event_type,
|
|
</if>
|
|
<if test="eventDescription != null">event_description,
|
|
</if>
|
|
<if test="direction != null">direction,
|
|
</if>
|
|
<if test="verifyType != null">verify_type,
|
|
</if>
|
|
<if test="createTime != null">create_time,
|
|
</if>
|
|
<if test="createBy != null">create_by,
|
|
</if>
|
|
<if test="updateTime != null">update_time,
|
|
</if>
|
|
<if test="updateBy != null">update_by,
|
|
</if>
|
|
<if test="remark != null">remark,
|
|
</if>
|
|
<if test="configStatus != null">config_status,
|
|
</if>
|
|
<if test="deviceId != null">device_id,
|
|
</if>
|
|
<if test="deviceKey != null">device_key,
|
|
</if>
|
|
<if test="orderCode != null">order_code,
|
|
</if>
|
|
<if test="status != null">status,
|
|
</if>
|
|
<if test="input != null">input,
|
|
</if>
|
|
<if test="now != null">now,
|
|
</if>
|
|
<if test="T1 != null">T1,
|
|
</if>
|
|
<if test="H1 != null">H1,
|
|
</if>
|
|
<if test="T2 != null">T2,
|
|
</if>
|
|
<if test="H2 != null">H2,
|
|
</if>
|
|
<if test="deviceIndex != null">device_index,
|
|
</if>
|
|
<if test="ver != null">ver,
|
|
</if>
|
|
<if test="willPass != null">will_pass,
|
|
</if>
|
|
<if test="passed != null">passed,
|
|
</if>
|
|
<if test="modbus != null">modbus,
|
|
</if>
|
|
<if test="voice != null">voice,
|
|
</if>
|
|
<if test="reqResult != null">req_result,
|
|
</if>
|
|
<if test="respResult != null">resp_result,
|
|
</if>
|
|
<if test="deptId != null">dept_id,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="type != null">#{type},
|
|
</if>
|
|
<if test="model != null">#{model},
|
|
</if>
|
|
<if test="serial != null">#{serial},
|
|
</if>
|
|
<if test="mac != null">#{mac},
|
|
</if>
|
|
<if test="dateTime != null">#{dateTime},
|
|
</if>
|
|
<if test="ipAddress != null">#{ipAddress},
|
|
</if>
|
|
<if test="ipv6Address != null">#{ipv6Address},
|
|
</if>
|
|
<if test="portNo != null">#{portNo},
|
|
</if>
|
|
<if test="protocolType != null">#{protocolType},
|
|
</if>
|
|
<if test="eventType != null">#{eventType},
|
|
</if>
|
|
<if test="eventDescription != null">#{eventDescription},
|
|
</if>
|
|
<if test="direction != null">#{direction},
|
|
</if>
|
|
<if test="verifyType != null">#{verifyType},
|
|
</if>
|
|
<if test="createTime != null">#{createTime},
|
|
</if>
|
|
<if test="createBy != null">#{createBy},
|
|
</if>
|
|
<if test="updateTime != null">#{updateTime},
|
|
</if>
|
|
<if test="updateBy != null">#{updateBy},
|
|
</if>
|
|
<if test="remark != null">#{remark},
|
|
</if>
|
|
<if test="configStatus != null">#{configStatus},
|
|
</if>
|
|
<if test="deviceId != null">#{deviceId},
|
|
</if>
|
|
<if test="deviceKey != null">#{deviceKey},
|
|
</if>
|
|
<if test="orderCode != null">#{orderCode},
|
|
</if>
|
|
<if test="status != null">#{status},
|
|
</if>
|
|
<if test="input != null">#{input},
|
|
</if>
|
|
<if test="now != null">#{now},
|
|
</if>
|
|
<if test="T1 != null">#{T1},
|
|
</if>
|
|
<if test="H1 != null">#{H1},
|
|
</if>
|
|
<if test="T2 != null">#{T2},
|
|
</if>
|
|
<if test="H2 != null">#{H2},
|
|
</if>
|
|
<if test="deviceIndex != null">#{deviceIndex},
|
|
</if>
|
|
<if test="ver != null">#{ver},
|
|
</if>
|
|
<if test="willPass != null">#{willPass},
|
|
</if>
|
|
<if test="passed != null">#{passed},
|
|
</if>
|
|
<if test="modbus != null">#{modbus},
|
|
</if>
|
|
<if test="voice != null">#{voice},
|
|
</if>
|
|
<if test="reqResult != null">#{reqResult},
|
|
</if>
|
|
<if test="respResult != null">#{respResult},
|
|
</if>
|
|
<if test="deptId != null">#{deptId},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="saveBatch">
|
|
insert into zdy_device_gate_heart_log
|
|
(model, serial, mac, ip_address, event_description, create_time, device_id, config_status, status, dept_id)
|
|
values
|
|
<foreach collection="list" item="item" separator=",">
|
|
(#{item.model}, #{item.serial}, #{item.mac}, #{item.ipAddress}, #{item.eventDescription}, #{item.createTime}, #{item.deviceId}, #{item.configStatus}, #{item.status}, #{item.deptId})
|
|
</foreach>
|
|
</insert>
|
|
|
|
<update id="updateZdyDeviceGateHeartLog" parameterType="ZdyDeviceGateHeartLog">
|
|
update zdy_device_gate_heart_log
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="type != null">type =
|
|
#{type},
|
|
</if>
|
|
<if test="model != null">model =
|
|
#{model},
|
|
</if>
|
|
<if test="serial != null">serial =
|
|
#{serial},
|
|
</if>
|
|
<if test="mac != null">mac =
|
|
#{mac},
|
|
</if>
|
|
<if test="dateTime != null">date_time =
|
|
#{dateTime},
|
|
</if>
|
|
<if test="ipAddress != null">ip_address =
|
|
#{ipAddress},
|
|
</if>
|
|
<if test="ipv6Address != null">ipv6_address =
|
|
#{ipv6Address},
|
|
</if>
|
|
<if test="portNo != null">port_no =
|
|
#{portNo},
|
|
</if>
|
|
<if test="protocolType != null">protocol_type =
|
|
#{protocolType},
|
|
</if>
|
|
<if test="eventType != null">event_type =
|
|
#{eventType},
|
|
</if>
|
|
<if test="eventDescription != null">event_description =
|
|
#{eventDescription},
|
|
</if>
|
|
<if test="direction != null">direction =
|
|
#{direction},
|
|
</if>
|
|
<if test="verifyType != null">verify_type =
|
|
#{verifyType},
|
|
</if>
|
|
<if test="createTime != null">create_time =
|
|
#{createTime},
|
|
</if>
|
|
<if test="createBy != null">create_by =
|
|
#{createBy},
|
|
</if>
|
|
<if test="updateTime != null">update_time =
|
|
#{updateTime},
|
|
</if>
|
|
<if test="updateBy != null">update_by =
|
|
#{updateBy},
|
|
</if>
|
|
<if test="remark != null">remark =
|
|
#{remark},
|
|
</if>
|
|
<if test="configStatus != null">config_status =
|
|
#{configStatus},
|
|
</if>
|
|
<if test="deviceId != null">device_id =
|
|
#{deviceId},
|
|
</if>
|
|
<if test="deviceKey != null">device_key =
|
|
#{deviceKey},
|
|
</if>
|
|
<if test="orderCode != null">order_code =
|
|
#{orderCode},
|
|
</if>
|
|
<if test="status != null">status =
|
|
#{status},
|
|
</if>
|
|
<if test="input != null">input =
|
|
#{input},
|
|
</if>
|
|
<if test="now != null">now =
|
|
#{now},
|
|
</if>
|
|
<if test="T1 != null">T1 =
|
|
#{T1},
|
|
</if>
|
|
<if test="H1 != null">H1 =
|
|
#{H1},
|
|
</if>
|
|
<if test="T2 != null">T2 =
|
|
#{T2},
|
|
</if>
|
|
<if test="H2 != null">H2 =
|
|
#{H2},
|
|
</if>
|
|
<if test="deviceIndex != null">device_index =
|
|
#{deviceIndex},
|
|
</if>
|
|
<if test="ver != null">ver =
|
|
#{ver},
|
|
</if>
|
|
<if test="willPass != null">will_pass =
|
|
#{willPass},
|
|
</if>
|
|
<if test="passed != null">passed =
|
|
#{passed},
|
|
</if>
|
|
<if test="modbus != null">modbus =
|
|
#{modbus},
|
|
</if>
|
|
<if test="voice != null">voice =
|
|
#{voice},
|
|
</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteZdyDeviceGateHeartLogById" parameterType="Long">
|
|
delete from zdy_device_gate_heart_log where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteZdyDeviceGateHeartLogByIds" parameterType="String">
|
|
delete from zdy_device_gate_heart_log where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|