Commit a996076c by 周海宝

Merge branch 'dev' into 'master'

Dev

See merge request !1
2 parents 9c20994c 57636643
Showing 24 changed files with 1238 additions and 0 deletions
package com.glsx.smart.controller;
import com.glsx.smart.pojo.request.*;
import com.glsx.smart.pojo.response.SmartCarKeyOpreateResponse;
import com.glsx.smart.pojo.response.SmartCarKeyResponse;
import com.glsx.smart.service.AiLockingKeyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Slf4j
@RestController
@RequestMapping("/lockingKey")
public class AiLockingkeyController {
@Autowired
private AiLockingKeyService aiLockingKeyService;
//sn查询/新增车钥匙
@ResponseBody
@PostMapping(value = "/get")
public SmartCarKeyResponse getLockingKey(SmartCarKeyRequest request) {
return aiLockingKeyService.getLockingKey(request);
}
//智能车钥匙解绑
@ResponseBody
@PostMapping(value = "/remove")
public SmartCarKeyOpreateResponse removeLockingKey(SmartCarKeyRmRequest request) {
return aiLockingKeyService.removeLockingKey(request);
}
//智能车钥匙注册成功后的数据保存
@ResponseBody
@PostMapping(value = "/saveRegisterInfo")
public SmartCarKeyOpreateResponse saveLockingKeyRegisterInfo(SmartCarKeyRegisterRequest request) {
return aiLockingKeyService.saveLockingKeyRegisterInfo(request);
}
//车钥匙操作指令上报
@ResponseBody
@PostMapping(value = "/logCommand")
public SmartCarKeyOpreateResponse LogLockingKeyCommand(SmartCarKeyCommandRequest request) {
return aiLockingKeyService.LogLockingKeyCommand(request);
}
//车钥匙修改昵称
@ResponseBody
@PostMapping(value = "/setName")
public SmartCarKeyOpreateResponse setLockingKeyName(SmartCarKeyNameRequest request) {
return aiLockingKeyService.setLockingKeyName(request);
}
//车钥匙修改自动感应
@ResponseBody
@PostMapping(value = "/setAutoSense")
public SmartCarKeyOpreateResponse setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest request) {
return aiLockingKeyService.setLockingKeyAutoSense(request);
}
}
package com.glsx.smart.dao.entity;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* 智能蓝牙车钥匙指令操作日志表
*/
@Data
@Table(name = "smart_key_command_log")
public class SmartKeyCommandLog implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 平台生成的唯一CREP信息(密文)
*/
private String crep;
/**
* 指令代码
*/
private String keyCommand;
/**
* 创建时间
*/
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
}
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.dao.entity;
import java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* 智能蓝牙车钥匙表
*/
@Data
public class SmartVehicleBlueKey implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 智能车钥匙设备号
*/
private String sn;
/**
* 平台生成的唯一CREP信息(密文)
*/
private String crepCode;
/**
* 注册成功后生成的密钥(密文)
*/
private String secretKey;
/**
* 手机蓝牙的MAC地址
*/
private String mobileBlueMac;
/**
* 智能车钥匙MAC地址
*/
private String smartLockMac;
/**
* 车牌号
*/
private String carNumber;
/**
* 昵称
*/
private String keyName;
/**
* 自动感应状态 0:关 1:开
*/
private Integer autoSenseStatus;
/**
* 逻辑删除 0:正常 1:删除
*/
private Integer isDelete;
/**
* 创建时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
}
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SmartKeyCommandLogMapper {
long countByExample(SmartKeyCommandLogExample example);
int deleteByExample(SmartKeyCommandLogExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartKeyCommandLog record);
int insertSelective(SmartKeyCommandLog record);
List<SmartKeyCommandLog> selectByExample(SmartKeyCommandLogExample example);
SmartKeyCommandLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartKeyCommandLog record, @Param("example") SmartKeyCommandLogExample example);
int updateByExample(@Param("record") SmartKeyCommandLog record, @Param("example") SmartKeyCommandLogExample example);
int updateByPrimaryKeySelective(SmartKeyCommandLog record);
int updateByPrimaryKey(SmartKeyCommandLog record);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SmartVehicleBlueKeyMapper {
long countByExample(SmartVehicleBlueKeyExample example);
int deleteByExample(SmartVehicleBlueKeyExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartVehicleBlueKey record);
int insertSelective(SmartVehicleBlueKey record);
List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example);
SmartVehicleBlueKey selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example);
int updateByExample(@Param("record") SmartVehicleBlueKey record, @Param("example") SmartVehicleBlueKeyExample example);
int updateByPrimaryKeySelective(SmartVehicleBlueKey record);
int updateByPrimaryKey(SmartVehicleBlueKey record);
}
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,自动感应状态
*/
public class SmartCarKeyAutoSenseRequest{
//智能车钥匙自动感应状态
private Integer autoSenseStatus;
private String crep;
private Long userId;
public Integer getAutoSenseStatus() {
return autoSenseStatus;
}
public void setAutoSenseStatus(Integer autoSenseStatus) {
this.autoSenseStatus = autoSenseStatus;
}
public String getCrep() {
return crep;
}
public void setCrep(String crep) {
this.crep = crep;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyAutoSenseRequest{" +
"autoSenseStatus=" + autoSenseStatus +
", crep='" + crep + '\'' +
", userId=" + userId +
'}';
}
}
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,指令上报
*/
public class SmartCarKeyCommandRequest{
//平台生成的唯一CREP信息
private String crepCode;
//指令代码
//1、开锁;2、关锁;3、开尾门;4、寻车;5、自动感应近;
// 6、自动感应中;7、自动感应远;8、自动感应关
private String keyCommond;
//用户id
private Long userId;
public String getCrepCode() {
return crepCode;
}
public void setCrepCode(String crepCode) {
this.crepCode = crepCode;
}
public String getKeyCommond() {
return keyCommond;
}
public void setKeyCommond(String keyCommond) {
this.keyCommond = keyCommond;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyCommandRequest{" +
"crepCode='" + crepCode + '\'' +
", keyCommond='" + keyCommond + '\'' +
", userId=" + userId +
'}';
}
}
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,昵称
*/
public class SmartCarKeyNameRequest{
//昵称
private String name;
private String crep;
private Long userId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCrep() {
return crep;
}
public void setCrep(String crep) {
this.crep = crep;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyNameRequest{" +
"name='" + name + '\'' +
", crep='" + crep + '\'' +
", userId=" + userId +
'}';
}
}
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,注册信息保存
*/
public class SmartCarKeyRegisterRequest{
//手机蓝牙的MAC地址
private String mobileMac;
//平台生成的唯一CREP信息
private String crepCode;
//注册成功后生成的密钥
private String keyLock;
//智能车钥匙MAC地址
private String smartLockMac;
private Long userId;
public String getMobileMac() {
return mobileMac;
}
public void setMobileMac(String mobileMac) {
this.mobileMac = mobileMac;
}
public String getCrepCode() {
return crepCode;
}
public void setCrepCode(String crepCode) {
this.crepCode = crepCode;
}
public String getKeyLock() {
return keyLock;
}
public void setKeyLock(String keyLock) {
this.keyLock = keyLock;
}
public String getSmartLockMac() {
return smartLockMac;
}
public void setSmartLockMac(String smartLockMac) {
this.smartLockMac = smartLockMac;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyRegisterRequest{" +
"mobileMac='" + mobileMac + '\'' +
", crepCode='" + crepCode + '\'' +
", keyLock='" + keyLock + '\'' +
", smartLockMac='" + smartLockMac + '\'' +
", userId=" + userId +
'}';
}
}
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,查询车钥匙和生成crep接口
*/
public class SmartCarKeyRequest{
private String sn;
private Long userId;
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyRequest{" +
"sn='" + sn + '\'' +
", userId='" + userId + '\'' +
'}';
}
}
package com.glsx.smart.pojo.request;
/**
* 智能车钥匙,查询车钥匙和生成crep接口
*/
public class SmartCarKeyRmRequest {
private String crep;
private Long userId;
public String getCrep() {
return crep;
}
public void setCrep(String crep) {
this.crep = crep;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
@Override
public String toString() {
return "SmartCarKeyRmRequest{" +
"crep='" + crep + '\'' +
", userId='" + userId + '\'' +
'}';
}
}
package com.glsx.smart.pojo.response;
import java.io.Serializable;
public class SmartCarKeyOpreateResponse implements Serializable {
private boolean isSuccess;
public boolean isSuccess() {
return isSuccess;
}
public void setSuccess(boolean success) {
isSuccess = success;
}
@Override
public String toString() {
return "SmartCarKeyOpreateResponse{" +
"isSuccess=" + isSuccess +
'}';
}
}
package com.glsx.smart.pojo.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
@Data
public class SmartCarKeyResponse implements Serializable {
private Long id;
/**
* 用户ID
*/
private Long userId;
/**
* 智能车钥匙设备号
*/
private String sn;
/**
* 平台生成的唯一CREP信息(密文)
*/
private String crepCode;
/**
* 注册成功后生成的密钥(密文)
*/
private String secretKey;
/**
* 手机蓝牙的MAC地址
*/
private String mobileBlueMac;
/**
* 智能车钥匙MAC地址
*/
private String smartLockMac;
/**
* 车牌号
*/
private String carNumber;
/**
* 昵称
*/
private String keyName;
/**
* 自动感应状态 0:关 1:开
*/
private Integer autoSenseStatus;
/**
* 创建时间
*/
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date createTime;
}
package com.glsx.smart.service;
import com.glsx.smart.pojo.request.*;
import com.glsx.smart.pojo.response.SmartCarKeyOpreateResponse;
import com.glsx.smart.pojo.response.SmartCarKeyResponse;
/**
* <p>Description:智能车钥匙接口
* <p>Project: chejia-smart
*
* @author fenbgzhi
* @date 2021-04-19
*/
public interface AiLockingKeyService {
/**
* 通过sn获取车钥匙
*/
SmartCarKeyResponse getLockingKey(SmartCarKeyRequest request);
/**
* 通过sn解绑车钥匙
*/
SmartCarKeyOpreateResponse removeLockingKey(SmartCarKeyRmRequest request);
/**
* 车钥匙注册信息保存
*/
SmartCarKeyOpreateResponse saveLockingKeyRegisterInfo(SmartCarKeyRegisterRequest registerSaveRequest);
/**
* 车钥匙指令上报
*/
SmartCarKeyOpreateResponse LogLockingKeyCommand(SmartCarKeyCommandRequest carKeyCommandRequest);
/**
* 修改车钥匙昵称
*/
SmartCarKeyOpreateResponse setLockingKeyName(SmartCarKeyNameRequest name);
/**
* 修改车钥匙自动感应状态
*/
SmartCarKeyOpreateResponse setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest autoSenseStatus);
}
package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import java.util.List;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
public interface SmartKeyCommandLogService {
long countByExample(SmartKeyCommandLogExample example);
int deleteByExample(SmartKeyCommandLogExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartKeyCommandLog record);
int insertSelective(SmartKeyCommandLog record);
List<SmartKeyCommandLog> selectByExample(SmartKeyCommandLogExample example);
SmartKeyCommandLog selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartKeyCommandLog record, SmartKeyCommandLogExample example);
int updateByExample(SmartKeyCommandLog record, SmartKeyCommandLogExample example);
int updateByPrimaryKeySelective(SmartKeyCommandLog record);
int updateByPrimaryKey(SmartKeyCommandLog record);
}
package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import java.util.List;
public interface SmartVehicleBlueKeyService {
long countByExample(SmartVehicleBlueKeyExample example);
int deleteByExample(SmartVehicleBlueKeyExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartVehicleBlueKey record);
int insertSelective(SmartVehicleBlueKey record);
List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example);
SmartVehicleBlueKey selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example);
int updateByExample(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example);
int updateByPrimaryKeySelective(SmartVehicleBlueKey record);
int updateByPrimaryKey(SmartVehicleBlueKey record);
}
package com.glsx.smart.service.impl;
import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.common.utils.StringUtils;
import com.glsx.plat.common.utils.SnowFlake;
import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import com.glsx.smart.pojo.request.*;
import com.glsx.smart.pojo.response.SmartCarKeyOpreateResponse;
import com.glsx.smart.pojo.response.SmartCarKeyResponse;
import com.glsx.smart.service.AiLockingKeyService;
import com.glsx.smart.service.SmartKeyCommandLogService;
import com.glsx.smart.service.SmartVehicleBlueKeyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* <p>Description:智能车钥匙service
* <p>Project: chejia-smart
*
* @author fengzhi
* @date 2021-04-19
*/
@Service
@Slf4j
public class AiLockingKeyServiceImpl implements AiLockingKeyService {
@Autowired
private SmartKeyCommandLogService smartKeyCommandLogService;
@Autowired
private SmartVehicleBlueKeyService smartVehicleBlueKeyService;
//sn查询/新增车钥匙
@Override
public SmartCarKeyResponse getLockingKey(SmartCarKeyRequest request) {
SmartCarKeyResponse response = new SmartCarKeyResponse();
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria().andUserIdEqualTo(request.getUserId()).andSnEqualTo(request.getSn()).andIsDeleteEqualTo(0);
List<SmartVehicleBlueKey> smartVehicleBlueKeys = smartVehicleBlueKeyService.selectByExample(example);
if(CollectionUtils.isEmpty(smartVehicleBlueKeys)){
//如果sn,userid没有数据,生成只含有crep钥匙信息返回
SmartVehicleBlueKey newKey = new SmartVehicleBlueKey();
//todo 雪花算法生成crep,对称加密
long id = SnowFlake.nextId();
long userId = request.getUserId();
newKey.setCrepCode("");
newKey.setCreateTime(new Date());
smartVehicleBlueKeyService.insert(newKey);
BeanUtils.copyProperties(newKey,response);
return response;
}else {
SmartVehicleBlueKey carkey = smartVehicleBlueKeys.get(0);
String crepCode = carkey.getCrepCode();
if(StringUtils.isNotEmpty(crepCode)){
//如果sn,userid有对应的crep,返回钥匙信息
BeanUtils.copyProperties(carkey,response);
return response;
}else {
//如果sn,userid没有对应的crep。生成只含有crep钥匙信息返回
carkey.setCrepCode(request.getSn());
carkey.setCreateTime(new Date());
smartVehicleBlueKeyService.updateByPrimaryKey(carkey);
BeanUtils.copyProperties(carkey,response);
return response;
}
}
}
//智能车钥匙解绑
@Override
public SmartCarKeyOpreateResponse removeLockingKey(SmartCarKeyRmRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setIsDelete(1);
int conut = smartVehicleBlueKeyService.updateByExample(smartVehicleBlueKey, getExample(request.getUserId(), request.getCrep()));
return getOpreateResponse(conut);
}
//车钥匙操作指令上报
@Override
public SmartCarKeyOpreateResponse LogLockingKeyCommand(SmartCarKeyCommandRequest carKeyCommandRequest) {
SmartKeyCommandLog log = new SmartKeyCommandLog();
log.setUserId(carKeyCommandRequest.getUserId());
log.setCrep(carKeyCommandRequest.getCrepCode());
log.setKeyCommand(carKeyCommandRequest.getKeyCommond());
log.setCreateTime(new Date());
int conut = smartKeyCommandLogService.insert(log);
return getOpreateResponse(conut);
}
//车钥匙修改昵称
@Override
public SmartCarKeyOpreateResponse setLockingKeyName(SmartCarKeyNameRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setKeyName(request.getName());
int conut = smartVehicleBlueKeyService.updateByExample(smartVehicleBlueKey, getExample(request.getUserId(), request.getCrep()));
return getOpreateResponse(conut);
}
//车钥匙修改自动感应
@Override
public SmartCarKeyOpreateResponse setLockingKeyAutoSense(SmartCarKeyAutoSenseRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setAutoSenseStatus(request.getAutoSenseStatus());
int conut = smartVehicleBlueKeyService.updateByExample(smartVehicleBlueKey, getExample(request.getUserId(), request.getCrep()));
return getOpreateResponse(conut);
}
//智能车钥匙注册成功后的数据保存
@Override
public SmartCarKeyOpreateResponse saveLockingKeyRegisterInfo(SmartCarKeyRegisterRequest request) {
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setMobileBlueMac(request.getMobileMac());
smartVehicleBlueKey.setSmartLockMac(request.getSmartLockMac());
smartVehicleBlueKey.setSecretKey(request.getKeyLock());
int conut = smartVehicleBlueKeyService.updateByExample(smartVehicleBlueKey, getExample(request.getUserId(), request.getCrepCode()));
return getOpreateResponse(conut);
}
//查询车钥匙example,根据用户ID和crep查
private SmartVehicleBlueKeyExample getExample(Long userId, String crep) {
SmartVehicleBlueKeyExample example = new SmartVehicleBlueKeyExample();
example.createCriteria().andUserIdEqualTo(userId).andCrepCodeEqualTo(crep).andIsDeleteEqualTo(0);
return example;
}
private SmartCarKeyOpreateResponse getOpreateResponse(int conut) {
SmartCarKeyOpreateResponse response = new SmartCarKeyOpreateResponse();
response.setSuccess(conut > 0);
return response;
}
}
package com.glsx.smart.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import java.util.List;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
import com.glsx.smart.dao.mapper.SmartKeyCommandLogMapper;
import com.glsx.smart.service.SmartKeyCommandLogService;
@Service
public class SmartKeyCommandLogServiceImpl implements SmartKeyCommandLogService {
@Resource
private SmartKeyCommandLogMapper smartKeyCommandLogMapper;
@Override
public long countByExample(SmartKeyCommandLogExample example) {
return smartKeyCommandLogMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartKeyCommandLogExample example) {
return smartKeyCommandLogMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartKeyCommandLogMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartKeyCommandLog record) {
return smartKeyCommandLogMapper.insert(record);
}
@Override
public int insertSelective(SmartKeyCommandLog record) {
return smartKeyCommandLogMapper.insertSelective(record);
}
@Override
public List<SmartKeyCommandLog> selectByExample(SmartKeyCommandLogExample example) {
return smartKeyCommandLogMapper.selectByExample(example);
}
@Override
public SmartKeyCommandLog selectByPrimaryKey(Long id) {
return smartKeyCommandLogMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartKeyCommandLog record, SmartKeyCommandLogExample example) {
return smartKeyCommandLogMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartKeyCommandLog record, SmartKeyCommandLogExample example) {
return smartKeyCommandLogMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartKeyCommandLog record) {
return smartKeyCommandLogMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartKeyCommandLog record) {
return smartKeyCommandLogMapper.updateByPrimaryKey(record);
}
}
...@@ -357,7 +357,9 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ ...@@ -357,7 +357,9 @@ public class SmartSceneServiceImpl extends BaseService implements SmartSceneServ
} }
} }
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
log.info("下发通知异常{}",e);
} }
} }
} }
......
package com.glsx.smart.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import java.util.List;
import com.glsx.smart.dao.mapper.SmartVehicleBlueKeyMapper;
import com.glsx.smart.service.SmartVehicleBlueKeyService;
@Service
public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyService {
@Resource
private SmartVehicleBlueKeyMapper smartVehicleBlueKeyMapper;
@Override
public long countByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartVehicleBlueKeyMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.insert(record);
}
@Override
public int insertSelective(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.insertSelective(record);
}
@Override
public List<SmartVehicleBlueKey> selectByExample(SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.selectByExample(example);
}
@Override
public SmartVehicleBlueKey selectByPrimaryKey(Long id) {
return smartVehicleBlueKeyMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.updateByExampleSelective(record, example);
}
@Override
public int updateByExample(SmartVehicleBlueKey record, SmartVehicleBlueKeyExample example) {
return smartVehicleBlueKeyMapper.updateByExample(record, example);
}
@Override
public int updateByPrimaryKeySelective(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartVehicleBlueKey record) {
return smartVehicleBlueKeyMapper.updateByPrimaryKey(record);
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.glsx.smart.dao.mapper.SmartKeyCommandLogMapper">
<resultMap id="BaseResultMap" type="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated-->
<!--@Table cyb_os.smart_key_command_log-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="crep" jdbcType="VARCHAR" property="crep" />
<result column="key_command" jdbcType="VARCHAR" property="keyCommand" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
</resultMap>
<sql id="Example_Where_Clause">
<!--@mbg.generated-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--@mbg.generated-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, user_id, crep, key_command, create_time
</sql>
<select id="selectByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<include refid="Base_Column_List" />
from cyb_os.smart_key_command_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from cyb_os.smart_key_command_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample">
<!--@mbg.generated-->
delete from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into cyb_os.smart_key_command_log (user_id, crep, key_command,
create_time)
values (#{userId,jdbcType=BIGINT}, #{crep,jdbcType=VARCHAR}, #{keyCommand,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into cyb_os.smart_key_command_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null">
user_id,
</if>
<if test="crep != null">
crep,
</if>
<if test="keyCommand != null">
key_command,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="crep != null">
#{crep,jdbcType=VARCHAR},
</if>
<if test="keyCommand != null">
#{keyCommand,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample" resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.crep != null">
crep = #{record.crep,jdbcType=VARCHAR},
</if>
<if test="record.keyCommand != null">
key_command = #{record.keyCommand,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
crep = #{record.crep,jdbcType=VARCHAR},
key_command = #{record.keyCommand,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="crep != null">
crep = #{crep,jdbcType=VARCHAR},
</if>
<if test="keyCommand != null">
key_command = #{keyCommand,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log
set user_id = #{userId,jdbcType=BIGINT},
crep = #{crep,jdbcType=VARCHAR},
key_command = #{keyCommand,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!