提交 a77fb3c7 authored 作者: taojinlong's avatar taojinlong

fix: 同步日志按时间排序;修复添加定时任务失败

上级 5c26b598
...@@ -17,9 +17,9 @@ public class DatasetTableTaskLog implements Serializable { ...@@ -17,9 +17,9 @@ public class DatasetTableTaskLog implements Serializable {
private String status; private String status;
private String info;
private Long createTime; private Long createTime;
private String info;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
} }
\ No newline at end of file
...@@ -504,76 +504,6 @@ public class DatasetTableTaskLogExample { ...@@ -504,76 +504,6 @@ public class DatasetTableTaskLogExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andInfoIsNull() {
addCriterion("info is null");
return (Criteria) this;
}
public Criteria andInfoIsNotNull() {
addCriterion("info is not null");
return (Criteria) this;
}
public Criteria andInfoEqualTo(String value) {
addCriterion("info =", value, "info");
return (Criteria) this;
}
public Criteria andInfoNotEqualTo(String value) {
addCriterion("info <>", value, "info");
return (Criteria) this;
}
public Criteria andInfoGreaterThan(String value) {
addCriterion("info >", value, "info");
return (Criteria) this;
}
public Criteria andInfoGreaterThanOrEqualTo(String value) {
addCriterion("info >=", value, "info");
return (Criteria) this;
}
public Criteria andInfoLessThan(String value) {
addCriterion("info <", value, "info");
return (Criteria) this;
}
public Criteria andInfoLessThanOrEqualTo(String value) {
addCriterion("info <=", value, "info");
return (Criteria) this;
}
public Criteria andInfoLike(String value) {
addCriterion("info like", value, "info");
return (Criteria) this;
}
public Criteria andInfoNotLike(String value) {
addCriterion("info not like", value, "info");
return (Criteria) this;
}
public Criteria andInfoIn(List<String> values) {
addCriterion("info in", values, "info");
return (Criteria) this;
}
public Criteria andInfoNotIn(List<String> values) {
addCriterion("info not in", values, "info");
return (Criteria) this;
}
public Criteria andInfoBetween(String value1, String value2) {
addCriterion("info between", value1, value2, "info");
return (Criteria) this;
}
public Criteria andInfoNotBetween(String value1, String value2) {
addCriterion("info not between", value1, value2, "info");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -10,13 +10,21 @@ public interface DatasetTableIncrementalConfigMapper { ...@@ -10,13 +10,21 @@ public interface DatasetTableIncrementalConfigMapper {
int deleteByExample(DatasetTableIncrementalConfigExample example); int deleteByExample(DatasetTableIncrementalConfigExample example);
int deleteByPrimaryKey(String id);
int insert(DatasetTableIncrementalConfig record); int insert(DatasetTableIncrementalConfig record);
int insertSelective(DatasetTableIncrementalConfig record); int insertSelective(DatasetTableIncrementalConfig record);
List<DatasetTableIncrementalConfig> selectByExample(DatasetTableIncrementalConfigExample example); List<DatasetTableIncrementalConfig> selectByExample(DatasetTableIncrementalConfigExample example);
DatasetTableIncrementalConfig selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") DatasetTableIncrementalConfig record, @Param("example") DatasetTableIncrementalConfigExample example); int updateByExampleSelective(@Param("record") DatasetTableIncrementalConfig record, @Param("example") DatasetTableIncrementalConfigExample example);
int updateByExample(@Param("record") DatasetTableIncrementalConfig record, @Param("example") DatasetTableIncrementalConfigExample example); int updateByExample(@Param("record") DatasetTableIncrementalConfig record, @Param("example") DatasetTableIncrementalConfigExample example);
int updateByPrimaryKeySelective(DatasetTableIncrementalConfig record);
int updateByPrimaryKey(DatasetTableIncrementalConfig record);
} }
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.dataease.base.mapper.DatasetTableIncrementalConfigMapper"> <mapper namespace="io.dataease.base.mapper.DatasetTableIncrementalConfigMapper">
<resultMap id="BaseResultMap" type="io.dataease.base.domain.DatasetTableIncrementalConfig"> <resultMap id="BaseResultMap" type="io.dataease.base.domain.DatasetTableIncrementalConfig">
<result column="id" jdbcType="VARCHAR" property="id" /> <id column="id" jdbcType="VARCHAR" property="id" />
<result column="table_id" jdbcType="VARCHAR" property="tableId" /> <result column="table_id" jdbcType="VARCHAR" property="tableId" />
<result column="incremental_delete" jdbcType="VARCHAR" property="incrementalDelete" /> <result column="incremental_delete" jdbcType="VARCHAR" property="incrementalDelete" />
<result column="incremental_add" jdbcType="VARCHAR" property="incrementalAdd" /> <result column="incremental_add" jdbcType="VARCHAR" property="incrementalAdd" />
...@@ -82,6 +82,16 @@ ...@@ -82,6 +82,16 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from dataset_table_incremental_config
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from dataset_table_incremental_config
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="io.dataease.base.domain.DatasetTableIncrementalConfigExample"> <delete id="deleteByExample" parameterType="io.dataease.base.domain.DatasetTableIncrementalConfigExample">
delete from dataset_table_incremental_config delete from dataset_table_incremental_config
<if test="_parameter != null"> <if test="_parameter != null">
...@@ -161,4 +171,26 @@ ...@@ -161,4 +171,26 @@
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByPrimaryKeySelective" parameterType="io.dataease.base.domain.DatasetTableIncrementalConfig">
update dataset_table_incremental_config
<set>
<if test="tableId != null">
table_id = #{tableId,jdbcType=VARCHAR},
</if>
<if test="incrementalDelete != null">
incremental_delete = #{incrementalDelete,jdbcType=VARCHAR},
</if>
<if test="incrementalAdd != null">
incremental_add = #{incrementalAdd,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DatasetTableIncrementalConfig">
update dataset_table_incremental_config
set table_id = #{tableId,jdbcType=VARCHAR},
incremental_delete = #{incrementalDelete,jdbcType=VARCHAR},
incremental_add = #{incrementalAdd,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper> </mapper>
\ No newline at end of file
...@@ -16,15 +16,21 @@ public interface DatasetTableTaskLogMapper { ...@@ -16,15 +16,21 @@ public interface DatasetTableTaskLogMapper {
int insertSelective(DatasetTableTaskLog record); int insertSelective(DatasetTableTaskLog record);
List<DatasetTableTaskLog> selectByExampleWithBLOBs(DatasetTableTaskLogExample example);
List<DatasetTableTaskLog> selectByExample(DatasetTableTaskLogExample example); List<DatasetTableTaskLog> selectByExample(DatasetTableTaskLogExample example);
DatasetTableTaskLog selectByPrimaryKey(String id); DatasetTableTaskLog selectByPrimaryKey(String id);
int updateByExampleSelective(@Param("record") DatasetTableTaskLog record, @Param("example") DatasetTableTaskLogExample example); int updateByExampleSelective(@Param("record") DatasetTableTaskLog record, @Param("example") DatasetTableTaskLogExample example);
int updateByExampleWithBLOBs(@Param("record") DatasetTableTaskLog record, @Param("example") DatasetTableTaskLogExample example);
int updateByExample(@Param("record") DatasetTableTaskLog record, @Param("example") DatasetTableTaskLogExample example); int updateByExample(@Param("record") DatasetTableTaskLog record, @Param("example") DatasetTableTaskLogExample example);
int updateByPrimaryKeySelective(DatasetTableTaskLog record); int updateByPrimaryKeySelective(DatasetTableTaskLog record);
int updateByPrimaryKeyWithBLOBs(DatasetTableTaskLog record);
int updateByPrimaryKey(DatasetTableTaskLog record); int updateByPrimaryKey(DatasetTableTaskLog record);
} }
\ No newline at end of file
...@@ -8,9 +8,11 @@ ...@@ -8,9 +8,11 @@
<result column="start_time" jdbcType="BIGINT" property="startTime" /> <result column="start_time" jdbcType="BIGINT" property="startTime" />
<result column="end_time" jdbcType="BIGINT" property="endTime" /> <result column="end_time" jdbcType="BIGINT" property="endTime" />
<result column="status" jdbcType="VARCHAR" property="status" /> <result column="status" jdbcType="VARCHAR" property="status" />
<result column="info" jdbcType="VARCHAR" property="info" />
<result column="create_time" jdbcType="BIGINT" property="createTime" /> <result column="create_time" jdbcType="BIGINT" property="createTime" />
</resultMap> </resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="io.dataease.base.domain.DatasetTableTaskLog">
<result column="info" jdbcType="LONGVARCHAR" property="info" />
</resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
<foreach collection="oredCriteria" item="criteria" separator="or"> <foreach collection="oredCriteria" item="criteria" separator="or">
...@@ -70,8 +72,27 @@ ...@@ -70,8 +72,27 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, table_id, task_id, start_time, end_time, `status`, info, create_time id, table_id, task_id, start_time, end_time, `status`, create_time
</sql>
<sql id="Blob_Column_List">
info
</sql> </sql>
<select id="selectByExampleWithBLOBs" parameterType="io.dataease.base.domain.DatasetTableTaskLogExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from dataset_table_task_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="io.dataease.base.domain.DatasetTableTaskLogExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="io.dataease.base.domain.DatasetTableTaskLogExample" resultMap="BaseResultMap">
select select
<if test="distinct"> <if test="distinct">
...@@ -86,9 +107,11 @@ ...@@ -86,9 +107,11 @@
order by ${orderByClause} order by ${orderByClause}
</if> </if>
</select> </select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="ResultMapWithBLOBs">
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from dataset_table_task_log from dataset_table_task_log
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</select> </select>
...@@ -105,10 +128,10 @@ ...@@ -105,10 +128,10 @@
<insert id="insert" parameterType="io.dataease.base.domain.DatasetTableTaskLog"> <insert id="insert" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
insert into dataset_table_task_log (id, table_id, task_id, insert into dataset_table_task_log (id, table_id, task_id,
start_time, end_time, `status`, start_time, end_time, `status`,
info, create_time) create_time, info)
values (#{id,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR}, values (#{id,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{taskId,jdbcType=VARCHAR},
#{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{status,jdbcType=VARCHAR},
#{info,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}) #{createTime,jdbcType=BIGINT}, #{info,jdbcType=LONGVARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetTableTaskLog"> <insert id="insertSelective" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
insert into dataset_table_task_log insert into dataset_table_task_log
...@@ -131,12 +154,12 @@ ...@@ -131,12 +154,12 @@
<if test="status != null"> <if test="status != null">
`status`, `status`,
</if> </if>
<if test="info != null">
info,
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time, create_time,
</if> </if>
<if test="info != null">
info,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
...@@ -157,12 +180,12 @@ ...@@ -157,12 +180,12 @@
<if test="status != null"> <if test="status != null">
#{status,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
</if> </if>
<if test="info != null">
#{info,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
#{createTime,jdbcType=BIGINT}, #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="info != null">
#{info,jdbcType=LONGVARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="io.dataease.base.domain.DatasetTableTaskLogExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="io.dataease.base.domain.DatasetTableTaskLogExample" resultType="java.lang.Long">
...@@ -192,17 +215,31 @@ ...@@ -192,17 +215,31 @@
<if test="record.status != null"> <if test="record.status != null">
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
</if> </if>
<if test="record.info != null">
info = #{record.info,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null"> <if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT}, create_time = #{record.createTime,jdbcType=BIGINT},
</if> </if>
<if test="record.info != null">
info = #{record.info,jdbcType=LONGVARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
</update> </update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update dataset_table_task_log
set id = #{record.id,jdbcType=VARCHAR},
table_id = #{record.tableId,jdbcType=VARCHAR},
task_id = #{record.taskId,jdbcType=VARCHAR},
start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT},
`status` = #{record.status,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
info = #{record.info,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map"> <update id="updateByExample" parameterType="map">
update dataset_table_task_log update dataset_table_task_log
set id = #{record.id,jdbcType=VARCHAR}, set id = #{record.id,jdbcType=VARCHAR},
...@@ -211,7 +248,6 @@ ...@@ -211,7 +248,6 @@
start_time = #{record.startTime,jdbcType=BIGINT}, start_time = #{record.startTime,jdbcType=BIGINT},
end_time = #{record.endTime,jdbcType=BIGINT}, end_time = #{record.endTime,jdbcType=BIGINT},
`status` = #{record.status,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR},
info = #{record.info,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT} create_time = #{record.createTime,jdbcType=BIGINT}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -235,15 +271,26 @@ ...@@ -235,15 +271,26 @@
<if test="status != null"> <if test="status != null">
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
</if> </if>
<if test="info != null">
info = #{info,jdbcType=VARCHAR},
</if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT}, create_time = #{createTime,jdbcType=BIGINT},
</if> </if>
<if test="info != null">
info = #{info,jdbcType=LONGVARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
update dataset_table_task_log
set table_id = #{tableId,jdbcType=VARCHAR},
task_id = #{taskId,jdbcType=VARCHAR},
start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT},
`status` = #{status,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
info = #{info,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DatasetTableTaskLog"> <update id="updateByPrimaryKey" parameterType="io.dataease.base.domain.DatasetTableTaskLog">
update dataset_table_task_log update dataset_table_task_log
set table_id = #{tableId,jdbcType=VARCHAR}, set table_id = #{tableId,jdbcType=VARCHAR},
...@@ -251,7 +298,6 @@ ...@@ -251,7 +298,6 @@
start_time = #{startTime,jdbcType=BIGINT}, start_time = #{startTime,jdbcType=BIGINT},
end_time = #{endTime,jdbcType=BIGINT}, end_time = #{endTime,jdbcType=BIGINT},
`status` = #{status,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR},
info = #{info,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT} create_time = #{createTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}
</update> </update>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
FROM dataset_table_task_log FROM dataset_table_task_log
LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id LEFT JOIN dataset_table_task ON dataset_table_task_log.task_id = dataset_table_task.id
WHERE dataset_table_task_log.table_id = #{tableId,jdbcType=VARCHAR} WHERE dataset_table_task_log.table_id = #{tableId,jdbcType=VARCHAR}
ORDER BY dataset_table_task_log.create_time desc
</select> </select>
</mapper> </mapper>
...@@ -664,9 +664,7 @@ public class DataSetTableService { ...@@ -664,9 +664,7 @@ public class DataSetTableService {
datasetTableIncrementalConfig.setId(UUID.randomUUID().toString()); datasetTableIncrementalConfig.setId(UUID.randomUUID().toString());
datasetTableIncrementalConfigMapper.insertSelective(datasetTableIncrementalConfig); datasetTableIncrementalConfigMapper.insertSelective(datasetTableIncrementalConfig);
} else { } else {
DatasetTableIncrementalConfigExample example = new DatasetTableIncrementalConfigExample(); datasetTableIncrementalConfigMapper.updateByPrimaryKey(datasetTableIncrementalConfig);
example.createCriteria().andTableIdEqualTo(datasetTableIncrementalConfig.getTableId());
datasetTableIncrementalConfigMapper.updateByExample(datasetTableIncrementalConfig, example);
} }
} }
......
...@@ -39,12 +39,6 @@ public class DataSetTableTaskLogService { ...@@ -39,12 +39,6 @@ public class DataSetTableTaskLogService {
} }
public List<DataSetTaskLogDTO> list(DatasetTableTaskLog request) { public List<DataSetTaskLogDTO> list(DatasetTableTaskLog request) {
DatasetTableTaskLogExample datasetTableTaskLogExample = new DatasetTableTaskLogExample();
DatasetTableTaskLogExample.Criteria criteria = datasetTableTaskLogExample.createCriteria();
if (StringUtils.isNotEmpty(request.getTableId())) {
criteria.andTableIdEqualTo(request.getTableId());
}
datasetTableTaskLogExample.setOrderByClause("create_time desc");
return extDataSetTaskMapper.list(request); return extDataSetTaskMapper.list(request);
} }
......
...@@ -64,11 +64,12 @@ ...@@ -64,11 +64,12 @@
<!--要生成的数据库表 --> <!--要生成的数据库表 -->
<!-- <table tableName="datasource"/>-->
<!-- <table tableName="sys_dict"/>--> <table tableName="dataset_table_incremental_config">
<!-- <table tableName="sys_dict_item"/>--> <columnOverride column="incremental_delete" javaType="java.lang.String" jdbcType="VARCHAR" />
<table tableName="my_plugin"/> <columnOverride column="incremental_add" javaType="java.lang.String" jdbcType="VARCHAR" />
<!-- <table tableName="panel_design"/>--> </table>
</context> </context>
......
...@@ -468,8 +468,6 @@ export default { ...@@ -468,8 +468,6 @@ export default {
this.incrementalConfig.incrementalDelete = this.sql this.incrementalConfig.incrementalDelete = this.sql
} }
this.incrementalConfig.tableId = this.table.id this.incrementalConfig.tableId = this.table.id
console.log(this.incrementalConfig)
task.startTime = new Date(task.startTime).getTime() task.startTime = new Date(task.startTime).getTime()
task.endTime = new Date(task.endTime).getTime() task.endTime = new Date(task.endTime).getTime()
task.tableId = this.table.id task.tableId = this.table.id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论