107 lines
5.0 KiB
XML
107 lines
5.0 KiB
XML
<?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.ruoyi.job.mapper.JobCallBackMapper">
|
|
|
|
<resultMap type="JobCallBack" id="JobCallBackResult">
|
|
<result property="id" column="id" />
|
|
<result property="type" column="type" />
|
|
<result property="taskNo" column="task_no" />
|
|
<result property="mydoJobId" column="mydoJob_Id" />
|
|
<result property="status" column="status" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="reqCode" column="req_code" />
|
|
<result property="taskTypeCode" column="task_type_code" />
|
|
<result property="taskCode" column="task_code" />
|
|
<result property="retry" column="retry" />
|
|
</resultMap>
|
|
|
|
<sql id="selectJobCallBackVo">
|
|
select id, type, task_no, mydoJob_Id, status, create_time, req_code, task_type_code, task_code, retry from job_call_back
|
|
</sql>
|
|
|
|
<select id="selectJobCallBackList" parameterType="JobCallBack" resultMap="JobCallBackResult">
|
|
<include refid="selectJobCallBackVo"/>
|
|
<where>
|
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
|
<if test="taskNo != null "> and task_no = #{taskNo}</if>
|
|
<if test="mydoJobId != null and mydoJobId != ''"> and mydoJob_Id = #{mydoJobId}</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="reqCode != null and reqCode != ''"> and req_code = #{reqCode}</if>
|
|
<if test="taskTypeCode != null and taskTypeCode != ''"> and task_type_code = #{taskTypeCode}</if>
|
|
<if test="taskCode != null and taskCode != ''"> and task_code = #{taskCode}</if>
|
|
<if test="retry != null and retry != ''"> and retry = #{retry}</if>
|
|
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectJobCallBackById" parameterType="Long" resultMap="JobCallBackResult">
|
|
<include refid="selectJobCallBackVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
<select id="selectJobCallBackListNoSuccess" resultMap="JobCallBackResult">
|
|
<include refid="selectJobCallBackVo"/>
|
|
where status != '1' and retry < 10
|
|
</select>
|
|
|
|
<insert id="insertJobCallBack" parameterType="JobCallBack" useGeneratedKeys="false" keyProperty="id">
|
|
insert into job_call_back
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="type != null">type,</if>
|
|
<if test="taskNo != null">task_no,</if>
|
|
<if test="mydoJobId != null">mydoJob_Id,</if>
|
|
<if test="status != null">status,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="reqCode != null">req_code,</if>
|
|
<if test="taskTypeCode != null">task_type_code,</if>
|
|
<if test="taskCode != null">task_code,</if>
|
|
<if test="retry != null">retry,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="type != null">#{type},</if>
|
|
<if test="taskNo != null">#{taskNo},</if>
|
|
<if test="mydoJobId != null">#{mydoJobId},</if>
|
|
<if test="status != null">#{status},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="reqCode != null">#{reqCode},</if>
|
|
<if test="taskTypeCode != null">#{taskTypeCode},</if>
|
|
<if test="taskCode != null">#{taskCode},</if>
|
|
<if test="retry != null">#{retry},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateJobCallBack" parameterType="JobCallBack">
|
|
update job_call_back
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="type != null">type = #{type},</if>
|
|
<if test="taskNo != null">task_no = #{taskNo},</if>
|
|
<if test="mydoJobId != null">mydoJob_Id = #{mydoJobId},</if>
|
|
<if test="status != null">status = #{status},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="reqCode != null">req_code = #{reqCode},</if>
|
|
<if test="taskTypeCode != null">task_type_code = #{taskTypeCode},</if>
|
|
<if test="taskCode != null">task_code = #{taskCode},</if>
|
|
<if test="retry != null">retry = #{retry},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteJobCallBackById" parameterType="Long">
|
|
delete from job_call_back where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteJobCallBackByIds" parameterType="String">
|
|
delete from job_call_back where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="getTopJobCallBack" resultMap="JobCallBackResult">
|
|
select top(1) id, type, task_no, mydoJob_Id, status, create_time,req_code,task_type_code,task_code,retry from job_call_back
|
|
where status = '0' and spare1 in ('0','1','2')
|
|
order by create_time asc
|
|
</select>
|
|
</mapper>
|