From ccc0a99d6894844d83d751b924cfebe74da7826c Mon Sep 17 00:00:00 2001 From: ‘sxh’ <1632740646@qq.com> Date: 星期四, 15 六月 2023 11:20:43 +0800 Subject: [PATCH] 同步主线的代码,保持一致性 --- src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java | 19 +++++++++---------- 1 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java index 9716c75..ae8471b 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/LogMapper.java @@ -1,6 +1,5 @@ package com.genersoft.iot.vmp.storager.dao; -import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm; import com.genersoft.iot.vmp.storager.dao.dto.LogDto; import org.apache.ibatis.annotations.Delete; import org.apache.ibatis.annotations.Insert; @@ -17,21 +16,21 @@ @Repository public interface LogMapper { - @Insert("insert into log ( name, type, uri, address, result, timing, username, createTime) " + - "values ('${name}', '${type}', '${uri}', '${address}', '${result}', ${timing}, '${username}', '${createTime}')") + @Insert("insert into wvp_log ( name,type,uri,address,result,timing,username,create_time) " + + "values (#{name}, #{type}, #{uri}, #{address}, #{result}, #{timing}, #{username}, #{createTime})") int add(LogDto logDto); @Select(value = {"<script>" + - " SELECT * FROM log " + + " SELECT * FROM wvp_log " + " WHERE 1=1 " + - " <if test=\"query != null\"> AND (name LIKE '%${query}%')</if> " + - " <if test=\"type != null\" > AND type = '${type}'</if>" + - " <if test=\"startTime != null\" > AND createTime >= '${startTime}' </if>" + - " <if test=\"endTime != null\" > AND createTime <= '${endTime}' </if>" + - " ORDER BY createTime DESC " + + " <if test=\"query != null\"> AND (name LIKE concat('%',#{query},'%'))</if> " + + " <if test=\"type != null\" > AND type = #{type}</if>" + + " <if test=\"startTime != null\" > AND create_time >= #{startTime} </if>" + + " <if test=\"endTime != null\" > AND create_time <= #{endTime} </if>" + + " ORDER BY create_time DESC " + " </script>"}) List<LogDto> query(String query, String type, String startTime, String endTime); - @Delete("DELETE FROM log") + @Delete("DELETE FROM wvp_log") int clear(); } -- Gitblit v1.8.0