Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
0d7b2ce3
Commit
0d7b2ce3
authored
Nov 06, 2023
by
14796
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备信息代码
parent
c0bb5aa8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
26 deletions
+22
-26
DeviceServiceImpl.java
...ain/java/share/system/service/impl/DeviceServiceImpl.java
+19
-23
DeviceGatewayMapper.xml
.../src/main/resources/mapper/system/DeviceGatewayMapper.xml
+1
-1
DeviceMapper.xml
...-system/src/main/resources/mapper/system/DeviceMapper.xml
+2
-2
No files found.
share-system/src/main/java/share/system/service/impl/DeviceServiceImpl.java
View file @
0d7b2ce3
package
share
.
system
.
service
.
impl
;
package
share
.
system
.
service
.
impl
;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
share.common.utils.DateUtils
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.SecurityUtils
;
import
share.system.mapper.DeviceMapper
;
import
share.system.mapper.DeviceMapper
;
import
share.system.domain.Device
;
import
share.system.domain.Device
;
import
share.system.service.DeviceService
;
import
share.system.service.DeviceService
;
/**
/**
* 设备信息Service业务层处理
* 设备信息Service业务层处理
*
*
* @author wuwenlong
* @author wuwenlong
* @date 2023-11-04
* @date 2023-11-04
*/
*/
@Service
@Service
public
class
DeviceServiceImpl
extends
ServiceImpl
<
DeviceMapper
,
Device
>
implements
DeviceService
public
class
DeviceServiceImpl
extends
ServiceImpl
<
DeviceMapper
,
Device
>
implements
DeviceService
{
{
@Autowired
@Autowired
private
DeviceMapper
deviceMapper
;
private
DeviceMapper
deviceMapper
;
/**
/**
* 查询设备信息
* 查询设备信息
*
*
* @param id 设备信息主键
* @param id 设备信息主键
* @return 设备信息
* @return 设备信息
*/
*/
@Override
@Override
public
Device
selectDeviceById
(
Long
id
)
public
Device
selectDeviceById
(
Long
id
)
{
{
return
deviceMapper
.
selectDeviceById
(
id
);
return
deviceMapper
.
selectDeviceById
(
id
);
}
}
/**
/**
* 查询设备信息列表
* 查询设备信息列表
*
*
* @param device 设备信息
* @param device 设备信息
* @return 设备信息
* @return 设备信息
*/
*/
@Override
@Override
public
List
<
Device
>
selectDeviceList
(
Device
device
)
public
List
<
Device
>
selectDeviceList
(
Device
device
)
{
{
return
deviceMapper
.
selectDeviceList
(
device
);
return
deviceMapper
.
selectDeviceList
(
device
);
}
}
/**
/**
* 新增设备信息
* 新增设备信息
*
*
* @param device 设备信息
* @param device 设备信息
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
insertDevice
(
Device
device
)
public
int
insertDevice
(
Device
device
)
{
{
device
.
setCreateTime
(
DateUtils
.
getNowDate
());
device
.
setCreateTime
(
DateUtils
.
getNowDate
());
device
.
setCreateBy
(
SecurityUtils
.
getUsername
());
return
deviceMapper
.
insertDevice
(
device
);
return
deviceMapper
.
insertDevice
(
device
);
}
}
/**
/**
* 修改设备信息
* 修改设备信息
*
*
* @param device 设备信息
* @param device 设备信息
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updateDevice
(
Device
device
)
public
int
updateDevice
(
Device
device
)
{
{
device
.
setUpdateTime
(
DateUtils
.
getNowDate
());
device
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
deviceMapper
.
updateDevice
(
device
);
return
deviceMapper
.
updateDevice
(
device
);
}
}
/**
/**
* 批量删除设备信息
* 批量删除设备信息
*
*
* @param ids 需要删除的设备信息主键
* @param ids 需要删除的设备信息主键
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteDeviceByIds
(
Long
[]
ids
)
public
int
deleteDeviceByIds
(
Long
[]
ids
)
{
{
return
deviceMapper
.
deleteDeviceByIds
(
ids
);
return
deviceMapper
.
deleteDeviceByIds
(
ids
);
}
}
/**
/**
* 删除设备信息信息
* 删除设备信息信息
*
*
* @param id 设备信息主键
* @param id 设备信息主键
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
deleteDeviceById
(
Long
id
)
public
int
deleteDeviceById
(
Long
id
)
{
{
return
deviceMapper
.
deleteDeviceById
(
id
);
return
deviceMapper
.
deleteDeviceById
(
id
);
}
}
/**
/**
* 修改设备信息
* 修改设备信息
* 根据devid
* 根据devid
*
* @param device 设备信息
* @param device 设备信息
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updateDeviceByDevId
(
Device
device
)
public
int
updateDeviceByDevId
(
Device
device
)
{
{
device
.
setUpdateTime
(
DateUtils
.
getNowDate
());
device
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
deviceMapper
.
updateDeviceByDevId
(
device
);
return
deviceMapper
.
updateDeviceByDevId
(
device
);
}
}
...
...
share-system/src/main/resources/mapper/system/DeviceGatewayMapper.xml
View file @
0d7b2ce3
...
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectDeviceGatewayVo"
>
<sql
id=
"selectDeviceGatewayVo"
>
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type,
group
, status, mqtt_iP, mqtt_port, mqtt_user, mqtt_paswd, create_by, create_time, update_by, update_time, remark, dev_position from s_device_gateway
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type,
`group`
, status, mqtt_iP, mqtt_port, mqtt_user, mqtt_paswd, create_by, create_time, update_by, update_time, remark, dev_position from s_device_gateway
</sql>
</sql>
<select
id=
"selectDeviceGatewayList"
parameterType=
"DeviceGateway"
resultMap=
"DeviceGatewayResult"
>
<select
id=
"selectDeviceGatewayList"
parameterType=
"DeviceGateway"
resultMap=
"DeviceGatewayResult"
>
...
...
share-system/src/main/resources/mapper/system/DeviceMapper.xml
View file @
0d7b2ce3
...
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectDeviceVo"
>
<sql
id=
"selectDeviceVo"
>
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, projt_id, projt_psw,
group
, status, create_by, create_time, update_by, update_time, remark, dev_position, gateway_id, voltage, signal_value from s_device
select id, dev_name, dev_mac, dev_id, dev_psw, dev_ver, dev_type, projt_id, projt_psw,
`group`
, status, create_by, create_time, update_by, update_time, remark, dev_position, gateway_id, voltage, signal_value from s_device
</sql>
</sql>
<select
id=
"selectDeviceList"
parameterType=
"Device"
resultMap=
"DeviceResult"
>
<select
id=
"selectDeviceList"
parameterType=
"Device"
resultMap=
"DeviceResult"
>
...
@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -143,7 +143,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"devType != null"
>
dev_type = #{devType},
</if>
<if
test=
"devType != null"
>
dev_type = #{devType},
</if>
<if
test=
"projtId != null"
>
projt_id = #{projtId},
</if>
<if
test=
"projtId != null"
>
projt_id = #{projtId},
</if>
<if
test=
"projtPsw != null"
>
projt_psw = #{projtPsw},
</if>
<if
test=
"projtPsw != null"
>
projt_psw = #{projtPsw},
</if>
<if
test=
"group != null"
>
group = #{group},
</if>
<if
test=
"group != null"
>
group = #{group},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment