|
|
|
@ -3,10 +3,13 @@ |
|
|
|
|
<mapper namespace="com.psdc.mapper.PsdcDeviceMapper"> |
|
|
|
|
<resultMap type="com.psdc.entity.PsdcDevice" id="PsdcDeviceMap"> |
|
|
|
|
<result property="deviceId" column="device_id" /> |
|
|
|
|
<result property="parentId" column="parent_id" /> |
|
|
|
|
<result property="userId" column="user_id" /> |
|
|
|
|
<result property="deviceType" column="device_type" /> |
|
|
|
|
<result property="deviceModel" column="device_model" /> |
|
|
|
|
<result property="deviceSn" column="device_sn" /> |
|
|
|
|
<result property="deviceName" column="device_name" /> |
|
|
|
|
<result property="isControl" column="is_control" /> |
|
|
|
|
<result property="hardVersion" column="hard_version" /> |
|
|
|
|
<result property="softVersion" column="soft_version" /> |
|
|
|
|
<result property="deviceAddress" column="device_address" /> |
|
|
|
@ -37,7 +40,7 @@ |
|
|
|
|
|
|
|
|
|
<!-- 通过ID查询单条数据 --> |
|
|
|
|
<select id="queryById" resultMap="PsdcDeviceMap"> |
|
|
|
|
select device_id, |
|
|
|
|
select device_id, parent_id, device_model, is_control, |
|
|
|
|
user_id, |
|
|
|
|
device_type, |
|
|
|
|
device_sn, |
|
|
|
@ -70,7 +73,7 @@ |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="queryByUserId" resultMap="PsdcDeviceMap"> |
|
|
|
|
select device_id, |
|
|
|
|
select device_id, parent_id, device_model, is_control, |
|
|
|
|
user_id, |
|
|
|
|
device_type, |
|
|
|
|
device_sn, |
|
|
|
@ -93,7 +96,7 @@ |
|
|
|
|
<!--分页查询指定行数据--> |
|
|
|
|
<select id="queryAllByLimit" resultMap="PsdcDeviceMap"> |
|
|
|
|
select |
|
|
|
|
device_id,user_id,device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,device_runstatus,photo_url,create_by,create_time,update_by,update_time |
|
|
|
|
device_id, parent_id, device_model, is_control, user_id, device_type,device_sn,device_name,hard_version,soft_version,device_address,start_time,device_status,device_runstatus,photo_url,create_by,create_time,update_by,update_time |
|
|
|
|
from psdc_device |
|
|
|
|
<where> |
|
|
|
|
<if test="deviceId != null and deviceId != ''"> |
|
|
|
@ -205,16 +208,16 @@ |
|
|
|
|
|
|
|
|
|
<!--新增数据--> |
|
|
|
|
<insert id="insert"> |
|
|
|
|
insert into psdc_device(user_id, device_type, device_sn, device_name, hard_version, soft_version, |
|
|
|
|
insert into psdc_device(user_id, device_type, parent_id, device_model, is_control, device_sn, device_name, hard_version, soft_version, |
|
|
|
|
device_address, start_time, device_status, device_runstatus, photo_url, create_by, |
|
|
|
|
create_time, update_by, update_time) |
|
|
|
|
values (#{userId}, #{deviceType}, #{deviceSn}, #{deviceName}, #{hardVersion}, #{softVersion}, #{deviceAddress}, |
|
|
|
|
values (#{userId}, #{deviceType}, #{deviceModel},#{parentId},#{isControl, #{deviceSn}, #{deviceName}, #{hardVersion}, #{softVersion}, #{deviceAddress}, |
|
|
|
|
#{startTime}, #{deviceStatus}, #{deviceRunstatus}, #{photoUrl}, #{createBy}, #{createTime}, #{updateBy}, |
|
|
|
|
#{updateTime}) |
|
|
|
|
</insert> |
|
|
|
|
|
|
|
|
|
<insert id="saveDevicesData" parameterType="com.psdc.entity.PsdcDevice" useGeneratedKeys="true"> |
|
|
|
|
Insert into psdc_device(user_id, device_type, device_sn, device_name, hard_version, soft_version, |
|
|
|
|
Insert into psdc_device(user_id, device_type, device_sn, parent_id, device_model, is_control, device_name, hard_version, soft_version, |
|
|
|
|
device_address, start_time, device_status, device_runstatus, photo_url, create_by, |
|
|
|
|
create_time, update_by, update_time) |
|
|
|
|
Values |
|
|
|
|