feat: 增加拍照时间表的最后时间

dev
huangfeng 2 days ago
parent f76d121f0c
commit 7fde9069c5

@ -2,6 +2,7 @@ package com.shxy.xymanager_common.entity;
import com.shxy.xymanager_common.dto.ScheduleDetailsDto; import com.shxy.xymanager_common.dto.ScheduleDetailsDto;
import java.util.Date;
import java.util.List; import java.util.List;
public class CameraSchedule { public class CameraSchedule {
@ -41,6 +42,15 @@ public class CameraSchedule {
*/ */
private Integer protocol; private Integer protocol;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column camera_schedule.update_time
*
* @mbg.generated
*/
private Date updateTime;
/** /**
* *
* This field was generated by MyBatis Generator. * This field was generated by MyBatis Generator.
@ -146,6 +156,30 @@ public class CameraSchedule {
this.protocol = protocol; this.protocol = protocol;
} }
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column camera_schedule.update_time
*
* @return the value of camera_schedule.update_time
*
* @mbg.generated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column camera_schedule.update_time
*
* @param updateTime the value for camera_schedule.update_time
*
* @mbg.generated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/** /**
* This method was generated by MyBatis Generator. * This method was generated by MyBatis Generator.
* This method returns the value of the database column camera_schedule.data * This method returns the value of the database column camera_schedule.data

@ -1,6 +1,7 @@
package com.shxy.xymanager_common.entity; package com.shxy.xymanager_common.entity;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class CameraScheduleExample { public class CameraScheduleExample {
@ -433,6 +434,66 @@ public class CameraScheduleExample {
addCriterion("protocol not between", value1, value2, "protocol"); addCriterion("protocol not between", value1, value2, "protocol");
return (Criteria) this; return (Criteria) this;
} }
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
} }
/** /**

@ -10,6 +10,7 @@
<result column="term_id" jdbcType="INTEGER" property="termId" /> <result column="term_id" jdbcType="INTEGER" property="termId" />
<result column="channel_id" jdbcType="INTEGER" property="channelId" /> <result column="channel_id" jdbcType="INTEGER" property="channelId" />
<result column="protocol" jdbcType="INTEGER" property="protocol" /> <result column="protocol" jdbcType="INTEGER" property="protocol" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.shxy.xymanager_common.entity.CameraSchedule"> <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.shxy.xymanager_common.entity.CameraSchedule">
<!-- <!--
@ -89,7 +90,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
--> -->
id, term_id, channel_id, protocol id, term_id, channel_id, protocol, update_time
</sql> </sql>
<sql id="Blob_Column_List"> <sql id="Blob_Column_List">
<!-- <!--
@ -175,9 +176,9 @@
SELECT LAST_INSERT_ID() SELECT LAST_INSERT_ID()
</selectKey> </selectKey>
insert into camera_schedule (term_id, channel_id, protocol, insert into camera_schedule (term_id, channel_id, protocol,
`data`) update_time, `data`)
values (#{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER}, values (#{termId,jdbcType=INTEGER}, #{channelId,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{data,jdbcType=LONGVARCHAR}) #{updateTime,jdbcType=TIMESTAMP}, #{data,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.CameraSchedule"> <insert id="insertSelective" parameterType="com.shxy.xymanager_common.entity.CameraSchedule">
<!-- <!--
@ -198,6 +199,9 @@
<if test="protocol != null"> <if test="protocol != null">
protocol, protocol,
</if> </if>
<if test="updateTime != null">
update_time,
</if>
<if test="data != null"> <if test="data != null">
`data`, `data`,
</if> </if>
@ -212,6 +216,9 @@
<if test="protocol != null"> <if test="protocol != null">
#{protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
</if> </if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="data != null"> <if test="data != null">
#{data,jdbcType=LONGVARCHAR}, #{data,jdbcType=LONGVARCHAR},
</if> </if>
@ -246,6 +253,9 @@
<if test="row.protocol != null"> <if test="row.protocol != null">
protocol = #{row.protocol,jdbcType=INTEGER}, protocol = #{row.protocol,jdbcType=INTEGER},
</if> </if>
<if test="row.updateTime != null">
update_time = #{row.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="row.data != null"> <if test="row.data != null">
`data` = #{row.data,jdbcType=LONGVARCHAR}, `data` = #{row.data,jdbcType=LONGVARCHAR},
</if> </if>
@ -264,6 +274,7 @@
term_id = #{row.termId,jdbcType=INTEGER}, term_id = #{row.termId,jdbcType=INTEGER},
channel_id = #{row.channelId,jdbcType=INTEGER}, channel_id = #{row.channelId,jdbcType=INTEGER},
protocol = #{row.protocol,jdbcType=INTEGER}, protocol = #{row.protocol,jdbcType=INTEGER},
update_time = #{row.updateTime,jdbcType=TIMESTAMP},
`data` = #{row.data,jdbcType=LONGVARCHAR} `data` = #{row.data,jdbcType=LONGVARCHAR}
<if test="example != null"> <if test="example != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -278,7 +289,8 @@
set id = #{row.id,jdbcType=INTEGER}, set id = #{row.id,jdbcType=INTEGER},
term_id = #{row.termId,jdbcType=INTEGER}, term_id = #{row.termId,jdbcType=INTEGER},
channel_id = #{row.channelId,jdbcType=INTEGER}, channel_id = #{row.channelId,jdbcType=INTEGER},
protocol = #{row.protocol,jdbcType=INTEGER} protocol = #{row.protocol,jdbcType=INTEGER},
update_time = #{row.updateTime,jdbcType=TIMESTAMP}
<if test="example != null"> <if test="example != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -299,6 +311,9 @@
<if test="protocol != null"> <if test="protocol != null">
protocol = #{protocol,jdbcType=INTEGER}, protocol = #{protocol,jdbcType=INTEGER},
</if> </if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="data != null"> <if test="data != null">
`data` = #{data,jdbcType=LONGVARCHAR}, `data` = #{data,jdbcType=LONGVARCHAR},
</if> </if>
@ -314,6 +329,7 @@
set term_id = #{termId,jdbcType=INTEGER}, set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER}, channel_id = #{channelId,jdbcType=INTEGER},
protocol = #{protocol,jdbcType=INTEGER}, protocol = #{protocol,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`data` = #{data,jdbcType=LONGVARCHAR} `data` = #{data,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
@ -325,7 +341,8 @@
update camera_schedule update camera_schedule
set term_id = #{termId,jdbcType=INTEGER}, set term_id = #{termId,jdbcType=INTEGER},
channel_id = #{channelId,jdbcType=INTEGER}, channel_id = #{channelId,jdbcType=INTEGER},
protocol = #{protocol,jdbcType=INTEGER} protocol = #{protocol,jdbcType=INTEGER},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
</mapper> </mapper>

@ -22,10 +22,7 @@ import org.springframework.util.CollectionUtils;
import javax.annotation.PreDestroy; import javax.annotation.PreDestroy;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@Service @Service
@Slf4j @Slf4j
@ -76,11 +73,13 @@ public class StoreCameraScheduleTask {
record.setChannelId(channel); record.setChannelId(channel);
record.setProtocol(term.getProtocol()); record.setProtocol(term.getProtocol());
record.setData(results.getData()); record.setData(results.getData());
record.setUpdateTime(new Date());
cameraScheduleMapper.insert(record); cameraScheduleMapper.insert(record);
} else { } else {
CameraSchedule record = list.get(0); CameraSchedule record = list.get(0);
record.setProtocol(term.getProtocol()); record.setProtocol(term.getProtocol());
record.setData(results.getData()); record.setData(results.getData());
record.setUpdateTime(new Date());
cameraScheduleMapper.updateByPrimaryKeyWithBLOBs(record); cameraScheduleMapper.updateByPrimaryKeyWithBLOBs(record);
} }
} else { } else {

Loading…
Cancel
Save