Browse Source

日志查询

WXF 2 years ago
parent
commit
05fd5706ca

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

@@ -19,9 +19,9 @@ public class LogPageParam extends PageVO {
     //操作内容
     private String content;
     //操作时间起
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Timestamp createTimeBegin;
     //操作时间止
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
     private Timestamp createTimeEnd;
 }

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

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