Commit 7c1d0eeb by fz

1.添加主钥匙,分享钥匙批量上报指令日志接口

1 parent 0c1a6d49
package com.glsx.smart.controller; package com.glsx.smart.controller;
import com.glsx.cloudframework.core.util.Assert;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import com.glsx.smart.pojo.request.*; import com.glsx.smart.pojo.request.*;
import com.glsx.smart.service.AiLockingKeyService; import com.glsx.smart.service.AiLockingKeyService;
...@@ -94,6 +95,12 @@ public class AiLockingkeyController { ...@@ -94,6 +95,12 @@ public class AiLockingkeyController {
return aiLockingKeyService.LogLockingKeyCommand(request); return aiLockingKeyService.LogLockingKeyCommand(request);
} }
//车钥匙操作指令批量上报
@PostMapping(value = "/batchLogCommand")
public R batchLogCommand(@RequestBody SmartCarKeyActionLogBatchRequest request) {
return aiLockingKeyService.batchLogCommand(request);
}
//车钥匙修改昵称 //车钥匙修改昵称
@PostMapping(value = "/setName") @PostMapping(value = "/setName")
public R setLockingKeyName(@RequestBody SmartCarKeyNameRequest request) { public R setLockingKeyName(@RequestBody SmartCarKeyNameRequest request) {
......
...@@ -44,6 +44,12 @@ public class AiLockingkeyShareController { ...@@ -44,6 +44,12 @@ public class AiLockingkeyShareController {
return aiLockingKeyShareService.logShareLockingKeyCommand(request); return aiLockingKeyShareService.logShareLockingKeyCommand(request);
} }
//车钥匙操作指令批量上报
@PostMapping(value = "/batchLogCommand")
public R batchLogCommand(@RequestBody SmartCarKeyShareActionLogBatchRequest request) {
return aiLockingKeyShareService.batchLogCommand(request);
}
//获取分享的钥匙信息 //获取分享的钥匙信息
@GetMapping(value = "/getKey") @GetMapping(value = "/getKey")
public R getShareLockingKey(@RequestParam(value="keyId") String keyId) { public R getShareLockingKey(@RequestParam(value="keyId") String keyId) {
......
...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper; ...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyCommandLog; import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
import com.glsx.smart.pojo.request.SmartCarKeyCommandRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -30,4 +31,6 @@ public interface SmartKeyCommandLogMapper { ...@@ -30,4 +31,6 @@ public interface SmartKeyCommandLogMapper {
int updateByPrimaryKeySelective(SmartKeyCommandLog record); int updateByPrimaryKeySelective(SmartKeyCommandLog record);
int updateByPrimaryKey(SmartKeyCommandLog record); int updateByPrimaryKey(SmartKeyCommandLog record);
int insertBatch(@Param("lockingkeyActLogList")List<SmartCarKeyCommandRequest> lockingkeyActLogList);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper; ...@@ -2,6 +2,7 @@ package com.glsx.smart.dao.mapper;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog; import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -60,4 +61,6 @@ public interface SmartKeyCommandShareLogMapper { ...@@ -60,4 +61,6 @@ public interface SmartKeyCommandShareLogMapper {
* @return update count * @return update count
*/ */
int updateByPrimaryKey(SmartKeyCommandShareLog record); int updateByPrimaryKey(SmartKeyCommandShareLog record);
int insertBatch(@Param("lockingkeyActLogList")List<SmartCarKeyShareLogRequest> lockingkeyActLogList);
} }
\ No newline at end of file \ No newline at end of file
package com.glsx.smart.pojo.request;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author fengzhi
* @version 1.0.0
* @ClassName LockingkeyShareIdRequest.java
* @description: 分享的数字钥匙操作
* @createTime 2021年05月02日 09:59:00
*/
@Data
public class SmartCarKeyActionLogBatchRequest {
/**
* 批量上报的日志
*/
@NotBlank
private String actLogList;
@NotBlank
private String userId;
}
package com.glsx.smart.pojo.request;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @author fengzhi
* @version 1.0.0
* @ClassName LockingkeyShareIdRequest.java
* @description: 分享的数字钥匙操作
* @createTime 2021年05月02日 09:59:00
*/
@Data
public class SmartCarKeyShareActionLogBatchRequest {
/**
* 批量上报的日志
*/
@NotBlank
private String actLogList;
}
...@@ -53,4 +53,6 @@ public interface AiLockingKeyService { ...@@ -53,4 +53,6 @@ public interface AiLockingKeyService {
R getShareToken(SmartCarKeyTokenRequest request); R getShareToken(SmartCarKeyTokenRequest request);
R getShareKeyList(SmartShareCarKeyPageRequest request); R getShareKeyList(SmartShareCarKeyPageRequest request);
R batchLogCommand(SmartCarKeyActionLogBatchRequest request);
} }
package com.glsx.smart.service; package com.glsx.smart.service;
import com.glsx.plat.core.web.R; import com.glsx.plat.core.web.R;
import com.glsx.smart.pojo.request.SmartCarKeyReceiveRequest; import com.glsx.smart.pojo.request.*;
import com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest;
import com.glsx.smart.pojo.request.SmartShareKeyEditReq;
public interface AiLockingKeyShareService { public interface AiLockingKeyShareService {
...@@ -20,4 +18,6 @@ public interface AiLockingKeyShareService { ...@@ -20,4 +18,6 @@ public interface AiLockingKeyShareService {
R isTokenValid(String token); R isTokenValid(String token);
R getShareKeyListByUser(Long userId); R getShareKeyListByUser(Long userId);
R batchLogCommand(SmartCarKeyShareActionLogBatchRequest request);
} }
...@@ -2,6 +2,7 @@ package com.glsx.smart.service; ...@@ -2,6 +2,7 @@ package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyCommandLog; import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
import com.glsx.smart.pojo.request.SmartCarKeyCommandRequest;
import java.util.List; import java.util.List;
...@@ -30,6 +31,7 @@ public interface SmartKeyCommandLogService { ...@@ -30,6 +31,7 @@ public interface SmartKeyCommandLogService {
int updateByPrimaryKey(SmartKeyCommandLog record); int updateByPrimaryKey(SmartKeyCommandLog record);
int insertBatch(List<SmartCarKeyCommandRequest> lockingkeyActLogList);
} }
......
...@@ -2,6 +2,7 @@ package com.glsx.smart.service; ...@@ -2,6 +2,7 @@ package com.glsx.smart.service;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog; import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest;
import java.util.List; import java.util.List;
public interface SmartKeyCommandShareLogService{ public interface SmartKeyCommandShareLogService{
...@@ -29,4 +30,5 @@ public interface SmartKeyCommandShareLogService{ ...@@ -29,4 +30,5 @@ public interface SmartKeyCommandShareLogService{
int updateByPrimaryKey(SmartKeyCommandShareLog record); int updateByPrimaryKey(SmartKeyCommandShareLog record);
int insertBatch(List<SmartCarKeyShareLogRequest> lockingkeyActLogList);
} }
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.common.utils.StringUtils;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -184,6 +185,25 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -184,6 +185,25 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
return R.ok(); return R.ok();
} }
//车钥匙操作指令批量上报
@Override
public R batchLogCommand(SmartCarKeyActionLogBatchRequest request) {
String userId = request.getUserId();
String actLogList = request.getActLogList();
List<SmartCarKeyCommandRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, SmartCarKeyCommandRequest.class);
if (CollectionUtils.isEmpty(lockingkeyActLogList)) {
return R.ok();
}
lockingkeyActLogList.stream().forEach(key->key.setUserId(userId));
int count = smartKeyCommandLogService.insertBatch(lockingkeyActLogList);
return R.ok().data(count);
}
//车钥匙修改昵称 //车钥匙修改昵称
@Override @Override
public R setLockingKeyName(SmartCarKeyNameRequest request) { public R setLockingKeyName(SmartCarKeyNameRequest request) {
...@@ -707,4 +727,6 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService { ...@@ -707,4 +727,6 @@ public class AiLockingKeyServiceImpl implements AiLockingKeyService {
return R.ok().data(PageInfo.of(shareKeyList)); return R.ok().data(PageInfo.of(shareKeyList));
} }
} }
package com.glsx.smart.service.impl; package com.glsx.smart.service.impl;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.nacos.common.utils.StringUtils; import com.alibaba.nacos.common.utils.StringUtils;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
...@@ -8,9 +9,7 @@ import com.glsx.plat.core.web.R; ...@@ -8,9 +9,7 @@ import com.glsx.plat.core.web.R;
import com.glsx.smart.dao.entity.*; import com.glsx.smart.dao.entity.*;
import com.glsx.smart.exception.BusinessException; import com.glsx.smart.exception.BusinessException;
import com.glsx.smart.exception.ResultEnum; import com.glsx.smart.exception.ResultEnum;
import com.glsx.smart.pojo.request.SmartCarKeyReceiveRequest; import com.glsx.smart.pojo.request.*;
import com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest;
import com.glsx.smart.pojo.request.SmartShareKeyEditReq;
import com.glsx.smart.redis.RedisService; import com.glsx.smart.redis.RedisService;
import com.glsx.smart.service.AiLockingKeyShareService; import com.glsx.smart.service.AiLockingKeyShareService;
import com.glsx.smart.service.SmartKeyCommandShareLogService; import com.glsx.smart.service.SmartKeyCommandShareLogService;
...@@ -169,6 +168,21 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService { ...@@ -169,6 +168,21 @@ public class AiLockingKeyShareServiceImpl implements AiLockingKeyShareService {
return R.ok(); return R.ok();
} }
//分享钥匙操作日志批量上报
@Override
public R batchLogCommand(SmartCarKeyShareActionLogBatchRequest request) {
String actLogList = request.getActLogList();
List<SmartCarKeyShareLogRequest> lockingkeyActLogList = JSONArray.parseArray(actLogList, SmartCarKeyShareLogRequest.class);
if (CollectionUtils.isEmpty(lockingkeyActLogList)) {
return R.ok().data(0);
}
int count = shareLogService.insertBatch(lockingkeyActLogList);
return R.ok().data(count);
}
//删除共享钥匙 //删除共享钥匙
@Override @Override
......
...@@ -3,6 +3,7 @@ package com.glsx.smart.service.impl; ...@@ -3,6 +3,7 @@ package com.glsx.smart.service.impl;
import com.glsx.smart.dao.entity.SmartKeyCommandLog; import com.glsx.smart.dao.entity.SmartKeyCommandLog;
import com.glsx.smart.dao.entity.SmartKeyCommandLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandLogExample;
import com.glsx.smart.dao.mapper.SmartKeyCommandLogMapper; import com.glsx.smart.dao.mapper.SmartKeyCommandLogMapper;
import com.glsx.smart.pojo.request.SmartCarKeyCommandRequest;
import com.glsx.smart.service.SmartKeyCommandLogService; import com.glsx.smart.service.SmartKeyCommandLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -70,6 +71,11 @@ public class SmartKeyCommandLogServiceImpl implements SmartKeyCommandLogService ...@@ -70,6 +71,11 @@ public class SmartKeyCommandLogServiceImpl implements SmartKeyCommandLogService
return smartKeyCommandLogMapper.updateByPrimaryKey(record); return smartKeyCommandLogMapper.updateByPrimaryKey(record);
} }
@Override
public int insertBatch(List<SmartCarKeyCommandRequest> lockingkeyActLogList) {
return smartKeyCommandLogMapper.insertBatch(lockingkeyActLogList);
}
} }
......
...@@ -3,6 +3,7 @@ package com.glsx.smart.service.impl; ...@@ -3,6 +3,7 @@ package com.glsx.smart.service.impl;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLog; import com.glsx.smart.dao.entity.SmartKeyCommandShareLog;
import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample; import com.glsx.smart.dao.entity.SmartKeyCommandShareLogExample;
import com.glsx.smart.dao.mapper.SmartKeyCommandShareLogMapper; import com.glsx.smart.dao.mapper.SmartKeyCommandShareLogMapper;
import com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest;
import com.glsx.smart.service.SmartKeyCommandShareLogService; import com.glsx.smart.service.SmartKeyCommandShareLogService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -69,4 +70,9 @@ public class SmartKeyCommandShareLogServiceImpl implements SmartKeyCommandShareL ...@@ -69,4 +70,9 @@ public class SmartKeyCommandShareLogServiceImpl implements SmartKeyCommandShareL
return smartKeyCommandShareLogMapper.updateByPrimaryKey(record); return smartKeyCommandShareLogMapper.updateByPrimaryKey(record);
} }
@Override
public int insertBatch(List<SmartCarKeyShareLogRequest> lockingkeyActLogList) {
return smartKeyCommandShareLogMapper.insertBatch(lockingkeyActLogList);
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!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"> <mapper namespace="com.glsx.smart.dao.mapper.SmartKeyCommandLogMapper">
<resultMap id="BaseResultMap" type="com.glsx.smart.dao.entity.SmartKeyCommandLog"> <resultMap id="BaseResultMap" type="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated--> <!--@mbg.generated-->
<!--@Table cyb_os.smart_key_command_log--> <!--@Table cyb_os.smart_key_command_log-->
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id"/>
<result column="user_id" jdbcType="BIGINT" property="userId" /> <result column="user_id" jdbcType="BIGINT" property="userId"/>
<result column="crep_code" jdbcType="VARCHAR" property="crepCode" /> <result column="crep_code" jdbcType="VARCHAR" property="crepCode"/>
<result column="key_command" jdbcType="VARCHAR" property="keyCommand" /> <result column="key_command" jdbcType="VARCHAR" property="keyCommand"/>
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<!--@mbg.generated--> <!--@mbg.generated-->
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid"> <if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")"> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion"> <foreach collection="criteria.criteria" item="criterion">
<choose> <choose>
<when test="criterion.noValue"> <when test="criterion.noValue">
and ${criterion.condition} and ${criterion.condition}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.betweenValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<!-- <when test="criterion.listValue">--> <!-- <when test="criterion.listValue">-->
<!-- and ${criterion.condition}--> <!-- and ${criterion.condition}-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">--> <!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- #{listItem}--> <!-- #{listItem}-->
<!-- </foreach>--> <!-- </foreach>-->
<!-- </when>--> <!-- </when>-->
</choose> </choose>
</foreach>
</trim>
</if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Update_By_Example_Where_Clause">
</where> <!--@mbg.generated-->
</sql> <where>
<sql id="Update_By_Example_Where_Clause"> <foreach collection="example.oredCriteria" item="criteria" separator="or">
<!--@mbg.generated--> <if test="criteria.valid">
<where> <trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="example.oredCriteria" item="criteria" separator="or"> <foreach collection="criteria.criteria" item="criterion">
<if test="criteria.valid"> <choose>
<trim prefix="(" prefixOverrides="and" suffix=")"> <when test="criterion.noValue">
<foreach collection="criteria.criteria" item="criterion"> and ${criterion.condition}
<choose> </when>
<when test="criterion.noValue"> <when test="criterion.singleValue">
and ${criterion.condition} and ${criterion.condition} #{criterion.value}
</when> </when>
<when test="criterion.singleValue"> <when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when> </when>
<when test="criterion.betweenValue"> <!-- <when test="criterion.listValue">-->
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} <!-- and ${criterion.condition}-->
</when> <!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">-->
<!-- <when test="criterion.listValue">--> <!-- #{listItem}-->
<!-- and ${criterion.condition}--> <!-- </foreach>-->
<!-- <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">--> <!-- </when>-->
<!-- #{listItem}--> </choose>
<!-- </foreach>--> </foreach>
<!-- </when>--> </trim>
</choose> </if>
</foreach> </foreach>
</trim> </where>
</if> </sql>
</foreach> <sql id="Base_Column_List">
</where> <!--@mbg.generated-->
</sql> id, user_id, crep_code, key_command, create_time
<sql id="Base_Column_List"> </sql>
<!--@mbg.generated--> <select id="selectByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample"
id, user_id, crep_code, key_command, create_time resultMap="BaseResultMap">
</sql> <!--@mbg.generated-->
<select id="selectByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample" resultMap="BaseResultMap">
<!--@mbg.generated-->
select select
<if test="distinct">
<if test="distinct">
distinct distinct
</if>
<include refid="Base_Column_List" /> </if>
<include refid="Base_Column_List"/>
from cyb_os.smart_key_command_log from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
<if test="orderByClause != null"> </if>
<if test="orderByClause != null">
order by ${orderByClause} order by ${orderByClause}
</if>
</select> </if>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap"> </select>
<!--@mbg.generated--> <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
<!--@mbg.generated-->
select select
<include refid="Base_Column_List" />
<include refid="Base_Column_List"/>
from cyb_os.smart_key_command_log from cyb_os.smart_key_command_log
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> </select>
<!--@mbg.generated--> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
<!--@mbg.generated-->
delete from cyb_os.smart_key_command_log delete from cyb_os.smart_key_command_log
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample"> </delete>
<!--@mbg.generated--> <delete id="deleteByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample">
<!--@mbg.generated-->
delete from cyb_os.smart_key_command_log delete from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
</delete> </if>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog" useGeneratedKeys="true"> </delete>
<!--@mbg.generated--> <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_code, key_command, insert into cyb_os.smart_key_command_log (user_id, crep_code, key_command,
create_time) create_time)
values (#{userId,jdbcType=BIGINT}, #{crepCode,jdbcType=VARCHAR}, #{keyCommand,jdbcType=VARCHAR}, values (#{userId,jdbcType=BIGINT}, #{crepCode,jdbcType=VARCHAR}, #{keyCommand,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog" useGeneratedKeys="true"> </insert>
<!--@mbg.generated--> <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 insert into cyb_os.smart_key_command_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="userId != null"> <trim prefix="(" suffix=")" suffixOverrides=",">
user_id, <if test="userId != null">
</if> user_id,
<if test="crepCode != null">
</if>
<if test="crepCode != null">
crep_code, crep_code,
</if>
<if test="keyCommand != null"> </if>
<if test="keyCommand != null">
key_command, key_command,
</if>
<if test="createTime != null"> </if>
<if test="createTime != null">
create_time, create_time,
</if> </if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="userId != null"> <if test="userId != null">
#{userId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT},
</if>
<if test="crepCode != null"> </if>
<if test="crepCode != null">
#{crepCode,jdbcType=VARCHAR}, #{crepCode,jdbcType=VARCHAR},
</if>
<if test="keyCommand != null"> </if>
<if test="keyCommand != null">
#{keyCommand,jdbcType=VARCHAR}, #{keyCommand,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> </if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP},
</if> </if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLogExample"
<!--@mbg.generated--> resultType="java.lang.Long">
<!--@mbg.generated-->
select count(*) from cyb_os.smart_key_command_log select count(*) from cyb_os.smart_key_command_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Example_Where_Clause"/>
</select> </if>
<update id="updateByExampleSelective" parameterType="map"> </select>
<!--@mbg.generated--> <update id="updateByExampleSelective" parameterType="map">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log update cyb_os.smart_key_command_log
<set>
<if test="record.id != null"> <set>
id = #{record.id,jdbcType=BIGINT}, <if test="record.id != null">
</if> id = #{record.id,jdbcType=BIGINT},
<if test="record.userId != null">
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.crepCode != null"> </if>
<if test="record.crepCode != null">
crep_code = #{record.crepCode,jdbcType=VARCHAR}, crep_code = #{record.crepCode,jdbcType=VARCHAR},
</if>
<if test="record.keyCommand != null"> </if>
<if test="record.keyCommand != null">
key_command = #{record.keyCommand,jdbcType=VARCHAR}, key_command = #{record.keyCommand,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> </if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if> </if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause"/>
</if> </if>
</update> </update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
<!--@mbg.generated--> <!--@mbg.generated-->
update cyb_os.smart_key_command_log update cyb_os.smart_key_command_log
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT}, user_id = #{record.userId,jdbcType=BIGINT},
crep_code = #{record.crepCode,jdbcType=VARCHAR}, crep_code = #{record.crepCode,jdbcType=VARCHAR},
key_command = #{record.keyCommand,jdbcType=VARCHAR}, key_command = #{record.keyCommand,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP} create_time = #{record.createTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <if test="_parameter != null">
</if> <include refid="Update_By_Example_Where_Clause"/>
</update> </if>
<update id="updateByPrimaryKeySelective" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog"> </update>
<!--@mbg.generated--> <update id="updateByPrimaryKeySelective" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log update cyb_os.smart_key_command_log
<set>
<if test="userId != null"> <set>
user_id = #{userId,jdbcType=BIGINT}, <if test="userId != null">
</if> user_id = #{userId,jdbcType=BIGINT},
<if test="crepCode != null">
</if>
<if test="crepCode != null">
crep_code = #{crepCode,jdbcType=VARCHAR}, crep_code = #{crepCode,jdbcType=VARCHAR},
</if>
<if test="keyCommand != null"> </if>
<if test="keyCommand != null">
key_command = #{keyCommand,jdbcType=VARCHAR}, key_command = #{keyCommand,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> </if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
</if> </if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog"> </update>
<!--@mbg.generated--> <update id="updateByPrimaryKey" parameterType="com.glsx.smart.dao.entity.SmartKeyCommandLog">
<!--@mbg.generated-->
update cyb_os.smart_key_command_log update cyb_os.smart_key_command_log
set user_id = #{userId,jdbcType=BIGINT}, set user_id = #{userId,jdbcType=BIGINT},
crep_code = #{crepCode,jdbcType=VARCHAR}, crep_code = #{crepCode,jdbcType=VARCHAR},
key_command = #{keyCommand,jdbcType=VARCHAR}, key_command = #{keyCommand,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update>
</update>
<insert id="insertBatch" parameterType="com.glsx.smart.pojo.request.SmartCarKeyCommandRequest">
INSERT INTO `smart_key_command_log` (`user_id`, `crep_code`, `key_command`, `create_time`)
VALUES
<foreach collection="lockingkeyActLogList" item="keyActLog" separator=",">
(#{keyActLog.userId,jdbcType=BIGINT},#{keyActLog.crepCode,jdbcType=VARCHAR},#{keyActLog.keyCommand,jdbcType=VARCHAR},#{keyActLog.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -203,4 +203,12 @@ ...@@ -203,4 +203,12 @@
create_time = #{createTime,jdbcType=TIMESTAMP} create_time = #{createTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<insert id="insertBatch" parameterType="com.glsx.smart.pojo.request.SmartCarKeyShareLogRequest">
INSERT INTO `smart_key_command_share_log` (`share_car_key_id`, `key_command`, `create_time`)
VALUES
<foreach collection="lockingkeyActLogList" item="keyActLog" separator=",">
(#{keyActLog.shareKeyId,jdbcType=BIGINT},#{keyActLog.keyCommand,jdbcType=VARCHAR},#{keyActLog.createTime,jdbcType=TIMESTAMP})
</foreach>
</insert>
</mapper> </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!