Przeglądaj źródła

添加时间处理

yq 4 lat temu
rodzic
commit
fccf6e83f4

+ 9 - 0
fiveep-persistence/src/main/java/com/bizmatics/persistence/mapper/HtAnalogDataMapper.java

@@ -1,5 +1,8 @@
 package com.bizmatics.persistence.mapper;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.bizmatics.model.AlarmPower;
 import com.bizmatics.model.HtAnalogData;
 import com.bizmatics.common.mvc.base.CrudMapper;
 import org.apache.ibatis.annotations.Param;
@@ -41,4 +44,10 @@ public interface HtAnalogDataMapper extends CrudMapper<HtAnalogData> {
     List<HtAnalogData> list(@Param("startTime") Date startTime,
                             @Param("endTime") Date endTime,
                             @Param("deviceCode") String deviceCode);
+
+
+    Page<HtAnalogData> page(IPage<HtAnalogData> page,
+                          @Param("startTime") Date startTime,
+                          @Param("endTime") Date endTime,
+                            @Param("id") Integer id);
 }

+ 2 - 2
fiveep-persistence/src/main/resources/mapper/mysql/AlarmPowerMapper.xml

@@ -68,10 +68,10 @@
                 and ap.handling_status = #{handlingStatus}
             </if>
             <if test="startTime != null">
-                and ap.soe_time = #{startTime}
+                and ap.soe_time >= #{startTime}
             </if>
             <if test="endTime != null">
-                and ap.soe_time = #{endTime}
+                and ap.soe_time &lt;= #{endTime}
             </if>
         </where>
     </select>

+ 12 - 0
fiveep-persistence/src/main/resources/mapper/mysql/HtAnalogDataMapper.xml

@@ -73,5 +73,17 @@
             </if>
         </where>
     </select>
+    <select id="page" resultType="com.bizmatics.model.HtAnalogData">
+        select *
+        from ht_analog_data
+        <where>
+            <if test="siteId != null and siteId != 0">
+                and d.site_id = #{siteId}
+            </if>
+            <if test="endTime != null and startTime != null">
+                and dataTime BETWEEN #{startTime} and #{endTime}
+            </if>
+        </where>
+    </select>
 
 </mapper>

+ 18 - 0
fiveep-service/src/main/java/com/bizmatics/service/job/RatAnalogTask.java

@@ -0,0 +1,18 @@
+package com.bizmatics.service.job;
+
+import com.bizmatics.persistence.mapper.HtAnalogDataMapper;
+import com.bizmatics.persistence.mapper.RtAnalogDataMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author yq
+ * @date 2021/7/17 19:41
+ */
+@Service
+public class RatAnalogTask {
+
+
+    @Autowired
+    private HtAnalogDataMapper htAnalogDataMapper;
+}