Commit 9a1c7460 by fz

1.v1.0.2 车钥匙分享功能接口添加定义,实体类,操作类定义

1 parent 58261a70
Showing 30 changed files with 1397 additions and 19 deletions
...@@ -6,7 +6,12 @@ import com.glsx.smart.service.AiLockingKeyService; ...@@ -6,7 +6,12 @@ import com.glsx.smart.service.AiLockingKeyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
/**
* @Title: ConditionController.java
* @Description: 提供给gop-accounts(车钥匙app)使用的接口
* @author fengzhi
* @version V1.0
*/
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/lockingKey") @RequestMapping("/lockingKey")
...@@ -14,6 +19,8 @@ public class AiLockingkeyController { ...@@ -14,6 +19,8 @@ public class AiLockingkeyController {
@Autowired @Autowired
private AiLockingKeyService aiLockingKeyService; private AiLockingKeyService aiLockingKeyService;
/************************车钥匙相关接口************************/
//sn查询/新增车钥匙 //sn查询/新增车钥匙
@GetMapping(value = "/get") @GetMapping(value = "/get")
public R getLockingKey(SmartCarKeyRequest request) { public R getLockingKey(SmartCarKeyRequest request) {
...@@ -34,7 +41,7 @@ public class AiLockingkeyController { ...@@ -34,7 +41,7 @@ public class AiLockingkeyController {
//智能车钥匙解绑 //智能车钥匙解绑
@PostMapping(value = "/remove") @PostMapping(value = "/remove")
public R removeLockingKey(@RequestBody SmartCarKeyRmRequest request) { public R removeLockingKey(@RequestBody SmartCarKeyRequest request) {
return aiLockingKeyService.removeLockingKey(request); return aiLockingKeyService.removeLockingKey(request);
} }
...@@ -67,4 +74,30 @@ public class AiLockingkeyController { ...@@ -67,4 +74,30 @@ public class AiLockingkeyController {
public R setLockingKeyAutoSense(@RequestBody SmartCarKeyAutoSenseRequest request) { public R setLockingKeyAutoSense(@RequestBody SmartCarKeyAutoSenseRequest request) {
return aiLockingKeyService.setLockingKeyAutoSense(request); return aiLockingKeyService.setLockingKeyAutoSense(request);
} }
//主车钥匙修改分享状态
@PostMapping(value = "/setAutoSense")
public R setPrimaryLockingKeyShareStatus(@RequestBody SmartCarKeyShareEditRequest request) {
return aiLockingKeyService.setPrimaryLockingKeyShareStatus(request);
}
/************************分享车钥匙相关接口************************/
//车钥匙分享令牌获取
@GetMapping(value = "/user/getAll")
public R getShareUrl(SmartCarKeyUserRequest request) {
return aiLockingKeyService.getShareUrl(request);
}
//智能车钥匙共享列表获取
@PostMapping(value = "/remove")
public R getShareKeyList(@RequestBody SmartCarKeyShareEditRequest request) {
return aiLockingKeyService.getShareKeyList(request);
}
//分享车钥匙设置修改分享状态
@PostMapping(value = "/saveRegisterInfo")
public R setShareLockingKeyShareStatus(@RequestBody SmartCarKeyRegisterRequest request) {
return aiLockingKeyService.setShareLockingKeyShareStatus(request);
}
} }
package com.glsx.smart.controller;
import com.glsx.plat.core.web.R;
import com.glsx.smart.pojo.request.SmartCarKeyUserRequest;
import com.glsx.smart.service.AiLockingKeyShareService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/share/lockingKey")
public class AiLockingkeyShareController {
@Autowired
private AiLockingKeyShareService aiLockingKeyShareService;
//通过令牌获取领取信息
@PostMapping(value = "/getByToken")
public R getShareKeyByToken(@RequestBody SmartCarKeyUserRequest request) {
return aiLockingKeyShareService.getShareKeyByToken(request);
}
//领取钥匙接口
@PostMapping(value = "/receive")
public R receiveKey(@RequestBody SmartCarKeyUserRequest request) {
return aiLockingKeyShareService.receiveKey(request);
}
//分享钥匙的操作日志
@PostMapping(value = "/logCommand")
public R logShareLockingKeyCommand(@RequestBody SmartCarKeyUserRequest request) {
return aiLockingKeyShareService.logShareLockingKeyCommand(request);
}
//todo 获取分享的钥匙信息
//删除共享钥匙
@PostMapping(value = "/removeShareKey")
public R removeShareKey(@RequestBody SmartCarKeyUserRequest request) {
return aiLockingKeyShareService.removeShareKey(request);
}
}
package com.glsx.smart.dao.entity; package com.glsx.smart.dao.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -13,6 +11,7 @@ import javax.persistence.GeneratedValue; ...@@ -13,6 +11,7 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
/** /**
* 智能车钥匙手机蓝牙感应状态表 * 智能车钥匙手机蓝牙感应状态表
......
package com.glsx.smart.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* 分享智能蓝牙车钥匙指令操作日志表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "smart_key_blue_sense")
public class SmartKeyCommandShareLog {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 分享车钥匙ID
*/
private Long shareCarKeyId;
/**
* 指令代码(1、开锁;2、关锁;3、开尾门;4、寻车;5、自动感应近;6、自动感应中;7、自动感应远;8、自动感应关)
*/
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; package com.glsx.smart.dao.entity;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import java.util.Date;
/** /**
* 智能蓝牙车钥匙表 * 智能蓝牙车钥匙表
...@@ -84,4 +85,14 @@ public class SmartVehicleBlueKey { ...@@ -84,4 +85,14 @@ public class SmartVehicleBlueKey {
* ios专用 * ios专用
*/ */
private String peripheralUuid; private String peripheralUuid;
private Integer autoSenseStatus;
private String mobileBlueMac;
/**
* 分享状态 0:打开 1:关闭
* 默认打开
*/
private Integer shareStatus;
} }
\ No newline at end of file \ No newline at end of file
...@@ -645,7 +645,6 @@ public class SmartVehicleBlueKeyExample { ...@@ -645,7 +645,6 @@ public class SmartVehicleBlueKeyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andIsDeleteIsNull() { public Criteria andIsDeleteIsNull() {
addCriterion("is_delete is null"); addCriterion("is_delete is null");
return (Criteria) this; return (Criteria) this;
...@@ -766,6 +765,75 @@ public class SmartVehicleBlueKeyExample { ...@@ -766,6 +765,75 @@ public class SmartVehicleBlueKeyExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andMobileCodeIsNull() {
addCriterion("mobile_code is null");
return (Criteria) this;
}
public Criteria andMobileCodeIsNotNull() {
addCriterion("mobile_code is not null");
return (Criteria) this;
}
public Criteria andMobileCodeEqualTo(String value) {
addCriterion("mobile_code =", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeNotEqualTo(String value) {
addCriterion("mobile_code <>", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeGreaterThan(String value) {
addCriterion("mobile_code >", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeGreaterThanOrEqualTo(String value) {
addCriterion("mobile_code >=", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeLessThan(String value) {
addCriterion("mobile_code <", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeLessThanOrEqualTo(String value) {
addCriterion("mobile_code <=", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeLike(String value) {
addCriterion("mobile_code like", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeNotLike(String value) {
addCriterion("mobile_code not like", value, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeIn(List<String> values) {
addCriterion("mobile_code in", values, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeNotIn(List<String> values) {
addCriterion("mobile_code not in", values, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeBetween(String value1, String value2) {
addCriterion("mobile_code between", value1, value2, "mobileCode");
return (Criteria) this;
}
public Criteria andMobileCodeNotBetween(String value1, String value2) {
addCriterion("mobile_code not between", value1, value2, "mobileCode");
return (Criteria) this;
}
public Criteria andPeripheralUuidIsNull() { public Criteria andPeripheralUuidIsNull() {
addCriterion("peripheral_uuid is null"); addCriterion("peripheral_uuid is null");
...@@ -836,6 +904,196 @@ public class SmartVehicleBlueKeyExample { ...@@ -836,6 +904,196 @@ public class SmartVehicleBlueKeyExample {
addCriterion("peripheral_uuid not between", value1, value2, "peripheralUuid"); addCriterion("peripheral_uuid not between", value1, value2, "peripheralUuid");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andAutoSenseStatusIsNull() {
addCriterion("auto_sense_status is null");
return (Criteria) this;
}
public Criteria andAutoSenseStatusIsNotNull() {
addCriterion("auto_sense_status is not null");
return (Criteria) this;
}
public Criteria andAutoSenseStatusEqualTo(Integer value) {
addCriterion("auto_sense_status =", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotEqualTo(Integer value) {
addCriterion("auto_sense_status <>", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusGreaterThan(Integer value) {
addCriterion("auto_sense_status >", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("auto_sense_status >=", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusLessThan(Integer value) {
addCriterion("auto_sense_status <", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusLessThanOrEqualTo(Integer value) {
addCriterion("auto_sense_status <=", value, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusIn(List<Integer> values) {
addCriterion("auto_sense_status in", values, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotIn(List<Integer> values) {
addCriterion("auto_sense_status not in", values, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusBetween(Integer value1, Integer value2) {
addCriterion("auto_sense_status between", value1, value2, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andAutoSenseStatusNotBetween(Integer value1, Integer value2) {
addCriterion("auto_sense_status not between", value1, value2, "autoSenseStatus");
return (Criteria) this;
}
public Criteria andMobileBlueMacIsNull() {
addCriterion("mobile_blue_mac is null");
return (Criteria) this;
}
public Criteria andMobileBlueMacIsNotNull() {
addCriterion("mobile_blue_mac is not null");
return (Criteria) this;
}
public Criteria andMobileBlueMacEqualTo(String value) {
addCriterion("mobile_blue_mac =", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacNotEqualTo(String value) {
addCriterion("mobile_blue_mac <>", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacGreaterThan(String value) {
addCriterion("mobile_blue_mac >", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacGreaterThanOrEqualTo(String value) {
addCriterion("mobile_blue_mac >=", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacLessThan(String value) {
addCriterion("mobile_blue_mac <", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacLessThanOrEqualTo(String value) {
addCriterion("mobile_blue_mac <=", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacLike(String value) {
addCriterion("mobile_blue_mac like", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacNotLike(String value) {
addCriterion("mobile_blue_mac not like", value, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacIn(List<String> values) {
addCriterion("mobile_blue_mac in", values, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacNotIn(List<String> values) {
addCriterion("mobile_blue_mac not in", values, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacBetween(String value1, String value2) {
addCriterion("mobile_blue_mac between", value1, value2, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andMobileBlueMacNotBetween(String value1, String value2) {
addCriterion("mobile_blue_mac not between", value1, value2, "mobileBlueMac");
return (Criteria) this;
}
public Criteria andShareStatusIsNull() {
addCriterion("share_status is null");
return (Criteria) this;
}
public Criteria andShareStatusIsNotNull() {
addCriterion("share_status is not null");
return (Criteria) this;
}
public Criteria andShareStatusEqualTo(Integer value) {
addCriterion("share_status =", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusNotEqualTo(Integer value) {
addCriterion("share_status <>", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusGreaterThan(Integer value) {
addCriterion("share_status >", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("share_status >=", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusLessThan(Integer value) {
addCriterion("share_status <", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusLessThanOrEqualTo(Integer value) {
addCriterion("share_status <=", value, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusIn(List<Integer> values) {
addCriterion("share_status in", values, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusNotIn(List<Integer> values) {
addCriterion("share_status not in", values, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusBetween(Integer value1, Integer value2) {
addCriterion("share_status between", value1, value2, "shareStatus");
return (Criteria) this;
}
public Criteria andShareStatusNotBetween(Integer value1, Integer value2) {
addCriterion("share_status not between", value1, value2, "shareStatus");
return (Criteria) this;
}
} }
public static class Criteria extends GeneratedCriteria { public static class Criteria extends GeneratedCriteria {
......
package com.glsx.smart.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
/**
* 分享智能蓝牙车钥匙表
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "smart_key_blue_sense")
public class SmartVehicleBlueShareKey {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
/**
* 车钥匙ID
*/
private Long carKeyId;
/**
* 令牌
*/
private String shareKeyToken;
/**
* 钥匙领取状态 0:未领取 1:已领取
*/
private Integer sharePickStatus;
/**
* 领取用户ID
*/
private Long pickUserId;
/**
* 领取时间
*/
@DateTimeFormat(pattern="yyyy/MM/dd HH:mm:ss")
@JsonFormat(
pattern = "yyyy-MM-dd HH:mm:ss",
timezone = "GMT+8"
)
private Date pickTime;
/**
* 分享状态 0:打开 1:关闭
*/
private Integer shareStatus;
}
\ No newline at end of file \ No newline at end of file
...@@ -2,9 +2,10 @@ package com.glsx.smart.dao.mapper; ...@@ -2,9 +2,10 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyBlueSense; import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample; import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SmartKeyBlueSenseMapper { public interface SmartKeyBlueSenseMapper {
long countByExample(SmartKeyBlueSenseExample example); long countByExample(SmartKeyBlueSenseExample example);
......
package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SmartKeyCommandShareLogMapper {
long countByExample(SmartKeyCommandShareLogExample example);
int deleteByExample(SmartKeyCommandShareLogExample example);
/**
* delete by primary key
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Long id);
/**
* insert record to table
* @param record the record
* @return insert count
*/
int insert(SmartKeyCommandShareLog record);
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int insertSelective(SmartKeyCommandShareLog record);
List<SmartKeyCommandShareLog> selectByExample(SmartKeyCommandShareLogExample example);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
SmartKeyCommandShareLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartKeyCommandShareLog record, @Param("example") SmartKeyCommandShareLogExample example);
int updateByExample(@Param("record") SmartKeyCommandShareLog record, @Param("example") SmartKeyCommandShareLogExample example);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(SmartKeyCommandShareLog record);
/**
* update record
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(SmartKeyCommandShareLog record);
}
\ No newline at end of file \ No newline at end of file
...@@ -2,12 +2,10 @@ package com.glsx.smart.dao.mapper; ...@@ -2,12 +2,10 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartVehicleBlueKey; import com.glsx.smart.dao.entity.SmartVehicleBlueKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample; import com.glsx.smart.dao.entity.SmartVehicleBlueKeyExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper import java.util.List;
public interface SmartVehicleBlueKeyMapper { public interface SmartVehicleBlueKeyMapper {
long countByExample(SmartVehicleBlueKeyExample example); long countByExample(SmartVehicleBlueKeyExample example);
......
package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SmartVehicleBlueShareKeyMapper {
long countByExample(SmartVehicleBlueShareKeyExample example);
int deleteByExample(SmartVehicleBlueShareKeyExample example);
/**
* delete by primary key
* @param id primaryKey
* @return deleteCount
*/
int deleteByPrimaryKey(Long id);
/**
* insert record to table
* @param record the record
* @return insert count
*/
int insert(SmartVehicleBlueShareKey record);
/**
* insert record to table selective
* @param record the record
* @return insert count
*/
int insertSelective(SmartVehicleBlueShareKey record);
List<SmartVehicleBlueShareKey> selectByExample(SmartVehicleBlueShareKeyExample example);
/**
* select by primary key
* @param id primary key
* @return object by primary key
*/
SmartVehicleBlueShareKey selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SmartVehicleBlueShareKey record, @Param("example") SmartVehicleBlueShareKeyExample example);
int updateByExample(@Param("record") SmartVehicleBlueShareKey record, @Param("example") SmartVehicleBlueShareKeyExample example);
/**
* update record selective
* @param record the updated record
* @return update count
*/
int updateByPrimaryKeySelective(SmartVehicleBlueShareKey record);
/**
* update record
* @param record the updated record
* @return update count
*/
int updateByPrimaryKey(SmartVehicleBlueShareKey record);
}
\ No newline at end of file \ No newline at end of file
...@@ -6,8 +6,14 @@ import lombok.Data; ...@@ -6,8 +6,14 @@ import lombok.Data;
* 智能车钥匙,解绑车钥匙接口 * 智能车钥匙,解绑车钥匙接口
*/ */
@Data @Data
public class SmartCarKeyRmRequest { public class SmartCarKeyShareEditRequest {
private String sn; private String sn;
private String userId; private String userId;
/**
* 分享状态 0:打开 1:关闭
* 默认打开
*/
private Integer shareStatus;
} }
...@@ -3,6 +3,7 @@ package com.glsx.smart.pojo.response; ...@@ -3,6 +3,7 @@ package com.glsx.smart.pojo.response;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
...@@ -73,4 +74,10 @@ public class SmartCarKeyResponse implements Serializable { ...@@ -73,4 +74,10 @@ public class SmartCarKeyResponse implements Serializable {
* ios专用 * ios专用
*/ */
private String peripheralUuid; private String peripheralUuid;
/**
* 分享状态 0:打开 1:关闭
* 默认打开
*/
private Integer shareStatus;
} }
...@@ -19,7 +19,7 @@ public interface AiLockingKeyService { ...@@ -19,7 +19,7 @@ public interface AiLockingKeyService {
/** /**
* 通过sn解绑车钥匙 * 通过sn解绑车钥匙
*/ */
R removeLockingKey(SmartCarKeyRmRequest request); R removeLockingKey(SmartCarKeyRequest request);
/** /**
* 车钥匙注册信息保存 * 车钥匙注册信息保存
...@@ -48,4 +48,11 @@ public interface AiLockingKeyService { ...@@ -48,4 +48,11 @@ public interface AiLockingKeyService {
R removeKeysByUser(SmartCarKeyUserRequest request); R removeKeysByUser(SmartCarKeyUserRequest request);
R setPrimaryLockingKeyShareStatus(SmartCarKeyShareEditRequest request);
R getShareUrl(SmartCarKeyUserRequest request);
R getShareKeyList(SmartCarKeyShareEditRequest request);
R setShareLockingKeyShareStatus(SmartCarKeyRegisterRequest request);
} }
package com.glsx.smart.service;
import com.glsx.plat.core.web.R;
import com.glsx.smart.pojo.request.SmartCarKeyUserRequest;
public interface AiLockingKeyShareService {
R getShareKeyByToken(SmartCarKeyUserRequest request);
R receiveKey(SmartCarKeyUserRequest request);
R logShareLockingKeyCommand(SmartCarKeyUserRequest request);
R removeShareKey(SmartCarKeyUserRequest request);
}
package com.glsx.smart.service; package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import com.glsx.smart.dao.entity.SmartKeyBlueSense; import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import java.util.List; import java.util.List;
public interface SmartKeyBlueSenseService { public interface SmartKeyBlueSenseService {
......
package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import java.util.List;
public interface SmartKeyCommandShareLogService{
long countByExample(SmartKeyCommandShareLogExample example);
int deleteByExample(SmartKeyCommandShareLogExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartKeyCommandShareLog record);
int insertSelective(SmartKeyCommandShareLog record);
List<SmartKeyCommandShareLog> selectByExample(SmartKeyCommandShareLogExample example);
SmartKeyCommandShareLog selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartKeyCommandShareLog record,SmartKeyCommandShareLogExample example);
int updateByExample(SmartKeyCommandShareLog record,SmartKeyCommandShareLogExample example);
int updateByPrimaryKeySelective(SmartKeyCommandShareLog record);
int updateByPrimaryKey(SmartKeyCommandShareLog record);
}
...@@ -36,3 +36,4 @@ public interface SmartVehicleBlueKeyService { ...@@ -36,3 +36,4 @@ public interface SmartVehicleBlueKeyService {
package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample;
import java.util.List;
public interface SmartVehicleBlueShareKeyService{
long countByExample(SmartVehicleBlueShareKeyExample example);
int deleteByExample(SmartVehicleBlueShareKeyExample example);
int deleteByPrimaryKey(Long id);
int insert(SmartVehicleBlueShareKey record);
int insertSelective(SmartVehicleBlueShareKey record);
List<SmartVehicleBlueShareKey> selectByExample(SmartVehicleBlueShareKeyExample example);
SmartVehicleBlueShareKey selectByPrimaryKey(Long id);
int updateByExampleSelective(SmartVehicleBlueShareKey record,SmartVehicleBlueShareKeyExample example);
int updateByExample(SmartVehicleBlueShareKey record,SmartVehicleBlueShareKeyExample example);
int updateByPrimaryKeySelective(SmartVehicleBlueShareKey record);
int updateByPrimaryKey(SmartVehicleBlueShareKey record);
}
...@@ -114,7 +114,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -114,7 +114,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
//智能车钥匙解绑 //智能车钥匙解绑
@Override @Override
public R removeLockingKey(SmartCarKeyRmRequest request) { public R removeLockingKey(SmartCarKeyRequest request) {
//逻辑删除蓝牙车钥匙设备 //逻辑删除蓝牙车钥匙设备
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey(); SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setIsDelete(1); smartVehicleBlueKey.setIsDelete(1);
...@@ -143,6 +143,34 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -143,6 +143,34 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
return R.ok(); return R.ok();
} }
//主车钥匙修改分享状态
@Override
public R setPrimaryLockingKeyShareStatus(SmartCarKeyShareEditRequest request) {
//逻辑删除蓝牙车钥匙设备
SmartVehicleBlueKey smartVehicleBlueKey = new SmartVehicleBlueKey();
smartVehicleBlueKey.setShareStatus(request.getShareStatus());
smartVehicleBlueKeyService.updateByExampleSelective(smartVehicleBlueKey, getBlueKeyExampleByUserAndSn(Long.valueOf(request.getUserId()), request.getSn()));
return R.ok();
}
//todo 车钥匙分享令牌获取
@Override
public R getShareUrl(SmartCarKeyUserRequest request) {
return null;
}
//todo 分享车钥匙列表获取
@Override
public R getShareKeyList(SmartCarKeyShareEditRequest request) {
return null;
}
//todo 分享车钥匙设置修改分享状态
@Override
public R setShareLockingKeyShareStatus(SmartCarKeyRegisterRequest request) {
return null;
}
//车钥匙操作指令上报 //车钥匙操作指令上报
@Override @Override
...@@ -481,6 +509,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -481,6 +509,8 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
SmartVehicleBlueKey newKey = new SmartVehicleBlueKey(); SmartVehicleBlueKey newKey = new SmartVehicleBlueKey();
newKey.setSn(sn); newKey.setSn(sn);
newKey.setUserId(userId); newKey.setUserId(userId);
//默认打开共享
newKey.setShareStatus(0);
//crep用明文存储 //crep用明文存储
newKey.setCrepCode(crep); newKey.setCrepCode(crep);
//默认密钥 //默认密钥
...@@ -495,6 +525,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -495,6 +525,7 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
newKey.setCreateTime(new Date()); newKey.setCreateTime(new Date());
//默认0,正常数据 //默认0,正常数据
newKey.setIsDelete(0); newKey.setIsDelete(0);
newKey.setPeripheralUuid(""); newKey.setPeripheralUuid("");
try { try {
//保存车钥匙 //保存车钥匙
......
package com.glsx.smart.service.impl;
import com.glsx.plat.core.web.R;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKey;
import com.glsx.smart.pojo.request.SmartCarKeyUserRequest;
import com.glsx.smart.service.AiLockingKeyShareService;
import com.glsx.smart.service.SmartKeyCommandShareLogService;
import com.glsx.smart.service.SmartVehicleBlueShareKeyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>Description:智能车钥匙service
* <p>Project: chejia-smart
*
* @author fengzhi
* @date 2021-04-19
*/
@Service
@Slf4j
public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
@Autowired
private SmartKeyCommandShareLogService shareLogService;
@Autowired
private SmartVehicleBlueShareKeyService shareKeyService;
//todo 通过令牌获取领取信息
@Override
public R getShareKeyByToken(SmartCarKeyUserRequest request) {
return null;
}
//todo 领取钥匙接口
@Override
public R receiveKey(SmartCarKeyUserRequest request) {
return null;
}
//todo 分享钥匙的操作日志
@Override
public R logShareLockingKeyCommand(SmartCarKeyUserRequest request) {
return null;
}
//todo 获取分享的钥匙信息
//todo 删除共享钥匙
@Override
public R removeShareKey(SmartCarKeyUserRequest request) {
SmartVehicleBlueShareKey shareBlueKey = new SmartVehicleBlueShareKey();
//分享状态关闭
shareBlueKey.setShareStatus(1);
//shareKeyService.updateByExampleSelective(shareBlueKey, getShareKeyExampleByUserAndSn(Long.valueOf(request.getUserId()), request.getSn()));
return R.ok();
}
}
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import com.glsx.smart.dao.entity.SmartKeyBlueSense; import com.glsx.smart.dao.entity.SmartKeyBlueSense;
import java.util.List; import com.glsx.smart.dao.entity.SmartKeyBlueSenseExample;
import com.glsx.smart.dao.mapper.SmartKeyBlueSenseMapper; import com.glsx.smart.dao.mapper.SmartKeyBlueSenseMapper;
import com.glsx.smart.service.SmartKeyBlueSenseService; import com.glsx.smart.service.SmartKeyBlueSenseService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service @Service
public class SmartKeyBlueSenseServiceImpl implements SmartKeyBlueSenseService { public class SmartKeyBlueSenseServiceImpl implements SmartKeyBlueSenseService {
......
package com.glsx.smart.service.impl;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import com.glsx.smart.dao.mapper.SmartKeyCommandShareLogMapper;
import com.glsx.smart.service.SmartKeyCommandShareLogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SmartKeyCommandShareLogServiceImpl implements SmartKeyCommandShareLogService{
@Resource
private SmartKeyCommandShareLogMapper smartKeyCommandShareLogMapper;
@Override
public long countByExample(SmartKeyCommandShareLogExample example) {
return smartKeyCommandShareLogMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartKeyCommandShareLogExample example) {
return smartKeyCommandShareLogMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartKeyCommandShareLogMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartKeyCommandShareLog record) {
return smartKeyCommandShareLogMapper.insert(record);
}
@Override
public int insertSelective(SmartKeyCommandShareLog record) {
return smartKeyCommandShareLogMapper.insertSelective(record);
}
@Override
public List<SmartKeyCommandShareLog> selectByExample(SmartKeyCommandShareLogExample example) {
return smartKeyCommandShareLogMapper.selectByExample(example);
}
@Override
public SmartKeyCommandShareLog selectByPrimaryKey(Long id) {
return smartKeyCommandShareLogMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartKeyCommandShareLog record,SmartKeyCommandShareLogExample example) {
return smartKeyCommandShareLogMapper.updateByExampleSelective(record,example);
}
@Override
public int updateByExample(SmartKeyCommandShareLog record,SmartKeyCommandShareLogExample example) {
return smartKeyCommandShareLogMapper.updateByExample(record,example);
}
@Override
public int updateByPrimaryKeySelective(SmartKeyCommandShareLog record) {
return smartKeyCommandShareLogMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartKeyCommandShareLog record) {
return smartKeyCommandShareLogMapper.updateByPrimaryKey(record);
}
}
...@@ -76,3 +76,4 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic ...@@ -76,3 +76,4 @@ public class SmartVehicleBlueKeyServiceImpl implements SmartVehicleBlueKeyServic
package com.glsx.smart.service.impl;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKey;
import com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample;
import com.glsx.smart.dao.mapper.SmartVehicleBlueShareKeyMapper;
import com.glsx.smart.service.SmartVehicleBlueShareKeyService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
@Service
public class SmartVehicleBlueShareKeyServiceImpl implements SmartVehicleBlueShareKeyService{
@Resource
private SmartVehicleBlueShareKeyMapper smartVehicleBlueShareKeyMapper;
@Override
public long countByExample(SmartVehicleBlueShareKeyExample example) {
return smartVehicleBlueShareKeyMapper.countByExample(example);
}
@Override
public int deleteByExample(SmartVehicleBlueShareKeyExample example) {
return smartVehicleBlueShareKeyMapper.deleteByExample(example);
}
@Override
public int deleteByPrimaryKey(Long id) {
return smartVehicleBlueShareKeyMapper.deleteByPrimaryKey(id);
}
@Override
public int insert(SmartVehicleBlueShareKey record) {
return smartVehicleBlueShareKeyMapper.insert(record);
}
@Override
public int insertSelective(SmartVehicleBlueShareKey record) {
return smartVehicleBlueShareKeyMapper.insertSelective(record);
}
@Override
public List<SmartVehicleBlueShareKey> selectByExample(SmartVehicleBlueShareKeyExample example) {
return smartVehicleBlueShareKeyMapper.selectByExample(example);
}
@Override
public SmartVehicleBlueShareKey selectByPrimaryKey(Long id) {
return smartVehicleBlueShareKeyMapper.selectByPrimaryKey(id);
}
@Override
public int updateByExampleSelective(SmartVehicleBlueShareKey record,SmartVehicleBlueShareKeyExample example) {
return smartVehicleBlueShareKeyMapper.updateByExampleSelective(record,example);
}
@Override
public int updateByExample(SmartVehicleBlueShareKey record,SmartVehicleBlueShareKeyExample example) {
return smartVehicleBlueShareKeyMapper.updateByExample(record,example);
}
@Override
public int updateByPrimaryKeySelective(SmartVehicleBlueShareKey record) {
return smartVehicleBlueShareKeyMapper.updateByPrimaryKeySelective(record);
}
@Override
public int updateByPrimaryKey(SmartVehicleBlueShareKey record) {
return smartVehicleBlueShareKeyMapper.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.SmartKeyCommandShareLogMapper">
<resultMap id="BaseResultMap" type="com.glsx.smart.dao.entity.SmartKeyCommandShareLog">
<!--@mbg.generated-->
<!--@Table smart_key_command_share_log-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="share_car_key_id" jdbcType="BIGINT" property="shareCarKeyId" />
<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>
<!-- <when test="criterion.listValue">-->
<!-- and ${criterion.condition}-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- #{listItem}-->
<!-- </foreach>-->
<!-- </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>
<!-- <when test="criterion.listValue">-->
<!-- and ${criterion.condition}-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- #{listItem}-->
<!-- </foreach>-->
<!-- </when>-->
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, share_car_key_id, key_command, create_time
</sql>
<select id="selectByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from smart_key_command_share_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 smart_key_command_share_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from smart_key_command_share_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample">
<!--@mbg.generated-->
delete from smart_key_command_share_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.SmartKeyCommandShareLog" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into smart_key_command_share_log (share_car_key_id, key_command, create_time
)
values (#{shareCarKeyId,jdbcType=BIGINT}, #{keyCommand,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandShareLog" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into smart_key_command_share_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="shareCarKeyId != null">
share_car_key_id,
</if>
<if test="keyCommand != null">
key_command,
</if>
<if test="createTime != null">
create_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="shareCarKeyId != null">
#{shareCarKeyId,jdbcType=BIGINT},
</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.SmartKeyCommandShareLogExample" resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from smart_key_command_share_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--@mbg.generated-->
update smart_key_command_share_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.shareCarKeyId != null">
share_car_key_id = #{record.shareCarKeyId,jdbcType=BIGINT},
</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 smart_key_command_share_log
set id = #{record.id,jdbcType=BIGINT},
share_car_key_id = #{record.shareCarKeyId,jdbcType=BIGINT},
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.SmartKeyCommandShareLog">
<!--@mbg.generated-->
update smart_key_command_share_log
<set>
<if test="shareCarKeyId != null">
share_car_key_id = #{shareCarKeyId,jdbcType=BIGINT},
</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.SmartKeyCommandShareLog">
<!--@mbg.generated-->
update smart_key_command_share_log
set share_car_key_id = #{shareCarKeyId,jdbcType=BIGINT},
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
<?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.SmartVehicleBlueShareKeyMapper">
<resultMap id="BaseResultMap" type="com.glsx.smart.dao.entity.SmartVehicleBlueShareKey">
<!--@mbg.generated-->
<!--@Table smart_vehicle_blue_share_key-->
<id column="id" jdbcType="BIGINT" property="id" />
<result column="car_key_id" jdbcType="BIGINT" property="carKeyId" />
<result column="share_key_token" jdbcType="VARCHAR" property="shareKeyToken" />
<result column="share_pick_status" jdbcType="TINYINT" property="sharePickStatus" />
<result column="pick_user_id" jdbcType="BIGINT" property="pickUserId" />
<result column="pick_time" jdbcType="TIMESTAMP" property="pickTime" />
<result column="share_status" jdbcType="TINYINT" property="shareStatus" />
</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>
<!-- <when test="criterion.listValue">-->
<!-- and ${criterion.condition}-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- #{listItem}-->
<!-- </foreach>-->
<!-- </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>
<!-- <when test="criterion.listValue">-->
<!-- and ${criterion.condition}-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- #{listItem}-->
<!-- </foreach>-->
<!-- </when>-->
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--@mbg.generated-->
id, car_key_id, share_key_token, share_pick_status, pick_user_id, pick_time, share_status
</sql>
<select id="selectByExample" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample" resultMap="BaseResultMap">
<!--@mbg.generated-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from smart_vehicle_blue_share_key
<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 smart_vehicle_blue_share_key
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from smart_vehicle_blue_share_key
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample">
<!--@mbg.generated-->
delete from smart_vehicle_blue_share_key
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKey" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into smart_vehicle_blue_share_key (car_key_id, share_key_token, share_pick_status,
pick_user_id, pick_time, share_status
)
values (#{carKeyId,jdbcType=BIGINT}, #{shareKeyToken,jdbcType=VARCHAR}, #{sharePickStatus,jdbcType=TINYINT},
#{pickUserId,jdbcType=BIGINT}, #{pickTime,jdbcType=TIMESTAMP}, #{shareStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKey" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into smart_vehicle_blue_share_key
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="carKeyId != null">
car_key_id,
</if>
<if test="shareKeyToken != null">
share_key_token,
</if>
<if test="sharePickStatus != null">
share_pick_status,
</if>
<if test="pickUserId != null">
pick_user_id,
</if>
<if test="pickTime != null">
pick_time,
</if>
<if test="shareStatus != null">
share_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="carKeyId != null">
#{carKeyId,jdbcType=BIGINT},
</if>
<if test="shareKeyToken != null">
#{shareKeyToken,jdbcType=VARCHAR},
</if>
<if test="sharePickStatus != null">
#{sharePickStatus,jdbcType=TINYINT},
</if>
<if test="pickUserId != null">
#{pickUserId,jdbcType=BIGINT},
</if>
<if test="pickTime != null">
#{pickTime,jdbcType=TIMESTAMP},
</if>
<if test="shareStatus != null">
#{shareStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKeyExample" resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from smart_vehicle_blue_share_key
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--@mbg.generated-->
update smart_vehicle_blue_share_key
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.carKeyId != null">
car_key_id = #{record.carKeyId,jdbcType=BIGINT},
</if>
<if test="record.shareKeyToken != null">
share_key_token = #{record.shareKeyToken,jdbcType=VARCHAR},
</if>
<if test="record.sharePickStatus != null">
share_pick_status = #{record.sharePickStatus,jdbcType=TINYINT},
</if>
<if test="record.pickUserId != null">
pick_user_id = #{record.pickUserId,jdbcType=BIGINT},
</if>
<if test="record.pickTime != null">
pick_time = #{record.pickTime,jdbcType=TIMESTAMP},
</if>
<if test="record.shareStatus != null">
share_status = #{record.shareStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--@mbg.generated-->
update smart_vehicle_blue_share_key
set id = #{record.id,jdbcType=BIGINT},
car_key_id = #{record.carKeyId,jdbcType=BIGINT},
share_key_token = #{record.shareKeyToken,jdbcType=VARCHAR},
share_pick_status = #{record.sharePickStatus,jdbcType=TINYINT},
pick_user_id = #{record.pickUserId,jdbcType=BIGINT},
pick_time = #{record.pickTime,jdbcType=TIMESTAMP},
share_status = #{record.shareStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKey">
<!--@mbg.generated-->
update smart_vehicle_blue_share_key
<set>
<if test="carKeyId != null">
car_key_id = #{carKeyId,jdbcType=BIGINT},
</if>
<if test="shareKeyToken != null">
share_key_token = #{shareKeyToken,jdbcType=VARCHAR},
</if>
<if test="sharePickStatus != null">
share_pick_status = #{sharePickStatus,jdbcType=TINYINT},
</if>
<if test="pickUserId != null">
pick_user_id = #{pickUserId,jdbcType=BIGINT},
</if>
<if test="pickTime != null">
pick_time = #{pickTime,jdbcType=TIMESTAMP},
</if>
<if test="shareStatus != null">
share_status = #{shareStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.smart.dao.entity.SmartVehicleBlueShareKey">
<!--@mbg.generated-->
update smart_vehicle_blue_share_key
set car_key_id = #{carKeyId,jdbcType=BIGINT},
share_key_token = #{shareKeyToken,jdbcType=VARCHAR},
share_pick_status = #{sharePickStatus,jdbcType=TINYINT},
pick_user_id = #{pickUserId,jdbcType=BIGINT},
pick_time = #{pickTime,jdbcType=TIMESTAMP},
share_status = #{shareStatus,jdbcType=TINYINT}
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!