提交 987137bf 编写于 作者: xixian.wang@picahealth.com's avatar xixian.wang@picahealth.com

Merge branch 'release' into dev-130

# Conflicts:
#	server/pom.xml
流水线 #16635 已失败 于阶段
in 0 second
......@@ -81,12 +81,27 @@ public class Test {
System.out.println("--------------------登录接口-------------");
String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCa6j3SJwXr/pLLwb6Pq8pi9StPq+Wvm6vu+LWQB1hNqClWk0jQm5GnF6Kj0ac2gqgsMsutc3hhMaaX2QZvLX+gFQHC/ufGBdBbpPtDeGWsQItsMf/xqqlkLPkc7eVTyfsmrpQM7BG9LVvaPVXPVUcZfJNBaYuR4+Sf6Zi2ayI/hQIDAQAB";
BaseRequest login = new BaseRequest();
login.setMobile("130241112588");
login.setPassword("D0DCBF0D12A6B1E7FBFA2CE5848F3EFF");
login.setMobile("13024112588");
login.setPassword("d0dcbf0d12a6b1e7fbfa2ce5848f3eff");
String con = JSONObject.toJSONString(login);
String contentResult = AESUtil.aesEncrypt(con, "YCPQPx4qpQjEjDea");
String keyResult = RSAUtil.encrypt("YCPQPx4qpQjEjDea",publicKey);
EncryptEntity encryptTest = new EncryptEntity();
encryptTest.setContent(contentResult);
encryptTest.setKey(keyResult);
......
package com.pica.cloud.account.account.server.controller;
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.entity.EncryptEntity;
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.req.BaseRequest;
import com.pica.cloud.account.account.server.service.AccountInfoService;
import com.pica.cloud.account.account.server.service.DoctorService;
import com.pica.cloud.account.account.server.service.ModifyMobileService;
import com.pica.cloud.account.account.server.service.impl.AccountServiceImpl;
import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.account.account.server.util.CryptoUtil;
......@@ -19,7 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@Api(description="修改手机号资源")
@Api(description = "修改手机号资源")
@RestController
public class ModifyMobileController extends AccountBaseController {
......@@ -32,6 +36,9 @@ public class ModifyMobileController extends AccountBaseController {
@Autowired
private DoctorService doctorService;
@Autowired
private AccountServiceImpl accountService;
@ApiOperation("修改手机号")
@PostMapping("/mobile/modify")
......@@ -43,7 +50,13 @@ public class ModifyMobileController extends AccountBaseController {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String mobile = request.getMobile();
accountUtils.checkMobilePhoneAndAuthCode(mobile, AccountTypeEnum.SYSCODE_TYPE_MODIFY_MOBILE.getCode() + "", request.getAuthCode());
//判断当前手机号是否已经注册过
AccountInfoEntity accountInfoEntity = accountService.getAccountByMobilePhone(mobile);
if (accountInfoEntity == null) {
modifyMobileService.modify(acctId, mobile);
return PicaResponse.toResponse();
} else {
return PicaResponse.toResponse(null,AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(),AccountExceptionEnum.PICA_ALREADY_REGISTER.getMessage());
}
}
}
......@@ -48,7 +48,6 @@ public class PasswordController extends AccountBaseController {
@PostMapping(value = "/modify")
public PicaResponse modifyPassword(@RequestBody EncryptEntity entity) throws Exception {
Long doctorId= super.getDoctorIdByToken();
// AESUtil.encryptV0(picaUser.getMobile())
Doctor doctorInfo = doctorService.getDoctorInfo(doctorId.intValue());
String mobile = doctorInfo.getMobilePhone();
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile);
......
......@@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.RestController;
public class RegisterController extends AccountBaseController {
private final String REPEAT_REGISTER_PREFIX = "repeat-register—";
@Autowired
private RegisterService registerService;
......@@ -46,32 +46,18 @@ public class RegisterController extends AccountBaseController {
BaseRequest request = CryptoUtil.decrypt(entity, BaseRequest.class);
String mobile = request.getMobile();
//接口幂等性处理(redis中没有就进行注册逻辑,如果已经存在,就不处理)
String exist = redisClient.get(REPEAT_REGISTER_PREFIX + mobile);
if (StringUtils.isBlank(exist)) {
String authCode = request.getAuthCode();
String flag = AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode() + "";
accountUtils.checkMobilePhoneAndAuthCode(mobile, flag, authCode);
accountUtils.checkPassword(request.getPassword());
redisClient.set(REPEAT_REGISTER_PREFIX + mobile, mobile, 30);
LoginResult result = null;
try {
request.setFlag(AccountTypeEnum.SYSCODE_TYPE_REGISTER.getCode());
request.setProductType(super.getProductType());
request.setSourceType(super.getSourceType());
request.setLoginIp(super.getIpAddr());
result = registerService.register(request);
} catch (Exception e) {
//向上抛出异常,让异常处理框架捕获到
throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL);
} finally {
//如果在注册过程中抛出异常,就删除redis中的注册标记
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
}
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
return PicaResponse.toResponse(result);
} else {
return PicaResponse.toResponse(null, AccountExceptionEnum.PICA_ALREADY_REGISTER.getCode(), "正在注册中,请勿重复提交");
}
}
//"sourceType":6 表示长海项目
......
package com.pica.cloud.account.account.server.job;
import com.pica.cloud.account.account.server.mapper.DoctorMapper;
import com.pica.cloud.foundation.redis.ICacheClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* Created on 2019/10/29 15:37
* author:crs
* Description:doctor表重复记录处理
*/
@Component
public class DoctorRepeatDataJob {
private final String KEY = "cacheProcessDoctorRepeat";
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
private ICacheClient cacheClient;
@Autowired
private DoctorMapper doctorMapper;
/**
* 1、使用分布式锁保证一个微服务执行;
* 2、定时任务;
*/
@Scheduled(cron = "0 0 0 * * ?")
public void processDoctorRepeatData() {
//通过接口幂等性逻辑处理
String exist = cacheClient.get(KEY);
if (exist==null){
cacheClient.set(KEY,"1");
cacheClient.expire(KEY, 60 * 10);
logger.info("开始执行刷新doctor表中重复的记录");
int row = doctorMapper.processDoctorRepeatData();
logger.info("此次数据刷新影响的行数:{}", row);
try {
//防止任务一秒跑完,其他机器的时间晚了几秒
Thread.sleep(30*1000);
} catch (InterruptedException ex) {
logger.error(ex.getMessage(), ex);
}
//释放锁
cacheClient.del(KEY);
}
}
}
......@@ -10,6 +10,8 @@ import com.pica.cloud.account.account.server.mapper.LogLoginMapper;
import com.pica.cloud.account.account.server.mapper.LogPWDModifyMapper;
import com.pica.cloud.account.account.server.mapper.LogUserInfoMapper;
import com.pica.cloud.account.account.server.util.BeanUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Created on 2019/08/27
......@@ -18,6 +20,8 @@ import com.pica.cloud.account.account.server.util.BeanUtil;
*/
public class AccountLogTask implements Runnable {
private Logger logger = LoggerFactory.getLogger(this.getClass());
private LogLoginMapper loginLogMapper;
private LogPWDModifyMapper logPWDModifyMapper;
......@@ -44,12 +48,18 @@ public class AccountLogTask implements Runnable {
@Override
public void run() {
try {
logger.info("log record......");
if (type == AccountTypeEnum.LOG_TYPE_LOGIN.getCode()) {
loginLogMapper.insertSelective((LogLoginEntity) picaLogEntity);
logger.info("login record......");
loginLogMapper.insert((LogLoginEntity) picaLogEntity);
} else if (type == AccountTypeEnum.LOG_TYPE_PASSWORD.getCode()) {
logPWDModifyMapper.insert((LogPWDModifyEntity) picaLogEntity);
} else if (type == AccountTypeEnum.LOG_TYPE_USER_INFO.getCode()) {
logUserInfoMapper.insertSelective((LogUserInfoEntity) picaLogEntity);
}
} catch (Exception e) {
logger.error("log record......"+e.getMessage(),e);
}
}
}
......@@ -44,10 +44,16 @@ public interface DoctorMapper {
/**
* 通过账户id更新用户信息
*
* @param doctor
*/
void updateByAcctId(Doctor doctor);
/**
* 处理重复的记录(相同手机号多条记录一致)
*/
int processDoctorRepeatData();
void updateByMobile(Doctor doctor);
int deleteByPrimaryKey(Integer id);
......@@ -60,6 +66,7 @@ public interface DoctorMapper {
/**
* 绑定微信
*
* @param acctId
* @param unionId
* @return
......@@ -68,6 +75,7 @@ public interface DoctorMapper {
/**
* 解绑微信
*
* @param acctId
* @return
*/
......@@ -78,7 +86,6 @@ public interface DoctorMapper {
void updateDeleteByPrimaryKey(Integer id);
/**
* 通过手机号获取用户id
* @param mobile
......
......@@ -10,40 +10,40 @@ import org.springframework.context.annotation.Configuration;
* author:crs
* Description:消息队列配置
*/
@Configuration
public class QueueConfig {
public final static String QUEUE_NAME = "register_queue_account_13201";
public final static String EXCHANGE_NAME = "register_exchange";
public final static String ROUTE_KEY_NAME = "register_finish";
/**
* 创建一个消息队列
*
* @return
*/
@Bean
public Queue queue() {
return new Queue(QUEUE_NAME, true, false, true);
}
/**
* 创建交换机
*
* @return
*/
@Bean
public TopicExchange directExchange() {
return new TopicExchange(EXCHANGE_NAME);
}
/**
* 把消息队里和交换机进行绑定
*
* @return
*/
@Bean
public Binding binding() {
return BindingBuilder.bind(queue()).to(directExchange()).with(ROUTE_KEY_NAME);
}
}
//@Configuration
//public class QueueConfig {
//
// public final static String QUEUE_NAME = "register_queue_account_13201";
// public final static String EXCHANGE_NAME = "register_exchange";
// public final static String ROUTE_KEY_NAME = "register_finish";
//
// /**
// * 创建一个消息队列
// *
// * @return
// */
// @Bean
// public Queue queue() {
// return new Queue(QUEUE_NAME, true, false, true);
// }
//
// /**
// * 创建交换机
// *
// * @return
// */
// @Bean
// public TopicExchange directExchange() {
// return new TopicExchange(EXCHANGE_NAME);
// }
//
// /**
// * 把消息队里和交换机进行绑定
// *
// * @return
// */
// @Bean
// public Binding binding() {
// return BindingBuilder.bind(queue()).to(directExchange()).with(ROUTE_KEY_NAME);
// }
//}
......@@ -9,18 +9,18 @@ import org.springframework.stereotype.Component;
* author:crs
* Description:消息生产者
*/
@Component
public class QueueProducer {
@Autowired
private AmqpTemplate amqpTemplate;
/**
* 发送消息
*
* @param message
*/
public void send(byte[] message) {
amqpTemplate.convertAndSend(QueueConfig.EXCHANGE_NAME, QueueConfig.ROUTE_KEY_NAME, message);
}
}
//@Component
//public class QueueProducer {
//
// @Autowired
// private AmqpTemplate amqpTemplate;
//
// /**
// * 发送消息
// *
// * @param message
// */
// public void send(byte[] message) {
// amqpTemplate.convertAndSend(QueueConfig.EXCHANGE_NAME, QueueConfig.ROUTE_KEY_NAME, message);
// }
//}
......@@ -38,6 +38,7 @@ public class DoctorServiceImpl implements DoctorService {
return doctorMapper.selectByPrimaryKey(id);
}
@Transactional
@Override
public void modifyDoctorInfo(Doctor doctor) {
Integer id = doctor.getId();
......@@ -55,9 +56,16 @@ public class DoctorServiceImpl implements DoctorService {
doctor.setMobilePhone(AESUtil.encryptV0(mobilePhone));
doctor.setModifyTime(new Date());
doctorMapper.updateByPrimaryKeySelective(doctor);
Integer acctId = entity.getAcctId();
AccountInfoEntity accountInfoEntity = new AccountInfoEntity();
accountInfoEntity.setMobilePhone(AESUtil.encryptV0(mobilePhone));
accountInfoEntity.setId(acctId);
accountInfoEntity.setModifiedId(1580052);
accountInfoEntity.setModifiedTime(new Date());
accountInfoDetailMapper.updateByPrimaryKeySelective(accountInfoEntity);
}
@Transactional()
@Transactional
@Override
public void deleteDoctorInfo(Integer id) {
//p_doctor表修改记录状态
......@@ -96,7 +104,7 @@ public class DoctorServiceImpl implements DoctorService {
entity.setPassword(password);
entity.setCreatedTime(currentTime);
entity.setModifiedTime(currentTime);
entity.setModifiedId(0);
entity.setModifiedId(1580052);
entity.setRegisterProduct(1);
entity.setRegTime(currentTime);
entity.setRegisterSource(3);
......@@ -110,7 +118,7 @@ public class DoctorServiceImpl implements DoctorService {
accountInfoDetailMapper.insertSelective(entity);
doctor.setAcctId(entity.getId());
doctor.setMobilePhone(mobileEncrypt);
doctor.setModifyId(0);
doctor.setModifyId(1580052);
doctor.setCreatId(0);
doctor.setCreatTime(currentTime);
doctor.setModifyTime(new Date());
......
......@@ -125,10 +125,12 @@ public class LoginServiceImpl implements LoginService {
if (productType == AccountTypeEnum.PRODUCT_TYPE_DOCTOR.getCode()) {
result.setEntireFlag(doctorInfo.getEntireFlag());
}
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, sourceType,
AccountTypeEnum.LOGIN_PWD.getCode(), request.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(),
AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity);
return result;
} else {
logger.info("login failure:" + mobile);
......
......@@ -9,28 +9,27 @@ 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.AccountLogUtils;
import com.pica.cloud.account.account.server.mapper.*;
import com.pica.cloud.account.account.server.queue.QueueProducer;
import com.pica.cloud.account.account.server.req.BaseRequest;
import com.pica.cloud.account.account.server.service.RegisterService;
import com.pica.cloud.account.account.server.util.AESUtil;
import com.pica.cloud.account.account.server.util.AccountUtils;
import com.pica.cloud.account.account.server.util.ExecutorServiceUtils;
import com.pica.cloud.account.account.server.util.TokenUtils;
import com.pica.cloud.foundation.redis.ICacheClient;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.util.Date;
import java.util.concurrent.ExecutorService;
@Service
public class RegisterServiceImpl implements RegisterService {
private final String REPEAT_REGISTER_PREFIX = "repeat-register—";
private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired
......@@ -51,8 +50,8 @@ public class RegisterServiceImpl implements RegisterService {
@Autowired
private TokenUtils tokenUtils;
@Autowired
private QueueProducer queueProducer;
// @Autowired
// private QueueProducer queueProducer;
@Autowired
private AgreementEntityMapper agreementEntityMapper;
......@@ -61,7 +60,7 @@ public class RegisterServiceImpl implements RegisterService {
private AgreementLogEntityMapper agreementLogEntityMapper;
@Autowired
private DoctorMapper doctorMapper;
private ICacheClient redisClient;
/**
* 1)注册功能:默认未完善信息;
......@@ -74,9 +73,14 @@ public class RegisterServiceImpl implements RegisterService {
@Override
public LoginResult register(BaseRequest baseRequest) {
String mobile = baseRequest.getMobile();
//对注册接口做幂等性处理:注册成功,删除缓存,注册失败提示用户
String exist = redisClient.get(REPEAT_REGISTER_PREFIX + mobile);
if (StringUtils.isBlank(exist)) {
String mobileEncrypt = AESUtil.encryptV0(mobile);
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobileEncrypt);
if (accountInfoEntity == null) {
redisClient.set(REPEAT_REGISTER_PREFIX + mobile, mobile, 30);
try {
Date currentTime = new Date();
int productType = baseRequest.getProductType();
int sourceType = baseRequest.getSourceType();
......@@ -135,20 +139,31 @@ public class RegisterServiceImpl implements RegisterService {
result.setToken(newToken);
result.setUserId(userId);
result.setEntireFlag(1);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(bos);
try {
dos.writeLong(userId);
} catch (IOException e) {
e.printStackTrace();
}
queueProducer.send(bos.toByteArray());
queueProducer.send(bos.toByteArray());*/
LogLoginEntity entity = AccountLogEntityUtils.getLogLoginEntity(acctId, productType, baseRequest.getSourceType(),
AccountTypeEnum.LOGIN_REGISTER.getCode(), baseRequest.getLoginIp(), AccountTypeEnum.LOGIN_STATUS_SUCCESS.getCode(),
AccountTypeEnum.LOG_TYPE_LOGIN.getCode());
picaLogUtils.info(entity);
processAgreement(userId);
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
return result;
} catch (Exception e) {
//向上抛出异常,让异常处理框架捕获到
throw new AccountException(AccountExceptionEnum.PICA_REGISTER_FAIL);
} finally {
//如果在注册过程中抛出异常,就删除redis中的注册标记
redisClient.del(REPEAT_REGISTER_PREFIX + mobile);
}
} else {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
}
} else {
throw new AccountException(AccountExceptionEnum.PICA_ALREADY_REGISTER);
}
......@@ -162,6 +177,7 @@ public class RegisterServiceImpl implements RegisterService {
@Override
public void ocinRegister(OCINRequest request) {
String mobile = request.getMobile();
String name = request.getName();
AccountInfoEntity accountInfoEntity = accountInfoDetailMapper.selectByMobile(mobile);
if (accountInfoEntity == null) {
Date currentTime = new Date();
......@@ -177,6 +193,7 @@ public class RegisterServiceImpl implements RegisterService {
accountInfo.setRegTime(currentTime);
accountInfo.setDeleteFlag(1);
accountInfo.setSex(0);
accountInfo.setName(name);
accountInfo.setRegisterProduct(productType);
accountInfo.setRegisterSource(sourceType);
accountInfoDetailMapper.insertSelective(accountInfo);
......@@ -194,6 +211,7 @@ public class RegisterServiceImpl implements RegisterService {
account.setFirstLoginTime(currentTime);
account.setLastLoginTime(currentTime);
account.setPassword("");
account.setName(name);
accountMapper.insertSelective(account);
Long userId = accountUtils.getUserIdByAcctId(productType, acctId);
processAgreement(userId);
......
......@@ -168,7 +168,7 @@ public class AESUtil {
public static void main(String[] args) throws Exception {
String KEY="zJJ$c5md3$yuuhWW";
System.out.println("-------------加密---------");
String content = "13024112588";
String content = "13024112666";
System.out.println("加密前:" + content);
System.out.println("加密密钥和解密密钥:" + KEY);
......@@ -179,11 +179,11 @@ public class AESUtil {
System.out.println("解密后:" + decrypt);
//请求参数解密处理
// String encrypt="eZujXEvfG80W1Jp4yUnGqrnwedYIng+Sk3+BGN01B9TgXRwijp0Gd0DtJBDnrAJ/LIZqh2vVcb46IMtv5Yx1CL53ohUCThsp2cBxlFgpD8btBHKn+3I7J7D2Hyttl8RxjckhlChCKs/kZ9HWNn+XcBBO14I33ydNmmNjzUyTO9w=";
// String encrypt="DC7Sc7ydClKJztuIz/E/5fXuQ8hqdr4W8mxL/XACtqT2wzK3jBiRXnoPOvR9lANIinXInrdbY5rCIwTiI9DeWFiwPP7cSF0cjnQOY11oJLjVg9qV9VZQXbFyDYVhRv8bbto5hD4evryzbdPTq6A23fD5LmXFYnWKdbSzZfFUl/w=";
// String decrypt = RSAUtil.decrypt(encrypt,privateKey);
// System.out.println(decrypt);
// //System.out.println("YCPQPx4qpQjEjDea");
// String content="6fz7TiskNgfoKxl20O8MlKEiY3BQ3iF6wccrs3BO72QukkK8iTdugr27yCwv5ogFSJtgz3gRuMu5LfQlFyoK2aGxHpnxVIHB43LVoDbLLGE=";
// String content="z9zZyUYwKkYy08l0s1qH9CSnoNnXZbbhHVbAUwGIsOXKPGeTkZFnbL1HYJQXBdKqGzKZt8E5lDzdTGUiUVkkK8GO27fsSrRMewY5T6ndSuo=";
// String result = AESUtil.aesDecrypt(content, decrypt);
// System.out.println(result);
......@@ -199,6 +199,9 @@ public class AESUtil {
}
......
......@@ -10,7 +10,9 @@ import java.util.concurrent.Executors;
*/
public class ExecutorServiceUtils {
private static ExecutorService executorService = Executors.newFixedThreadPool(30);
public static ExecutorService getExecutor() {
return Executors.newFixedThreadPool(30);
return executorService;
}
}
......@@ -123,7 +123,7 @@ public class RSAUtil {
public static void main(String[] args) throws Exception {
//生成公钥和私钥
//genKeyPair();
// genKeyPair();
// keyMap.put(0, publicKey);
// keyMap.put(1, privateKey);
// //加密字符串
......
......@@ -45,3 +45,7 @@ spring.rabbitmq.port=5672
spring.rabbitmq.username=appuser
spring.rabbitmq.password=AqLfvyWOvLQEUzdI
spring.rabbitmq.virtual-host=account-register-vhost
management.security.enabled=false
management.endpoint.health.show-details=always
......@@ -41,3 +41,6 @@ weChatURL=https://api.weixin.qq.com/sns/userinfo?
#是否开启双写模式,是否需要向p_doctor表写数据
doubleWritingMode=true
management.security.enabled=false
management.endpoint.health.show-details=always
......@@ -35,7 +35,7 @@
select
<include refid="Base_Column_List"/>
from account_info
where mobile_phone = #{mobile} and delete_flag=1
where mobile_phone = #{mobile} and delete_flag=1 limit 1
</select>
<!--通过电话号码查询账号信息-->
......
......@@ -82,6 +82,14 @@
and delete_flag = 1
</select>
<!--刷新重复的记录-->
<update id="processDoctorRepeatData">
update p_doctor set delete_flag=2, modify_id=101432928, modify_time=now() where id in (
select id from (select pd.id from account_info pd
inner JOIN (SELECT mobile_phone,MIN(id) as id FROM account_info WHERE delete_flag=1 and mobile_phone is not null GROUP BY mobile_phone having count(*)>1) inn
on pd.id <![CDATA[!= ]]> inn.id and pd.mobile_phone = inn.mobile_phone) ttt )
</update>
<!--通过手机号查询用户id-->
<select id="selectDoctorIdByMobile" parameterType="java.lang.String" resultType="java.lang.Long">
SELECT id
......@@ -752,7 +760,6 @@
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.pica.cloud.account.account.server.entity.Doctor">
update p_doctor
<set>
......@@ -822,9 +829,6 @@
<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>
......@@ -840,9 +844,6 @@
<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>
......@@ -930,9 +931,7 @@
<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>
......
......@@ -31,18 +31,21 @@
delete from log_login
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" >
insert into log_login (id, acct_id, acct_name,
insert into log_login ( acct_id, acct_name,
product_type, source_type, login_type,
login_ip, login_time, login_status,
create_id, create_time, modify_id,
modify_time, delete_flag)
values (#{id,jdbcType=INTEGER}, #{acctId,jdbcType=INTEGER}, #{acctName,jdbcType=VARCHAR},
values (#{acctId,jdbcType=INTEGER}, #{acctName,jdbcType=VARCHAR},
#{productType,jdbcType=TINYINT}, #{sourceType,jdbcType=TINYINT}, #{loginType,jdbcType=TINYINT},
#{loginIp,jdbcType=VARCHAR}, #{loginTime,jdbcType=TIMESTAMP}, #{loginStatus,jdbcType=TINYINT},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP}, #{deleteFlag,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.pica.cloud.account.account.server.entity.LogLoginEntity" >
insert into log_login
<trim prefix="(" suffix=")" suffixOverrides="," >
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册