提交 f5dd2814 编写于 作者:  Peijun.zhao's avatar Peijun.zhao

add 客服系统删除医生 恢复接口

上级 e211fed9
流水线 #26247 已失败 于阶段
in 0 second
......@@ -4,16 +4,20 @@ import com.pica.cloud.account.account.server.entity.AccountUser;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.req.RevertAcctsReq;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.foundation.encryption.common.constants.EncryptConstants;
import com.pica.cloud.foundation.encryption.util.EncryptUtils;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.service.starter.interceptor.EnabledLoginValidate;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Created on 2019/9/10 18:51
* author:crs
......@@ -78,4 +82,21 @@ public class DoctorController extends AccountBaseController {
doctorService.deleteDoctorInfo(id,super.getDoctorIdByToken());
return PicaResponse.toResponse();
}
/**
* @Description 恢复客服系统误删除医生
* @Author peijun.zhao
* @Date 2020/6/3 17:39
* @ModifyDate 2020/6/3 17:39
* @Params [doctorIds]
* @Return com.pica.cloud.foundation.entity.PicaResponse
*/
@PostMapping(value = "/revert")
@EnabledLoginValidate
public PicaResponse revertDoctor(@RequestBody RevertAcctsReq revertAcctsReq) {
if("revertAccts".equals(revertAcctsReq.getType())){
doctorService.revertAccts(revertAcctsReq.getDoctorIds());
}
return PicaResponse.toResponse();
}
}
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class DoctorEducation {
private Integer id;
private Integer doctorId;
private String schoolName;
private Integer majorId;
private String majorName;
private String educationId;
private String educationName;
private String year;
private Integer deleteFlag;
private Integer creatId;
private Date creatTime;
private Integer modifyId;
private Date modifyTime;
private String graduatedYear;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getDoctorId() {
return doctorId;
}
public void setDoctorId(Integer doctorId) {
this.doctorId = doctorId;
}
public String getSchoolName() {
return schoolName;
}
public void setSchoolName(String schoolName) {
this.schoolName = schoolName == null ? null : schoolName.trim();
}
public Integer getMajorId() {
return majorId;
}
public void setMajorId(Integer majorId) {
this.majorId = majorId;
}
public String getMajorName() {
return majorName;
}
public void setMajorName(String majorName) {
this.majorName = majorName == null ? null : majorName.trim();
}
public String getEducationId() {
return educationId;
}
public void setEducationId(String educationId) {
this.educationId = educationId == null ? null : educationId.trim();
}
public String getEducationName() {
return educationName;
}
public void setEducationName(String educationName) {
this.educationName = educationName == null ? null : educationName.trim();
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year == null ? null : year.trim();
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Integer getCreatId() {
return creatId;
}
public void setCreatId(Integer creatId) {
this.creatId = creatId;
}
public Date getCreatTime() {
return creatTime;
}
public void setCreatTime(Date creatTime) {
this.creatTime = creatTime;
}
public Integer getModifyId() {
return modifyId;
}
public void setModifyId(Integer modifyId) {
this.modifyId = modifyId;
}
public Date getModifyTime() {
return modifyTime;
}
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public String getGraduatedYear() {
return graduatedYear;
}
public void setGraduatedYear(String graduatedYear) {
this.graduatedYear = graduatedYear == null ? null : graduatedYear.trim();
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class DoctorHospital {
private Long id;
private Long doctorId;
private Long hospitalId;
private Integer status;
private Integer sysCode;
private String memo;
private Integer deleteFlag;
private Long createdId;
private Date createdTime;
private Long modifiedId;
private Date modifiedTime;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDoctorId() {
return doctorId;
}
public void setDoctorId(Long doctorId) {
this.doctorId = doctorId;
}
public Long getHospitalId() {
return hospitalId;
}
public void setHospitalId(Long hospitalId) {
this.hospitalId = hospitalId;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getSysCode() {
return sysCode;
}
public void setSysCode(Integer sysCode) {
this.sysCode = sysCode;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo == null ? null : memo.trim();
}
public Integer getDeleteFlag() {
return deleteFlag;
}
public void setDeleteFlag(Integer deleteFlag) {
this.deleteFlag = deleteFlag;
}
public Long getCreatedId() {
return createdId;
}
public void setCreatedId(Long createdId) {
this.createdId = createdId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Long getModifiedId() {
return modifiedId;
}
public void setModifiedId(Long modifiedId) {
this.modifiedId = modifiedId;
}
public Date getModifiedTime() {
return modifiedTime;
}
public void setModifiedTime(Date modifiedTime) {
this.modifiedTime = modifiedTime;
}
}
\ No newline at end of file
......@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Component
public interface AccountInfoDetailMapper {
/**
......@@ -66,4 +68,6 @@ public interface AccountInfoDetailMapper {
void processAccountRepeatData();
int updateRevertByAcctIds(List<Integer> list);
}
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.DoctorEducation;
import java.util.List;
public interface DoctorEducationMapper {
int deleteByPrimaryKey(Integer id);
int insert(DoctorEducation record);
int insertSelective(DoctorEducation record);
DoctorEducation selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(DoctorEducation record);
int updateByPrimaryKey(DoctorEducation record);
int updateRevertByDocIds(List<Integer> list);
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.DoctorHospital;
import java.util.List;
public interface DoctorHospitalMapper {
int deleteByPrimaryKey(Long id);
int insert(DoctorHospital record);
int insertSelective(DoctorHospital record);
DoctorHospital selectByPrimaryKey(Long id);
int updateByPrimaryKeySelective(DoctorHospital record);
int updateByPrimaryKey(DoctorHospital record);
int updateRevertByDocIds(List<Integer> list);
}
\ No newline at end of file
......@@ -8,6 +8,8 @@ import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
@Component
public interface DoctorMapper {
/**
......@@ -99,6 +101,9 @@ public interface DoctorMapper {
Integer getAcctIdByDoctorId(long id);
List<Doctor> getRevertListByDoctorIds(List<Integer> list);
int updateRevertByIdList(List<Integer> list);
/**
* 更新p_doctor表的修改记录
......
// Copyright 2016-2101 Pica.
package com.pica.cloud.account.account.server.req;
import java.util.List;
/**
* @ClassName RevertAcctsReq
* @Description TODO
* @Author peijun.zhao
* @Date 2020/6/3 17:43
* @ModifyDate 2020/6/3 17:43
* @Version 1.0
*/
public class RevertAcctsReq {
private List<Integer> doctorIds;
private String type;
public List<Integer> getDoctorIds() {
return doctorIds;
}
public void setDoctorIds(List<Integer> doctorIds) {
this.doctorIds = doctorIds;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}
......@@ -2,6 +2,8 @@ package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.server.entity.Doctor;
import java.util.List;
/**
* Created on 2019/9/11 11:01
* author:crs
......@@ -50,4 +52,6 @@ public interface DoctorService {
* @param acctId
*/
void unbindWeChat(int acctId);
void revertAccts(List<Integer> doctorIds);
}
package com.pica.cloud.account.account.server.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.pica.cloud.account.account.server.entity.AccountInfoEntity;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum;
import com.pica.cloud.account.account.server.enums.AccountTypeEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.mapper.AccountInfoDetailMapper;
import com.pica.cloud.account.account.server.mapper.DoctorEducationMapper;
import com.pica.cloud.account.account.server.mapper.DoctorHospitalMapper;
import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.foundation.utils.entity.PicaDoctor;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
......@@ -20,6 +26,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
/**
* Created on 2019/9/11 11:02
......@@ -35,11 +43,19 @@ public class DoctorServiceImpl implements DoctorService {
@Autowired
private AccountInfoDetailMapper accountInfoDetailMapper;
@Autowired
private DoctorEducationMapper doctorEducationMapper;
@Autowired
private DoctorHospitalMapper doctorHospitalMapper;
@Override
public Doctor getDoctorInfo(Integer id) {
return doctorMapper.selectByPrimaryKey(id);
}
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Transactional
@Override
public void modifyDoctorInfo(Doctor doctor,Long doctorId) {
......@@ -148,4 +164,35 @@ public class DoctorServiceImpl implements DoctorService {
public void unbindWeChat(int acctId) {
doctorMapper.unbindWeChat(acctId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void revertAccts(List<Integer> doctorIds) {
logger.info("revertAccts:{}", JSONObject.toJSONString(doctorIds));
if(doctorIds.size() == 0){
return;
}
//check docIds 是否都是已经删除了
List<Doctor> docList = doctorMapper.getRevertListByDoctorIds(doctorIds);
if(docList.size() != doctorIds.size()){
logger.error("revertAccts: 入参中存在未删除的医生id");
return;
}
//revert doctor数据
doctorMapper.updateRevertByIdList(doctorIds);
//revert account数据
List<Integer> acctIds = docList.stream().map(obj -> obj.getAcctId()).collect(Collectors.toList());
accountInfoDetailMapper.updateRevertByAcctIds(acctIds);
//revert doctor 教育信息
doctorEducationMapper.updateRevertByDocIds(doctorIds);
//revert 医生机构
doctorHospitalMapper.updateRevertByDocIds(doctorIds);
logger.info("revertAccts:end");
}
}
......@@ -59,7 +59,16 @@
<!--逻辑删除用户-->
<update id="updateDeleteByPrimaryKey" >
update account_info set delete_flag=2,modified_time=now(), modified_id=#{map.modifyId} where id=#{map.acctId}
</update>
</update>
<update id="updateRevertByAcctIds" parameterType="java.util.List" >
update account_info set
delete_flag = 1, modified_time = now(), modified_id = 99999999
where delete_flag = 2 and id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
<!--更新用户的手机号-->
<update id="updateMobileByPrimaryKey"
......
<?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.DoctorEducationMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.DoctorEducation" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="doctor_id" property="doctorId" jdbcType="INTEGER" />
<result column="school_name" property="schoolName" jdbcType="VARCHAR" />
<result column="major_id" property="majorId" jdbcType="INTEGER" />
<result column="major_name" property="majorName" jdbcType="VARCHAR" />
<result column="education_id" property="educationId" jdbcType="VARCHAR" />
<result column="education_name" property="educationName" jdbcType="VARCHAR" />
<result column="year" property="year" jdbcType="VARCHAR" />
<result column="delete_flag" property="deleteFlag" jdbcType="INTEGER" />
<result column="creat_id" property="creatId" jdbcType="INTEGER" />
<result column="creat_time" property="creatTime" jdbcType="TIMESTAMP" />
<result column="modify_id" property="modifyId" jdbcType="INTEGER" />
<result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
<result column="graduated_year" property="graduatedYear" jdbcType="VARCHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, doctor_id, school_name, major_id, major_name, education_id, education_name, year,
delete_flag, creat_id, creat_time, modify_id, modify_time, graduated_year
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from p_doctor_education
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from p_doctor_education
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.DoctorEducation" >
insert into p_doctor_education (id, doctor_id, school_name,
major_id, major_name, education_id,
education_name, year, delete_flag,
creat_id, creat_time, modify_id,
modify_time, graduated_year)
values (#{id,jdbcType=INTEGER}, #{doctorId,jdbcType=INTEGER}, #{schoolName,jdbcType=VARCHAR},
#{majorId,jdbcType=INTEGER}, #{majorName,jdbcType=VARCHAR}, #{educationId,jdbcType=VARCHAR},
#{educationName,jdbcType=VARCHAR}, #{year,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{creatId,jdbcType=INTEGER}, #{creatTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{graduatedYear,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.DoctorEducation" >
insert into p_doctor_education
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="doctorId != null" >
doctor_id,
</if>
<if test="schoolName != null" >
school_name,
</if>
<if test="majorId != null" >
major_id,
</if>
<if test="majorName != null" >
major_name,
</if>
<if test="educationId != null" >
education_id,
</if>
<if test="educationName != null" >
education_name,
</if>
<if test="year != null" >
year,
</if>
<if test="deleteFlag != null" >
delete_flag,
</if>
<if test="creatId != null" >
creat_id,
</if>
<if test="creatTime != null" >
creat_time,
</if>
<if test="modifyId != null" >
modify_id,
</if>
<if test="modifyTime != null" >
modify_time,
</if>
<if test="graduatedYear != null" >
graduated_year,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="doctorId != null" >
#{doctorId,jdbcType=INTEGER},
</if>
<if test="schoolName != null" >
#{schoolName,jdbcType=VARCHAR},
</if>
<if test="majorId != null" >
#{majorId,jdbcType=INTEGER},
</if>
<if test="majorName != null" >
#{majorName,jdbcType=VARCHAR},
</if>
<if test="educationId != null" >
#{educationId,jdbcType=VARCHAR},
</if>
<if test="educationName != null" >
#{educationName,jdbcType=VARCHAR},
</if>
<if test="year != null" >
#{year,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=INTEGER},
</if>
<if test="creatId != null" >
#{creatId,jdbcType=INTEGER},
</if>
<if test="creatTime != null" >
#{creatTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyId != null" >
#{modifyId,jdbcType=INTEGER},
</if>
<if test="modifyTime != null" >
#{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="graduatedYear != null" >
#{graduatedYear,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.DoctorEducation" >
update p_doctor_education
<set >
<if test="doctorId != null" >
doctor_id = #{doctorId,jdbcType=INTEGER},
</if>
<if test="schoolName != null" >
school_name = #{schoolName,jdbcType=VARCHAR},
</if>
<if test="majorId != null" >
major_id = #{majorId,jdbcType=INTEGER},
</if>
<if test="majorName != null" >
major_name = #{majorName,jdbcType=VARCHAR},
</if>
<if test="educationId != null" >
education_id = #{educationId,jdbcType=VARCHAR},
</if>
<if test="educationName != null" >
education_name = #{educationName,jdbcType=VARCHAR},
</if>
<if test="year != null" >
year = #{year,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null" >
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if test="creatId != null" >
creat_id = #{creatId,jdbcType=INTEGER},
</if>
<if test="creatTime != null" >
creat_time = #{creatTime,jdbcType=TIMESTAMP},
</if>
<if test="modifyId != null" >
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
<if test="graduatedYear != null" >
graduated_year = #{graduatedYear,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.DoctorEducation" >
update p_doctor_education
set doctor_id = #{doctorId,jdbcType=INTEGER},
school_name = #{schoolName,jdbcType=VARCHAR},
major_id = #{majorId,jdbcType=INTEGER},
major_name = #{majorName,jdbcType=VARCHAR},
education_id = #{educationId,jdbcType=VARCHAR},
education_name = #{educationName,jdbcType=VARCHAR},
year = #{year,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
creat_id = #{creatId,jdbcType=INTEGER},
creat_time = #{creatTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
graduated_year = #{graduatedYear,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateRevertByDocIds" parameterType="java.util.List" >
update p_doctor_education
set
delete_flag = 1,
modify_id = 99999999,
modify_time = now()
where delete_flag = 2 and doctor_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>
\ 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.DoctorHospitalMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.DoctorHospital" >
<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="status" property="status" jdbcType="INTEGER" />
<result column="sys_code" property="sysCode" jdbcType="INTEGER" />
<result column="memo" property="memo" jdbcType="VARCHAR" />
<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, status, sys_code, memo, 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 doctor_hospital
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
delete from doctor_hospital
where id = #{id,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.DoctorHospital" >
insert into doctor_hospital (id, doctor_id, hospital_id,
status, sys_code, memo,
delete_flag, created_id, created_time,
modified_id, modified_time)
values (#{id,jdbcType=BIGINT}, #{doctorId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT},
#{status,jdbcType=INTEGER}, #{sysCode,jdbcType=INTEGER}, #{memo,jdbcType=VARCHAR},
#{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.DoctorHospital" >
insert into doctor_hospital
<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="status != null" >
status,
</if>
<if test="sysCode != null" >
sys_code,
</if>
<if test="memo != null" >
memo,
</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="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="sysCode != null" >
#{sysCode,jdbcType=INTEGER},
</if>
<if test="memo != null" >
#{memo,jdbcType=VARCHAR},
</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.DoctorHospital" >
update doctor_hospital
<set >
<if test="doctorId != null" >
doctor_id = #{doctorId,jdbcType=BIGINT},
</if>
<if test="hospitalId != null" >
hospital_id = #{hospitalId,jdbcType=BIGINT},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
<if test="sysCode != null" >
sys_code = #{sysCode,jdbcType=INTEGER},
</if>
<if test="memo != null" >
memo = #{memo,jdbcType=VARCHAR},
</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.DoctorHospital" >
update doctor_hospital
set doctor_id = #{doctorId,jdbcType=BIGINT},
hospital_id = #{hospitalId,jdbcType=BIGINT},
status = #{status,jdbcType=INTEGER},
sys_code = #{sysCode,jdbcType=INTEGER},
memo = #{memo,jdbcType=VARCHAR},
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>
<update id="updateRevertByDocIds" parameterType="java.util.List" >
update doctor_hospital
set
delete_flag = 1,
modified_id = 99999999,
modified_time = now()
where delete_flag = 2 and doctor_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>
\ No newline at end of file
......@@ -1045,4 +1045,23 @@
<select id="getAcctIdByDoctorId" resultType="java.lang.Integer" parameterType="java.lang.Long">
select acct_id from p_doctor where id = #{id}
</select>
<select id="getRevertListByDoctorIds" resultMap="BaseResultMap" parameterType="java.util.List">
select * from p_doctor where delete_flag = 2
and id IN
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</select>
<update id="updateRevertByIdList" parameterType="java.util.List">
update p_doctor
set delete_flag = 1, modify_time = now(), modify_id = 99999999
where delete_flag = 2 and id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</update>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册