Selaa lähdekoodia

开闸时间查询

LIVE_YE 10 kuukautta sitten
vanhempi
commit
0df29ed7a4

+ 20 - 1
ruoyi-system/src/main/java/com/ruoyi/system/domain/OpeningDoorRecord.java

@@ -38,7 +38,26 @@ public class OpeningDoorRecord extends BaseEntity
     @Excel(name = "创建部门")
     private Long createDept;
 
-    public void setRecordId(Long recordId) 
+    private String startTime;
+    private String endTime;
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public void setRecordId(Long recordId)
     {
         this.recordId = recordId;
     }

+ 9 - 1
ruoyi-system/src/main/resources/mapper/system/OpeningDoorRecordMapper.xml

@@ -26,10 +26,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectOpeningDoorRecordVo"/>
         <where>  
             <if test="entranceGuardName != null  and entranceGuardName != ''"> and entrance_guard_name like concat('%', #{entranceGuardName}, '%')</if>
-            <if test="controlsTime != null  and controlsTime != ''"> and controls_time = #{controlsTime}</if>
+            <if test="controlsTime != null  and controlsTime != ''">
+            AND date_format(controls_time,'%y%m%d') = date_format(#{controlsTime},'%y%m%d')
+            </if>
             <if test="type != null  and type != ''"> and type = #{type}</if>
             <if test="pictureUrl != null  and pictureUrl != ''"> and picture_url = #{pictureUrl}</if>
             <if test="createDept != null "> and create_dept = #{createDept}</if>
+            <if test="startTime != null and startTime != ''"><!-- 开始时间检索 -->
+                AND controls_time &gt;= #{startTime}
+            </if>
+            <if test="endTime != null and endTime != ''"><!-- 结束时间检索 -->
+                AND controls_time &lt;= #{endTime}
+            </if>
         </where>
     </select>