1
0
mirror of https://gitee.com/bookshelfplus/bookshelfplus synced 2025-09-21 01:10:39 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

定时任务相关修改;添加schedule_task数据库表;BusinessErrorCode扩充;QCloudCosUtils调整(暂存)

This commit is contained in:
2022-04-10 22:09:12 +08:00
parent c84cd46197
commit 63d8192372
14 changed files with 726 additions and 12 deletions

View File

@@ -0,0 +1,174 @@
<?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="plus.bookshelf.Dao.Mapper.ScheduleTaskDOMapper">
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.ScheduleTaskDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" jdbcType="INTEGER" property="id" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="schedule_time" jdbcType="TIMESTAMP" property="scheduleTime" />
<result column="action" jdbcType="VARCHAR" property="action" />
<result column="data" jdbcType="VARCHAR" property="data" />
<result column="task_guid" jdbcType="VARCHAR" property="taskGuid" />
<result column="associated_user_id" jdbcType="INTEGER" property="associatedUserId" />
<result column="fail_time" jdbcType="TINYINT" property="failTime" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, create_time, schedule_time, `action`, `data`, task_guid, associated_user_id,
fail_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from schedule_task
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from schedule_task
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.ScheduleTaskDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into schedule_task (id, create_time, schedule_time,
`action`, `data`, task_guid,
associated_user_id, fail_time)
values (#{id,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{scheduleTime,jdbcType=TIMESTAMP},
#{action,jdbcType=VARCHAR}, #{data,jdbcType=VARCHAR}, #{taskGuid,jdbcType=VARCHAR},
#{associatedUserId,jdbcType=INTEGER}, #{failTime,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.ScheduleTaskDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into schedule_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="scheduleTime != null">
schedule_time,
</if>
<if test="action != null">
`action`,
</if>
<if test="data != null">
`data`,
</if>
<if test="taskGuid != null">
task_guid,
</if>
<if test="associatedUserId != null">
associated_user_id,
</if>
<if test="failTime != null">
fail_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="scheduleTime != null">
#{scheduleTime,jdbcType=TIMESTAMP},
</if>
<if test="action != null">
#{action,jdbcType=VARCHAR},
</if>
<if test="data != null">
#{data,jdbcType=VARCHAR},
</if>
<if test="taskGuid != null">
#{taskGuid,jdbcType=VARCHAR},
</if>
<if test="associatedUserId != null">
#{associatedUserId,jdbcType=INTEGER},
</if>
<if test="failTime != null">
#{failTime,jdbcType=TINYINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.ScheduleTaskDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update schedule_task
<set>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="scheduleTime != null">
schedule_time = #{scheduleTime,jdbcType=TIMESTAMP},
</if>
<if test="action != null">
`action` = #{action,jdbcType=VARCHAR},
</if>
<if test="data != null">
`data` = #{data,jdbcType=VARCHAR},
</if>
<if test="taskGuid != null">
task_guid = #{taskGuid,jdbcType=VARCHAR},
</if>
<if test="associatedUserId != null">
associated_user_id = #{associatedUserId,jdbcType=INTEGER},
</if>
<if test="failTime != null">
fail_time = #{failTime,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="plus.bookshelf.Dao.DO.ScheduleTaskDO">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update schedule_task
set create_time = #{createTime,jdbcType=TIMESTAMP},
schedule_time = #{scheduleTime,jdbcType=TIMESTAMP},
`action` = #{action,jdbcType=VARCHAR},
`data` = #{data,jdbcType=VARCHAR},
task_guid = #{taskGuid,jdbcType=VARCHAR},
associated_user_id = #{associatedUserId,jdbcType=INTEGER},
fail_time = #{failTime,jdbcType=TINYINT}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectTodoTask" parameterType="plus.bookshelf.Dao.DO.BookDOExample" resultMap="ResultMap">
select
<include refid="Base_Column_List" />
from schedule_task
where <![CDATA[ schedule_time <= CURRENT_TIMESTAMP ]]>
order by schedule_time asc
</select>
<select id="selectByGuid" parameterType="plus.bookshelf.Dao.DO.BookDOExample" resultMap="ResultMap">
select
<include refid="Base_Column_List" />
from schedule_task
where task_guid = #{taskGuid,jdbcType=VARCHAR}
</select>
</mapper>

View File

@@ -100,5 +100,8 @@
<!--<table tableName="cos_presigned_url_generate_log" domainObjectName="CosPresignedUrlGenerateLogDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
<!--<table tableName="schedule_task" domainObjectName="ScheduleTaskDO" enableCountByExample="false"-->
<!-- enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"-->
<!-- selectByExampleQueryId="false"></table>-->
</context>
</generatorConfiguration>