Bladeren bron

日志查询

WXF 2 jaren geleden
bovenliggende
commit
3dfb6e2585

+ 4 - 6
api-common/src/main/java/api/common/pojo/param/log/LogPageParam.java

@@ -1,9 +1,7 @@
 package api.common.pojo.param.log;
 
 import api.common.pojo.common.PageVO;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
-import java.sql.Timestamp;
 
 @Data
 public class LogPageParam extends PageVO {
@@ -19,9 +17,9 @@ public class LogPageParam extends PageVO {
     //操作内容
     private String content;
     //操作时间起
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
-    private Timestamp createTimeBegin;
+    //@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
+    private String createTimeBegin;
     //操作时间止
-    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
-    private Timestamp createTimeEnd;
+    //@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
+    private String createTimeEnd;
 }

+ 2 - 2
simulation-resource-server/src/main/java/com/css/simulation/resource/model/service/VehicleService.java

@@ -10,7 +10,7 @@ import api.common.util.StringUtil;
 import com.css.simulation.resource.common.utils.AuthUtil;
 import com.css.simulation.resource.common.utils.PoUtil;
 import com.css.simulation.resource.model.mapper.VehicleMapper;
-import com.sun.deploy.util.StringUtils;
+import org.apache.tomcat.util.buf.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -51,7 +51,7 @@ public class VehicleService {
         ObjectUtil.voToPo(vehicleVO,vehiclePO);
         //车辆模型字段解析
         String[] vehicleType = vehicleVO.getVehicleType();
-        String vehicleTypeStr = StringUtils.join(Arrays.asList(vehicleType),",");
+        String vehicleTypeStr = StringUtils.join(Arrays.asList(vehicleType),',');
         vehiclePO.setVehicleType(vehicleTypeStr);
         //常规字段赋值
         PoUtil.initAddPo(vehiclePO);

+ 12 - 12
simulation-resource-server/src/main/resources/mapper/log/LogMapper.xml

@@ -34,11 +34,11 @@
         <if test="username != null and username != ''">
             and username like CONCAT('%',#{username,jdbcType=VARCHAR},'%')
         </if>
-        <if test="createTimeBegin != null">
-            and DATE(create_time) &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and DATE(create_time) &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>
@@ -63,11 +63,11 @@
         <if test="operationType != null and operationType != ''">
             and operation_type = #{operationType,jdbcType=VARCHAR}
         </if>
-        <if test="createTimeBegin != null">
-            and DATE(create_time) &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and DATE(create_time) &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>
@@ -96,11 +96,11 @@
         <if test="content != null and content != ''">
             and content like CONCAT('%',#{content,jdbcType=VARCHAR},'%')
         </if>
-        <if test="createTimeBegin != null">
-            and DATE(create_time) &gt;= #{createTimeBegin,jdbcType=TIMESTAMP}
+        <if test="createTimeBegin != null and createTimeBegin != ''">
+            and DATE(create_time) &gt;= #{createTimeBegin}
         </if>
-        <if test="createTimeEnd != null">
-            and DATE(create_time) &lt;= #{createTimeEnd,jdbcType=TIMESTAMP}
+        <if test="createTimeEnd != null and createTimeBegin != ''">
+            and DATE(create_time) &lt;= #{createTimeEnd}
         </if>
         ORDER BY create_time DESC
     </select>