86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame^] | 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <!DOCTYPE mapper |
| 3 | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| 4 | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| 5 | <mapper namespace="com.ruoyi.quartz.mapper.SysJobMapper"> |
| 6 | |
| 7 | <resultMap type="SysJob" id="SysJobResult"> |
| 8 | <id property="jobId" column="job_id" /> |
| 9 | <result property="jobName" column="job_name" /> |
| 10 | <result property="jobGroup" column="job_group" /> |
| 11 | <result property="invokeTarget" column="invoke_target" /> |
| 12 | <result property="cronExpression" column="cron_expression" /> |
| 13 | <result property="misfirePolicy" column="misfire_policy" /> |
| 14 | <result property="concurrent" column="concurrent" /> |
| 15 | <result property="status" column="status" /> |
| 16 | <result property="createBy" column="create_by" /> |
| 17 | <result property="createTime" column="create_time" /> |
| 18 | <result property="updateBy" column="update_by" /> |
| 19 | <result property="updateTime" column="update_time" /> |
| 20 | <result property="remark" column="remark" /> |
| 21 | </resultMap> |
| 22 | |
| 23 | <sql id="selectJobVo"> |
| 24 | select job_id, job_name, job_group, invoke_target, cron_expression, misfire_policy, concurrent, status, create_by, create_time, remark |
| 25 | from sys_job |
| 26 | </sql> |
| 27 | |
| 28 | <select id="selectJobList" parameterType="SysJob" resultMap="SysJobResult"> |
| 29 | <include refid="selectJobVo"/> |
| 30 | <where> |
| 31 | <if test="jobName != null and jobName != ''"> |
| 32 | AND job_name like concat('%', #{jobName}, '%') |
| 33 | </if> |
| 34 | <if test="jobGroup != null and jobGroup != ''"> |
| 35 | AND job_group = #{jobGroup} |
| 36 | </if> |
| 37 | <if test="status != null and status != ''"> |
| 38 | AND status = #{status} |
| 39 | </if> |
| 40 | <if test="invokeTarget != null and invokeTarget != ''"> |
| 41 | AND invoke_target like concat('%', #{invokeTarget}, '%') |
| 42 | </if> |
| 43 | </where> |
| 44 | </select> |
| 45 | |
| 46 | <select id="selectJobAll" resultMap="SysJobResult"> |
| 47 | <include refid="selectJobVo"/> |
| 48 | </select> |
| 49 | |
| 50 | <select id="selectJobById" parameterType="Long" resultMap="SysJobResult"> |
| 51 | <include refid="selectJobVo"/> |
| 52 | where job_id = #{jobId} |
| 53 | </select> |
| 54 | |
| 55 | <delete id="deleteJobById" parameterType="Long"> |
| 56 | delete from sys_job where job_id = #{jobId} |
| 57 | </delete> |
| 58 | |
| 59 | <delete id="deleteJobByIds" parameterType="Long"> |
| 60 | delete from sys_job where job_id in |
| 61 | <foreach collection="array" item="jobId" open="(" separator="," close=")"> |
| 62 | #{jobId} |
| 63 | </foreach> |
| 64 | </delete> |
| 65 | |
| 66 | <update id="updateJob" parameterType="SysJob"> |
| 67 | update sys_job |
| 68 | <set> |
| 69 | <if test="jobName != null and jobName != ''">job_name = #{jobName},</if> |
| 70 | <if test="jobGroup != null and jobGroup != ''">job_group = #{jobGroup},</if> |
| 71 | <if test="invokeTarget != null and invokeTarget != ''">invoke_target = #{invokeTarget},</if> |
| 72 | <if test="cronExpression != null and cronExpression != ''">cron_expression = #{cronExpression},</if> |
| 73 | <if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy = #{misfirePolicy},</if> |
| 74 | <if test="concurrent != null and concurrent != ''">concurrent = #{concurrent},</if> |
| 75 | <if test="status !=null">status = #{status},</if> |
| 76 | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| 77 | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| 78 | update_time = sysdate() |
| 79 | </set> |
| 80 | where job_id = #{jobId} |
| 81 | </update> |
| 82 | |
| 83 | <insert id="insertJob" parameterType="SysJob" useGeneratedKeys="true" keyProperty="jobId"> |
| 84 | insert into sys_job( |
| 85 | <if test="jobId != null and jobId != 0">job_id,</if> |
| 86 | <if test="jobName != null and jobName != ''">job_name,</if> |
| 87 | <if test="jobGroup != null and jobGroup != ''">job_group,</if> |
| 88 | <if test="invokeTarget != null and invokeTarget != ''">invoke_target,</if> |
| 89 | <if test="cronExpression != null and cronExpression != ''">cron_expression,</if> |
| 90 | <if test="misfirePolicy != null and misfirePolicy != ''">misfire_policy,</if> |
| 91 | <if test="concurrent != null and concurrent != ''">concurrent,</if> |
| 92 | <if test="status != null and status != ''">status,</if> |
| 93 | <if test="remark != null and remark != ''">remark,</if> |
| 94 | <if test="createBy != null and createBy != ''">create_by,</if> |
| 95 | create_time |
| 96 | )values( |
| 97 | <if test="jobId != null and jobId != 0">#{jobId},</if> |
| 98 | <if test="jobName != null and jobName != ''">#{jobName},</if> |
| 99 | <if test="jobGroup != null and jobGroup != ''">#{jobGroup},</if> |
| 100 | <if test="invokeTarget != null and invokeTarget != ''">#{invokeTarget},</if> |
| 101 | <if test="cronExpression != null and cronExpression != ''">#{cronExpression},</if> |
| 102 | <if test="misfirePolicy != null and misfirePolicy != ''">#{misfirePolicy},</if> |
| 103 | <if test="concurrent != null and concurrent != ''">#{concurrent},</if> |
| 104 | <if test="status != null and status != ''">#{status},</if> |
| 105 | <if test="remark != null and remark != ''">#{remark},</if> |
| 106 | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| 107 | sysdate() |
| 108 | ) |
| 109 | </insert> |
| 110 | |
| 111 | </mapper> |