Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
entrance_api
Project
Project
Details
Activity
Releases
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
王琮
entrance_api
Commits
49879854
Commit
49879854
authored
Dec 22, 2022
by
zhangyanduan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改设备表新增编辑接口
parent
f6b4ca97
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
14 deletions
+63
-14
JieLinkServiceImpl.java
.../integration/jieLink/service/impl/JieLinkServiceImpl.java
+8
-6
DevicesRepository.java
...n/java/org/rcisoft/sys/devices/dao/DevicesRepository.java
+5
-1
DevicesServiceImpl.java
.../rcisoft/sys/devices/service/impl/DevicesServiceImpl.java
+6
-6
DevicesMapper.xml
src/main/resources/mapper/DevicesMapper.xml
+44
-1
No files found.
src/main/java/org/rcisoft/integration/jieLink/service/impl/JieLinkServiceImpl.java
View file @
49879854
...
@@ -421,12 +421,14 @@ public class JieLinkServiceImpl implements IJieLinkService {
...
@@ -421,12 +421,14 @@ public class JieLinkServiceImpl implements IJieLinkService {
public
static
List
<
Map
<
String
,
String
>>
deviceGuidInArray
=
new
ArrayList
<>();
public
static
List
<
Map
<
String
,
String
>>
deviceGuidInArray
=
new
ArrayList
<>();
static
{
static
{
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"1"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"59c50c9c-3d75-420f-be9b-ad2db1aee432"
);}});
//右出口
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"2"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"64467dcf-9e59-495e-b9e4-f65a98732a99"
);}});
//右入口
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"3"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"6e2bfaad-feb3-4171-9b85-86f00589bcce"
);}});
//左入口
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"4"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"e90c55ec-bc68-498d-966c-66091ee85c27"
);}});
//左出口
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"5"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"754fdf10-be59-4004-b869-969dbc61987d"
);}});
//大门出口
deviceGuidInArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"1"
);}});
deviceGuidAllArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
"a3dc7973-a64c-4359-bdc9-a19fe32a9f9d"
);}});
//大门入口
//门口访客机器
deviceGuidInArray
.
add
(
new
HashMap
(){{
put
(
"deviceApGuid"
,
""
);}});
}
}
...
...
src/main/java/org/rcisoft/sys/devices/dao/DevicesRepository.java
View file @
49879854
...
@@ -18,6 +18,10 @@ import java.util.List;
...
@@ -18,6 +18,10 @@ import java.util.List;
public
interface
DevicesRepository
extends
CyBaseMapper
<
Devices
>
{
public
interface
DevicesRepository
extends
CyBaseMapper
<
Devices
>
{
int
saveDeviceInfo
(
@Param
(
"entity"
)
Devices
devices
);
void
updateDeviceInfo
(
@Param
(
"entity"
)
Devices
devices
);
List
<
Devices
>
queryDevicess
(
@Param
(
"entity"
)
Devices
devices
);
List
<
Devices
>
queryDevicess
(
@Param
(
"entity"
)
Devices
devices
);
/**
/**
...
@@ -31,7 +35,7 @@ public interface DevicesRepository extends CyBaseMapper<Devices> {
...
@@ -31,7 +35,7 @@ public interface DevicesRepository extends CyBaseMapper<Devices> {
* @param deviceGuid
* @param deviceGuid
* @return
* @return
*/
*/
Devices
getDeviceInfoBy
Device
Guid
(
@Param
(
"deviceGuid"
)
String
deviceGuid
);
Devices
getDeviceInfoByGuid
(
@Param
(
"deviceGuid"
)
String
deviceGuid
);
}
}
...
...
src/main/java/org/rcisoft/sys/devices/service/impl/DevicesServiceImpl.java
View file @
49879854
...
@@ -42,9 +42,9 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
...
@@ -42,9 +42,9 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
@Override
@Override
public
CyPersistModel
persist
(
Devices
devices
){
public
CyPersistModel
persist
(
Devices
devices
){
//增加操作
//增加操作
int
line
=
baseMapper
.
insert
(
devices
);
int
line
=
baseMapper
.
saveDeviceInfo
(
devices
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
devices
.
get
BusinessI
d
()+
"的通行设备信息表信息"
);
devices
.
get
DeviceGui
d
()+
"的通行设备信息表信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
line
);
}
}
...
@@ -69,9 +69,9 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
...
@@ -69,9 +69,9 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
@Override
public
CyPersistModel
merge
(
Devices
devices
){
public
CyPersistModel
merge
(
Devices
devices
){
int
line
=
baseMapper
.
updateById
(
devices
);
baseMapper
.
updateDeviceInfo
(
devices
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
devices
.
get
BusinessI
d
()+
"的通行设备信息表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
devices
.
get
DeviceGui
d
()+
"的通行设备信息表信息"
);
return
new
CyPersistModel
(
line
);
return
new
CyPersistModel
(
1
);
}
}
/**
/**
...
@@ -118,7 +118,7 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
...
@@ -118,7 +118,7 @@ public class DevicesServiceImpl extends ServiceImpl<DevicesRepository,Devices>
@Override
@Override
public
Devices
getDeviceInfoByDeviceGuid
(
String
deviceGuid
)
{
public
Devices
getDeviceInfoByDeviceGuid
(
String
deviceGuid
)
{
return
baseMapper
.
getDeviceInfoBy
Device
Guid
(
deviceGuid
);
return
baseMapper
.
getDeviceInfoByGuid
(
deviceGuid
);
}
}
...
...
src/main/resources/mapper/DevicesMapper.xml
View file @
49879854
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
<mapper
namespace=
"org.rcisoft.sys.devices.dao.DevicesRepository"
>
<mapper
namespace=
"org.rcisoft.sys.devices.dao.DevicesRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.sys.devices.entity.Devices"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.sys.devices.entity.Devices"
>
<id
column=
"device_guid"
jdbcType=
"VARCHAR"
property=
"deviceGuid"
/>
<id
column=
"device_guid"
jdbcType=
"VARCHAR"
property=
"deviceGuid"
/>
<result
column=
"device_id"
jdbcType=
"VARCHAR"
property=
"deviceId"
/>
<result
column=
"device_id"
jdbcType=
"VARCHAR"
property=
"deviceId"
/>
<result
column=
"device_name"
jdbcType=
"VARCHAR"
property=
"deviceName"
/>
<result
column=
"device_name"
jdbcType=
"VARCHAR"
property=
"deviceName"
/>
<result
column=
"device_ip"
jdbcType=
"VARCHAR"
property=
"deviceIp"
/>
<result
column=
"device_ip"
jdbcType=
"VARCHAR"
property=
"deviceIp"
/>
...
@@ -15,6 +14,50 @@
...
@@ -15,6 +14,50 @@
<result
column=
"parent_id"
jdbcType=
"VARCHAR"
property=
"parentId"
/>
<result
column=
"parent_id"
jdbcType=
"VARCHAR"
property=
"parentId"
/>
</resultMap>
</resultMap>
<insert
id=
"saveDeviceInfo"
parameterType=
"org.rcisoft.sys.devices.entity.Devices"
useGeneratedKeys=
"false"
>
insert into devices
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"entity.deviceGuid != null"
>
device_guid ,
</if>
<if
test=
"entity.deviceId != null"
>
device_id ,
</if>
<if
test=
"entity.deviceName != null"
>
device_name ,
</if>
<if
test=
"entity.deviceIp != null"
>
device_ip ,
</if>
<if
test=
"entity.deviceGateway != null"
>
device_gateway ,
</if>
<if
test=
"entity.deviceNetmask != null"
>
device_netmask ,
</if>
<if
test=
"entity.deviceType != null"
>
device_type ,
</if>
<if
test=
"entity.deviceioType != null"
>
deviceIo_type ,
</if>
<if
test=
"entity.remark != null"
>
remark ,
</if>
<if
test=
"entity.parentId != null"
>
parent_id ,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"entity.deviceGuid != null"
>
#{entity.deviceGuid},
</if>
<if
test=
"entity.deviceId != null"
>
#{entity.deviceId},
</if>
<if
test=
"entity.deviceName != null"
>
#{entity.deviceName},
</if>
<if
test=
"entity.deviceIp != null"
>
#{entity.deviceIp},
</if>
<if
test=
"entity.deviceGateway != null"
>
#{entity.deviceGateway},
</if>
<if
test=
"entity.deviceNetmask != null"
>
#{entity.deviceNetmask},
</if>
<if
test=
"entity.deviceType != null"
>
#{entity.deviceType},
</if>
<if
test=
"entity.deviceioType != null"
>
#{entity.deviceioType},
</if>
<if
test=
"entity.remark != null"
>
#{entity.remark},
</if>
<if
test=
"entity.parentId != null"
>
#{entity.parentId},
</if>
</trim>
</insert>
<update
id=
"updateDeviceInfo"
parameterType=
"org.rcisoft.sys.devices.entity.Devices"
>
update devices
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"entity.deviceId != null"
>
device_id = #{entity.deviceId},
</if>
<if
test=
"entity.deviceName != null"
>
device_name = #{entity.deviceName},
</if>
<if
test=
"entity.deviceIp != null"
>
device_ip = #{entity.deviceIp},
</if>
<if
test=
"entity.deviceGateway != null"
>
device_gateway = #{entity.deviceGateway},
</if>
<if
test=
"entity.deviceNetmask != null"
>
device_netmask = #{entity.deviceNetmask},
</if>
<if
test=
"entity.deviceType != null"
>
device_type = #{entity.deviceType},
</if>
<if
test=
"entity.deviceioType != null"
>
deviceIo_type = #{entity.deviceioType},
</if>
<if
test=
"entity.remark != null"
>
remark = #{entity.remark},
</if>
<if
test=
"entity.parentId != null"
>
parent_id = #{entity.parentId},
</if>
</trim>
where device_guid = #{entity.deviceGuid}
</update>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select
id=
"queryDevicess"
resultMap=
"BaseResultMap"
>
<select
id=
"queryDevicess"
resultMap=
"BaseResultMap"
>
select * from devices
select * from devices
...
...
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