|
|
|
@ -73,24 +73,15 @@ |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<select id="queryByUserId" resultMap="PsdcDeviceMap"> |
|
|
|
|
select 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 user_id = #{userId} |
|
|
|
|
Select * From psdc_device |
|
|
|
|
<where> |
|
|
|
|
<if test="userId != null and userId != ''"> |
|
|
|
|
And user_id = #{userId} |
|
|
|
|
</if> |
|
|
|
|
<if test="parentId != null and parentId != ''"> |
|
|
|
|
And parent_id = #{parentId} |
|
|
|
|
</if> |
|
|
|
|
</where> |
|
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
<!--分页查询指定行数据--> |
|
|
|
@ -211,7 +202,7 @@ |
|
|
|
|
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}, #{deviceModel},#{parentId},#{isControl, #{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> |
|
|
|
@ -222,7 +213,7 @@ |
|
|
|
|
create_time, update_by, update_time) |
|
|
|
|
Values |
|
|
|
|
<foreach collection="devRecord" item="entity" separator=","> |
|
|
|
|
(NULL, #{entity.deviceType}, #{entity.deviceSn}, #{entity.deviceName}, #{entity.hardVersion}, #{entity.softVersion}, #{entity.deviceAddress}, |
|
|
|
|
(NULL, #{entity.deviceType}, #{entity.deviceSn}, #{entity.deviceModel},#{entity.parentId},#{entity.isControl}, #{entity.deviceName}, #{entity.hardVersion}, #{entity.softVersion}, #{entity.deviceAddress}, |
|
|
|
|
#{entity.startTime}, #{entity.deviceStatus}, #{entity.deviceRunstatus}, #{entity.photoUrl}, #{entity.createBy}, #{entity.createTime}, NULL, NULL) |
|
|
|
|
</foreach> |
|
|
|
|
</insert> |
|
|
|
|