提交 bb591cad 编写于 作者: rushui.chen's avatar rushui.chen

20200106 删除定时任务代码

上级 93b66cdb
流水线 #20191 已失败 于阶段
in 0 second
package com.pica.cloud.account.account.server.job;
import com.pica.cloud.account.account.server.mapper.HospitalMapper;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Created on 2019/12/16 17:53
* author:crs
* Description:记录doctor修改记录日志
*/
@JobHandler(value = "HospitalLogHandler")
@Component
public class HospitalLogHandler extends IJobHandler {
@Autowired
private HospitalMapper hospitalMapper;
@Override
public ReturnT<String> execute(String s) throws Exception {
XxlJobLogger.log("hospitalLogRecord start-----");
Integer rows = hospitalMapper.updateDoctorModifyRecord();
XxlJobLogger.log("hospitalLogRecord end-----"+rows);
return SUCCESS;
}
}
//@JobHandler(value = "HospitalLogHandler")
//@Component
//public class HospitalLogHandler extends IJobHandler {
//
// @Autowired
// private HospitalMapper hospitalMapper;
//
// @Override
// public ReturnT<String> execute(String s) throws Exception {
// XxlJobLogger.log("hospitalLogRecord start-----");
// Integer rows = hospitalMapper.updateDoctorModifyRecord();
// XxlJobLogger.log("hospitalLogRecord end-----"+rows);
// return SUCCESS;
// }
//}
package com.pica.cloud.account.account.server.job;
import com.pica.cloud.account.account.server.mapper.PermissionDoctorRoleMapper;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import com.xxl.job.core.log.XxlJobLogger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* Created on 2019/12/16 17:53
* author:crs
......
......@@ -87,15 +87,6 @@ public interface DoctorMapper {
void updateDeleteByPrimaryKey(@Param("map") HashMap<String, Long> map);
/**
* 通过手机号获取用户id
*
* @param mobile
* @return
*/
//Long selectDoctorIdByMobile(String mobile);
Integer getAcctIdByDoctorId(long id);
......
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.Hospital;
public interface HospitalMapper {
int deleteByPrimaryKey(Integer id);
int insert(Hospital record);
int insertSelective(Hospital record);
Hospital selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(Hospital record);
int updateByPrimaryKey(Hospital record);
Integer updateDoctorModifyRecord();
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.PermissionDoctorRole;
public interface PermissionDoctorRoleMapper {
int deleteByPrimaryKey(Long id);
int insert(PermissionDoctorRole record);
int insertSelective(PermissionDoctorRole record);
PermissionDoctorRole selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(PermissionDoctorRole record);
int updateByPrimaryKey(PermissionDoctorRole record);
/**
* 记录用户权限修改记录
*
* @return
*/
Integer updatePermissionModifyRecord();
}
\ No newline at end of file
<?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.pica.cloud.account.account.server.mapper.PermissionDoctorRoleMapper">
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.PermissionDoctorRole">
<id column="id" property="id" jdbcType="BIGINT"/>
<result column="doctor_id" property="doctorId" jdbcType="BIGINT"/>
<result column="hospital_id" property="hospitalId" jdbcType="BIGINT"/>
<result column="role_id" property="roleId" jdbcType="BIGINT"/>
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER"/>
<result column="created_id" property="createdId" jdbcType="BIGINT"/>
<result column="created_time" property="createdTime" jdbcType="TIMESTAMP"/>
<result column="modified_id" property="modifiedId" jdbcType="BIGINT"/>
<result column="modified_time" property="modifiedTime" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id, doctor_id, hospital_id, role_id, delete_flag, created_id, created_time, modified_id,
modified_time
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">
select
<include refid="Base_Column_List"/>
from permission_doctor_role
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from permission_doctor_role
where id = #{id,jdbcType=BIGINT}
</delete>
<!--用户权限记录表的变更-->
<insert id="updatePermissionModifyRecord">
insert into log_permission_doctor_role(`id`, `doctor_id`, `hospital_id`, `role_id`, `delete_flag`, `created_id`,
`created_time`, `modified_id`, `modified_time`)
SELECT * FROM permission_doctor_role where modified_time &gt; DATE_SUB(DATE_FORMAT(NOW(),'%Y-%m-%d
%H:00:00'),INTERVAL 1 hour) and modified_time &lt; DATE_FORMAT(NOW(), '%Y-%m-%d %H:00:00')
</insert>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.PermissionDoctorRole">
insert into permission_doctor_role (id, doctor_id, hospital_id,
role_id, delete_flag, created_id,
created_time, modified_id, modified_time
)
values (#{id,jdbcType=BIGINT}, #{doctorId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT},
#{roleId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=INTEGER}, #{createdId,jdbcType=BIGINT},
#{createdTime,jdbcType=TIMESTAMP}, #{modifiedId,jdbcType=BIGINT}, #{modifiedTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.PermissionDoctorRole">
insert into permission_doctor_role
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="doctorId != null">
doctor_id,
</if>
<if test="hospitalId != null">
hospital_id,
</if>
<if test="roleId != null">
role_id,
</if>
<if test="deleteFlag != null">
delete_flag,
</if>
<if test="createdId != null">
created_id,
</if>
<if test="createdTime != null">
created_time,
</if>
<if test="modifiedId != null">
modified_id,
</if>
<if test="modifiedTime != null">
modified_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="doctorId != null">
#{doctorId,jdbcType=BIGINT},
</if>
<if test="hospitalId != null">
#{hospitalId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
#{roleId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null">
#{createdId,jdbcType=BIGINT},
</if>
<if test="createdTime != null">
#{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null">
#{modifiedId,jdbcType=BIGINT},
</if>
<if test="modifiedTime != null">
#{modifiedTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective"
parameterType="com.pica.cloud.account.account.server.entity.PermissionDoctorRole">
update permission_doctor_role
<set>
<if test="doctorId != null">
doctor_id = #{doctorId,jdbcType=BIGINT},
</if>
<if test="hospitalId != null">
hospital_id = #{hospitalId,jdbcType=BIGINT},
</if>
<if test="roleId != null">
role_id = #{roleId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null">
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="createdId != null">
created_id = #{createdId,jdbcType=BIGINT},
</if>
<if test="createdTime != null">
created_time = #{createdTime,jdbcType=TIMESTAMP},
</if>
<if test="modifiedId != null">
modified_id = #{modifiedId,jdbcType=BIGINT},
</if>
<if test="modifiedTime != null">
modified_time = #{modifiedTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.PermissionDoctorRole">
update permission_doctor_role
set doctor_id = #{doctorId,jdbcType=BIGINT},
hospital_id = #{hospitalId,jdbcType=BIGINT},
role_id = #{roleId,jdbcType=BIGINT},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
created_id = #{createdId,jdbcType=BIGINT},
created_time = #{createdTime,jdbcType=TIMESTAMP},
modified_id = #{modifiedId,jdbcType=BIGINT},
modified_time = #{modifiedTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册