229 lines
13 KiB
XML
229 lines
13 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.yanzhu.job.mapper.DevIotMapper">
|
|
|
|
<resultMap type="DevIotConfigPoint" id="DevIotConfigPointResult">
|
|
<result property="id" column="id" />
|
|
<result property="cfgId" column="cfg_id" />
|
|
<result property="comId" column="com_id" />
|
|
<result property="projectId" column="project_id" />
|
|
<result property="deviceSn" column="device_sn" />
|
|
<result property="deviceName" column="device_name" />
|
|
<result property="factoryName" column="factory_name" />
|
|
<result property="contactPerson" column="contact_person" />
|
|
<result property="contactPersonPhone" column="contact_person_phone" />
|
|
<result property="levels" column="levels" />
|
|
<result property="leakageCurrent" column="leakage_current" />
|
|
<result property="ratedTemperature" column="rated_temperature" />
|
|
<result property="shortCircuitCurrent" column="short_circuit_current" />
|
|
<result property="ratedCurrent" column="rated_current" />
|
|
<result property="ratedVoltage" column="rated_voltage" />
|
|
<result property="onlineStatus" column="online_status" />
|
|
<result property="isDel" column="is_del" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="remark" column="remark" />
|
|
</resultMap>
|
|
|
|
<sql id="selectDevIotConfigPointVo">
|
|
select id, cfg_id, com_id, project_id, device_sn, device_name, factory_name, contact_person, contact_person_phone, levels, leakage_current, rated_temperature, short_circuit_current, rated_current, rated_voltage, online_status, is_del, create_by, create_time, update_by, update_time, remark from dev_iot_config_point
|
|
</sql>
|
|
|
|
<select id="selectDevIotConfigPointList" parameterType="DevIotConfigPoint" resultMap="DevIotConfigPointResult">
|
|
<include refid="selectDevIotConfigPointVo"/>
|
|
<where>
|
|
<if test="cfgId != null "> and cfg_id = #{cfgId}</if>
|
|
<if test="comId != null "> and com_id = #{comId}</if>
|
|
<if test="projectId != null "> and project_id = #{projectId}</if>
|
|
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<insert id="insertDevIotConfigPoint" parameterType="DevIotConfigPoint" useGeneratedKeys="true" keyProperty="id">
|
|
insert into dev_iot_config_point
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">cfg_id,</if>
|
|
<if test="comId != null">com_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="deviceSn != null">device_sn,</if>
|
|
<if test="deviceName != null">device_name,</if>
|
|
<if test="factoryName != null">factory_name,</if>
|
|
<if test="contactPerson != null">contact_person,</if>
|
|
<if test="contactPersonPhone != null">contact_person_phone,</if>
|
|
<if test="levels != null">levels,</if>
|
|
<if test="leakageCurrent != null">leakage_current,</if>
|
|
<if test="ratedTemperature != null">rated_temperature,</if>
|
|
<if test="shortCircuitCurrent != null">short_circuit_current,</if>
|
|
<if test="ratedCurrent != null">rated_current,</if>
|
|
<if test="ratedVoltage != null">rated_voltage,</if>
|
|
<if test="onlineStatus != null">online_status,</if>
|
|
<if test="isDel != null">is_del,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="remark != null">remark,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">#{cfgId},</if>
|
|
<if test="comId != null">#{comId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="deviceSn != null">#{deviceSn},</if>
|
|
<if test="deviceName != null">#{deviceName},</if>
|
|
<if test="factoryName != null">#{factoryName},</if>
|
|
<if test="contactPerson != null">#{contactPerson},</if>
|
|
<if test="contactPersonPhone != null">#{contactPersonPhone},</if>
|
|
<if test="levels != null">#{levels},</if>
|
|
<if test="leakageCurrent != null">#{leakageCurrent},</if>
|
|
<if test="ratedTemperature != null">#{ratedTemperature},</if>
|
|
<if test="shortCircuitCurrent != null">#{shortCircuitCurrent},</if>
|
|
<if test="ratedCurrent != null">#{ratedCurrent},</if>
|
|
<if test="ratedVoltage != null">#{ratedVoltage},</if>
|
|
<if test="onlineStatus != null">#{onlineStatus},</if>
|
|
<if test="isDel != null">#{isDel},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateDevIotConfigPoint" parameterType="DevIotConfigPoint">
|
|
update dev_iot_config_point
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="cfgId != null">cfg_id = #{cfgId},</if>
|
|
<if test="comId != null">com_id = #{comId},</if>
|
|
<if test="projectId != null">project_id = #{projectId},</if>
|
|
<if test="deviceSn != null">device_sn = #{deviceSn},</if>
|
|
<if test="deviceName != null">device_name = #{deviceName},</if>
|
|
<if test="factoryName != null">factory_name = #{factoryName},</if>
|
|
<if test="contactPerson != null">contact_person = #{contactPerson},</if>
|
|
<if test="contactPersonPhone != null">contact_person_phone = #{contactPersonPhone},</if>
|
|
<if test="levels != null">levels = #{levels},</if>
|
|
<if test="leakageCurrent != null">leakage_current = #{leakageCurrent},</if>
|
|
<if test="ratedTemperature != null">rated_temperature = #{ratedTemperature},</if>
|
|
<if test="shortCircuitCurrent != null">short_circuit_current = #{shortCircuitCurrent},</if>
|
|
<if test="ratedCurrent != null">rated_current = #{ratedCurrent},</if>
|
|
<if test="ratedVoltage != null">rated_voltage = #{ratedVoltage},</if>
|
|
<if test="onlineStatus != null">online_status = #{onlineStatus},</if>
|
|
<if test="isDel != null">is_del = #{isDel},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<select id="selectDevIotConfigList" resultType="Map">
|
|
select dic.id, dic.com_id, dic.project_id, pi.project_name, dic.signal_name, dic.signal_code, dic.factory_name
|
|
from dev_iot_config dic
|
|
left join pro_project_info pi on pi.id = dic.project_id
|
|
where dic.is_del = '0'
|
|
</select>
|
|
|
|
<insert id="insertDevIotDatas" parameterType="DevIotDatas" useGeneratedKeys="true" keyProperty="id">
|
|
insert into dev_iot_datas
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">cfg_id,</if>
|
|
<if test="pointId != null">point_id,</if>
|
|
<if test="comId != null">com_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="deviceSn != null">device_sn,</if>
|
|
<if test="switchesAc != null">switches_ac,</if>
|
|
<if test="switchesSwitch != null">switches_switch,</if>
|
|
<if test="switchesSwitches != null">switches_switches,</if>
|
|
<if test="switchesSwitchstatus != null">switches_switchStatus,</if>
|
|
<if test="temperature != null">temperature,</if>
|
|
<if test="leakage != null">leakage,</if>
|
|
<if test="voltageA != null">voltage_a,</if>
|
|
<if test="voltageB != null">voltage_b,</if>
|
|
<if test="voltageC != null">voltage_c,</if>
|
|
<if test="voltageAb != null">voltage_ab,</if>
|
|
<if test="voltageBc != null">voltage_bc,</if>
|
|
<if test="voltageCa != null">voltage_ca,</if>
|
|
<if test="currentA != null">current_a,</if>
|
|
<if test="currentB != null">current_b,</if>
|
|
<if test="currentC != null">current_c,</if>
|
|
<if test="powerA != null">power_a,</if>
|
|
<if test="powerB != null">power_b,</if>
|
|
<if test="powerC != null">power_c,</if>
|
|
<if test="energyA != null">energy_a,</if>
|
|
<if test="energyB != null">energy_b,</if>
|
|
<if test="energyC != null">energy_c,</if>
|
|
<if test="factorA != null">factor_a,</if>
|
|
<if test="factorB != null">factor_b,</if>
|
|
<if test="factorC != null">factor_c,</if>
|
|
<if test="frequencyA != null">frequency_a,</if>
|
|
<if test="frequencyB != null">frequency_b,</if>
|
|
<if test="frequencyC != null">frequency_c,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">#{cfgId},</if>
|
|
<if test="pointId != null">#{pointId},</if>
|
|
<if test="comId != null">#{comId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="deviceSn != null">#{deviceSn},</if>
|
|
<if test="switchesAc != null">#{switchesAc},</if>
|
|
<if test="switchesSwitch != null">#{switchesSwitch},</if>
|
|
<if test="switchesSwitches != null">#{switchesSwitches},</if>
|
|
<if test="switchesSwitchstatus != null">#{switchesSwitchstatus},</if>
|
|
<if test="temperature != null">#{temperature},</if>
|
|
<if test="leakage != null">#{leakage},</if>
|
|
<if test="voltageA != null">#{voltageA},</if>
|
|
<if test="voltageB != null">#{voltageB},</if>
|
|
<if test="voltageC != null">#{voltageC},</if>
|
|
<if test="voltageAb != null">#{voltageAb},</if>
|
|
<if test="voltageBc != null">#{voltageBc},</if>
|
|
<if test="voltageCa != null">#{voltageCa},</if>
|
|
<if test="currentA != null">#{currentA},</if>
|
|
<if test="currentB != null">#{currentB},</if>
|
|
<if test="currentC != null">#{currentC},</if>
|
|
<if test="powerA != null">#{powerA},</if>
|
|
<if test="powerB != null">#{powerB},</if>
|
|
<if test="powerC != null">#{powerC},</if>
|
|
<if test="energyA != null">#{energyA},</if>
|
|
<if test="energyB != null">#{energyB},</if>
|
|
<if test="energyC != null">#{energyC},</if>
|
|
<if test="factorA != null">#{factorA},</if>
|
|
<if test="factorB != null">#{factorB},</if>
|
|
<if test="factorC != null">#{factorC},</if>
|
|
<if test="frequencyA != null">#{frequencyA},</if>
|
|
<if test="frequencyB != null">#{frequencyB},</if>
|
|
<if test="frequencyC != null">#{frequencyC},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertDevIotWarning" parameterType="DevIotWarning" useGeneratedKeys="true" keyProperty="id">
|
|
insert into dev_iot_warning
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">cfg_id,</if>
|
|
<if test="pointId != null">point_id,</if>
|
|
<if test="comId != null">com_id,</if>
|
|
<if test="projectId != null">project_id,</if>
|
|
<if test="deviceSn != null">device_sn,</if>
|
|
<if test="warningType != null">warning_type,</if>
|
|
<if test="warningContent != null">warning_content,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="cfgId != null">#{cfgId},</if>
|
|
<if test="pointId != null">#{pointId},</if>
|
|
<if test="comId != null">#{comId},</if>
|
|
<if test="projectId != null">#{projectId},</if>
|
|
<if test="deviceSn != null">#{deviceSn},</if>
|
|
<if test="warningType != null">#{warningType},</if>
|
|
<if test="warningContent != null">#{warningContent},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
</mapper> |