新增数据迁移任务到定时任务白名单;优化默认收货时间范围逻辑

This commit is contained in:
wuweihua
2026-11-11 15:34:11 +08:00
parent f82d9c667f
commit 7869205afc
14 changed files with 1251 additions and 3 deletions
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.bms.system.mapper.SysDataMigrationMapper">
<resultMap type="com.bms.system.domain.SysDataMigration" id="SysDataMigrationResult">
<id property="migrationId" column="migration_id" />
<result property="migrationName" column="migration_name" />
<result property="sqlText" column="sql_text" />
<result property="cronExpression" column="cron_expression" />
<result property="status" column="status" />
<result property="jobId" column="job_id" />
<result property="lastRunTime" column="last_run_time" />
<result property="lastRunStatus" column="last_run_status" />
<result property="lastRunMessage" column="last_run_message" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<resultMap type="com.bms.system.domain.SysDataMigrationLog" id="SysDataMigrationLogResult">
<id property="logId" column="log_id" />
<result property="migrationId" column="migration_id" />
<result property="triggerType" column="trigger_type" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="status" column="status" />
<result property="affectedRows" column="affected_rows" />
<result property="message" column="message" />
<result property="createBy" column="create_by" />
</resultMap>
<sql id="selectVo">
select migration_id, migration_name, sql_text, cron_expression, status, job_id,
last_run_time, last_run_status, last_run_message, remark,
create_by, create_time, update_by, update_time
from sys_data_migration
</sql>
<select id="selectSysDataMigrationById" resultMap="SysDataMigrationResult">
<include refid="selectVo"/>
where migration_id = #{migrationId}
</select>
<select id="selectSysDataMigrationList" parameterType="com.bms.system.domain.SysDataMigration" resultMap="SysDataMigrationResult">
<include refid="selectVo"/>
<where>
<if test="migrationName != null and migrationName != ''">
and migration_name like concat('%', #{migrationName}, '%')
</if>
<if test="status != null and status != ''">and status = #{status}</if>
</where>
order by migration_id desc
</select>
<insert id="insertSysDataMigration" parameterType="com.bms.system.domain.SysDataMigration" useGeneratedKeys="true" keyProperty="migrationId">
insert into sys_data_migration (
migration_name, sql_text, cron_expression, status, job_id,
last_run_time, last_run_status, last_run_message, remark, create_by, create_time
) values (
#{migrationName}, #{sqlText}, #{cronExpression}, ifnull(#{status}, '1'), #{jobId},
#{lastRunTime}, #{lastRunStatus}, #{lastRunMessage}, #{remark}, #{createBy}, sysdate()
)
</insert>
<update id="updateSysDataMigration" parameterType="com.bms.system.domain.SysDataMigration">
update sys_data_migration
<set>
<if test="migrationName != null and migrationName != ''">migration_name = #{migrationName},</if>
<if test="sqlText != null">sql_text = #{sqlText},</if>
<if test="cronExpression != null">cron_expression = #{cronExpression},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="jobId != null">job_id = #{jobId},</if>
<if test="lastRunTime != null">last_run_time = #{lastRunTime},</if>
<if test="lastRunStatus != null">last_run_status = #{lastRunStatus},</if>
<if test="lastRunMessage != null">last_run_message = #{lastRunMessage},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
update_time = sysdate()
</set>
where migration_id = #{migrationId}
</update>
<delete id="deleteSysDataMigrationByIds">
delete from sys_data_migration where migration_id in
<foreach collection="array" item="id" open="(" separator="," close=")">#{id}</foreach>
</delete>
<update id="clearJobId">
update sys_data_migration set job_id = null, update_time = sysdate() where migration_id = #{migrationId}
</update>
<insert id="insertSysDataMigrationLog" parameterType="com.bms.system.domain.SysDataMigrationLog" useGeneratedKeys="true" keyProperty="logId">
insert into sys_data_migration_log (
migration_id, trigger_type, start_time, end_time, status, affected_rows, message, create_by
) values (
#{migrationId}, #{triggerType}, #{startTime}, #{endTime}, #{status},
ifnull(#{affectedRows}, 0), #{message}, #{createBy}
)
</insert>
<select id="selectSysDataMigrationLogList" parameterType="com.bms.system.domain.SysDataMigrationLog" resultMap="SysDataMigrationLogResult">
select log_id, migration_id, trigger_type, start_time, end_time, status, affected_rows, message, create_by
from sys_data_migration_log
<where>
<if test="migrationId != null">and migration_id = #{migrationId}</if>
<if test="status != null and status != ''">and status = #{status}</if>
<if test="triggerType != null and triggerType != ''">and trigger_type = #{triggerType}</if>
</where>
order by log_id desc
</select>
</mapper>