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

20190911 退出登录获取随机token

上级 03bb4100
流水线 #14347 已失败 于阶段
in 0 second
package com.pica.cloud.account.account.server.controller;
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.service.DoctorService;
import com.pica.cloud.foundation.entity.PicaResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* Created on 2019/9/10 18:51
* author:crs
* Description:云鹊医 获取用户信息资源
*/
@Api(description = "云鹊医用户信息信息资源")
@RestController
@RequestMapping("/doctor")
public class DoctorController extends AccountBaseController {
@Autowired
private DoctorService doctorService;
@ApiOperation("获取医生信息用接口")
@GetMapping(value = "/info", produces = "application/json;charset=utf-8")
public PicaResponse<Doctor> getDoctorInfo() {
AccountUser accountUser = null;
try {
accountUser = super.getAccountUser();
} catch (Exception e) {
e.printStackTrace();
throw new AccountException(AccountExceptionEnum.PICA_LOGIN_AGAIN);
}
Integer userId = accountUser.getId();
Doctor doctorInfo = doctorService.getDoctorInfo(userId);
return PicaResponse.toResponse(doctorInfo);
}
@ApiOperation("修改医生信息接口")
@PutMapping(value = "/info", produces = "application/json;charset=utf-8")
public PicaResponse modifyDoctorInfo(@RequestBody Doctor doctor) {
AccountUser accountUser = null;
try {
accountUser = super.getAccountUser();
} catch (Exception e) {
e.printStackTrace();
throw new AccountException(AccountExceptionEnum.PICA_LOGIN_AGAIN);
}
Integer userId = accountUser.getId();
doctor.setId(userId);
doctorService.modifyDoctorInfo(doctor);
return PicaResponse.toResponse();
}
//TODO: 2019/9/11 doctor服务已经有这两个接口了 暂时不需要提供
}
package com.pica.cloud.account.account.server.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
/**
* Created on 2019/9/10 18:51
* author:crs
* Description:云鹊医 获取用户信息资源
*/
@Api(description = "云鹊医用户信息信息资源")
@RestController
public class DoctorInfoController {
//获取用户信息接口
//修改用户信息接口
}
...@@ -3,13 +3,17 @@ package com.pica.cloud.account.account.server.controller; ...@@ -3,13 +3,17 @@ package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.server.entity.EncryptEntity; import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.entity.LogLoginEntity; import com.pica.cloud.account.account.server.entity.LogLoginEntity;
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.enums.AccountTypeEnum;
import com.pica.cloud.account.account.server.exception.AccountException;
import com.pica.cloud.account.account.server.log.AccountLogEntityUtils; import com.pica.cloud.account.account.server.log.AccountLogEntityUtils;
import com.pica.cloud.account.account.server.log.AccountLogUtils; import com.pica.cloud.account.account.server.log.AccountLogUtils;
import com.pica.cloud.account.account.server.req.BaseRequest; import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.service.LoginService; import com.pica.cloud.account.account.server.service.LoginService;
import com.pica.cloud.account.account.server.service.TokenService;
import com.pica.cloud.account.account.server.util.AccountUtils; import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.account.account.server.util.CryptoUtil; import com.pica.cloud.account.account.server.util.CryptoUtil;
import com.pica.cloud.foundation.entity.PicaException;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.redis.ICacheClient; import com.pica.cloud.foundation.redis.ICacheClient;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -22,6 +26,8 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -22,6 +26,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Api(description = "登录资源") @Api(description = "登录资源")
@RestController @RestController
public class LoginController extends AccountBaseController { public class LoginController extends AccountBaseController {
...@@ -39,6 +45,9 @@ public class LoginController extends AccountBaseController { ...@@ -39,6 +45,9 @@ public class LoginController extends AccountBaseController {
@Autowired @Autowired
private AccountUtils accountUtils; private AccountUtils accountUtils;
@Autowired
private TokenService tokenService;
/** /**
* 密码登录接口 * 密码登录接口
* *
...@@ -127,9 +136,8 @@ public class LoginController extends AccountBaseController { ...@@ -127,9 +136,8 @@ public class LoginController extends AccountBaseController {
return PicaResponse.toResponse(); return PicaResponse.toResponse();
} }
/** /**
* 退出登录接口 * 退出登录接口,返回一个随机token
* *
* @return * @return
*/ */
...@@ -139,15 +147,16 @@ public class LoginController extends AccountBaseController { ...@@ -139,15 +147,16 @@ public class LoginController extends AccountBaseController {
//只有在登录状态下才能调用此接口; //只有在登录状态下才能调用此接口;
String token = super.getToken(); String token = super.getToken();
if (StringUtils.isNotEmpty(token)) { if (StringUtils.isNotEmpty(token)) {
Integer id = super.getAcctId(); redisClient.deleteToken(token);
Map<String, Object> headersMap = super.getHeaders();
String newToken = tokenService.getToken(headersMap);
//记录登录日志 //记录登录日志
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(id, super.getProductType(), super.getSourceType(), LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(super.getAcctId(), super.getProductType(), super.getSourceType(),
AccountTypeEnum.LOGIN_OUT.getCode(), super.getIpAddr(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(), AccountTypeEnum.LOG_TYPE_LOGIN.getCode()); AccountTypeEnum.LOGIN_OUT.getCode(), super.getIpAddr(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(), AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity); picaLogUtils.info(entity);
if (redisClient.deleteToken(token)) { return PicaResponse.toResponse(newToken);
return PicaResponse.toResponse(); } else {
} throw new AccountException(AccountExceptionEnum.PICA_LOGIN_AGAIN);
} }
return PicaResponse.toResponse();
} }
} }
package com.pica.cloud.account.account.server.controller; package com.pica.cloud.account.account.server.controller;
import com.aliyun.oss.common.utils.DateUtil;
import com.pica.cloud.account.account.server.entity.AccountUser;
import com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity; import com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity;
import com.pica.cloud.account.account.server.entity.AccountUser;
import com.pica.cloud.account.account.server.entity.EncryptEntity; import com.pica.cloud.account.account.server.entity.EncryptEntity;
import com.pica.cloud.account.account.server.req.PatientReq; import com.pica.cloud.account.account.server.req.PatientReq;
import com.pica.cloud.account.account.server.service.PatientInfoService; import com.pica.cloud.account.account.server.service.PatientInfoService;
import com.pica.cloud.account.account.server.util.CryptoUtil; import com.pica.cloud.account.account.server.util.CryptoUtil;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.utils.utils.StringUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Date;
@Api(description = "云鹊健康用户信息信息资源") @Api(description = "云鹊健康用户信息信息资源")
@RestController @RestController
...@@ -28,8 +23,6 @@ public class PatientInfoController extends AccountBaseController { ...@@ -28,8 +23,6 @@ public class PatientInfoController extends AccountBaseController {
@Autowired @Autowired
private PatientInfoService patientInfoService; private PatientInfoService patientInfoService;
/** /**
* 获取用户信息接口 * 获取用户信息接口
* *
......
package com.pica.cloud.account.account.server.controller; package com.pica.cloud.account.account.server.controller;
import com.pica.cloud.account.account.server.constants.Constants; import com.pica.cloud.account.account.server.service.TokenService;
import com.pica.cloud.foundation.entity.PicaResponse; import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.entity.PicaUser;
import com.pica.cloud.foundation.utils.utils.CommonUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map; import java.util.Map;
import java.util.UUID;
import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapString;
/** /**
* Created on 2019/9/10 9:35 * Created on 2019/9/10 9:35
...@@ -29,36 +20,14 @@ import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapS ...@@ -29,36 +20,14 @@ import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapS
public class TokenController extends AccountBaseController { public class TokenController extends AccountBaseController {
@Autowired @Autowired
@Qualifier("cacheMigrateClient") private TokenService tokenService;
private ICacheClient redisClient;
@ApiOperation(value = "获取token接口") @ApiOperation(value = "获取token接口")
@GetMapping(value = "/token") @GetMapping(value = "/token")
public PicaResponse<String> getRandomToken() { public PicaResponse<String> getRandomToken() {
Map<String, Object> headersMap = super.getHeaders(); Map<String, Object> headersMap = super.getHeaders();
String mobile = new StringBuilder("9").append(CommonUtil.getRandom(10)).toString(); String token = tokenService.getToken(headersMap);
headersMap.put(Constants.HEADER_MOBILE, mobile);
if (!CollectionUtils.isEmpty(headersMap)) {
PicaUser picaUser = new PicaUser();
picaUser.setCreated_time(new Date());
picaUser.setMobile((String) headersMap.get(Constants.HEADER_MOBILE));
picaUser.setName(Constants.HEADER_USER_TYPE);
picaUser.setId(0);
picaUser.setBrowser_ver((String) headersMap.get(Constants.HEADER_BROWSER));
picaUser.setOs_name((String) headersMap.get(Constants.HEADER_OPERATOR_SYSTEM));
picaUser.setTerminal_type((String) headersMap.get(Constants.HEADER_TERMINAL_TYPE));
picaUser.setIp_addr((String) headersMap.get(Constants.HEADER_IP));
try {
Map<String, String> map = objectToMapString(Constants.TIME_FORMAT, picaUser, new String[0]);
map.put(Constants.HEADER_SYS_CODE, Constants.HEADER_SYS_SOURCE);
map.put(Constants.HEADER_GUEST_ID, UUID.randomUUID().toString().replace("-", "").toUpperCase());
String token = redisClient.saveToken(map, 21600);
return PicaResponse.toResponse(token); return PicaResponse.toResponse(token);
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
} }
} }
package com.pica.cloud.account.account.server.entity;
import java.util.Date;
public class Doctor {
private Integer id;
private Integer sex;
private String name;
private String mobilePhone;
private String tel;
private Integer status;
private Integer type;
private Integer hospitalId;
private Integer departmentId;
private Integer titleId;
private String hospital;
private String department;
private String title;
private String certImageUrl;
private String avatarImageUrl;
private Date authTime;
private String honor;
private String skills;
private Integer thumbUpNum;
private String email;
private String qrcode;
private String nickname;
private String personalSign;
private Integer deleteFlag;
private Integer creatId;
private Date creatTime;
private Integer modifyId;
private Date modifyTime;
private Integer praiseNum;
private String password;
private String info;
private String rank;
private Long province;
private String provinceName;
private Long city;
private String cityName;
private Long county;
private String countyName;
private Long town;
private String townName;
private String inviteCode;
private Date inviteStartTime;
private String gaoxueyaPassword;
private Integer smsSendNum;
private Integer totalSmsSendNum;
private Boolean entireFlag;
private Integer doctorProjectType;
private Date regTime;
private Date lastLoginTime;
private String unionid;
private Integer registerSource;
private String comment;
private Integer administerTitleId;
private String administerTitle;
private Integer registerType;
private Date firstLoginTime;
private String card;
private Date birthday;
private Integer showFlag;
private Integer acctId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSex() {
return sex;
}
public void setSex(Integer sex) {
this.sex = sex;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getMobilePhone() {
return mobilePhone;
}
public void setMobilePhone(String mobilePhone) {
this.mobilePhone = mobilePhone == null ? null : mobilePhone.trim();
}
public String getTel() {
return tel;
}
public void setTel(String tel) {
this.tel = tel == null ? null : tel.trim();
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getHospitalId() {
return hospitalId;
}
public void setHospitalId(Integer hospitalId) {
this.hospitalId = hospitalId;
}
public Integer getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Integer departmentId) {
this.departmentId = departmentId;
}
public Integer getTitleId() {
return titleId;
}
public void setTitleId(Integer titleId) {
this.titleId = titleId;
}
public String getHospital() {
return hospital;
}
public void setHospital(String hospital) {
this.hospital = hospital == null ? null : hospital.trim();
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department == null ? null : department.trim();
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getCertImageUrl() {
return certImageUrl;
}
public void setCertImageUrl(String certImageUrl) {
this.certImageUrl = certImageUrl == null ? null : certImageUrl.trim();
}
public String getAvatarImageUrl() {
return avatarImageUrl;
}
public void setAvatarImageUrl(String avatarImageUrl) {
this.avatarImageUrl = avatarImageUrl == null ? null : avatarImageUrl.trim();
}
public Date getAuthTime() {
return authTime;
}
public void setAuthTime(Date authTime) {
this.authTime = authTime;
}
public String getHonor() {
return honor;
}
public void setHonor(String honor) {
this.honor = honor == null ? null : honor.trim();
}
public String getSkills() {
return skills;
}
public void setSkills(String skills) {
this.skills = skills == null ? null : skills.trim();
}
public Integer getThumbUpNum() {
return thumbUpNum;
}
public void setThumbUpNum(Integer thumbUpNum) {
this.thumbUpNum = thumbUpNum;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public String getQrcode() {
return qrcode;
}
public void setQrcode(String qrcode) {
this.qrcode = qrcode == null ? null : qrcode.trim();
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public String getPersonalSign() {
return personalSign;
}
public void setPersonalSign(String personalSign) {
this.personalSign = personalSign == null ? null : personalSign.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 Integer getPraiseNum() {
return praiseNum;
}
public void setPraiseNum(Integer praiseNum) {
this.praiseNum = praiseNum;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info == null ? null : info.trim();
}
public String getRank() {
return rank;
}
public void setRank(String rank) {
this.rank = rank == null ? null : rank.trim();
}
public Long getProvince() {
return province;
}
public void setProvince(Long province) {
this.province = province;
}
public String getProvinceName() {
return provinceName;
}
public void setProvinceName(String provinceName) {
this.provinceName = provinceName == null ? null : provinceName.trim();
}
public Long getCity() {
return city;
}
public void setCity(Long city) {
this.city = city;
}
public String getCityName() {
return cityName;
}
public void setCityName(String cityName) {
this.cityName = cityName == null ? null : cityName.trim();
}
public Long getCounty() {
return county;
}
public void setCounty(Long county) {
this.county = county;
}
public String getCountyName() {
return countyName;
}
public void setCountyName(String countyName) {
this.countyName = countyName == null ? null : countyName.trim();
}
public Long getTown() {
return town;
}
public void setTown(Long town) {
this.town = town;
}
public String getTownName() {
return townName;
}
public void setTownName(String townName) {
this.townName = townName == null ? null : townName.trim();
}
public String getInviteCode() {
return inviteCode;
}
public void setInviteCode(String inviteCode) {
this.inviteCode = inviteCode == null ? null : inviteCode.trim();
}
public Date getInviteStartTime() {
return inviteStartTime;
}
public void setInviteStartTime(Date inviteStartTime) {
this.inviteStartTime = inviteStartTime;
}
public String getGaoxueyaPassword() {
return gaoxueyaPassword;
}
public void setGaoxueyaPassword(String gaoxueyaPassword) {
this.gaoxueyaPassword = gaoxueyaPassword == null ? null : gaoxueyaPassword.trim();
}
public Integer getSmsSendNum() {
return smsSendNum;
}
public void setSmsSendNum(Integer smsSendNum) {
this.smsSendNum = smsSendNum;
}
public Integer getTotalSmsSendNum() {
return totalSmsSendNum;
}
public void setTotalSmsSendNum(Integer totalSmsSendNum) {
this.totalSmsSendNum = totalSmsSendNum;
}
public Boolean getEntireFlag() {
return entireFlag;
}
public void setEntireFlag(Boolean entireFlag) {
this.entireFlag = entireFlag;
}
public Integer getDoctorProjectType() {
return doctorProjectType;
}
public void setDoctorProjectType(Integer doctorProjectType) {
this.doctorProjectType = doctorProjectType;
}
public Date getRegTime() {
return regTime;
}
public void setRegTime(Date regTime) {
this.regTime = regTime;
}
public Date getLastLoginTime() {
return lastLoginTime;
}
public void setLastLoginTime(Date lastLoginTime) {
this.lastLoginTime = lastLoginTime;
}
public String getUnionid() {
return unionid;
}
public void setUnionid(String unionid) {
this.unionid = unionid == null ? null : unionid.trim();
}
public Integer getRegisterSource() {
return registerSource;
}
public void setRegisterSource(Integer registerSource) {
this.registerSource = registerSource;
}
public String getComment() {
return comment;
}
public void setComment(String comment) {
this.comment = comment == null ? null : comment.trim();
}
public Integer getAdministerTitleId() {
return administerTitleId;
}
public void setAdministerTitleId(Integer administerTitleId) {
this.administerTitleId = administerTitleId;
}
public String getAdministerTitle() {
return administerTitle;
}
public void setAdministerTitle(String administerTitle) {
this.administerTitle = administerTitle == null ? null : administerTitle.trim();
}
public Integer getRegisterType() {
return registerType;
}
public void setRegisterType(Integer registerType) {
this.registerType = registerType;
}
public Date getFirstLoginTime() {
return firstLoginTime;
}
public void setFirstLoginTime(Date firstLoginTime) {
this.firstLoginTime = firstLoginTime;
}
public String getCard() {
return card;
}
public void setCard(String card) {
this.card = card == null ? null : card.trim();
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
public Integer getShowFlag() {
return showFlag;
}
public void setShowFlag(Integer showFlag) {
this.showFlag = showFlag;
}
public Integer getAcctId() {
return acctId;
}
public void setAcctId(Integer acctId) {
this.acctId = acctId;
}
}
\ No newline at end of file
package com.pica.cloud.account.account.server.mapper; package com.pica.cloud.account.account.server.mapper;
import com.pica.cloud.account.account.server.entity.DoctorEntity;
/** import com.pica.cloud.account.account.server.entity.Doctor;
* Created on 2019/9/10 17:48 import com.pica.cloud.account.account.server.entity.DoctorEntity;
* author:crs
* Description:查询医生信息
*/
public interface DoctorInfoMapper {
public interface DoctorMapper {
/** /**
* 获取医生信息 * 获取医生信息
* *
...@@ -26,5 +22,31 @@ public interface DoctorInfoMapper { ...@@ -26,5 +22,31 @@ public interface DoctorInfoMapper {
*/ */
Long selectUserIdByAcctId(Integer acctId); Long selectUserIdByAcctId(Integer acctId);
/**
* 通过id获取医生信息
*
* @param id
* @return
*/
Doctor selectByPrimaryKey(Integer id);
/**
* 更新医生信息
*
* @param record
* @return
*/
int updateByPrimaryKeySelective(Doctor record);
int deleteByPrimaryKey(Integer id);
int insert(Doctor record);
int insertSelective(Doctor record);
int updateByPrimaryKey(Doctor record);
} }
\ No newline at end of file
package com.pica.cloud.account.account.server.service;
import com.pica.cloud.account.account.server.entity.Doctor;
/**
* Created on 2019/9/11 11:01
* author:crs
* Description:医生信息接口
*/
public interface DoctorService {
/**
* 获取用户信息
*
* @param id 用户id
* @return
*/
Doctor getDoctorInfo(Integer id);
/**
* 修改医生信息
*
* @param doctor 待修改数据
*/
void modifyDoctorInfo(Doctor doctor);
}
package com.pica.cloud.account.account.server.service;
import java.util.Map;
/**
* Created on 2019/9/11 11:52
* author:crs
* Description:获取随机token
*/
public interface TokenService {
String getToken(Map<String, Object> map);
}
package com.pica.cloud.account.account.server.service.impl;
import com.pica.cloud.account.account.server.entity.Doctor;
import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.account.account.server.service.DoctorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* Created on 2019/9/11 11:02
* author:crs
* Description:医生相关Service
*/
@Service
public class DoctorServiceImpl implements DoctorService {
@Autowired
private DoctorMapper doctorMapper;
@Override
public Doctor getDoctorInfo(Integer id) {
return doctorMapper.selectByPrimaryKey(id);
}
@Override
public void modifyDoctorInfo(Doctor doctor) {
doctor.setModifyTime(new Date());
doctorMapper.insertSelective(doctor);
}
}
...@@ -56,7 +56,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -56,7 +56,7 @@ public class LoginServiceImpl implements LoginService {
private RegisterService registerService; private RegisterService registerService;
@Autowired @Autowired
private DoctorInfoMapper doctorInfoMapper; private DoctorMapper doctorInfoMapper;
@Autowired @Autowired
private AccountUtils accountUtils; private AccountUtils accountUtils;
......
package com.pica.cloud.account.account.server.service.impl;
import com.pica.cloud.account.account.server.constants.Constants;
import com.pica.cloud.account.account.server.service.TokenService;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.utils.entity.PicaUser;
import com.pica.cloud.foundation.utils.utils.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapString;
/**
* Created on 2019/9/11 13:10
* author:crs
* Description:获取随机token
*/
@Service
public class TokenServiceImpl implements TokenService {
@Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient;
@Override
public String getToken(Map<String, Object> headersMap) {
String mobile = new StringBuilder("9").append(CommonUtil.getRandom(10)).toString();
headersMap.put(Constants.HEADER_MOBILE, mobile);
if (!CollectionUtils.isEmpty(headersMap)) {
PicaUser picaUser = new PicaUser();
picaUser.setCreated_time(new Date());
picaUser.setMobile((String) headersMap.get(Constants.HEADER_MOBILE));
picaUser.setName(Constants.HEADER_USER_TYPE);
picaUser.setId(0);
picaUser.setBrowser_ver((String) headersMap.get(Constants.HEADER_BROWSER));
picaUser.setOs_name((String) headersMap.get(Constants.HEADER_OPERATOR_SYSTEM));
picaUser.setTerminal_type((String) headersMap.get(Constants.HEADER_TERMINAL_TYPE));
picaUser.setIp_addr((String) headersMap.get(Constants.HEADER_IP));
try {
Map<String, String> map = objectToMapString(Constants.TIME_FORMAT, picaUser, new String[0]);
map.put(Constants.HEADER_SYS_CODE, Constants.HEADER_SYS_SOURCE);
map.put(Constants.HEADER_GUEST_ID, UUID.randomUUID().toString().replace("-", "").toUpperCase());
String token = redisClient.saveToken(map, 21600);
return token;
} catch (Exception e) {
e.printStackTrace();
}
}
return null;
}
}
...@@ -5,7 +5,7 @@ import com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity; ...@@ -5,7 +5,7 @@ import com.pica.cloud.account.account.server.entity.AccountPatientInfoEntity;
import com.pica.cloud.account.account.server.enums.AccountExceptionEnum; 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.enums.AccountTypeEnum;
import com.pica.cloud.account.account.server.mapper.AccountPatientInfoMapper; import com.pica.cloud.account.account.server.mapper.AccountPatientInfoMapper;
import com.pica.cloud.account.account.server.mapper.DoctorInfoMapper; import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.account.account.server.req.BaseRequest; import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.foundation.entity.PicaException; import com.pica.cloud.foundation.entity.PicaException;
import com.pica.cloud.foundation.entity.PicaResultCode; import com.pica.cloud.foundation.entity.PicaResultCode;
...@@ -31,7 +31,7 @@ public class AccountUtils { ...@@ -31,7 +31,7 @@ public class AccountUtils {
private AccountPatientInfoMapper accountPatientInfoMapper; private AccountPatientInfoMapper accountPatientInfoMapper;
@Autowired @Autowired
private DoctorInfoMapper doctorInfoMapper; private DoctorMapper doctorInfoMapper;
private static final String AUTH_CODE_PREFIX = "authCode-"; private static final String AUTH_CODE_PREFIX = "authCode-";
......
...@@ -51,7 +51,7 @@ public class CryptoUtil { ...@@ -51,7 +51,7 @@ public class CryptoUtil {
/** /**
* 解密数据 * 解密数据
* *
* @param encryptEntity * @param encryptEntity·
* @return * @return
* @throws Exception * @throws Exception
*/ */
......
<?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.DoctorInfoMapper">
<!--根据手机号获取数据-->
<select id="getDoctorInfoByMobile" resultType="com.pica.cloud.account.account.server.entity.DoctorEntity"
parameterType="java.lang.String">
SELECT aa.id, aa.sex, aa.unionid, aa.name, aa.mobile_phone, aa.status, aa.type, aa.hospital_id, aa.department_id,
aa.title_id, ifnull(bb.name,aa.hospital) as hospital,
ifnull(pde.name,aa.department) as department, ifnull(pt.name,aa.title) as title, aa.cert_image_url,
aa.avatar_image_url, aa.auth_time, aa.invite_start_time, aa.honor, aa.skills, aa.thumb_up_num, aa.email,
aa.qrcode, aa.nickname, aa.personal_sign, aa.delete_flag, aa.creat_id, aa.creat_time, aa.modify_id,
aa.modify_time, aa.praise_num, aa.password, aa.info, aa.rank, aa.province, aa.city, aa.county,
aa.province_name, aa.city_name, aa.county_name,
aa.invite_code, aa.gaoxueya_password, aa.sms_send_num, aa.total_sms_send_num, aa.entire_flag, aa.doctor_project_type,
aa.administer_title_id, aa.administer_title,
pded.school_name, pded.major_id, pded.major_name, pded.education_id, pded.education_name, pded.year
FROM
p_doctor aa
left join
p_hospital bb
on aa.hospital_id = bb.id and bb.delete_flag=1
left join
p_title pt
on aa.title_id = pt.title_id
left join
p_department pde
on aa.department_id = pde.id
left join
p_doctor_education pded
on pded.doctor_id = aa.id
where aa.mobile_phone = #{mobile}
and aa.delete_flag = 1
limit 0,1
</select>
<!--通过账户id查询用户信息-->
<select id="selectUserIdByAcctId" parameterType="java.lang.Integer">
SELECT id
FROM p_doctor
where acct_id = #{acctId}
and delete_flag = 1
</select>
</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.DoctorMapper" >
<resultMap id="BaseResultMap" type="com.pica.cloud.account.account.server.entity.Doctor" >
<id column="id" property="id" jdbcType="INTEGER" />
<result column="sex" property="sex" jdbcType="INTEGER" />
<result column="name" property="name" jdbcType="VARCHAR" />
<result column="mobile_phone" property="mobilePhone" jdbcType="VARCHAR" />
<result column="tel" property="tel" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="INTEGER" />
<result column="type" property="type" jdbcType="INTEGER" />
<result column="hospital_id" property="hospitalId" jdbcType="INTEGER" />
<result column="department_id" property="departmentId" jdbcType="INTEGER" />
<result column="title_id" property="titleId" jdbcType="INTEGER" />
<result column="hospital" property="hospital" jdbcType="VARCHAR" />
<result column="department" property="department" jdbcType="VARCHAR" />
<result column="title" property="title" jdbcType="VARCHAR" />
<result column="cert_image_url" property="certImageUrl" jdbcType="VARCHAR" />
<result column="avatar_image_url" property="avatarImageUrl" jdbcType="VARCHAR" />
<result column="auth_time" property="authTime" jdbcType="TIMESTAMP" />
<result column="honor" property="honor" jdbcType="VARCHAR" />
<result column="skills" property="skills" jdbcType="VARCHAR" />
<result column="thumb_up_num" property="thumbUpNum" jdbcType="INTEGER" />
<result column="email" property="email" jdbcType="VARCHAR" />
<result column="qrcode" property="qrcode" jdbcType="VARCHAR" />
<result column="nickname" property="nickname" jdbcType="VARCHAR" />
<result column="personal_sign" property="personalSign" 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="praise_num" property="praiseNum" jdbcType="INTEGER" />
<result column="password" property="password" jdbcType="VARCHAR" />
<result column="info" property="info" jdbcType="VARCHAR" />
<result column="rank" property="rank" jdbcType="VARCHAR" />
<result column="province" property="province" jdbcType="BIGINT" />
<result column="province_name" property="provinceName" jdbcType="VARCHAR" />
<result column="city" property="city" jdbcType="BIGINT" />
<result column="city_name" property="cityName" jdbcType="VARCHAR" />
<result column="county" property="county" jdbcType="BIGINT" />
<result column="county_name" property="countyName" jdbcType="VARCHAR" />
<result column="town" property="town" jdbcType="BIGINT" />
<result column="town_name" property="townName" jdbcType="VARCHAR" />
<result column="invite_code" property="inviteCode" jdbcType="VARCHAR" />
<result column="invite_start_time" property="inviteStartTime" jdbcType="TIMESTAMP" />
<result column="gaoxueya_password" property="gaoxueyaPassword" jdbcType="VARCHAR" />
<result column="sms_send_num" property="smsSendNum" jdbcType="INTEGER" />
<result column="total_sms_send_num" property="totalSmsSendNum" jdbcType="INTEGER" />
<result column="entire_flag" property="entireFlag" jdbcType="BIT" />
<result column="doctor_project_type" property="doctorProjectType" jdbcType="INTEGER" />
<result column="reg_time" property="regTime" jdbcType="DATE" />
<result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP" />
<result column="unionid" property="unionid" jdbcType="VARCHAR" />
<result column="register_source" property="registerSource" jdbcType="INTEGER" />
<result column="comment" property="comment" jdbcType="VARCHAR" />
<result column="administer_title_id" property="administerTitleId" jdbcType="INTEGER" />
<result column="administer_title" property="administerTitle" jdbcType="VARCHAR" />
<result column="register_type" property="registerType" jdbcType="INTEGER" />
<result column="first_login_time" property="firstLoginTime" jdbcType="TIMESTAMP" />
<result column="card" property="card" jdbcType="VARCHAR" />
<result column="birthday" property="birthday" jdbcType="DATE" />
<result column="show_flag" property="showFlag" jdbcType="INTEGER" />
<result column="acct_id" property="acctId" jdbcType="INTEGER" />
</resultMap>
<sql id="Base_Column_List" >
id, sex, name, mobile_phone, tel, status, type, hospital_id, department_id, title_id,
hospital, department, title, cert_image_url, avatar_image_url, auth_time, honor,
skills, thumb_up_num, email, qrcode, nickname, personal_sign, delete_flag, creat_id,
creat_time, modify_id, modify_time, praise_num, password, info, rank, province, province_name,
city, city_name, county, county_name, town, town_name, invite_code, invite_start_time,
gaoxueya_password, sms_send_num, total_sms_send_num, entire_flag, doctor_project_type,
reg_time, last_login_time, unionid, register_source, comment, administer_title_id,
administer_title, register_type, first_login_time, card, birthday, show_flag, acct_id
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
select
<include refid="Base_Column_List" />
from p_doctor
where id = #{id,jdbcType=INTEGER}
</select>
<!--根据手机号获取数据-->
<select id="getDoctorInfoByMobile" resultType="com.pica.cloud.account.account.server.entity.DoctorEntity"
parameterType="java.lang.String">
SELECT aa.id, aa.sex, aa.unionid, aa.name, aa.mobile_phone, aa.status, aa.type, aa.hospital_id, aa.department_id,
aa.title_id, ifnull(bb.name,aa.hospital) as hospital,
ifnull(pde.name,aa.department) as department, ifnull(pt.name,aa.title) as title, aa.cert_image_url,
aa.avatar_image_url, aa.auth_time, aa.invite_start_time, aa.honor, aa.skills, aa.thumb_up_num, aa.email,
aa.qrcode, aa.nickname, aa.personal_sign, aa.delete_flag, aa.creat_id, aa.creat_time, aa.modify_id,
aa.modify_time, aa.praise_num, aa.password, aa.info, aa.rank, aa.province, aa.city, aa.county,
aa.province_name, aa.city_name, aa.county_name,
aa.invite_code, aa.gaoxueya_password, aa.sms_send_num, aa.total_sms_send_num, aa.entire_flag, aa.doctor_project_type,
aa.administer_title_id, aa.administer_title,
pded.school_name, pded.major_id, pded.major_name, pded.education_id, pded.education_name, pded.year
FROM
p_doctor aa
left join
p_hospital bb
on aa.hospital_id = bb.id and bb.delete_flag=1
left join
p_title pt
on aa.title_id = pt.title_id
left join
p_department pde
on aa.department_id = pde.id
left join
p_doctor_education pded
on pded.doctor_id = aa.id
where aa.mobile_phone = #{mobile}
and aa.delete_flag = 1
limit 0,1
</select>
<!--通过账户id查询用户信息-->
<select id="selectUserIdByAcctId" parameterType="java.lang.Integer">
SELECT id
FROM p_doctor
where acct_id = #{acctId}
and delete_flag = 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
delete from p_doctor
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.Doctor" >
insert into p_doctor (id, sex, name,
mobile_phone, tel, status,
type, hospital_id, department_id,
title_id, hospital, department,
title, cert_image_url, avatar_image_url,
auth_time, honor, skills,
thumb_up_num, email, qrcode,
nickname, personal_sign, delete_flag,
creat_id, creat_time, modify_id,
modify_time, praise_num, password,
info, rank, province,
province_name, city, city_name,
county, county_name, town,
town_name, invite_code, invite_start_time,
gaoxueya_password, sms_send_num, total_sms_send_num,
entire_flag, doctor_project_type, reg_time,
last_login_time, unionid, register_source,
comment, administer_title_id, administer_title,
register_type, first_login_time, card,
birthday, show_flag, acct_id
)
values (#{id,jdbcType=INTEGER}, #{sex,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{mobilePhone,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
#{type,jdbcType=INTEGER}, #{hospitalId,jdbcType=INTEGER}, #{departmentId,jdbcType=INTEGER},
#{titleId,jdbcType=INTEGER}, #{hospital,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR},
#{title,jdbcType=VARCHAR}, #{certImageUrl,jdbcType=VARCHAR}, #{avatarImageUrl,jdbcType=VARCHAR},
#{authTime,jdbcType=TIMESTAMP}, #{honor,jdbcType=VARCHAR}, #{skills,jdbcType=VARCHAR},
#{thumbUpNum,jdbcType=INTEGER}, #{email,jdbcType=VARCHAR}, #{qrcode,jdbcType=VARCHAR},
#{nickname,jdbcType=VARCHAR}, #{personalSign,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{creatId,jdbcType=INTEGER}, #{creatTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{praiseNum,jdbcType=INTEGER}, #{password,jdbcType=VARCHAR},
#{info,jdbcType=VARCHAR}, #{rank,jdbcType=VARCHAR}, #{province,jdbcType=BIGINT},
#{provinceName,jdbcType=VARCHAR}, #{city,jdbcType=BIGINT}, #{cityName,jdbcType=VARCHAR},
#{county,jdbcType=BIGINT}, #{countyName,jdbcType=VARCHAR}, #{town,jdbcType=BIGINT},
#{townName,jdbcType=VARCHAR}, #{inviteCode,jdbcType=VARCHAR}, #{inviteStartTime,jdbcType=TIMESTAMP},
#{gaoxueyaPassword,jdbcType=VARCHAR}, #{smsSendNum,jdbcType=INTEGER}, #{totalSmsSendNum,jdbcType=INTEGER},
#{entireFlag,jdbcType=BIT}, #{doctorProjectType,jdbcType=INTEGER}, #{regTime,jdbcType=DATE},
#{lastLoginTime,jdbcType=TIMESTAMP}, #{unionid,jdbcType=VARCHAR}, #{registerSource,jdbcType=INTEGER},
#{comment,jdbcType=VARCHAR}, #{administerTitleId,jdbcType=INTEGER}, #{administerTitle,jdbcType=VARCHAR},
#{registerType,jdbcType=INTEGER}, #{firstLoginTime,jdbcType=TIMESTAMP}, #{card,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{showFlag,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}
)
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.Doctor" >
insert into p_doctor
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="sex != null" >
sex,
</if>
<if test="name != null" >
name,
</if>
<if test="mobilePhone != null" >
mobile_phone,
</if>
<if test="tel != null" >
tel,
</if>
<if test="status != null" >
status,
</if>
<if test="type != null" >
type,
</if>
<if test="hospitalId != null" >
hospital_id,
</if>
<if test="departmentId != null" >
department_id,
</if>
<if test="titleId != null" >
title_id,
</if>
<if test="hospital != null" >
hospital,
</if>
<if test="department != null" >
department,
</if>
<if test="title != null" >
title,
</if>
<if test="certImageUrl != null" >
cert_image_url,
</if>
<if test="avatarImageUrl != null" >
avatar_image_url,
</if>
<if test="authTime != null" >
auth_time,
</if>
<if test="honor != null" >
honor,
</if>
<if test="skills != null" >
skills,
</if>
<if test="thumbUpNum != null" >
thumb_up_num,
</if>
<if test="email != null" >
email,
</if>
<if test="qrcode != null" >
qrcode,
</if>
<if test="nickname != null" >
nickname,
</if>
<if test="personalSign != null" >
personal_sign,
</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="praiseNum != null" >
praise_num,
</if>
<if test="password != null" >
password,
</if>
<if test="info != null" >
info,
</if>
<if test="rank != null" >
rank,
</if>
<if test="province != null" >
province,
</if>
<if test="provinceName != null" >
province_name,
</if>
<if test="city != null" >
city,
</if>
<if test="cityName != null" >
city_name,
</if>
<if test="county != null" >
county,
</if>
<if test="countyName != null" >
county_name,
</if>
<if test="town != null" >
town,
</if>
<if test="townName != null" >
town_name,
</if>
<if test="inviteCode != null" >
invite_code,
</if>
<if test="inviteStartTime != null" >
invite_start_time,
</if>
<if test="gaoxueyaPassword != null" >
gaoxueya_password,
</if>
<if test="smsSendNum != null" >
sms_send_num,
</if>
<if test="totalSmsSendNum != null" >
total_sms_send_num,
</if>
<if test="entireFlag != null" >
entire_flag,
</if>
<if test="doctorProjectType != null" >
doctor_project_type,
</if>
<if test="regTime != null" >
reg_time,
</if>
<if test="lastLoginTime != null" >
last_login_time,
</if>
<if test="unionid != null" >
unionid,
</if>
<if test="registerSource != null" >
register_source,
</if>
<if test="comment != null" >
comment,
</if>
<if test="administerTitleId != null" >
administer_title_id,
</if>
<if test="administerTitle != null" >
administer_title,
</if>
<if test="registerType != null" >
register_type,
</if>
<if test="firstLoginTime != null" >
first_login_time,
</if>
<if test="card != null" >
card,
</if>
<if test="birthday != null" >
birthday,
</if>
<if test="showFlag != null" >
show_flag,
</if>
<if test="acctId != null" >
acct_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=INTEGER},
</if>
<if test="sex != null" >
#{sex,jdbcType=INTEGER},
</if>
<if test="name != null" >
#{name,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null" >
#{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="tel != null" >
#{tel,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=INTEGER},
</if>
<if test="type != null" >
#{type,jdbcType=INTEGER},
</if>
<if test="hospitalId != null" >
#{hospitalId,jdbcType=INTEGER},
</if>
<if test="departmentId != null" >
#{departmentId,jdbcType=INTEGER},
</if>
<if test="titleId != null" >
#{titleId,jdbcType=INTEGER},
</if>
<if test="hospital != null" >
#{hospital,jdbcType=VARCHAR},
</if>
<if test="department != null" >
#{department,jdbcType=VARCHAR},
</if>
<if test="title != null" >
#{title,jdbcType=VARCHAR},
</if>
<if test="certImageUrl != null" >
#{certImageUrl,jdbcType=VARCHAR},
</if>
<if test="avatarImageUrl != null" >
#{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if test="authTime != null" >
#{authTime,jdbcType=TIMESTAMP},
</if>
<if test="honor != null" >
#{honor,jdbcType=VARCHAR},
</if>
<if test="skills != null" >
#{skills,jdbcType=VARCHAR},
</if>
<if test="thumbUpNum != null" >
#{thumbUpNum,jdbcType=INTEGER},
</if>
<if test="email != null" >
#{email,jdbcType=VARCHAR},
</if>
<if test="qrcode != null" >
#{qrcode,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
#{nickname,jdbcType=VARCHAR},
</if>
<if test="personalSign != null" >
#{personalSign,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="praiseNum != null" >
#{praiseNum,jdbcType=INTEGER},
</if>
<if test="password != null" >
#{password,jdbcType=VARCHAR},
</if>
<if test="info != null" >
#{info,jdbcType=VARCHAR},
</if>
<if test="rank != null" >
#{rank,jdbcType=VARCHAR},
</if>
<if test="province != null" >
#{province,jdbcType=BIGINT},
</if>
<if test="provinceName != null" >
#{provinceName,jdbcType=VARCHAR},
</if>
<if test="city != null" >
#{city,jdbcType=BIGINT},
</if>
<if test="cityName != null" >
#{cityName,jdbcType=VARCHAR},
</if>
<if test="county != null" >
#{county,jdbcType=BIGINT},
</if>
<if test="countyName != null" >
#{countyName,jdbcType=VARCHAR},
</if>
<if test="town != null" >
#{town,jdbcType=BIGINT},
</if>
<if test="townName != null" >
#{townName,jdbcType=VARCHAR},
</if>
<if test="inviteCode != null" >
#{inviteCode,jdbcType=VARCHAR},
</if>
<if test="inviteStartTime != null" >
#{inviteStartTime,jdbcType=TIMESTAMP},
</if>
<if test="gaoxueyaPassword != null" >
#{gaoxueyaPassword,jdbcType=VARCHAR},
</if>
<if test="smsSendNum != null" >
#{smsSendNum,jdbcType=INTEGER},
</if>
<if test="totalSmsSendNum != null" >
#{totalSmsSendNum,jdbcType=INTEGER},
</if>
<if test="entireFlag != null" >
#{entireFlag,jdbcType=BIT},
</if>
<if test="doctorProjectType != null" >
#{doctorProjectType,jdbcType=INTEGER},
</if>
<if test="regTime != null" >
#{regTime,jdbcType=DATE},
</if>
<if test="lastLoginTime != null" >
#{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="unionid != null" >
#{unionid,jdbcType=VARCHAR},
</if>
<if test="registerSource != null" >
#{registerSource,jdbcType=INTEGER},
</if>
<if test="comment != null" >
#{comment,jdbcType=VARCHAR},
</if>
<if test="administerTitleId != null" >
#{administerTitleId,jdbcType=INTEGER},
</if>
<if test="administerTitle != null" >
#{administerTitle,jdbcType=VARCHAR},
</if>
<if test="registerType != null" >
#{registerType,jdbcType=INTEGER},
</if>
<if test="firstLoginTime != null" >
#{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="card != null" >
#{card,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
#{birthday,jdbcType=DATE},
</if>
<if test="showFlag != null" >
#{showFlag,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
#{acctId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.Doctor" >
update p_doctor
<set >
<if test="sex != null" >
sex = #{sex,jdbcType=INTEGER},
</if>
<if test="name != null" >
name = #{name,jdbcType=VARCHAR},
</if>
<if test="mobilePhone != null" >
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
</if>
<if test="tel != null" >
tel = #{tel,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=INTEGER},
</if>
<if test="type != null" >
type = #{type,jdbcType=INTEGER},
</if>
<if test="hospitalId != null" >
hospital_id = #{hospitalId,jdbcType=INTEGER},
</if>
<if test="departmentId != null" >
department_id = #{departmentId,jdbcType=INTEGER},
</if>
<if test="titleId != null" >
title_id = #{titleId,jdbcType=INTEGER},
</if>
<if test="hospital != null" >
hospital = #{hospital,jdbcType=VARCHAR},
</if>
<if test="department != null" >
department = #{department,jdbcType=VARCHAR},
</if>
<if test="title != null" >
title = #{title,jdbcType=VARCHAR},
</if>
<if test="certImageUrl != null" >
cert_image_url = #{certImageUrl,jdbcType=VARCHAR},
</if>
<if test="avatarImageUrl != null" >
avatar_image_url = #{avatarImageUrl,jdbcType=VARCHAR},
</if>
<if test="authTime != null" >
auth_time = #{authTime,jdbcType=TIMESTAMP},
</if>
<if test="honor != null" >
honor = #{honor,jdbcType=VARCHAR},
</if>
<if test="skills != null" >
skills = #{skills,jdbcType=VARCHAR},
</if>
<if test="thumbUpNum != null" >
thumb_up_num = #{thumbUpNum,jdbcType=INTEGER},
</if>
<if test="email != null" >
email = #{email,jdbcType=VARCHAR},
</if>
<if test="qrcode != null" >
qrcode = #{qrcode,jdbcType=VARCHAR},
</if>
<if test="nickname != null" >
nickname = #{nickname,jdbcType=VARCHAR},
</if>
<if test="personalSign != null" >
personal_sign = #{personalSign,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="praiseNum != null" >
praise_num = #{praiseNum,jdbcType=INTEGER},
</if>
<if test="password != null" >
password = #{password,jdbcType=VARCHAR},
</if>
<if test="info != null" >
info = #{info,jdbcType=VARCHAR},
</if>
<if test="rank != null" >
rank = #{rank,jdbcType=VARCHAR},
</if>
<if test="province != null" >
province = #{province,jdbcType=BIGINT},
</if>
<if test="provinceName != null" >
province_name = #{provinceName,jdbcType=VARCHAR},
</if>
<if test="city != null" >
city = #{city,jdbcType=BIGINT},
</if>
<if test="cityName != null" >
city_name = #{cityName,jdbcType=VARCHAR},
</if>
<if test="county != null" >
county = #{county,jdbcType=BIGINT},
</if>
<if test="countyName != null" >
county_name = #{countyName,jdbcType=VARCHAR},
</if>
<if test="town != null" >
town = #{town,jdbcType=BIGINT},
</if>
<if test="townName != null" >
town_name = #{townName,jdbcType=VARCHAR},
</if>
<if test="inviteCode != null" >
invite_code = #{inviteCode,jdbcType=VARCHAR},
</if>
<if test="inviteStartTime != null" >
invite_start_time = #{inviteStartTime,jdbcType=TIMESTAMP},
</if>
<if test="gaoxueyaPassword != null" >
gaoxueya_password = #{gaoxueyaPassword,jdbcType=VARCHAR},
</if>
<if test="smsSendNum != null" >
sms_send_num = #{smsSendNum,jdbcType=INTEGER},
</if>
<if test="totalSmsSendNum != null" >
total_sms_send_num = #{totalSmsSendNum,jdbcType=INTEGER},
</if>
<if test="entireFlag != null" >
entire_flag = #{entireFlag,jdbcType=BIT},
</if>
<if test="doctorProjectType != null" >
doctor_project_type = #{doctorProjectType,jdbcType=INTEGER},
</if>
<if test="regTime != null" >
reg_time = #{regTime,jdbcType=DATE},
</if>
<if test="lastLoginTime != null" >
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="unionid != null" >
unionid = #{unionid,jdbcType=VARCHAR},
</if>
<if test="registerSource != null" >
register_source = #{registerSource,jdbcType=INTEGER},
</if>
<if test="comment != null" >
comment = #{comment,jdbcType=VARCHAR},
</if>
<if test="administerTitleId != null" >
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
</if>
<if test="administerTitle != null" >
administer_title = #{administerTitle,jdbcType=VARCHAR},
</if>
<if test="registerType != null" >
register_type = #{registerType,jdbcType=INTEGER},
</if>
<if test="firstLoginTime != null" >
first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},
</if>
<if test="card != null" >
card = #{card,jdbcType=VARCHAR},
</if>
<if test="birthday != null" >
birthday = #{birthday,jdbcType=DATE},
</if>
<if test="showFlag != null" >
show_flag = #{showFlag,jdbcType=INTEGER},
</if>
<if test="acctId != null" >
acct_id = #{acctId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.pica.cloud.account.account.server.entity.Doctor" >
update p_doctor
set sex = #{sex,jdbcType=INTEGER},
name = #{name,jdbcType=VARCHAR},
mobile_phone = #{mobilePhone,jdbcType=VARCHAR},
tel = #{tel,jdbcType=VARCHAR},
status = #{status,jdbcType=INTEGER},
type = #{type,jdbcType=INTEGER},
hospital_id = #{hospitalId,jdbcType=INTEGER},
department_id = #{departmentId,jdbcType=INTEGER},
title_id = #{titleId,jdbcType=INTEGER},
hospital = #{hospital,jdbcType=VARCHAR},
department = #{department,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
cert_image_url = #{certImageUrl,jdbcType=VARCHAR},
avatar_image_url = #{avatarImageUrl,jdbcType=VARCHAR},
auth_time = #{authTime,jdbcType=TIMESTAMP},
honor = #{honor,jdbcType=VARCHAR},
skills = #{skills,jdbcType=VARCHAR},
thumb_up_num = #{thumbUpNum,jdbcType=INTEGER},
email = #{email,jdbcType=VARCHAR},
qrcode = #{qrcode,jdbcType=VARCHAR},
nickname = #{nickname,jdbcType=VARCHAR},
personal_sign = #{personalSign,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},
praise_num = #{praiseNum,jdbcType=INTEGER},
password = #{password,jdbcType=VARCHAR},
info = #{info,jdbcType=VARCHAR},
rank = #{rank,jdbcType=VARCHAR},
province = #{province,jdbcType=BIGINT},
province_name = #{provinceName,jdbcType=VARCHAR},
city = #{city,jdbcType=BIGINT},
city_name = #{cityName,jdbcType=VARCHAR},
county = #{county,jdbcType=BIGINT},
county_name = #{countyName,jdbcType=VARCHAR},
town = #{town,jdbcType=BIGINT},
town_name = #{townName,jdbcType=VARCHAR},
invite_code = #{inviteCode,jdbcType=VARCHAR},
invite_start_time = #{inviteStartTime,jdbcType=TIMESTAMP},
gaoxueya_password = #{gaoxueyaPassword,jdbcType=VARCHAR},
sms_send_num = #{smsSendNum,jdbcType=INTEGER},
total_sms_send_num = #{totalSmsSendNum,jdbcType=INTEGER},
entire_flag = #{entireFlag,jdbcType=BIT},
doctor_project_type = #{doctorProjectType,jdbcType=INTEGER},
reg_time = #{regTime,jdbcType=DATE},
last_login_time = #{lastLoginTime,jdbcType=TIMESTAMP},
unionid = #{unionid,jdbcType=VARCHAR},
register_source = #{registerSource,jdbcType=INTEGER},
comment = #{comment,jdbcType=VARCHAR},
administer_title_id = #{administerTitleId,jdbcType=INTEGER},
administer_title = #{administerTitle,jdbcType=VARCHAR},
register_type = #{registerType,jdbcType=INTEGER},
first_login_time = #{firstLoginTime,jdbcType=TIMESTAMP},
card = #{card,jdbcType=VARCHAR},
birthday = #{birthday,jdbcType=DATE},
show_flag = #{showFlag,jdbcType=INTEGER},
acct_id = #{acctId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册