2025-07-23 09:55:50 +08:00
<?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.saye.hospitalgd.mapper.quzrtz.BaseQuartzConfigMapper" >
<resultMap id= "BaseResultMap" type= "com.saye.hospitalgd.model.BaseQuartzConfigEntity" >
<id column= "CONFIGID" property= "configId" jdbcType= "VARCHAR" />
<result column= "QUARTZ_NAME" property= "quartzName" jdbcType= "VARCHAR" />
<result column= "QUARTZ_GROUP" property= "quartzGroup" jdbcType= "VARCHAR" />
<result column= "STATUS" property= "status" jdbcType= "VARCHAR" />
<result column= "QUARTZ_CLASS" property= "quartzClass" jdbcType= "VARCHAR" />
2025-10-27 08:49:28 +08:00
<result column= "QUARTZ_TYPE" property= "quartzType" jdbcType= "VARCHAR" />
2025-07-23 09:55:50 +08:00
<result column= "REMARK" property= "remark" jdbcType= "VARCHAR" />
<result column= "CREATEUSERID" property= "createUserId" jdbcType= "VARCHAR" />
<result column= "EXPRESSION" property= "expression" jdbcType= "VARCHAR" />
<result column= "CREATE_TIME" property= "createTime" jdbcType= "VARCHAR" />
<result column= "NAME" property= "name" jdbcType= "VARCHAR" />
</resultMap>
<!-- 查询所有任务 -->
<select id= "findAll" parameterType= "HashMap" resultMap= "BaseResultMap" >
2025-10-27 08:49:28 +08:00
select bqc.CONFIGID,bqc.QUARTZ_NAME,bqc.QUARTZ_GROUP,bqc.STATUS,bqc.QUARTZ_CLASS,bqc.QUARTZ_TYPE,bqc.REMARK,bqc.CREATEUSERID,bqc.EXPRESSION,bqc.CREATE_TIME from base_quartz_config bqc
2025-07-23 09:55:50 +08:00
<where >
2025-10-27 08:49:28 +08:00
<if test= "quartz_name!=null and quartz_name!=''" >
2025-07-23 09:55:50 +08:00
and bqc.QUARTZ_NAME like concat('%',concat(#{quartz_name},'%'))
</if>
2025-10-27 08:49:28 +08:00
<if test= "quartz_type!=null and quartz_type!=''" >
and bqc.QUARTZ_TYPE = #{quartz_type}
</if>
<if test= "configId!=null and configId!=''" >
2025-07-23 09:55:50 +08:00
and bqc.CONFIGID = #{configId}
</if>
</where>
order by bqc.CONFIGID
</select>
<!-- 根据id查询定时任务 -->
<select id= "findEntityById" resultMap= "BaseResultMap" >
2025-10-27 08:49:28 +08:00
select CONFIGID,QUARTZ_NAME,QUARTZ_GROUP,STATUS,QUARTZ_CLASS,QUARTZ_TYPE,REMARK,CREATEUSERID,EXPRESSION,CREATE_TIME from base_quartz_config
2025-07-23 09:55:50 +08:00
where CONFIGID=#{id}
</select>
<!-- 更新定时任务 -->
<update id= "updateQuartzConfigByEntity" parameterType= "com.saye.hospitalgd.model.BaseQuartzConfigEntity" >
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},STATUS=#{status},QUARTZ_CLASS=#{quartzClass}
2025-10-27 08:49:28 +08:00
,QUARTZ_TYPE=#{quartzType},REMARK=#{remark},CREATEUSERID=#{createUserId},EXPRESSION=#{expression}
2025-07-23 09:55:50 +08:00
where CONFIGID=#{configId}
</update>
<!-- 查询最大任务号 -->
<select id= "findMaxId" resultType= "hashMap" >
select max(CONFIGID) as id from base_quartz_config
</select>
<!-- 删除任务 -->
<delete id= "deleteQuartzConfigById" >
delete from base_quartz_config where CONFIGID=#{id}
</delete>
<!-- 添加定时任务 -->
<insert id= "addQuartz" parameterType= "hashMap" >
2025-10-27 08:49:28 +08:00
insert into base_quartz_config(configid, quartz_name, status, quartz_class, quartz_type, remark, createuserid, expression, create_time)
values(#{id},#{quartzName},#{status}, #{quartz_class}, #{quartz_type}, #{remark}, #{createuserid}, #{expression}, #{create_time} )
2025-07-23 09:55:50 +08:00
</insert>
<!-- 更新定时任务信息 -->
<update id= "updateQuartzConfigById" >
update base_quartz_config set QUARTZ_NAME=#{quartzName},QUARTZ_GROUP=#{quartzGroup},QUARTZ_CLASS=#{quartzClass}
2025-10-27 08:49:28 +08:00
,QUARTZ_TYPE=#{quartzType},REMARK=#{remark},EXPRESSION=#{expression}
2025-07-23 09:55:50 +08:00
where CONFIGID=#{configId}
</update>
</mapper>