Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
znks
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
王夏晖
znks
Commits
80ca43b6
Commit
80ca43b6
authored
Nov 07, 2018
by
王夏晖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2018/11/7
parent
5386cf02
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
174 additions
and
28 deletions
+174
-28
DeviceController.java
...ain/java/com/adc/da/znks/controller/DeviceController.java
+14
-2
GatewayController.java
...in/java/com/adc/da/znks/controller/GatewayController.java
+12
-5
InstructionsController.java
...va/com/adc/da/znks/controller/InstructionsController.java
+21
-0
UserController.java
.../main/java/com/adc/da/znks/controller/UserController.java
+33
-4
DeviceDao.java
adc-da-main/src/main/java/com/adc/da/znks/dao/DeviceDao.java
+2
-0
GatewayDao.java
...da-main/src/main/java/com/adc/da/znks/dao/GatewayDao.java
+2
-0
UserDao.java
adc-da-main/src/main/java/com/adc/da/znks/dao/UserDao.java
+5
-1
User.java
adc-da-main/src/main/java/com/adc/da/znks/entity/User.java
+10
-0
DeviceService.java
.../src/main/java/com/adc/da/znks/service/DeviceService.java
+4
-0
GatewayService.java
...src/main/java/com/adc/da/znks/service/GatewayService.java
+4
-0
UserService.java
...in/src/main/java/com/adc/da/znks/service/UserService.java
+48
-14
ServerHandler.java
...c/main/java/com/adc/da/znks/util/netty/ServerHandler.java
+2
-2
DeviceMapper.xml
...n/src/main/resources/mybatis/mapper/znks/DeviceMapper.xml
+4
-0
GatewayMapper.xml
.../src/main/resources/mybatis/mapper/znks/GatewayMapper.xml
+4
-0
PositionMapper.xml
...src/main/resources/mybatis/mapper/znks/PositionMapper.xml
+1
-0
UserEOMapper.xml
...n/src/main/resources/mybatis/mapper/znks/UserEOMapper.xml
+8
-0
No files found.
adc-da-main/src/main/java/com/adc/da/znks/controller/DeviceController.java
View file @
80ca43b6
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* @author David
* @author David
...
@@ -41,9 +42,20 @@ public class DeviceController extends BaseController<Device> {
...
@@ -41,9 +42,20 @@ public class DeviceController extends BaseController<Device> {
deviceVO
.
setId
(
UUID
.
randomUUID
());
deviceVO
.
setId
(
UUID
.
randomUUID
());
deviceVO
.
setUserId
(
user
.
getId
());
deviceVO
.
setUserId
(
user
.
getId
());
deviceVO
.
setMacAddress
(
deviceService
.
getMacByPhone
(
deviceVO
.
getPhoneNumber
()));
deviceVO
.
setMacAddress
(
deviceService
.
getMacByPhone
(
deviceVO
.
getPhoneNumber
()));
deviceService
.
insertSelective
(
deviceVO
);
Device
device
=
new
Device
();
return
GenResponse
.
success
();
device
.
setUserId
(
user
.
getId
());
device
.
setCode
(
deviceVO
.
getCode
());
device
.
setType
(
deviceVO
.
getType
());
device
.
setName
(
deviceVO
.
getName
());
List
<
Map
<
String
,
Object
>>
list
=
deviceService
.
checkDevice
(
device
);
System
.
out
.
println
(
"66666666666666"
);
if
(
list
.
isEmpty
()){
deviceService
.
insertSelective
(
deviceVO
);
return
GenResponse
.
success
();
}
return
GenResponse
.
fail
(
"设备已存在"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
.
getMessage
());
return
GenResponse
.
fail
(
"保存失败"
);
return
GenResponse
.
fail
(
"保存失败"
);
}
}
}
}
...
...
adc-da-main/src/main/java/com/adc/da/znks/controller/GatewayController.java
View file @
80ca43b6
...
@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
/**
* @author David
* @author David
*/
*/
...
@@ -42,11 +44,16 @@ public class GatewayController extends BaseController<Gateway> {
...
@@ -42,11 +44,16 @@ public class GatewayController extends BaseController<Gateway> {
gateway
.
setId
(
UUID
.
randomUUID
());
gateway
.
setId
(
UUID
.
randomUUID
());
gateway
.
setUserId
(
user
.
getId
());
gateway
.
setUserId
(
user
.
getId
());
gateway
.
setMacAddress
(
gateway
.
getMacAddress
().
toUpperCase
());
gateway
.
setMacAddress
(
gateway
.
getMacAddress
().
toUpperCase
());
int
count
=
gatewayService
.
insertSelective
(
gateway
);
List
<
Gateway
>
list
=
gatewayService
.
checkGateWay
(
user
.
getId
(),
gateway
.
getMacAddress
().
toUpperCase
());
if
(
count
>
0
)
{
if
(
list
.
isEmpty
()){
return
GenResponse
.
success
();
int
count
=
gatewayService
.
insertSelective
(
gateway
);
}
else
{
if
(
count
>
0
)
{
return
GenResponse
.
fail
(
"保存失败"
);
return
GenResponse
.
success
();
}
else
{
return
GenResponse
.
fail
(
"保存失败"
);
}
}
else
{
return
GenResponse
.
fail
(
"数据已存在"
);
}
}
}
else
{
}
else
{
return
GenResponse
.
fail
(
"网关链路关闭,保存失败"
);
return
GenResponse
.
fail
(
"网关链路关闭,保存失败"
);
...
...
adc-da-main/src/main/java/com/adc/da/znks/controller/InstructionsController.java
View file @
80ca43b6
...
@@ -314,6 +314,27 @@ public class InstructionsController {
...
@@ -314,6 +314,27 @@ public class InstructionsController {
}
}
}
}
/**
* 验证网关是否在线
* @param phoneNumber
* @return
*/
@GetMapping
(
"/validateGateWay"
)
public
ResponseEntity
<
Boolean
>
validateGateWay
(
String
phoneNumber
)
{
String
mac
=
getMacByPhone
(
phoneNumber
);
if
(
mac
==
null
){
return
GenResponse
.
fail
(
"网关mac获取失败"
);
}
if
(
SystemValue
.
channelMap
.
get
(
mac
)!=
null
){
Channel
ch
=
((
Channel
)
SystemValue
.
channelMap
.
get
(
mac
));
if
(
ch
.
isActive
()){
return
GenResponse
.
success
();
}
}
return
GenResponse
.
fail
(
"网关未连接"
);
}
public
String
getMacByPhone
(
String
phone
){
public
String
getMacByPhone
(
String
phone
){
...
...
adc-da-main/src/main/java/com/adc/da/znks/controller/UserController.java
View file @
80ca43b6
...
@@ -41,11 +41,14 @@ public class UserController extends BaseController<User> {
...
@@ -41,11 +41,14 @@ public class UserController extends BaseController<User> {
@ApiOperation
(
value
=
"|User|登录或者注册用户"
)
@ApiOperation
(
value
=
"|User|登录或者注册用户"
)
@PostMapping
(
value
=
{
"/loginOrRegisterUser"
})
@PostMapping
(
value
=
{
"/loginOrRegisterUser"
})
public
ResponseEntity
<
Boolean
>
loginOrRegisterUser
(
String
phoneNumber
,
String
password
)
{
public
ResponseEntity
<
Boolean
>
loginOrRegisterUser
(
String
phoneNumber
,
String
password
)
{
boolean
flag
=
userService
.
loginOrRegister
(
phoneNumber
,
password
);
int
i
=
userService
.
loginOrRegister
(
phoneNumber
,
password
);
if
(
flag
)
{
if
(
i
<
0
)
{
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
.
value
()),
"登录或者注册用户成功"
,
flag
);
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
),
"用户不存在"
,
false
);
}
else
{
}
else
{
return
GenResponse
.
fail
(
"登录或者注册用户失败"
);
if
(
i
>
0
){
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
),
"登陆成功"
,
true
);
}
return
GenResponse
.
fail
(
"登录失败"
);
}
}
}
}
...
@@ -105,4 +108,30 @@ public class UserController extends BaseController<User> {
...
@@ -105,4 +108,30 @@ public class UserController extends BaseController<User> {
}
}
}
}
@ApiOperation
(
value
=
"更新家庭名称"
)
@PostMapping
(
"/updateHomeName"
)
public
ResponseEntity
updateHomeName
(
String
phoneNumber
,
String
homeName
)
{
User
user
=
new
User
();
user
.
setTemphone
(
phoneNumber
);
user
.
setHomeName
(
homeName
);
if
(
userService
.
updateHomeName
(
user
)){
return
GenResponse
.
success
();
}
return
GenResponse
.
fail
(
"更新失败"
);
}
@ApiOperation
(
value
=
"获取家庭名称"
)
@PostMapping
(
"/getHomeName"
)
public
ResponseEntity
<
String
>
getHomeName
(
String
phoneNumber
)
{
String
name
=
userService
.
selectHomeNameByPhone
(
phoneNumber
);
return
GenResponse
.
success
(
"200"
,
""
,
name
);
}
@ApiOperation
(
value
=
"|User|增加用户"
)
@PostMapping
(
value
=
{
"/register"
})
public
ResponseEntity
<
Boolean
>
register
(
String
phoneNumber
)
{
boolean
flag
=
userService
.
addUser
(
phoneNumber
);
return
GenResponse
.
success
(
String
.
valueOf
(
HttpStatus
.
OK
.
value
()),
""
,
flag
);
}
}
}
adc-da-main/src/main/java/com/adc/da/znks/dao/DeviceDao.java
View file @
80ca43b6
...
@@ -37,4 +37,6 @@ public interface DeviceDao extends BaseDao<Device> {
...
@@ -37,4 +37,6 @@ public interface DeviceDao extends BaseDao<Device> {
" AND t.temphone = #{phone}"
)
" AND t.temphone = #{phone}"
)
List
<
Map
<
String
,
Object
>>
getMacByPhone
(
@Param
(
"phone"
)
String
phone
);
List
<
Map
<
String
,
Object
>>
getMacByPhone
(
@Param
(
"phone"
)
String
phone
);
List
<
Map
<
String
,
Object
>>
checkDevice
(
@Param
(
"name"
)
String
name
,
@Param
(
"code"
)
int
code
,
@Param
(
"type"
)
int
type
,
@Param
(
"userId"
)
String
userId
);
}
}
adc-da-main/src/main/java/com/adc/da/znks/dao/GatewayDao.java
View file @
80ca43b6
...
@@ -30,4 +30,6 @@ public interface GatewayDao extends BaseDao<Gateway> {
...
@@ -30,4 +30,6 @@ public interface GatewayDao extends BaseDao<Gateway> {
@Update
(
"update tb_gateway set mac_address = #{macAddress} where user_id = #{userId}"
)
@Update
(
"update tb_gateway set mac_address = #{macAddress} where user_id = #{userId}"
)
int
updateMacByUser
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"macAddress"
)
String
macAddress
);
int
updateMacByUser
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"macAddress"
)
String
macAddress
);
List
<
Gateway
>
checkGateWay
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"macAddress"
)
String
macAddress
);
}
}
adc-da-main/src/main/java/com/adc/da/znks/dao/UserDao.java
View file @
80ca43b6
...
@@ -21,7 +21,7 @@ import java.util.Map;
...
@@ -21,7 +21,7 @@ import java.util.Map;
@Mapper
@Mapper
public
interface
UserDao
extends
BaseDao
<
User
>
{
public
interface
UserDao
extends
BaseDao
<
User
>
{
@Select
(
"SELECT * FROM tb_user WHERE temphone = #{phoneNumber}"
)
@Select
(
"SELECT * FROM tb_user WHERE temphone = #{phoneNumber}
limit 1
"
)
User
getUserByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
User
getUserByPhoneNumber
(
@Param
(
"phoneNumber"
)
String
phoneNumber
);
List
<
Map
<
String
,
Object
>>
queryMacByPhone
(
@Param
(
"phone"
)
String
phone
);
List
<
Map
<
String
,
Object
>>
queryMacByPhone
(
@Param
(
"phone"
)
String
phone
);
...
@@ -42,4 +42,8 @@ public interface UserDao extends BaseDao<User> {
...
@@ -42,4 +42,8 @@ public interface UserDao extends BaseDao<User> {
List
<
UserVO
>
listUserVOs
(
@Param
(
"userSearch"
)
UserSearch
userSearch
,
List
<
UserVO
>
listUserVOs
(
@Param
(
"userSearch"
)
UserSearch
userSearch
,
@Param
(
"pageNum"
)
Integer
pageNum
,
@Param
(
"pageSize"
)
Integer
pageSize
);
@Param
(
"pageNum"
)
Integer
pageNum
,
@Param
(
"pageSize"
)
Integer
pageSize
);
int
updateHomeName
(
User
user
);
List
<
User
>
selectHomeNameByPhone
(
@Param
(
"temphone"
)
String
temphone
);
}
}
adc-da-main/src/main/java/com/adc/da/znks/entity/User.java
View file @
80ca43b6
...
@@ -20,6 +20,8 @@ public class User extends BaseEntity {
...
@@ -20,6 +20,8 @@ public class User extends BaseEntity {
private
String
clientId
;
private
String
clientId
;
private
String
homeName
;
public
User
()
{
public
User
()
{
}
}
...
@@ -83,6 +85,14 @@ public class User extends BaseEntity {
...
@@ -83,6 +85,14 @@ public class User extends BaseEntity {
this
.
clientId
=
clientId
;
this
.
clientId
=
clientId
;
}
}
public
String
getHomeName
()
{
return
homeName
;
}
public
void
setHomeName
(
String
homeName
)
{
this
.
homeName
=
homeName
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
final
StringBuilder
sb
=
new
StringBuilder
(
"{"
);
final
StringBuilder
sb
=
new
StringBuilder
(
"{"
);
...
...
adc-da-main/src/main/java/com/adc/da/znks/service/DeviceService.java
View file @
80ca43b6
...
@@ -45,4 +45,8 @@ public class DeviceService extends BaseService<Device, String> {
...
@@ -45,4 +45,8 @@ public class DeviceService extends BaseService<Device, String> {
public
String
getMacByPhone
(
String
phone
){
public
String
getMacByPhone
(
String
phone
){
return
dao
.
getMacByPhone
(
phone
)!=
null
?
dao
.
getMacByPhone
(
phone
).
get
(
0
).
get
(
"mac_address"
).
toString
():
""
;
return
dao
.
getMacByPhone
(
phone
)!=
null
?
dao
.
getMacByPhone
(
phone
).
get
(
0
).
get
(
"mac_address"
).
toString
():
""
;
}
}
public
List
<
Map
<
String
,
Object
>>
checkDevice
(
Device
device
){
return
dao
.
checkDevice
(
device
.
getName
(),
device
.
getCode
(),
device
.
getType
(),
device
.
getUserId
());
}
}
}
adc-da-main/src/main/java/com/adc/da/znks/service/GatewayService.java
View file @
80ca43b6
...
@@ -79,4 +79,8 @@ public class GatewayService extends BaseService<Gateway, String> {
...
@@ -79,4 +79,8 @@ public class GatewayService extends BaseService<Gateway, String> {
}
}
return
false
;
return
false
;
}
}
public
List
<
Gateway
>
checkGateWay
(
String
userId
,
String
macAddress
){
return
dao
.
checkGateWay
(
userId
,
macAddress
);
}
}
}
adc-da-main/src/main/java/com/adc/da/znks/service/UserService.java
View file @
80ca43b6
...
@@ -53,11 +53,12 @@ public class UserService extends BaseService<User, String> {
...
@@ -53,11 +53,12 @@ public class UserService extends BaseService<User, String> {
Boolean
flag
=
false
;
Boolean
flag
=
false
;
User
user
=
dao
.
getUserByPhoneNumber
(
phoneNumber
);
User
user
=
dao
.
getUserByPhoneNumber
(
phoneNumber
);
if
(
user
!=
null
)
{
if
(
user
!=
null
)
{
if
(
user
.
getPassword
()!=
null
&&
!
""
.
equals
(
user
.
getPassword
())){
/*
if(user.getPassword()!=null && !"".equals(user.getPassword())){
flag = true;
flag = true;
}else{
}else{
flag = false;
flag = false;
}
}*/
flag
=
true
;
}
}
return
flag
;
return
flag
;
}
}
...
@@ -94,12 +95,15 @@ public class UserService extends BaseService<User, String> {
...
@@ -94,12 +95,15 @@ public class UserService extends BaseService<User, String> {
/**
/**
* user login or register
* user login or register
**/
**/
public
boolean
loginOrRegister
(
String
temphone
,
String
plainPassword
)
{
public
int
loginOrRegister
(
String
temphone
,
String
plainPassword
)
{
if
(
temphone
==
null
||
plainPassword
==
null
||
temphone
.
equals
(
""
)
||
plainPassword
.
equals
(
""
)){
return
-
1
;
}
UserPage
userPage
=
new
UserPage
();
UserPage
userPage
=
new
UserPage
();
userPage
.
setTemphone
(
temphone
);
userPage
.
setTemphone
(
temphone
);
List
<
User
>
users
=
dao
.
queryByList
(
userPage
);
List
<
User
>
users
=
dao
.
queryByList
(
userPage
);
if
(
CollectionUtils
.
isEmpty
(
users
))
{
if
(
CollectionUtils
.
isEmpty
(
users
))
{
List
<
String
>
encryptList
=
encryptList
(
plainPassword
);
/*
List<String> encryptList = encryptList(plainPassword);
Asserts.notNull(encryptList, "encrypt list must not be null.");
Asserts.notNull(encryptList, "encrypt list must not be null.");
String id = UUID.randomUUID();
String id = UUID.randomUUID();
User insertUser = new User(id, temphone, "", "");
User insertUser = new User(id, temphone, "", "");
...
@@ -109,17 +113,17 @@ public class UserService extends BaseService<User, String> {
...
@@ -109,17 +113,17 @@ public class UserService extends BaseService<User, String> {
return true;
return true;
} else {
} else {
return false;
return false;
}
}
else
{
/*User user = users.get(0);
String decryptPassword = SecurityUtils.decrypt(user.getEncryptkey(), user.getPassword());
Asserts.notNull(plainPassword, "plainPassword must not be null.");
if (plainPassword.equals(decryptPassword)) {
return true;
} else {
return false;
}*/
}*/
return
true
;
return
-
1
;
}
else
{
if
(
users
.
size
()>
1
){
return
0
;
}
String
mPassword
=
SecurityUtils
.
decrypt
(
users
.
get
(
0
).
getEncryptkey
(),
users
.
get
(
0
).
getPassword
());
if
(
plainPassword
.
equals
(
mPassword
)){
return
1
;
}
return
0
;
}
}
}
}
...
@@ -159,4 +163,34 @@ public class UserService extends BaseService<User, String> {
...
@@ -159,4 +163,34 @@ public class UserService extends BaseService<User, String> {
List
<
UserVO
>
userVOS
=
dao
.
listUserVOs
(
userSearch
,
pageNUm
,
pageSize
);
List
<
UserVO
>
userVOS
=
dao
.
listUserVOs
(
userSearch
,
pageNUm
,
pageSize
);
return
userVOS
;
return
userVOS
;
}
}
public
boolean
updateHomeName
(
User
user
){
if
(
dao
.
updateHomeName
(
user
)>
0
){
return
true
;
}
return
false
;
}
public
String
selectHomeNameByPhone
(
String
temphone
){
List
<
User
>
list
=
dao
.
selectHomeNameByPhone
(
temphone
);
if
(!
list
.
isEmpty
()){
return
list
.
get
(
0
).
getHomeName
();
}
return
null
;
}
public
boolean
addUser
(
String
temphone
){
User
user
=
dao
.
getUserByPhoneNumber
(
temphone
);
if
(
user
!=
null
){
return
false
;
}
String
id
=
UUID
.
randomUUID
();
User
insertUser
=
new
User
(
id
,
temphone
,
""
,
""
);
logger
.
info
(
"insertUser: {}"
,
insertUser
);
int
result
=
dao
.
insertSelective
(
insertUser
);
if
(
result
>
0
){
return
true
;
}
return
false
;
}
}
}
adc-da-main/src/main/java/com/adc/da/znks/util/netty/ServerHandler.java
View file @
80ca43b6
...
@@ -118,8 +118,8 @@ public class ServerHandler extends ChannelInboundHandlerAdapter {
...
@@ -118,8 +118,8 @@ public class ServerHandler extends ChannelInboundHandlerAdapter {
}
}
}
}
if
(
"80"
.
equals
(
instruct
)){
// 远程开锁触发请求,发送透传
if
(
"80"
.
equals
(
instruct
)){
// 远程开锁触发请求,发送透传
AppPushUtils
.
pushTc
(
title
,
message
,
client
);
/*
AppPushUtils.pushTc(title,message,client);
AppPushUtils
.
push
(
title
,
message
,
client
);
AppPushUtils.push(title,message,client);
*/
}
else
{
}
else
{
AppPushUtils
.
push
(
title
,
message
,
client
);
AppPushUtils
.
push
(
title
,
message
,
client
);
}
}
...
...
adc-da-main/src/main/resources/mybatis/mapper/znks/DeviceMapper.xml
View file @
80ca43b6
...
@@ -60,4 +60,8 @@
...
@@ -60,4 +60,8 @@
delete from tb_device where id = #{id}
delete from tb_device where id = #{id}
</delete>
</delete>
<select
id=
"checkDevice"
parameterType=
"com.adc.da.znks.entity.Device"
resultType=
"java.util.Map"
>
select * from tb_device where name = #{name} and type = #{type} and user_id = #{userId} and code = #{code}
</select>
</mapper>
</mapper>
adc-da-main/src/main/resources/mybatis/mapper/znks/GatewayMapper.xml
View file @
80ca43b6
...
@@ -48,4 +48,8 @@
...
@@ -48,4 +48,8 @@
select * from tb_gateway where ip = #{ip}
select * from tb_gateway where ip = #{ip}
</select>
</select>
<select
id=
"checkGateWay"
parameterType =
"java.util.Map"
resultType=
"com.adc.da.znks.entity.Gateway"
>
select * from tb_gateway where user_id = #{userId} and mac_address = #{macAddress}
</select>
</mapper>
</mapper>
adc-da-main/src/main/resources/mybatis/mapper/znks/PositionMapper.xml
View file @
80ca43b6
...
@@ -168,6 +168,7 @@ SELECT SEQ_tb_position.NEXTVAL FROM DUAL
...
@@ -168,6 +168,7 @@ SELECT SEQ_tb_position.NEXTVAL FROM DUAL
u.temphone LIKE #{telphoneLike}
u.temphone LIKE #{telphoneLike}
</if>
</if>
</where>
</where>
order by p.record_time desc
</select>
</select>
</mapper>
</mapper>
adc-da-main/src/main/resources/mybatis/mapper/znks/UserEOMapper.xml
View file @
80ca43b6
...
@@ -174,4 +174,12 @@
...
@@ -174,4 +174,12 @@
GROUP BY u.`id`
GROUP BY u.`id`
</select>
</select>
<update
id=
"updateHomeName"
parameterType=
"com.adc.da.znks.entity.User"
>
update tb_user set home_name = #{homeName} where temphone = #{temphone}
</update>
<select
id=
"selectHomeNameByPhone"
parameterType=
"java.util.Map"
resultType=
"com.adc.da.znks.entity.User"
>
select temphone,home_name homeName from tb_user where temphone = #{temphone}
</select>
</mapper>
</mapper>
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