Browse Source

查询项目(未测试)

master
zy_Java 4 years ago
parent
commit
7a9953526e
  1. 29
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/api/DomainController.java
  2. 29
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/DomainDto.java
  3. 8
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/HeartbeatDto.java
  4. 67
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/ProjectDto.java
  5. 44
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/UserDto.java
  6. 103
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/vo/ProjectVo.java
  7. 7
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/persist/dao/IdcDomainDao.java
  8. 177
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/DomainService.java
  9. 42
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/HeartbeatService.java
  10. 24
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/IDomainService.java
  11. 2
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/util/DiplomatistConstant.java
  12. 66
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/util/RSAUtil.java
  13. 10
      ptos_diplomatist/src/main/resources/mapper_dao/IdcDomainDao.xml
  14. 24
      ptos_tall/src/main/java/com/ccsens/ptos_tall/api/ProjectController.java
  15. 61
      ptos_tall/src/main/java/com/ccsens/ptos_tall/api/UserController.java
  16. 21
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/DomainDto.java
  17. 24
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/ProjectDto.java
  18. 51
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/UserDto.java
  19. 227
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/IdcDomain.java
  20. 1411
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/IdcDomainExample.java
  21. 128
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysAuth.java
  22. 831
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysAuthExample.java
  23. 139
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysSigninLog.java
  24. 881
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysSigninLogExample.java
  25. 194
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUser.java
  26. 117
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserDevice.java
  27. 761
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserDeviceExample.java
  28. 1241
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserExample.java
  29. 62
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/vo/UserVo.java
  30. 28
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/IdcDomainDao.java
  31. 25
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysAuthDao.java
  32. 9
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysUserDao.java
  33. 30
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/IdcDomainMapper.java
  34. 30
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysAuthMapper.java
  35. 30
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysSigninLogMapper.java
  36. 30
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysUserDeviceMapper.java
  37. 30
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysUserMapper.java
  38. 2
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/HeartbeatService.java
  39. 17
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IProjectService.java
  40. 39
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IUserService.java
  41. 206
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/ProjectService.java
  42. 384
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/UserService.java
  43. 6
      ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsCodeError.java
  44. 3
      ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsConstant.java
  45. 4
      ptos_tall/src/main/resources/application.yml
  46. 2
      ptos_tall/src/main/resources/druid-dev.yml
  47. 13
      ptos_tall/src/main/resources/mapper_dao/IdcDomainDao.xml
  48. 27
      ptos_tall/src/main/resources/mapper_dao/SysAuthDao.xml
  49. 5
      ptos_tall/src/main/resources/mapper_dao/SysUserDao.xml
  50. 432
      ptos_tall/src/main/resources/mapper_raw/IdcDomainMapper.xml
  51. 291
      ptos_tall/src/main/resources/mapper_raw/SysAuthMapper.xml
  52. 306
      ptos_tall/src/main/resources/mapper_raw/SysSigninLogMapper.xml
  53. 276
      ptos_tall/src/main/resources/mapper_raw/SysUserDeviceMapper.xml
  54. 385
      ptos_tall/src/main/resources/mapper_raw/SysUserMapper.xml
  55. 21
      util/src/main/java/com/ccsens/util/JsonResponse.java

29
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/api/DomainController.java

@ -1,9 +1,12 @@
package com.ccsens.ptos_diplomatist.api;
import cn.hutool.extra.servlet.ServletUtil;
import com.ccsens.ptos_diplomatist.bean.dto.DomainDto;
import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.dto.ProjectDto;
import com.ccsens.ptos_diplomatist.bean.dto.UserDto;
import com.ccsens.ptos_diplomatist.bean.vo.DomainVo;
import com.ccsens.ptos_diplomatist.bean.vo.ProjectVo;
import com.ccsens.ptos_diplomatist.service.IDomainService;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
@ -28,22 +31,22 @@ public class DomainController {
@Resource
private IDomainService domainService;
@ApiOperation(value = "查询用户关联的域列表(PT--传达室)", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<DomainVo.DomainInfo>> queryDomainByPt(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{
log.info("PT查询用户关联的域列表:{}",params);
log.info("PT查询用户关联的域列表返回:{}",params);
return JsonResponse.newInstance().ok();
@ApiOperation(value = "查询用户关联的其他域的项目信息(PT--传达室)", notes = "")
@RequestMapping(value = "/ptDomainProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryDomainProject(HttpServletRequest request, @ApiParam @Validated @RequestBody ProjectDto.QueryProjectByPhone params) throws Exception{
log.info("PT查询用户关联的其他域的项目信息:{}",params);
List<ProjectVo.ProjectInfo> projectInfos = domainService.queryDomainProject(params);
log.info("PT查询用户关联的其他域的项目信息返回:{}",projectInfos);
return JsonResponse.newInstance().ok(projectInfos);
}
@ApiOperation(value = "根据用户信息查询用户的访问权限(传达室--传达室)", notes = "")
@RequestMapping(value = "/queryByIdc", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Boolean> queryDomainByIdc(@ApiParam @Validated @RequestBody UserDto.PhoneAndIdCard params) throws Exception{
@ApiOperation(value = "接受其他传达室的信息请求本域项目列表(传达室--传达室)", notes = "")
@RequestMapping(value = "/idcDomainProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> idcDomainProject(HttpServletRequest request,@ApiParam @Validated @RequestBody HeartbeatDto.SendDomain params) throws Exception{
log.info("根据用户信息查询用户的访问权限:{}",params);
log.info("根据用户信息查询用户的访问权限返回:{}",params);
return JsonResponse.newInstance().ok();
List<ProjectVo.ProjectInfo> projectInfos = domainService.idcDomainProject(params);
log.info("根据用户信息查询用户的访问权限返回:{}",projectInfos);
return JsonResponse.newInstance().ok(projectInfos);
}
@ApiOperation(value = "接收私域的请求返回域列表", notes = "")

29
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/DomainDto.java

@ -0,0 +1,29 @@
package com.ccsens.ptos_diplomatist.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class DomainDto {
@Data
@ApiModel("PT请求其他域的信息")
public static class TallToOtherDomain{
@ApiModelProperty("请求的接口路径")
private String url;
@ApiModelProperty("参数")
private String param;
}
@Data
@ApiModel("传达室至传达室域之间传递的信息")
public static class RequestInfo {
@ApiModelProperty("域code")
private String code;
@ApiModelProperty("签名后信息")
private byte[] data;
}
}

8
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/HeartbeatDto.java

@ -14,10 +14,6 @@ public class HeartbeatDto {
public static class SendDomain {
@ApiModelProperty("域code")
private String code;
@ApiModelProperty("发送时的时间戳")
private Long timestamp;
@ApiModelProperty("随机码")
private String noncestr;
@ApiModelProperty("签名后信息")
private byte[] data;
}
@ -33,5 +29,9 @@ public class HeartbeatDto {
private String code;
@ApiModelProperty("ip")
private String host;
@ApiModelProperty("发送时的时间戳")
private Long timestamp;
@ApiModelProperty("随机码")
private String noncestr;
}
}

67
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/ProjectDto.java

@ -0,0 +1,67 @@
package com.ccsens.ptos_diplomatist.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class ProjectDto {
@Data
@ApiModel("用户查询可见的项目")
public static class QueryProjectDto{
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
}
@Data
@ApiModel("根据手机号查找用户能看的项目列表")
public static class QueryProjectByPhone{
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("结束时间")
private List<String> phone;
}
@Data
@ApiModel("心跳里的域信息")
public static class MessageDomainInfo {
@ApiModelProperty("域id")
private Long id;
@ApiModelProperty("域名称")
private String name;
@ApiModelProperty("域code")
private String code;
@ApiModelProperty("ip")
private String host;
@ApiModelProperty("发送时的时间戳")
private Long timestamp;
@ApiModelProperty("随机码")
private String noncestr;
@ApiModelProperty("随机码")
private QueryProjectByPhone projectByPhone;
public MessageDomainInfo() {
}
public MessageDomainInfo(Long id, String name, String code, String host, Long timestamp, String noncestr, QueryProjectByPhone projectByPhone) {
this.id = id;
this.name = name;
this.code = code;
this.host = host;
this.timestamp = timestamp;
this.noncestr = noncestr;
this.projectByPhone = projectByPhone;
}
}
}

44
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/UserDto.java

@ -12,26 +12,28 @@ import java.util.List;
@Data
public class UserDto {
@Data
@ApiModel("用户身份证和手机号")
public static class PhoneAndIdCard{
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("身份证号")
private String idCard;
}
@Data
@ApiModel("域内用户信息")
public static class DomainUser{
@ApiModelProperty("手机号")
private String name;
@ApiModelProperty("身份证号")
private String code;
@ApiModelProperty("身份证号")
private String domainName;
@ApiModelProperty("身份证号")
private List<PhoneAndIdCard> userList;
}
// @Data
// @ApiModel("用户身份证和手机号")
// public static class PhoneAndIdCard{
// @ApiModelProperty("手机号")
// private String phone;
// @ApiModelProperty("身份证号")
// private String idCard;
// }
// @Data
// @ApiModel("域内用户信息")
// public static class DomainUser{
// @ApiModelProperty("手机号")
// private String name;
// @ApiModelProperty("身份证号")
// private String code;
// @ApiModelProperty("身份证号")
// private String domainName;
// @ApiModelProperty("身份证号")
// private List<PhoneAndIdCard> userList;
// }
}

103
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/vo/ProjectVo.java

@ -0,0 +1,103 @@
package com.ccsens.ptos_diplomatist.bean.vo;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.util.WebConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class ProjectVo {
@Data
@ApiModel("域信息")
public static class DomainInfo{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("域名")
private String name;
@ApiModelProperty("域code")
private String code;
@ApiModelProperty("域访问前缀")
private String url;
@ApiModelProperty("是否是自身 0否 1是")
private byte self;
@ApiModelProperty("业务列表")
private List<BusinessInfo> businessList;
}
@Data
@ApiModel("业务信息")
public static class BusinessInfo{
@ApiModelProperty("业务id")
private Long businessId;
@ApiModelProperty("业务名")
private String businessName;
@ApiModelProperty("业务code")
private String businessCode;
@ApiModelProperty("业务访问前缀")
private String url;
@ApiModelProperty("项目列表")
private List<ProjectInfo> projectList;
}
@Data
@ApiModel("日历下项目列表信息")
public static class ProjectInfo{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("项目名")
private String name;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("项目完成状态(0-未开始,1-进行中,2-暂停,3-已完成)")
private byte status;
@ApiModelProperty("访问路径)")
private String url;
@ApiModelProperty("所属域code")
private String domainCode;
@ApiModelProperty("所属业务code")
private String businessCode;
@ApiModelProperty("子项目")
private List<ProjectInfo> sonProjectList;
@JsonIgnore
@ApiModelProperty("父级id")
private Long parentId;
public Byte getStatus() {
long current = System.currentTimeMillis();
if(ObjectUtil.isNull(getStartTime()) || ObjectUtil.isNull(getEndTime())) {
return null;
}
if(getStartTime() > current){
this.status = (byte) WebConstant.EVENT_PROCESS.Pending.value;
}else if(getEndTime() < current){
this.status = (byte) WebConstant.EVENT_PROCESS.Expired.value;
}else{
this.status = (byte) WebConstant.EVENT_PROCESS.Processing.value;
}
return this.status;
}
public ProjectInfo() {
}
public ProjectInfo(Long id, String name, Long startTime, Long endTime, String url, String domainCode, String businessCode) {
this.id = id;
this.name = name;
this.startTime = startTime;
this.endTime = endTime;
this.url = url;
this.domainCode = domainCode;
this.businessCode = businessCode;
}
}
}

7
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/persist/dao/IdcDomainDao.java

@ -41,4 +41,11 @@ public interface IdcDomainDao extends IdcDomainMapper {
* @return 返回公域信息
*/
IdcDomain getPubDomain();
/**
* 查询所有在线的域
* @param lastAnswerTime 判断离线时间
* @return 返回域列表
*/
List<IdcDomain> getOnlineDomain(@Param("now")Long now, @Param("lastAnswerTime") Long lastAnswerTime);
}

177
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/DomainService.java

@ -11,11 +11,16 @@ import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ptos_diplomatist.bean.dto.DomainDto;
import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.dto.ProjectDto;
import com.ccsens.ptos_diplomatist.bean.po.IdcDomain;
import com.ccsens.ptos_diplomatist.bean.vo.DomainVo;
import com.ccsens.ptos_diplomatist.bean.vo.ProjectVo;
import com.ccsens.ptos_diplomatist.persist.dao.IdcDomainDao;
import com.ccsens.ptos_diplomatist.util.DiplomatistCodeError;
import com.ccsens.ptos_diplomatist.util.DiplomatistConstant;
import com.ccsens.ptos_diplomatist.util.RSAUtil;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
@ -25,6 +30,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@ -41,7 +47,27 @@ public class DomainService implements IDomainService {
@Override
public List<DomainVo.DomainInfo> heartbeatQueryList(HeartbeatDto.SendDomain param, String clientIp) {
//验证其他域发来的信息是否合法
byte[] decode = verifyDomainMessage(param);
//转换成对象
HeartbeatDto.MessageDomainInfo domainInfo = JSON.parseObject(StrUtil.str(decode, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class);
//验证ip白名单是否匹配
if(domainInfo == null || !domainInfo.getHost().equals(clientIp)){
log.info("白名单不匹配:{}---实际请求{}",domainInfo,clientIp);
// throw new BaseException(ptos_diplomatistCodeError.GET_DOMAIN_ERROR);
}
//TODO 验证通讯时间
//TODO 随机字符
//查询除了自身的所有域信息并返回
return domainDao.queryAllDomain();
}
/**
* 验证其他域发来的信息是否合法
* @param param 其他域发来的信息
* @return 返回解密后的信息
*/
public byte[] verifyDomainMessage(HeartbeatDto.SendDomain param) {
//根据code查找发送方域信息
IdcDomain idcDomains = domainDao.getByCode(param.getCode());
if(ObjectUtil.isNull(idcDomains)){
@ -56,38 +82,11 @@ public class DomainService implements IDomainService {
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR);
}
//根据发送方公钥验证签名
byte[] decrypt;
try {
RSA pub = new RSA(null, idcDomains.getPublicKey());
decrypt = pub.decrypt(param.getData(), KeyType.PublicKey);
}catch (Exception e){
log.info("验证签名失败:{}",e);
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR);
}
//查询自身域信息
IdcDomain selfDomains = domainDao.getOneself();
HeartbeatDto.MessageDomainInfo domainInfo;
try {
//根据自身私钥解密
RSA pri = new RSA(selfDomains.getPrivateKey(),null);
byte[] decrypt2 = pri.decrypt(decrypt, KeyType.PrivateKey);
log.info("解密未报错");
//转换成对象
domainInfo = JSON.parseObject(StrUtil.str(decrypt2, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class);
}catch (Exception e){
log.info("解密失败:{}",e);
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR);
}
//验证ip白名单是否匹配
if(domainInfo == null || !domainInfo.getHost().equals(clientIp)){
log.info("白名单不匹配:{}---实际请求{}",domainInfo,clientIp);
// throw new BaseException(ptos_diplomatistCodeError.GET_DOMAIN_ERROR);
}
//查询除了自身的所有域信息并返回
return domainDao.queryAllDomain();
return RSAUtil.decode(param.getData(), idcDomains.getPublicKey(), selfDomains.getPrivateKey());
}
/**
* 定时请求公域更新自身域列表信息
*/
@ -102,24 +101,19 @@ public class DomainService implements IDomainService {
msgDomainInfo.setName(selfDomains.getName());
msgDomainInfo.setCode(selfDomains.getCode());
msgDomainInfo.setHost(selfDomains.getHost());
msgDomainInfo.setTimestamp(System.currentTimeMillis());
//TODO 随机码
msgDomainInfo.setNoncestr("");
//查询自身的公域
IdcDomain pubDomain = domainDao.getPubDomain();
if(ObjectUtil.isNull(pubDomain)){
return;
}
//使用对方的公钥加密
RSA pub = new RSA(null, pubDomain.getPublicKey());
byte[] encrypt = pub.encrypt(StrUtil.bytes(JSON.toJSONString(msgDomainInfo), CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
//使用自己的私钥签名
RSA pri = new RSA(selfDomains.getPrivateKey(),null);
byte[] encrypt2 = pri.encrypt(encrypt, KeyType.PrivateKey);
byte[] encrypt = RSAUtil.encrypt(JSON.toJSONString(msgDomainInfo), pubDomain.getPublicKey(), selfDomains.getPrivateKey());
//生成发送的对象
HeartbeatDto.SendDomain sendDomain = new HeartbeatDto.SendDomain();
sendDomain.setCode(selfDomains.getCode());
sendDomain.setTimestamp(System.currentTimeMillis());
//TODO 随机码
sendDomain.setData(encrypt2);
sendDomain.setData(encrypt);
//发送请求
String url = pubDomain.getUrl() + "/domain/list";
// String url = "http://localhost:7280/domain/list";
@ -182,4 +176,111 @@ public class DomainService implements IDomainService {
}
}
}
@Override
public List<ProjectVo.ProjectInfo> queryDomainProject(ProjectDto.QueryProjectByPhone params) {
List<ProjectVo.ProjectInfo> projectInfoList = new ArrayList<>();
//查询自身域信息
IdcDomain selfDomains = domainDao.getOneself();
if(ObjectUtil.isNull(selfDomains)){
return null;
}
//需要加密的信息
ProjectDto.MessageDomainInfo messageDomainInfo = new ProjectDto.MessageDomainInfo(selfDomains.getId(),
selfDomains.getName(),selfDomains.getName(),selfDomains.getHost(),System.currentTimeMillis(),"",params);
//查询所有在线的域列表
List<IdcDomain> idcDomains = domainDao.getOnlineDomain(System.currentTimeMillis(), DiplomatistConstant.LAST_ANSWER_TIME);
if(CollectionUtil.isNotEmpty(idcDomains)){
idcDomains.forEach(idcDomain -> {
//使用对方的公钥加密
byte[] encrypt = RSAUtil.encrypt(JSON.toJSONString(messageDomainInfo), idcDomain.getPublicKey(), selfDomains.getPrivateKey());
//生成发送的对象
HeartbeatDto.SendDomain sendDomain = new HeartbeatDto.SendDomain();
sendDomain.setCode(selfDomains.getCode());
sendDomain.setData(encrypt);
//发送请求
String url = idcDomain.getUrl() + "/domain/idcDomainProject";
log.info("调用接口:{}--{}", url, sendDomain);
JSONObject jsonObject = null;
try {
String postBody = RestTemplateUtil.postBody(url, sendDomain);
jsonObject = JSONObject.parseObject(postBody);
}catch (Exception e){
log.error("调用接口失败",e);
}
if(ObjectUtil.isNotNull(jsonObject)){
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
projectInfoList.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
}
}
}
}
});
}
return projectInfoList;
}
@Override
public List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params) {
List<ProjectVo.ProjectInfo> projectInfos = new ArrayList<>();
//验证信息是否正确
byte[] decode = verifyDomainMessage(params);
//转换为自己需要的对象
ProjectDto.MessageDomainInfo messageDomainInfo = null;
try {
messageDomainInfo = JSON.parseObject(StrUtil.str(decode, CharsetUtil.CHARSET_UTF_8), ProjectDto.MessageDomainInfo.class);
}catch (Exception e){
log.error("获取信息失败",e);
return null;
}
if(ObjectUtil.isNotNull(messageDomainInfo)){
//请求本域tall查找项目列表
//发送请求
//TODO 连接
String url = "/project/byPhone";
log.info("调用接口:{}--{}", url, messageDomainInfo.getProjectByPhone());
JSONObject jsonObject = null;
try {
String postBody = RestTemplateUtil.postBody(url, messageDomainInfo.getProjectByPhone());
jsonObject = JSONObject.parseObject(postBody);
}catch (Exception e){
log.error("调用接口失败",e);
}
if(ObjectUtil.isNotNull(jsonObject)){
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
projectInfos.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
}
}
}
}
}
return projectInfos;
}
}

42
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/HeartbeatService.java

@ -12,6 +12,7 @@ import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.po.IdcDomain;
import com.ccsens.ptos_diplomatist.persist.dao.IdcDomainDao;
import com.ccsens.ptos_diplomatist.util.DiplomatistCodeError;
import com.ccsens.ptos_diplomatist.util.RSAUtil;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
@ -36,8 +37,6 @@ public class HeartbeatService implements IHeartbeatService {
@Override
public void inHeartbeat(HeartbeatDto.SendDomain param, String clientIp) {
//TODO 验证通讯时间
//根据code查找发送方域信息
IdcDomain idcDomains = domainDao.getByCode(param.getCode());
if(ObjectUtil.isNull(idcDomains)){
@ -51,33 +50,16 @@ public class HeartbeatService implements IHeartbeatService {
log.info("不接受对方的请求");
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR);
}
//根据发送方公钥验证签名
byte[] decrypt;
try {
RSA pub = new RSA(null, idcDomains.getPublicKey());
decrypt = pub.decrypt(param.getData(), KeyType.PublicKey);
}catch (Exception e){
log.info("验证签名失败:{}",e);
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR);
}
//查询自身域信息
IdcDomain selfDomains = domainDao.getOneself();
HeartbeatDto.MessageDomainInfo domainInfo;
try {
//根据自身私钥解密
RSA pri = new RSA(selfDomains.getPrivateKey(),null);
byte[] decrypt2 = pri.decrypt(decrypt, KeyType.PrivateKey);
//转换成对象
domainInfo = JSON.parseObject(StrUtil.str(decrypt2, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class);
}catch (Exception e){
log.info("解密失败:{}",e);
throw new BaseException(DiplomatistCodeError.HEARTBEAT_ERROR);
}
byte[] decode = RSAUtil.decode(param.getData(), idcDomains.getPublicKey(), selfDomains.getPrivateKey());
HeartbeatDto.MessageDomainInfo domainInfo = JSON.parseObject(StrUtil.str(decode, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class);
//验证ip白名单是否匹配
if(domainInfo == null || !domainInfo.getHost().equals(clientIp)){
log.info("白名单不匹配:{}---实际请求{}",domainInfo,clientIp);
// throw new BaseException(ptos_diplomatistCodeError.HEARTBEAT_ERROR);
}
//TODO 验证通讯时间
//TODO 随机字符
}
@ -95,7 +77,9 @@ public class HeartbeatService implements IHeartbeatService {
domainInfo.setName(selfDomains.getName());
domainInfo.setCode(selfDomains.getCode());
domainInfo.setHost(selfDomains.getHost());
domainInfo.setTimestamp(System.currentTimeMillis());
//TODO 随机码
domainInfo.setNoncestr("");
//查找需要轮询的域
List<IdcDomain> idcDomains = domainDao.getPolling();
if(CollectionUtil.isNotEmpty(idcDomains)){
@ -104,17 +88,11 @@ public class HeartbeatService implements IHeartbeatService {
idcDomain.setLastAskTime(System.currentTimeMillis());
domainDao.updateByPrimaryKeySelective(idcDomain);
//使用对方的公钥加密
RSA pub = new RSA(null, idcDomain.getPublicKey());
byte[] encrypt = pub.encrypt(StrUtil.bytes(JSON.toJSONString(domainInfo), CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
//使用自己的私钥签名
RSA pri = new RSA(selfDomains.getPrivateKey(),null);
byte[] encrypt2 = pri.encrypt(encrypt, KeyType.PrivateKey);
byte[] encrypt = RSAUtil.encrypt(JSON.toJSONString(domainInfo), idcDomain.getPublicKey(), selfDomains.getPrivateKey());
//生成发送的对象
HeartbeatDto.SendDomain sendDomain = new HeartbeatDto.SendDomain();
sendDomain.setCode(selfDomains.getCode());
sendDomain.setTimestamp(System.currentTimeMillis());
//TODO 随机码
sendDomain.setData(encrypt2);
sendDomain.setData(encrypt);
//发送心跳
String url = idcDomain.getUrl() + "/heart";
log.info("调用接口:{}--{}", url, sendDomain);

24
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/IDomainService.java

@ -1,7 +1,10 @@
package com.ccsens.ptos_diplomatist.service;
import com.ccsens.ptos_diplomatist.bean.dto.DomainDto;
import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.dto.ProjectDto;
import com.ccsens.ptos_diplomatist.bean.vo.DomainVo;
import com.ccsens.ptos_diplomatist.bean.vo.ProjectVo;
import java.util.List;
@ -16,4 +19,25 @@ public interface IDomainService {
* @return 返回域列表
*/
List<DomainVo.DomainInfo> heartbeatQueryList(HeartbeatDto.SendDomain param, String clientIp);
// /**
// * 访问用户关联的其他域的接口
// * @param params 路径和参数
// * @return 返回
// */
// Object queryDomainByPt(DomainDto.TallToOtherDomain params);
/**
* 查询用户关联域内的项目列表
* @param params 用户信息和时间
* @return 返回项目列表
*/
List<ProjectVo.ProjectInfo> queryDomainProject(ProjectDto.QueryProjectByPhone params);
/**
* 其他域请求本域返回项目信息
* @param params 其他域的加密信息
* @return 返回项目列表
*/
List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params);
}

2
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/util/DiplomatistConstant.java

@ -7,6 +7,8 @@ import java.util.Map;
* @author
*/
public class DiplomatistConstant {
/**域离线时间 21分钟*/
public static final Long LAST_ANSWER_TIME = 21 * 60 * 1000L;
/**图片类型*/
public static final String FILE_TYPE_IMG = "bmp,jpg,jpeg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp";

66
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/util/RSAUtil.java

@ -0,0 +1,66 @@
package com.ccsens.ptos_diplomatist.util;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSON;
import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.po.IdcDomain;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import java.security.PublicKey;
/**
* @author
*/
@Slf4j
public class RSAUtil {
/**
* 加密后签名
* @param data 数据
* @param pubKey 公钥
* @param priKey 私钥
* @return 返回加密后的数据
*/
public static byte[] encrypt(String data, String pubKey, String priKey){
RSA pub = new RSA(null, pubKey);
byte[] encrypt = pub.encrypt(StrUtil.bytes(data, CharsetUtil.CHARSET_UTF_8), KeyType.PublicKey);
//使用自己的私钥签名
RSA pri = new RSA(priKey,null);
byte[] encrypt2 = pri.encrypt(encrypt, KeyType.PrivateKey);
return encrypt2;
}
/**
* 验签后解密
* @param data 数据
* @param pubKey 公钥
* @param priKey 私钥
* @return 返回加密后的数据
*/
public static byte[] decode(byte[] data, String pubKey, String priKey){
byte[] decrypt;
try {
RSA pub = new RSA(null, pubKey);
decrypt = pub.decrypt(data, KeyType.PublicKey);
}catch (Exception e){
log.info("验证签名失败:{}",e);
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR);
}
try {
//根据自身私钥解密
RSA pri = new RSA(priKey,null);
decrypt = pri.decrypt(decrypt, KeyType.PrivateKey);
log.info("解密未报错");
// //转换成对象
// domainInfo = JSON.parseObject(StrUtil.str(decrypt2, CharsetUtil.CHARSET_UTF_8), HeartbeatDto.MessageDomainInfo.class);
}catch (Exception e){
log.info("解密失败:{}",e);
throw new BaseException(DiplomatistCodeError.GET_DOMAIN_ERROR);
}
return decrypt;
}
}

10
ptos_diplomatist/src/main/resources/mapper_dao/SPluginDao.xml → ptos_diplomatist/src/main/resources/mapper_dao/IdcDomainDao.xml

@ -44,4 +44,14 @@
<select id="getPubDomain" resultType="com.ccsens.ptos_diplomatist.bean.po.IdcDomain">
SELECT * FROM `t_idc_domain` WHERE pub = 1 and rec_status = 0 limit 1
</select>
<select id="getOnlineDomain" resultType="com.ccsens.ptos_diplomatist.bean.po.IdcDomain">
SELECT
*
FROM
t_idc_domain
WHERE
self = 0
and last_answer_time + #{lastAnswerTime} > #{now}
and rec_status = 0
</select>
</mapper>

24
ptos_tall/src/main/java/com/ccsens/ptos_tall/api/ProjectController.java

@ -30,12 +30,28 @@ public class ProjectController {
@Resource
private IProjectService projectService;
@ApiOperation(value = "查询用户所有域下所有业务内的所有项目", notes = "")
@ApiOperation(value = "日历页获取项目列表", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryDomainByUser(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectDto> params) throws Exception{
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByUser(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectDto> params) throws Exception{
log.info("查询用户所有域下所有业务内的所有项目:{}",params);
List<ProjectVo.ProjectInfo> projectInfoList = projectService.queryDomainByUser(params.getParam(),params.getUserId());
log.info("查询用户所有域下所有业务内的所有项目");
List<ProjectVo.ProjectInfo> projectInfoList = projectService.queryProjectByUser(params.getPhone(),params.getParam(),params.getUserId());
log.info("返回用户所有域下所有业务内的所有项目");
return JsonResponse.newInstance().ok(projectInfoList);
}
@ApiOperation(value = "查询日历是否有小红点", notes = "查询日历是否有小红点")
@RequestMapping(value = "/day", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<String>> haveProjectDay(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryHaveProject> params) throws Exception{
List<String> projectById = projectService.haveProjectDay(params.getParam(), params.getUserId());
return JsonResponse.newInstance().ok(projectById);
}
@ApiOperation(value = "根据手机号获取用户在本域的业务项目列表", notes = "")
@RequestMapping(value = "/byPhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByPhone(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectByPhone> params) throws Exception{
log.info("根据手机号获取用户在本域的业务项目列表:{}",params);
List<ProjectVo.ProjectInfo> businessInfos = projectService.queryProjectByPhone(params.getParam());
log.info("返回手机号用户的项目");
return JsonResponse.newInstance().ok(businessInfos);
}
}

61
ptos_tall/src/main/java/com/ccsens/ptos_tall/api/UserController.java

@ -1,18 +1,73 @@
package com.ccsens.ptos_tall.api;
import cn.hutool.extra.servlet.ServletUtil;
import com.ccsens.ptos_tall.bean.dto.ProjectDto;
import com.ccsens.ptos_tall.bean.dto.UserDto;
import com.ccsens.ptos_tall.bean.vo.ProjectVo;
import com.ccsens.ptos_tall.bean.vo.UserVo;
import com.ccsens.ptos_tall.service.IUserService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import com.ccsens.util.bean.dto.QueryDto;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* @author
*/
@Api(tags = "user" , description = "用户信息相关接口")
@RestController
@RequestMapping("/user")
@RequestMapping("/users")
@Slf4j
public class UserController {
@Resource
private IUserService userService;
@ApiOperation(value = "登录", notes = "")
@RequestMapping(value = "/signin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> userSignin(HttpServletRequest request, @ApiParam @Validated @RequestBody UserDto.SigninDto params) throws Exception{
log.info("登录:{}",params);
// String deviceId = request.getHeader("deviceId");
UserVo.TokenBean tokenBean = userService.userSignin(params,"", ServletUtil.getClientIP(request));
log.info("返回用户信息");
return JsonResponse.newInstance().ok(tokenBean,tokenBean.getToken(),tokenBean.getRefreshToken());
}
@ApiOperation(value = "根据token换取用户信息", notes = "")
@RequestMapping(value = "/token", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.BusinessUserInfo> userByBusinessToken(HttpServletRequest request, @ApiParam @Validated @RequestBody UserDto.BusinessToken params) throws Exception{
log.info("根据token换取用户信息:{}",params);
UserVo.BusinessUserInfo userInfo = userService.userByBusinessToken(params);
log.info("返回用户信息");
return JsonResponse.newInstance().ok(userInfo);
}
@ApiOperation(value = "/发送验证码", notes = "")
@RequestMapping(value = "/smscode", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SmsCode> getSmsCode(@ApiParam @RequestParam String phone,
@RequestParam(required = true) String verificationCodeId, String verificationCodeValue) throws Exception {
log.info("发送验证码,手机号:{},图形验证码id:{},值:{}",phone,verificationCodeId,verificationCodeValue);
UserVo.SmsCode smsCodeVo = userService.getSignInSmsCode(phone,verificationCodeId,verificationCodeValue);
return JsonResponse.newInstance().ok(smsCodeVo);
}
@ApiOperation(value = "图片验证码")
@ApiImplicitParams({
})
@RequestMapping(value = "/code", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.VerificationCode> vertifyCode() throws Exception {
UserVo.VerificationCode vertifyCode = userService.getVertifyCode();
return JsonResponse.newInstance().ok(vertifyCode);
}
}

21
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/DomainDto.java

@ -0,0 +1,21 @@
package com.ccsens.ptos_tall.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class DomainDto {
@Data
@ApiModel("PT请求其他域的信息")
public static class TallToOtherDomain{
@ApiModelProperty("请求的接口路径")
private String url;
@ApiModelProperty("参数")
private String param;
}
}

24
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/ProjectDto.java

@ -4,6 +4,9 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author
*/
@ -19,4 +22,25 @@ public class ProjectDto {
private Long endTime;
}
@Data
@ApiModel("根据手机号查找用户能看的项目列表")
public static class QueryProjectByPhone{
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("结束时间")
private List<String> phone;
}
@Data
@ApiModel("查询日历是否有项目")
public static class QueryHaveProject {
@NotNull(message = "开始时间不能为空")
@ApiModelProperty("开始时间")
private Long startTime;
@NotNull(message = "结束时间不能为空")
@ApiModelProperty("结束时间")
private Long endTime;
}
}

51
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/UserDto.java

@ -0,0 +1,51 @@
package com.ccsens.ptos_tall.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author
*/
@Data
public class UserDto {
@Data
@ApiModel("登录")
public static class SigninDto{
@ApiModelProperty("登录客户端:0-H5,1-APP")
@NotNull(message = "客户端类型异常")
private Integer client;
@ApiModelProperty("登录类型:0-wxmp(小程序),1-phone(手机),2-email(邮箱),3-accounts(账号),4-OAUTH2_Wx(微信),5-Wx_H5(网页微信),6-OAUTH2_WeiBo, 7-Wx_Enterprise(企业微信)")
@NotNull(message = "登录类型异常")
private Integer type;
@ApiModelProperty("登录信息")
@NotNull(message = "登录信息不能为空")
private SigninData data;
}
@Data
@ApiModel("登录信息")
public static class SigninData{
@ApiModelProperty("用户标识|用户名|手机号")
private String identifier;
@ApiModelProperty("用户凭据|密码|验证码")
private String credential;
}
@Data
@ApiModel("业务根据token获取用户信息")
public static class BusinessToken{
@ApiModelProperty("token")
private String token;
@ApiModelProperty("appId")
private String appId;
@ApiModelProperty("secret")
private String secret;
}
}

227
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/IdcDomain.java

@ -0,0 +1,227 @@
package com.ccsens.ptos_tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class IdcDomain implements Serializable {
private Long id;
private String name;
private String code;
private String intro;
private String url;
private String host;
private Byte self;
private Byte pub;
private Byte polling;
private Byte answer;
private Long lastUpdateTime;
private Long lastAskTime;
private Long lastAnswerTime;
private String publicKey;
private String privateKey;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro == null ? null : intro.trim();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host == null ? null : host.trim();
}
public Byte getSelf() {
return self;
}
public void setSelf(Byte self) {
this.self = self;
}
public Byte getPub() {
return pub;
}
public void setPub(Byte pub) {
this.pub = pub;
}
public Byte getPolling() {
return polling;
}
public void setPolling(Byte polling) {
this.polling = polling;
}
public Byte getAnswer() {
return answer;
}
public void setAnswer(Byte answer) {
this.answer = answer;
}
public Long getLastUpdateTime() {
return lastUpdateTime;
}
public void setLastUpdateTime(Long lastUpdateTime) {
this.lastUpdateTime = lastUpdateTime;
}
public Long getLastAskTime() {
return lastAskTime;
}
public void setLastAskTime(Long lastAskTime) {
this.lastAskTime = lastAskTime;
}
public Long getLastAnswerTime() {
return lastAnswerTime;
}
public void setLastAnswerTime(Long lastAnswerTime) {
this.lastAnswerTime = lastAnswerTime;
}
public String getPublicKey() {
return publicKey;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey == null ? null : publicKey.trim();
}
public String getPrivateKey() {
return privateKey;
}
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey == null ? null : privateKey.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", code=").append(code);
sb.append(", intro=").append(intro);
sb.append(", url=").append(url);
sb.append(", host=").append(host);
sb.append(", self=").append(self);
sb.append(", pub=").append(pub);
sb.append(", polling=").append(polling);
sb.append(", answer=").append(answer);
sb.append(", lastUpdateTime=").append(lastUpdateTime);
sb.append(", lastAskTime=").append(lastAskTime);
sb.append(", lastAnswerTime=").append(lastAnswerTime);
sb.append(", publicKey=").append(publicKey);
sb.append(", privateKey=").append(privateKey);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

1411
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/IdcDomainExample.java

File diff suppressed because it is too large

128
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysAuth.java

@ -0,0 +1,128 @@
package com.ccsens.ptos_tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysAuth implements Serializable {
private Long id;
private Long userId;
private Byte identifyType;
private String identifier;
private String credential;
private String salt;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Byte getIdentifyType() {
return identifyType;
}
public void setIdentifyType(Byte identifyType) {
this.identifyType = identifyType;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier == null ? null : identifier.trim();
}
public String getCredential() {
return credential;
}
public void setCredential(String credential) {
this.credential = credential == null ? null : credential.trim();
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt == null ? null : salt.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", identifyType=").append(identifyType);
sb.append(", identifier=").append(identifier);
sb.append(", credential=").append(credential);
sb.append(", salt=").append(salt);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

831
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysAuthExample.java

@ -0,0 +1,831 @@
package com.ccsens.ptos_tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysAuthExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysAuthExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andIdentifyTypeIsNull() {
addCriterion("identify_type is null");
return (Criteria) this;
}
public Criteria andIdentifyTypeIsNotNull() {
addCriterion("identify_type is not null");
return (Criteria) this;
}
public Criteria andIdentifyTypeEqualTo(Byte value) {
addCriterion("identify_type =", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotEqualTo(Byte value) {
addCriterion("identify_type <>", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeGreaterThan(Byte value) {
addCriterion("identify_type >", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("identify_type >=", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeLessThan(Byte value) {
addCriterion("identify_type <", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeLessThanOrEqualTo(Byte value) {
addCriterion("identify_type <=", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeIn(List<Byte> values) {
addCriterion("identify_type in", values, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotIn(List<Byte> values) {
addCriterion("identify_type not in", values, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeBetween(Byte value1, Byte value2) {
addCriterion("identify_type between", value1, value2, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotBetween(Byte value1, Byte value2) {
addCriterion("identify_type not between", value1, value2, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifierIsNull() {
addCriterion("identifier is null");
return (Criteria) this;
}
public Criteria andIdentifierIsNotNull() {
addCriterion("identifier is not null");
return (Criteria) this;
}
public Criteria andIdentifierEqualTo(String value) {
addCriterion("identifier =", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotEqualTo(String value) {
addCriterion("identifier <>", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierGreaterThan(String value) {
addCriterion("identifier >", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierGreaterThanOrEqualTo(String value) {
addCriterion("identifier >=", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLessThan(String value) {
addCriterion("identifier <", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLessThanOrEqualTo(String value) {
addCriterion("identifier <=", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLike(String value) {
addCriterion("identifier like", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotLike(String value) {
addCriterion("identifier not like", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierIn(List<String> values) {
addCriterion("identifier in", values, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotIn(List<String> values) {
addCriterion("identifier not in", values, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierBetween(String value1, String value2) {
addCriterion("identifier between", value1, value2, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotBetween(String value1, String value2) {
addCriterion("identifier not between", value1, value2, "identifier");
return (Criteria) this;
}
public Criteria andCredentialIsNull() {
addCriterion("credential is null");
return (Criteria) this;
}
public Criteria andCredentialIsNotNull() {
addCriterion("credential is not null");
return (Criteria) this;
}
public Criteria andCredentialEqualTo(String value) {
addCriterion("credential =", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotEqualTo(String value) {
addCriterion("credential <>", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialGreaterThan(String value) {
addCriterion("credential >", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialGreaterThanOrEqualTo(String value) {
addCriterion("credential >=", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLessThan(String value) {
addCriterion("credential <", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLessThanOrEqualTo(String value) {
addCriterion("credential <=", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLike(String value) {
addCriterion("credential like", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotLike(String value) {
addCriterion("credential not like", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialIn(List<String> values) {
addCriterion("credential in", values, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotIn(List<String> values) {
addCriterion("credential not in", values, "credential");
return (Criteria) this;
}
public Criteria andCredentialBetween(String value1, String value2) {
addCriterion("credential between", value1, value2, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotBetween(String value1, String value2) {
addCriterion("credential not between", value1, value2, "credential");
return (Criteria) this;
}
public Criteria andSaltIsNull() {
addCriterion("salt is null");
return (Criteria) this;
}
public Criteria andSaltIsNotNull() {
addCriterion("salt is not null");
return (Criteria) this;
}
public Criteria andSaltEqualTo(String value) {
addCriterion("salt =", value, "salt");
return (Criteria) this;
}
public Criteria andSaltNotEqualTo(String value) {
addCriterion("salt <>", value, "salt");
return (Criteria) this;
}
public Criteria andSaltGreaterThan(String value) {
addCriterion("salt >", value, "salt");
return (Criteria) this;
}
public Criteria andSaltGreaterThanOrEqualTo(String value) {
addCriterion("salt >=", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLessThan(String value) {
addCriterion("salt <", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLessThanOrEqualTo(String value) {
addCriterion("salt <=", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLike(String value) {
addCriterion("salt like", value, "salt");
return (Criteria) this;
}
public Criteria andSaltNotLike(String value) {
addCriterion("salt not like", value, "salt");
return (Criteria) this;
}
public Criteria andSaltIn(List<String> values) {
addCriterion("salt in", values, "salt");
return (Criteria) this;
}
public Criteria andSaltNotIn(List<String> values) {
addCriterion("salt not in", values, "salt");
return (Criteria) this;
}
public Criteria andSaltBetween(String value1, String value2) {
addCriterion("salt between", value1, value2, "salt");
return (Criteria) this;
}
public Criteria andSaltNotBetween(String value1, String value2) {
addCriterion("salt not between", value1, value2, "salt");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

139
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysSigninLog.java

@ -0,0 +1,139 @@
package com.ccsens.ptos_tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysSigninLog implements Serializable {
private Long id;
private Long userId;
private Long authId;
private Long time;
private String deviceId;
private Byte clientType;
private String ipAddress;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getAuthId() {
return authId;
}
public void setAuthId(Long authId) {
this.authId = authId;
}
public Long getTime() {
return time;
}
public void setTime(Long time) {
this.time = time;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId == null ? null : deviceId.trim();
}
public Byte getClientType() {
return clientType;
}
public void setClientType(Byte clientType) {
this.clientType = clientType;
}
public String getIpAddress() {
return ipAddress;
}
public void setIpAddress(String ipAddress) {
this.ipAddress = ipAddress == null ? null : ipAddress.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", authId=").append(authId);
sb.append(", time=").append(time);
sb.append(", deviceId=").append(deviceId);
sb.append(", clientType=").append(clientType);
sb.append(", ipAddress=").append(ipAddress);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

881
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysSigninLogExample.java

@ -0,0 +1,881 @@
package com.ccsens.ptos_tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysSigninLogExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysSigninLogExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andAuthIdIsNull() {
addCriterion("auth_id is null");
return (Criteria) this;
}
public Criteria andAuthIdIsNotNull() {
addCriterion("auth_id is not null");
return (Criteria) this;
}
public Criteria andAuthIdEqualTo(Long value) {
addCriterion("auth_id =", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotEqualTo(Long value) {
addCriterion("auth_id <>", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThan(Long value) {
addCriterion("auth_id >", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdGreaterThanOrEqualTo(Long value) {
addCriterion("auth_id >=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThan(Long value) {
addCriterion("auth_id <", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdLessThanOrEqualTo(Long value) {
addCriterion("auth_id <=", value, "authId");
return (Criteria) this;
}
public Criteria andAuthIdIn(List<Long> values) {
addCriterion("auth_id in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotIn(List<Long> values) {
addCriterion("auth_id not in", values, "authId");
return (Criteria) this;
}
public Criteria andAuthIdBetween(Long value1, Long value2) {
addCriterion("auth_id between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andAuthIdNotBetween(Long value1, Long value2) {
addCriterion("auth_id not between", value1, value2, "authId");
return (Criteria) this;
}
public Criteria andTimeIsNull() {
addCriterion("time is null");
return (Criteria) this;
}
public Criteria andTimeIsNotNull() {
addCriterion("time is not null");
return (Criteria) this;
}
public Criteria andTimeEqualTo(Long value) {
addCriterion("time =", value, "time");
return (Criteria) this;
}
public Criteria andTimeNotEqualTo(Long value) {
addCriterion("time <>", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThan(Long value) {
addCriterion("time >", value, "time");
return (Criteria) this;
}
public Criteria andTimeGreaterThanOrEqualTo(Long value) {
addCriterion("time >=", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThan(Long value) {
addCriterion("time <", value, "time");
return (Criteria) this;
}
public Criteria andTimeLessThanOrEqualTo(Long value) {
addCriterion("time <=", value, "time");
return (Criteria) this;
}
public Criteria andTimeIn(List<Long> values) {
addCriterion("time in", values, "time");
return (Criteria) this;
}
public Criteria andTimeNotIn(List<Long> values) {
addCriterion("time not in", values, "time");
return (Criteria) this;
}
public Criteria andTimeBetween(Long value1, Long value2) {
addCriterion("time between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andTimeNotBetween(Long value1, Long value2) {
addCriterion("time not between", value1, value2, "time");
return (Criteria) this;
}
public Criteria andDeviceIdIsNull() {
addCriterion("device_id is null");
return (Criteria) this;
}
public Criteria andDeviceIdIsNotNull() {
addCriterion("device_id is not null");
return (Criteria) this;
}
public Criteria andDeviceIdEqualTo(String value) {
addCriterion("device_id =", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotEqualTo(String value) {
addCriterion("device_id <>", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdGreaterThan(String value) {
addCriterion("device_id >", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdGreaterThanOrEqualTo(String value) {
addCriterion("device_id >=", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLessThan(String value) {
addCriterion("device_id <", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLessThanOrEqualTo(String value) {
addCriterion("device_id <=", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLike(String value) {
addCriterion("device_id like", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotLike(String value) {
addCriterion("device_id not like", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdIn(List<String> values) {
addCriterion("device_id in", values, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotIn(List<String> values) {
addCriterion("device_id not in", values, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdBetween(String value1, String value2) {
addCriterion("device_id between", value1, value2, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotBetween(String value1, String value2) {
addCriterion("device_id not between", value1, value2, "deviceId");
return (Criteria) this;
}
public Criteria andClientTypeIsNull() {
addCriterion("client_type is null");
return (Criteria) this;
}
public Criteria andClientTypeIsNotNull() {
addCriterion("client_type is not null");
return (Criteria) this;
}
public Criteria andClientTypeEqualTo(Byte value) {
addCriterion("client_type =", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotEqualTo(Byte value) {
addCriterion("client_type <>", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeGreaterThan(Byte value) {
addCriterion("client_type >", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("client_type >=", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeLessThan(Byte value) {
addCriterion("client_type <", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeLessThanOrEqualTo(Byte value) {
addCriterion("client_type <=", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeIn(List<Byte> values) {
addCriterion("client_type in", values, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotIn(List<Byte> values) {
addCriterion("client_type not in", values, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeBetween(Byte value1, Byte value2) {
addCriterion("client_type between", value1, value2, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotBetween(Byte value1, Byte value2) {
addCriterion("client_type not between", value1, value2, "clientType");
return (Criteria) this;
}
public Criteria andIpAddressIsNull() {
addCriterion("ip_address is null");
return (Criteria) this;
}
public Criteria andIpAddressIsNotNull() {
addCriterion("ip_address is not null");
return (Criteria) this;
}
public Criteria andIpAddressEqualTo(String value) {
addCriterion("ip_address =", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressNotEqualTo(String value) {
addCriterion("ip_address <>", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressGreaterThan(String value) {
addCriterion("ip_address >", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressGreaterThanOrEqualTo(String value) {
addCriterion("ip_address >=", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressLessThan(String value) {
addCriterion("ip_address <", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressLessThanOrEqualTo(String value) {
addCriterion("ip_address <=", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressLike(String value) {
addCriterion("ip_address like", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressNotLike(String value) {
addCriterion("ip_address not like", value, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressIn(List<String> values) {
addCriterion("ip_address in", values, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressNotIn(List<String> values) {
addCriterion("ip_address not in", values, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressBetween(String value1, String value2) {
addCriterion("ip_address between", value1, value2, "ipAddress");
return (Criteria) this;
}
public Criteria andIpAddressNotBetween(String value1, String value2) {
addCriterion("ip_address not between", value1, value2, "ipAddress");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

194
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUser.java

@ -0,0 +1,194 @@
package com.ccsens.ptos_tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysUser implements Serializable {
private Long id;
private String name;
private Byte gender;
private String avatarUrl;
private String country;
private String province;
private String city;
private String phone;
private String idCard;
private Byte power;
private String deviceId;
private Byte authType;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public Byte getGender() {
return gender;
}
public void setGender(Byte gender) {
this.gender = gender;
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country == null ? null : country.trim();
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province == null ? null : province.trim();
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getIdCard() {
return idCard;
}
public void setIdCard(String idCard) {
this.idCard = idCard == null ? null : idCard.trim();
}
public Byte getPower() {
return power;
}
public void setPower(Byte power) {
this.power = power;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId == null ? null : deviceId.trim();
}
public Byte getAuthType() {
return authType;
}
public void setAuthType(Byte authType) {
this.authType = authType;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", gender=").append(gender);
sb.append(", avatarUrl=").append(avatarUrl);
sb.append(", country=").append(country);
sb.append(", province=").append(province);
sb.append(", city=").append(city);
sb.append(", phone=").append(phone);
sb.append(", idCard=").append(idCard);
sb.append(", power=").append(power);
sb.append(", deviceId=").append(deviceId);
sb.append(", authType=").append(authType);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

117
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserDevice.java

@ -0,0 +1,117 @@
package com.ccsens.ptos_tall.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysUserDevice implements Serializable {
private Long id;
private Long userId;
private String deviceId;
private Byte clientType;
private String refreshToken;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId == null ? null : deviceId.trim();
}
public Byte getClientType() {
return clientType;
}
public void setClientType(Byte clientType) {
this.clientType = clientType;
}
public String getRefreshToken() {
return refreshToken;
}
public void setRefreshToken(String refreshToken) {
this.refreshToken = refreshToken == null ? null : refreshToken.trim();
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", deviceId=").append(deviceId);
sb.append(", clientType=").append(clientType);
sb.append(", refreshToken=").append(refreshToken);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

761
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserDeviceExample.java

@ -0,0 +1,761 @@
package com.ccsens.ptos_tall.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysUserDeviceExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysUserDeviceExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andDeviceIdIsNull() {
addCriterion("device_id is null");
return (Criteria) this;
}
public Criteria andDeviceIdIsNotNull() {
addCriterion("device_id is not null");
return (Criteria) this;
}
public Criteria andDeviceIdEqualTo(String value) {
addCriterion("device_id =", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotEqualTo(String value) {
addCriterion("device_id <>", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdGreaterThan(String value) {
addCriterion("device_id >", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdGreaterThanOrEqualTo(String value) {
addCriterion("device_id >=", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLessThan(String value) {
addCriterion("device_id <", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLessThanOrEqualTo(String value) {
addCriterion("device_id <=", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdLike(String value) {
addCriterion("device_id like", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotLike(String value) {
addCriterion("device_id not like", value, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdIn(List<String> values) {
addCriterion("device_id in", values, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotIn(List<String> values) {
addCriterion("device_id not in", values, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdBetween(String value1, String value2) {
addCriterion("device_id between", value1, value2, "deviceId");
return (Criteria) this;
}
public Criteria andDeviceIdNotBetween(String value1, String value2) {
addCriterion("device_id not between", value1, value2, "deviceId");
return (Criteria) this;
}
public Criteria andClientTypeIsNull() {
addCriterion("client_type is null");
return (Criteria) this;
}
public Criteria andClientTypeIsNotNull() {
addCriterion("client_type is not null");
return (Criteria) this;
}
public Criteria andClientTypeEqualTo(Byte value) {
addCriterion("client_type =", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotEqualTo(Byte value) {
addCriterion("client_type <>", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeGreaterThan(Byte value) {
addCriterion("client_type >", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("client_type >=", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeLessThan(Byte value) {
addCriterion("client_type <", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeLessThanOrEqualTo(Byte value) {
addCriterion("client_type <=", value, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeIn(List<Byte> values) {
addCriterion("client_type in", values, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotIn(List<Byte> values) {
addCriterion("client_type not in", values, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeBetween(Byte value1, Byte value2) {
addCriterion("client_type between", value1, value2, "clientType");
return (Criteria) this;
}
public Criteria andClientTypeNotBetween(Byte value1, Byte value2) {
addCriterion("client_type not between", value1, value2, "clientType");
return (Criteria) this;
}
public Criteria andRefreshTokenIsNull() {
addCriterion("refresh_token is null");
return (Criteria) this;
}
public Criteria andRefreshTokenIsNotNull() {
addCriterion("refresh_token is not null");
return (Criteria) this;
}
public Criteria andRefreshTokenEqualTo(String value) {
addCriterion("refresh_token =", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenNotEqualTo(String value) {
addCriterion("refresh_token <>", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenGreaterThan(String value) {
addCriterion("refresh_token >", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenGreaterThanOrEqualTo(String value) {
addCriterion("refresh_token >=", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenLessThan(String value) {
addCriterion("refresh_token <", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenLessThanOrEqualTo(String value) {
addCriterion("refresh_token <=", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenLike(String value) {
addCriterion("refresh_token like", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenNotLike(String value) {
addCriterion("refresh_token not like", value, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenIn(List<String> values) {
addCriterion("refresh_token in", values, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenNotIn(List<String> values) {
addCriterion("refresh_token not in", values, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenBetween(String value1, String value2) {
addCriterion("refresh_token between", value1, value2, "refreshToken");
return (Criteria) this;
}
public Criteria andRefreshTokenNotBetween(String value1, String value2) {
addCriterion("refresh_token not between", value1, value2, "refreshToken");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

1241
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/po/SysUserExample.java

File diff suppressed because it is too large

62
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/vo/UserVo.java

@ -0,0 +1,62 @@
package com.ccsens.ptos_tall.bean.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class UserVo {
@Data
@ApiModel("登录后返回用户和token信息")
public static class TokenBean {
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("刷新token")
private String refreshToken;
}
@Data
@ApiModel("业务请求用户信息")
public static class BusinessUserInfo {
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("认证状态")
private String type;
}
@Data
public static class UserSign{
private Long userId;
private Long authId;
}
@Data
@ApiModel("获取手机验证码")
public static class SmsCode{
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("有效时间(秒)")
private Integer expiredInSeconds;
@JsonIgnore
private String smsCode;
}
@Data
@ApiModel("返回图片验证码")
public static class VerificationCode{
@ApiModelProperty("图片验证码Id")
private String verificationCodeId;
@ApiModelProperty("图片的Base64字符串")
private String imageBase64;
}
}

28
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/IdcDomainDao.java

@ -0,0 +1,28 @@
package com.ccsens.ptos_tall.persist.dao;
import com.ccsens.ptos_tall.bean.po.IdcDomain;
import com.ccsens.ptos_tall.persist.mapper.IdcDomainMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author
*/
public interface IdcDomainDao extends IdcDomainMapper {
/**
* 根据code查询域信息
* @param code 域code
* @return 返回域信息
*/
IdcDomain getByCode(@Param("code") String code);
/**
* 查找自己的域信息
* @return 返回域信息
*/
IdcDomain getOneself();
}

25
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysAuthDao.java

@ -0,0 +1,25 @@
package com.ccsens.ptos_tall.persist.dao;
import com.ccsens.ptos_tall.bean.po.SysAuth;
import com.ccsens.ptos_tall.persist.mapper.SysAuthMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author
*/
public interface SysAuthDao extends SysAuthMapper {
/**
* 根据手机号查看认证方式
* @param phone 手机号
* @return 返回认证信息
*/
SysAuth getByPhone(@Param("phone") String phone);
/**
* 根据userId获取手机号
* @param userId userId
* @return 返回手机号
*/
String getPhoneByUserId(@Param("userId") Long userId);
}

9
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysUserDao.java

@ -0,0 +1,9 @@
package com.ccsens.ptos_tall.persist.dao;
import com.ccsens.ptos_tall.persist.mapper.SysUserMapper;
/**
* @author
*/
public interface SysUserDao extends SysUserMapper {
}

30
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/IdcDomainMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_tall.persist.mapper;
import com.ccsens.ptos_tall.bean.po.IdcDomain;
import com.ccsens.ptos_tall.bean.po.IdcDomainExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface IdcDomainMapper {
long countByExample(IdcDomainExample example);
int deleteByExample(IdcDomainExample example);
int deleteByPrimaryKey(Long id);
int insert(IdcDomain record);
int insertSelective(IdcDomain record);
List<IdcDomain> selectByExample(IdcDomainExample example);
IdcDomain selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") IdcDomain record, @Param("example") IdcDomainExample example);
int updateByExample(@Param("record") IdcDomain record, @Param("example") IdcDomainExample example);
int updateByPrimaryKeySelective(IdcDomain record);
int updateByPrimaryKey(IdcDomain record);
}

30
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysAuthMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_tall.persist.mapper;
import com.ccsens.ptos_tall.bean.po.SysAuth;
import com.ccsens.ptos_tall.bean.po.SysAuthExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysAuthMapper {
long countByExample(SysAuthExample example);
int deleteByExample(SysAuthExample example);
int deleteByPrimaryKey(Long id);
int insert(SysAuth record);
int insertSelective(SysAuth record);
List<SysAuth> selectByExample(SysAuthExample example);
SysAuth selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByExample(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByPrimaryKeySelective(SysAuth record);
int updateByPrimaryKey(SysAuth record);
}

30
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysSigninLogMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_tall.persist.mapper;
import com.ccsens.ptos_tall.bean.po.SysSigninLog;
import com.ccsens.ptos_tall.bean.po.SysSigninLogExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysSigninLogMapper {
long countByExample(SysSigninLogExample example);
int deleteByExample(SysSigninLogExample example);
int deleteByPrimaryKey(Long id);
int insert(SysSigninLog record);
int insertSelective(SysSigninLog record);
List<SysSigninLog> selectByExample(SysSigninLogExample example);
SysSigninLog selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysSigninLog record, @Param("example") SysSigninLogExample example);
int updateByExample(@Param("record") SysSigninLog record, @Param("example") SysSigninLogExample example);
int updateByPrimaryKeySelective(SysSigninLog record);
int updateByPrimaryKey(SysSigninLog record);
}

30
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysUserDeviceMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_tall.persist.mapper;
import com.ccsens.ptos_tall.bean.po.SysUserDevice;
import com.ccsens.ptos_tall.bean.po.SysUserDeviceExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserDeviceMapper {
long countByExample(SysUserDeviceExample example);
int deleteByExample(SysUserDeviceExample example);
int deleteByPrimaryKey(Long id);
int insert(SysUserDevice record);
int insertSelective(SysUserDevice record);
List<SysUserDevice> selectByExample(SysUserDeviceExample example);
SysUserDevice selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysUserDevice record, @Param("example") SysUserDeviceExample example);
int updateByExample(@Param("record") SysUserDevice record, @Param("example") SysUserDeviceExample example);
int updateByPrimaryKeySelective(SysUserDevice record);
int updateByPrimaryKey(SysUserDevice record);
}

30
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/mapper/SysUserMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_tall.persist.mapper;
import com.ccsens.ptos_tall.bean.po.SysUser;
import com.ccsens.ptos_tall.bean.po.SysUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserMapper {
long countByExample(SysUserExample example);
int deleteByExample(SysUserExample example);
int deleteByPrimaryKey(Long id);
int insert(SysUser record);
int insertSelective(SysUser record);
List<SysUser> selectByExample(SysUserExample example);
SysUser selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKey(SysUser record);
}

2
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/HeartbeatService.java

@ -35,7 +35,7 @@ public class HeartbeatService{
/**
* 定时发送心跳信息
*/
@Scheduled(cron="0/30 * * * * ?")
@Scheduled(cron="0 */10 * * * ?")
public void sendHeartbeat(){
//查找业务列表
SysBusinessExample businessExample = new SysBusinessExample();

17
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IProjectService.java

@ -15,5 +15,20 @@ public interface IProjectService {
* @param userId userId
* @return 返回项目列表
*/
List<ProjectVo.ProjectInfo> queryDomainByUser(ProjectDto.QueryProjectDto param, Long userId);
List<ProjectVo.ProjectInfo> queryProjectByUser(String phone, ProjectDto.QueryProjectDto param, Long userId);
/**
* 根据手机号获取项目信息
* @param param 手机号和开始结束时间
* @return 返回业务项目列表
*/
List<ProjectVo.ProjectInfo> queryProjectByPhone(ProjectDto.QueryProjectByPhone param);
/**
* 查询日历是否有小红点
* @param param 开始/结束时间
* @param userId 用户id
* @return 是否有小红点
*/
List<String> haveProjectDay(ProjectDto.QueryHaveProject param, Long userId);
}

39
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IUserService.java

@ -0,0 +1,39 @@
package com.ccsens.ptos_tall.service;
import com.ccsens.ptos_tall.bean.dto.UserDto;
import com.ccsens.ptos_tall.bean.vo.UserVo;
/**
* @author
*/
public interface IUserService {
/**
* 用户登录
* @param params 登录信息
* @param deviceId 设备id
* @return 返回token
*/
UserVo.TokenBean userSignin(UserDto.SigninDto params, String deviceId,String clientIp);
/**
* 业务根据token获取用户信息
* @param params 业务app和token
* @return 返回用户信息
*/
UserVo.BusinessUserInfo userByBusinessToken(UserDto.BusinessToken params);
/**
* 获取手机验证码
* @param phone 手机号
* @param verificationCodeId 图形验证码id
* @param verificationCodeValue 图形验证码值
* @return 返回手机号和有效期
*/
UserVo.SmsCode getSignInSmsCode(String phone, String verificationCodeId, String verificationCodeValue) throws Exception;
/**
* 获取图片验证码
* @return 返回base64图片
*/
UserVo.VerificationCode getVertifyCode();
}

206
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/ProjectService.java

@ -1,14 +1,31 @@
package com.ccsens.ptos_tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ptos_tall.bean.dto.DomainDto;
import com.ccsens.ptos_tall.bean.dto.ProjectDto;
import com.ccsens.ptos_tall.bean.po.IdcDomain;
import com.ccsens.ptos_tall.bean.po.SysBusiness;
import com.ccsens.ptos_tall.bean.po.SysBusinessExample;
import com.ccsens.ptos_tall.bean.vo.ProjectVo;
import com.ccsens.ptos_tall.persist.dao.IdcDomainDao;
import com.ccsens.ptos_tall.persist.mapper.SysBusinessMapper;
import com.ccsens.ptos_tall.util.PtOsConstant;
import com.ccsens.util.RestTemplateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author
*/
@ -16,18 +33,191 @@ import java.util.List;
@Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class ProjectService implements IProjectService {
@Resource
private SysBusinessMapper businessMapper;
@Resource
private IdcDomainDao domainDao;
@Override
public List<ProjectVo.ProjectInfo> queryDomainByUser(ProjectDto.QueryProjectDto param, Long userId) {
public List<ProjectVo.ProjectInfo> queryProjectByUser(String phone, ProjectDto.QueryProjectDto param, Long userId) {
List<ProjectVo.ProjectInfo> projectInfoList = new ArrayList<>();
//访问传达室,请求该用户在其他域的项目信息
ProjectDto.QueryProjectByPhone queryProjectByPhone = new ProjectDto.QueryProjectByPhone();
queryProjectByPhone.setStartTime(param.getStartTime());
queryProjectByPhone.setEndTime(param.getEndTime());
queryProjectByPhone.setPhone(new ArrayList<>(Collections.singleton(phone)));
DomainDto.TallToOtherDomain tallToOtherDomain = new DomainDto.TallToOtherDomain();
tallToOtherDomain.setUrl("/project/byPhone");
tallToOtherDomain.setParam(JSON.toJSONString(queryProjectByPhone));
//发送到本域的传达室
//查询自身域信息
IdcDomain selfDomains = domainDao.getOneself();
if(ObjectUtil.isNotNull(selfDomains)) {
String domainUrl = selfDomains.getUrl() + "/domain/tallToIdc";
log.info("调用接口:{}--", domainUrl);
JSONObject jsonObject = null;
try {
String postBody = RestTemplateUtil.postBody(domainUrl, param);
jsonObject = JSONObject.parseObject(postBody);
}catch (Exception e){
log.error("调用传达室异常", e);
}
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
if(jsonObject != null){
Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
projectInfoList.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
}
}
}
}
}
//查询本域所有在线的业务信息
Long lastAnswerTime = System.currentTimeMillis() - PtOsConstant.LAST_ANSWER_TIME;
SysBusinessExample businessExample = new SysBusinessExample();
businessExample.createCriteria().andLastAnswerTimeGreaterThanOrEqualTo(lastAnswerTime).andTypeEqualTo((byte) 0);
List<SysBusiness> sysBusinesses = businessMapper.selectByExample(businessExample);
//遍历业务
if(CollectionUtil.isNotEmpty(sysBusinesses)){
for (SysBusiness business : sysBusinesses) {
String url = business.getUrl() + "/project/query";
log.info("调用接口:{}--", url);
//TODO token
String postBody = RestTemplateUtil.postBody(url,param);
JSONObject jsonObject = JSONObject.parseObject(postBody);
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
Integer code = jsonObject.getInteger("code");
if (code == null || code != 200) {
continue;
}
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
projectInfoList.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
}
}
}
}
//TODO 排序
//TODO 添加测试数据
projectInfoList.add(new ProjectVo.ProjectInfo(1L,"测试项目1",1641799829000L,1641886229000L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(2L,"测试项目2",1641799829001L,1641886229004L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(3L,"测试项目3",1641799829002L,1641886229005L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(4L,"测试项目4",1641799829003L,1641886229006L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(1L,"测试项目1",1641799829000L,1644718446001L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(2L,"测试项目2",1641799829001L,1644718446002L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(3L,"测试项目3",1641799829002L,1644718446003L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfoList.add(new ProjectVo.ProjectInfo(4L,"测试项目4",1641799829003L,1644718446004L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
ProjectVo.ProjectInfo projectInfo = new ProjectVo.ProjectInfo(4L,"测试项目4",1641799829003L,1644718446004L,"http://101.201.226.163/gateway/ptos/debug","dh","tall");
List<ProjectVo.ProjectInfo> p1 = new ArrayList<>();
p1.add(new ProjectVo.ProjectInfo(5L,"子项目1",1641799829003L,1644718446004L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
p1.add(new ProjectVo.ProjectInfo(6L,"子项目2",1641799829003L,1644718446004L,"http://101.201.226.163/gateway/ptos/debug","dh","tall"));
projectInfo.setSonProjectList(p1);
projectInfoList.add(projectInfo);
return projectInfoList;
}
@Override
public List<ProjectVo.ProjectInfo> queryProjectByPhone(ProjectDto.QueryProjectByPhone param) {
//根据手机号查询用户信息
//生成token
//查找所有在线的业务
//遍历业务
//查询用户在业务内的项目信息(带token过去)
return null;
}
@Override
public List<String> haveProjectDay(ProjectDto.QueryHaveProject param, Long userId) {
//返回值
List<String> haveProject = new ArrayList<>();
for (int i = 0; i < 28; i++) {
if(i < 5){
haveProject.add("0");
}else {
haveProject.add("1");
}
}
// //获取两个日期相差的天数
// SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// Date startTimeParam = new Date(param.getStartTime());
// Date endTimeParam = new Date(param.getEndTime());
// long dayDifference = DateUtil.betweenDay(startTimeParam, endTimeParam, false) + 1;
//
// Long realStartTime = null;
// Long realEndTime = null;
// Long realDifference = null;
// List<String> realDateList = new ArrayList<>();
// //查询项目列表
// List<ProjectVo.QueryProject> projectList = projectDao.queryProjectList(param.getStartTime(), param.getEndTime(), userId);
// //获取项目的时间范围
// if (CollectionUtil.isNotEmpty(projectList)) {
// List<Long> projectStartTimeList = projectList.stream().map(ProjectVo.QueryProject::getStartTime).collect(Collectors.toList());
// List<Long> projectEndTimeList = projectList.stream().map(ProjectVo.QueryProject::getEndTime).collect(Collectors.toList());
// Long maxStartTime = Collections.min(projectStartTimeList);
// Long maxEndTime = Collections.max(projectEndTimeList);
//
// realStartTime = maxStartTime >= param.getStartTime() ? maxStartTime : param.getStartTime();
// realEndTime = maxEndTime >= param.getEndTime() ? param.getEndTime() : maxEndTime;
// realDifference = DateUtil.betweenDay(new Date(realStartTime), new Date(realEndTime), false) + 1;
// GregorianCalendar calendar = new GregorianCalendar();
// calendar.setTime(new Date(realStartTime));
// realDateList.add(format.format(new Date(realStartTime)));
// for (int i = 1; i < realDifference; i++) {
// calendar.add(Calendar.DATE, 1);
// Date time = calendar.getTime();
// realDateList.add(format.format(time));
// }
// }
// //获取参数的时间范围
// GregorianCalendar calendar = new GregorianCalendar();
// calendar.setTime(startTimeParam);
// List<String> dateList = new ArrayList<>();
// dateList.add(format.format(startTimeParam));
// for (int i = 1; i < dayDifference; i++) {
// calendar.add(Calendar.DATE, 1);
// Date time = calendar.getTime();
// dateList.add(format.format(time));
// }
//
// System.out.println(dateList);
//
// //比较参数时间与项目时间
// for (int i = 0; i < dateList.size(); i++) {
// haveProject.add("0");
// if (CollectionUtil.isNotEmpty(projectList)) {
// for (String realDate : realDateList) {
// if (dateList.get(i).equals(realDate)) {
// haveProject.set(i, "1");
// }
// }
// }
// }
return haveProject;
}
}

384
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/UserService.java

@ -0,0 +1,384 @@
package com.ccsens.ptos_tall.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.ptos_tall.bean.dto.UserDto;
import com.ccsens.ptos_tall.bean.po.*;
import com.ccsens.ptos_tall.bean.vo.UserVo;
import com.ccsens.ptos_tall.persist.dao.SysAuthDao;
import com.ccsens.ptos_tall.persist.dao.SysUserDao;
import com.ccsens.ptos_tall.persist.mapper.SysSigninLogMapper;
import com.ccsens.ptos_tall.persist.mapper.SysUserDeviceMapper;
import com.ccsens.ptos_tall.util.PtOsCodeError;
import com.ccsens.util.*;
import com.ccsens.util.bean.wx.po.WxOauth2UserInfo;
import com.ccsens.util.exception.BaseException;
import com.ccsens.util.wx.WxGzhUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED,rollbackFor = Exception.class)
public class UserService implements IUserService {
@Resource
private RedisUtil redisUtil;
@Resource
private SysUserDao sysUserDao;
@Resource
private SysAuthDao sysAuthDao;
@Resource
private Snowflake snowflake;
@Resource
private SysUserDeviceMapper userDeviceMapper;
@Resource
private SysSigninLogMapper sysSigninLogMapper;
@Override
public UserVo.TokenBean userSignin(UserDto.SigninDto params, String deviceId, String clientIp) {
//验证客户端类型
switch (params.getClient()) {
case 0:
case 1:
break;
default:
throw new BaseException(PtOsCodeError.CLIENT_ERROR);
}
String identifier = params.getData().getIdentifier();
String credential = params.getData().getCredential();
//验证登录方式,第一版只支持手机号登录和微信登
UserVo.UserSign userSign;
//手机号
String phone = null;
switch (params.getType()) {
case 1:
//验证数据
if(StrUtil.isBlank(identifier)){
throw new BaseException(PtOsCodeError.NOT_PHONE);
}
if(StrUtil.isBlank(credential)){
throw new BaseException(PtOsCodeError.NOT_SMS_CODE);
}
//手机号登录
userSign = phoneLogin(identifier, credential, deviceId);
phone = identifier;
break;
case 4:
//微信登录
WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(params.getType());
userSign = wxLogin(identifyType,identifier);
break;
default: {
throw new BaseException(PtOsCodeError.SIGNIN_TYPE_ERROR);
}
}
//更新用户设备关联信息
saveUserDevice(userSign.getUserId(),deviceId,params.getClient());
//添加登录记录
saveSigninLog(userSign,deviceId,params.getClient(),clientIp);
//生成token
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSign.getAuthId()));
UserVo.TokenBean tokenBean = generateToken(userSign.getUserId(), theMap);
tokenBean.setId(userSign.getUserId());
if(ObjectUtil.isNull(phone)){
//TODO 获取手机号
phone = sysAuthDao.getPhoneByUserId(userSign.getUserId());
}
tokenBean.setPhone(phone);
return tokenBean;
}
/**
* 获取token
*/
private UserVo.TokenBean generateToken(Object subject, Map<String, Object> payLoads) {
UserVo.TokenBean tokenBean = new UserVo.TokenBean();
//生成过期时间
long tokenExpired = 3600 * 1000L * 2;
long refreshTokenExpired = 3600 * 1000L * 24 * 30;
//1.生成token并缓存
String token = JwtUtil.createJWT(subject + "",payLoads, tokenExpired,WebConstant.JWT_ACCESS_TOKEN_SECERT);
redisUtil.set(RedisKeyManager.getTokenCachedKey(subject), token, tokenExpired / 1000);
tokenBean.setToken(token);
//生成refreshToken
String refreshToken = JwtUtil.createJWT(subject + "", payLoads, refreshTokenExpired, WebConstant.JWT_ACCESS_TOKEN_SECERT);
redisUtil.set(RedisKeyManager.getRefreshTokenCachedKey(subject), refreshToken, refreshTokenExpired / 1000);
tokenBean.setRefreshToken(refreshToken);
//2.返回
return tokenBean;
}
/**
* 添加登录记录
*/
private void saveSigninLog(UserVo.UserSign userSign, String deviceId, Integer client, String clientIp) {
SysSigninLog sysSigninLog = new SysSigninLog();
sysSigninLog.setId(snowflake.nextId());
sysSigninLog.setUserId(userSign.getUserId());
sysSigninLog.setAuthId(userSign.getAuthId());
sysSigninLog.setTime(System.currentTimeMillis());
sysSigninLog.setDeviceId(deviceId);
sysSigninLog.setClientType(client.byteValue());
sysSigninLog.setIpAddress(clientIp);
sysSigninLogMapper.insertSelective(sysSigninLog);
}
/**
* 添加用户设备关联信息
* @param userId userId
* @param deviceId 设备id
*/
private void saveUserDevice(Long userId, String deviceId,Integer client) {
//查找用户和设备的关联信息,如果为空则添加关联信息
SysUserDeviceExample userDeviceExample = new SysUserDeviceExample();
userDeviceExample.createCriteria().andUserIdEqualTo(userId).andDeviceIdEqualTo(deviceId);
List<SysUserDevice> sysUserDevices = userDeviceMapper.selectByExample(userDeviceExample);
//不存在则添加
if(CollectionUtil.isEmpty(sysUserDevices)){
SysUserDevice sysUserDevice = new SysUserDevice();
sysUserDevice.setId(snowflake.nextId());
sysUserDevice.setUserId(userId);
sysUserDevice.setDeviceId(deviceId);
sysUserDevice.setClientType(client.byteValue());
userDeviceMapper.insertSelective(sysUserDevice);
}
}
/**
* 手机号登陆
* @param phone 手机号
* @param smsVerifyCode 验证码
* @param deviceId 设备id
* @return 返回用户信息
*/
private UserVo.UserSign phoneLogin(String phone, String smsVerifyCode, String deviceId) {
UserVo.UserSign userSignVo;
if (!isSmsCodeCorrect(phone, smsVerifyCode)) {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
//1.查找对应账户,不存在则注册
SysAuth theAuth = sysAuthDao.getByPhone(phone);
if (ObjectUtil.isNull(theAuth)) {
theAuth = saveUser(phone, null, WebConstant.IDENTIFY_TYPE.Phone,deviceId);
}
//返回用户id和认证id
userSignVo = new UserVo.UserSign();
userSignVo.setUserId(theAuth.getUserId());
userSignVo.setAuthId(theAuth.getId());
//TODO 给所有手机号一样的角色添加userId
return userSignVo;
}
/**
* 微信登陆
* @param code 微信code
* @return 返回用户信息
*/
private UserVo.UserSign wxLogin(WebConstant.IDENTIFY_TYPE identifyType, String code) {
UserVo.UserSign userSignVo;
//获取微信信息并保存
log.info("公众号登陆,{}", code);
WxOauth2UserInfo wxOauth2UserInfo = WxGzhUtil.getOauth2UserInfo(identifyType, code);
log.info("获取用户的微信信息,{}", wxOauth2UserInfo);
SysAuth theAuth;
if (ObjectUtil.isNull(wxOauth2UserInfo)) {
throw new BaseException(CodeEnum.NOT_SELECT_WX);
}
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value)
.andIdentifierEqualTo(wxOauth2UserInfo.getOpenId()).andCredentialEqualTo(wxOauth2UserInfo.getUnionId());
List<SysAuth> authList = sysAuthDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) {
theAuth = authList.get(0);
log.info("该用户已有微信登录的auth信息,{}", theAuth);
} else {
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andCredentialEqualTo(wxOauth2UserInfo.getUnionId());
List<SysAuth> sysAuthList = sysAuthDao.selectByExample(sysAuthExample);
if (CollectionUtil.isNotEmpty(sysAuthList)) {
//添加认证方式
theAuth = new SysAuth();
theAuth.setId(snowflake.nextId());
theAuth.setUserId(sysAuthList.get(0).getUserId());
theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value);
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
sysAuthDao.insertSelective(theAuth);
} else {
//新建用户并保存微信信息
SysUser user = new SysUser();
user.setId(snowflake.nextId());
user.setAvatarUrl(wxOauth2UserInfo.getHeadImgUrl());
user.setName(wxOauth2UserInfo.getNickname());
user.setGender((byte) wxOauth2UserInfo.getSex());
user.setCountry(wxOauth2UserInfo.getCountry());
user.setProvince(wxOauth2UserInfo.getProvince());
user.setCity(wxOauth2UserInfo.getCity());
sysUserDao.insertSelective(user);
//添加认证方式
theAuth = new SysAuth();
theAuth.setId(snowflake.nextId());
theAuth.setUserId(user.getId());
theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value);
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
sysAuthDao.insertSelective(theAuth);
}
}
//2.返回
userSignVo = new UserVo.UserSign();
userSignVo.setUserId(theAuth.getUserId());
userSignVo.setAuthId(theAuth.getId());
log.info("认证成功返回:{}", userSignVo);
return userSignVo;
}
/**
* 添加用户和认证方式
* @return 认证信息
*/
private SysAuth saveUser(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType, String deviceId) {
//1.添加user
SysUser user = new SysUser();
user.setId(snowflake.nextId());
user.setDeviceId(deviceId);
user.setAuthType((byte) 1);
sysUserDao.insertSelective(user);
//2.添加auth
SysAuth auth = new SysAuth();
auth.setId(snowflake.nextId());
auth.setUserId(user.getId());
auth.setIdentifyType((byte) identifyType.value);
auth.setIdentifier(identifier);
auth.setCredential(credential);
sysAuthDao.insertSelective(auth);
return auth;
}
/**
* 判断验证码是否有效
*/
private Boolean isSmsCodeCorrect(String phone, String smsCode) {
boolean correct = false;
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(phone))) {
if (smsCode.equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(phone)).toString())) {
correct = true;
}
}
return correct;
}
/**
* 通过用户查找手机号
* @param userId userId
* @return 手机号
*/
public String getPhone(Long userId) {
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
List<SysAuth> sysAuthList = sysAuthDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(sysAuthList)) {
return sysAuthList.get(0).getIdentifier();
} else {
return null;
}
}
@Override
public UserVo.SmsCode getSignInSmsCode(String phone, String verificationCodeId, String verificationCodeValue) {
//检查图形验证码是否正确
String codeKey = WebConstant.IMAGE_CODE + verificationCodeId;
if (!redisUtil.hasKey(codeKey)) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_PAST_IMG);
}
if (!verificationCodeValue.equals(String.valueOf(redisUtil.get(codeKey)))) {
throw new BaseException(CodeEnum.VERIFICATION_CODE_ERROR_IMG);
}
//验证一次,无论是否正确,都将缓存删除
redisUtil.del(codeKey);
//验证手机号的正确性
String regex = "[1]([3-9])[0-9]{9}$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);
boolean isMatch = m.matches();
if (!isMatch) {
throw new BaseException(CodeEnum.PHONE_ERR);
}
UserVo.SmsCode smsCodeVo;
//1.验证发送间隔是否大于指定间隔
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsExistKey(phone))) {
throw new BaseException(PtOsCodeError.ERROR_SEND_TOO_FAST);
}
//测试环境默认发送1111
String verifyCode = "1111";
if ("1".equalsIgnoreCase(PropUtil.smsCode)) {
verifyCode = RandomUtil.randomNumbers(4);
}
//3.保存到redis中
Integer codeValidInSeconds = WebConstant.Expired_Verify_Code_In_Seconds;
Integer codeExistInSeconds = WebConstant.Exist_Verify_Code_In_Seconds;
redisUtil.set(RedisKeyManager.getSigninSmsKey(phone), verifyCode, codeValidInSeconds);
redisUtil.set(RedisKeyManager.getSigninSmsExistKey(phone), verifyCode, codeExistInSeconds);
//5.发送验证码
if ("1".equalsIgnoreCase(PropUtil.smsCode)) {
SmsUtil.sendSms(phone, verifyCode, "", codeValidInSeconds);
}
//6.返回
smsCodeVo = new UserVo.SmsCode();
smsCodeVo.setPhone(phone);
smsCodeVo.setSmsCode(verifyCode);
smsCodeVo.setExpiredInSeconds(WebConstant.Expired_Verify_Code_In_Seconds);
return smsCodeVo;
}
@Override
public UserVo.VerificationCode getVertifyCode() {
Map<String, Object> codeMap = ImageCodeGeneratorUtil.generateCountCode();
//生成一个id
long id = snowflake.nextId();
//将两个数的和,存在redis内,key为新生成的id
String imageCodeKey = WebConstant.IMAGE_CODE + id;
redisUtil.set(imageCodeKey, codeMap.get("sum"), 90);
log.info("将图形验证码存入redis:{},,,{}", imageCodeKey,codeMap.get("sum"));
String imageBase64 = "data:image/png;base64," + ImageCodeGeneratorUtil.generateCodeImage(null, (String) codeMap.get("imageCode"), 200, 70);
UserVo.VerificationCode vertifyCode = new UserVo.VerificationCode();
vertifyCode.setImageBase64(imageBase64);
vertifyCode.setVerificationCodeId(String.valueOf(id));
return vertifyCode;
}
@Override
public UserVo.BusinessUserInfo userByBusinessToken(UserDto.BusinessToken params) {
//验证业务的appId和secret
//根据token查找用户信息
//返回用户信息
return null;
}
}

6
ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsCodeError.java

@ -7,6 +7,10 @@ import com.ccsens.util.CodeError;
*/
public class PtOsCodeError extends CodeError {
public static final Code NOT_WBS_SHEET = new Code(501,"找不到wbs表",true);
public static final Code CLIENT_ERROR = new Code(501,"客户端类型异常",true);
public static final Code SIGNIN_TYPE_ERROR = new Code(502,"登录类型异常",true);
public static final Code NOT_PHONE = new Code(503,"手机号不能为空",true);
public static final Code NOT_SMS_CODE = new Code(504,"请填写手机号验证码",true);
public static final Code ERROR_SEND_TOO_FAST = new Code(504,"60秒内只能发送一次,请稍后再试",true);
}

3
ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsConstant.java

@ -8,6 +8,9 @@ import java.util.Map;
*/
public class PtOsConstant {
/**业务离线时间*/
public static final Long LAST_ANSWER_TIME = 21 * 60 * 1000L;
/**图片类型*/
public static final String FILE_TYPE_IMG = "bmp,jpg,jpeg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp";
/**文档类型*/

4
ptos_tall/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring:
profiles:
active: prod
include: common, util-prod
active: dev
include: common, util-dev

2
ptos_tall/src/main/resources/druid-dev.yml

@ -28,7 +28,7 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://101.201.226.163:3306/tall_df?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
url: jdbc:mysql://101.201.226.163:3306/tall_dh?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

13
ptos_tall/src/main/resources/mapper_dao/IdcDomainDao.xml

@ -0,0 +1,13 @@
<?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.ccsens.ptos_tall.persist.dao.IdcDomainDao">
<select id="getByCode" resultType="com.ccsens.ptos_tall.bean.po.IdcDomain">
SELECT * FROM `t_idc_domain` WHERE `code` = #{code} and rec_status = 0 limit 1
</select>
<select id="getOneself" resultType="com.ccsens.ptos_tall.bean.po.IdcDomain">
SELECT * FROM `t_idc_domain` WHERE self = 1 and rec_status = 0 limit 1
</select>
</mapper>

27
ptos_tall/src/main/resources/mapper_dao/SysAuthDao.xml

@ -0,0 +1,27 @@
<?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.ccsens.ptos_tall.persist.dao.SysAuthDao">
<select id="getByPhone" resultType="com.ccsens.ptos_tall.bean.po.SysAuth">
SELECT
*
FROM
t_sys_auth
WHERE
identify_type = 1
and identifier = #{phone}
and rec_status = 0
limit 1
</select>
<select id="getPhoneByUserId" resultType="java.lang.String">
SELECT
identifier
FROM
t_sys_auth
WHERE
identify_type = 1
and user_id = #{userId}
and rec_status = 0
limit 1
</select>
</mapper>

5
ptos_tall/src/main/resources/mapper_dao/SysUserDao.xml

@ -0,0 +1,5 @@
<?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.ccsens.ptos_tall.persist.dao.SysUserDao">
</mapper>

432
ptos_tall/src/main/resources/mapper_raw/IdcDomainMapper.xml

@ -0,0 +1,432 @@
<?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.ccsens.ptos_tall.persist.mapper.IdcDomainMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_tall.bean.po.IdcDomain">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="intro" jdbcType="VARCHAR" property="intro" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="host" jdbcType="VARCHAR" property="host" />
<result column="self" jdbcType="TINYINT" property="self" />
<result column="pub" jdbcType="TINYINT" property="pub" />
<result column="polling" jdbcType="TINYINT" property="polling" />
<result column="answer" jdbcType="TINYINT" property="answer" />
<result column="last_update_time" jdbcType="BIGINT" property="lastUpdateTime" />
<result column="last_ask_time" jdbcType="BIGINT" property="lastAskTime" />
<result column="last_answer_time" jdbcType="BIGINT" property="lastAnswerTime" />
<result column="public_key" jdbcType="VARCHAR" property="publicKey" />
<result column="private_key" jdbcType="VARCHAR" property="privateKey" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, code, intro, url, host, self, pub, polling, answer, last_update_time, last_ask_time,
last_answer_time, public_key, private_key, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomainExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_idc_domain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_idc_domain
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_idc_domain
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomainExample">
delete from t_idc_domain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomain">
insert into t_idc_domain (id, name, code,
intro, url, host, self,
pub, polling, answer,
last_update_time, last_ask_time, last_answer_time,
public_key, private_key, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{intro,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, #{self,jdbcType=TINYINT},
#{pub,jdbcType=TINYINT}, #{polling,jdbcType=TINYINT}, #{answer,jdbcType=TINYINT},
#{lastUpdateTime,jdbcType=BIGINT}, #{lastAskTime,jdbcType=BIGINT}, #{lastAnswerTime,jdbcType=BIGINT},
#{publicKey,jdbcType=VARCHAR}, #{privateKey,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomain">
insert into t_idc_domain
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="code != null">
code,
</if>
<if test="intro != null">
intro,
</if>
<if test="url != null">
url,
</if>
<if test="host != null">
host,
</if>
<if test="self != null">
self,
</if>
<if test="pub != null">
pub,
</if>
<if test="polling != null">
polling,
</if>
<if test="answer != null">
answer,
</if>
<if test="lastUpdateTime != null">
last_update_time,
</if>
<if test="lastAskTime != null">
last_ask_time,
</if>
<if test="lastAnswerTime != null">
last_answer_time,
</if>
<if test="publicKey != null">
public_key,
</if>
<if test="privateKey != null">
private_key,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="intro != null">
#{intro,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="host != null">
#{host,jdbcType=VARCHAR},
</if>
<if test="self != null">
#{self,jdbcType=TINYINT},
</if>
<if test="pub != null">
#{pub,jdbcType=TINYINT},
</if>
<if test="polling != null">
#{polling,jdbcType=TINYINT},
</if>
<if test="answer != null">
#{answer,jdbcType=TINYINT},
</if>
<if test="lastUpdateTime != null">
#{lastUpdateTime,jdbcType=BIGINT},
</if>
<if test="lastAskTime != null">
#{lastAskTime,jdbcType=BIGINT},
</if>
<if test="lastAnswerTime != null">
#{lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="publicKey != null">
#{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null">
#{privateKey,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomainExample" resultType="java.lang.Long">
select count(*) from t_idc_domain
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_idc_domain
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.intro != null">
intro = #{record.intro,jdbcType=VARCHAR},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.host != null">
host = #{record.host,jdbcType=VARCHAR},
</if>
<if test="record.self != null">
self = #{record.self,jdbcType=TINYINT},
</if>
<if test="record.pub != null">
pub = #{record.pub,jdbcType=TINYINT},
</if>
<if test="record.polling != null">
polling = #{record.polling,jdbcType=TINYINT},
</if>
<if test="record.answer != null">
answer = #{record.answer,jdbcType=TINYINT},
</if>
<if test="record.lastUpdateTime != null">
last_update_time = #{record.lastUpdateTime,jdbcType=BIGINT},
</if>
<if test="record.lastAskTime != null">
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT},
</if>
<if test="record.lastAnswerTime != null">
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="record.publicKey != null">
public_key = #{record.publicKey,jdbcType=VARCHAR},
</if>
<if test="record.privateKey != null">
private_key = #{record.privateKey,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_idc_domain
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
intro = #{record.intro,jdbcType=VARCHAR},
url = #{record.url,jdbcType=VARCHAR},
host = #{record.host,jdbcType=VARCHAR},
self = #{record.self,jdbcType=TINYINT},
pub = #{record.pub,jdbcType=TINYINT},
polling = #{record.polling,jdbcType=TINYINT},
answer = #{record.answer,jdbcType=TINYINT},
last_update_time = #{record.lastUpdateTime,jdbcType=BIGINT},
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT},
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT},
public_key = #{record.publicKey,jdbcType=VARCHAR},
private_key = #{record.privateKey,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomain">
update t_idc_domain
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="intro != null">
intro = #{intro,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="host != null">
host = #{host,jdbcType=VARCHAR},
</if>
<if test="self != null">
self = #{self,jdbcType=TINYINT},
</if>
<if test="pub != null">
pub = #{pub,jdbcType=TINYINT},
</if>
<if test="polling != null">
polling = #{polling,jdbcType=TINYINT},
</if>
<if test="answer != null">
answer = #{answer,jdbcType=TINYINT},
</if>
<if test="lastUpdateTime != null">
last_update_time = #{lastUpdateTime,jdbcType=BIGINT},
</if>
<if test="lastAskTime != null">
last_ask_time = #{lastAskTime,jdbcType=BIGINT},
</if>
<if test="lastAnswerTime != null">
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="publicKey != null">
public_key = #{publicKey,jdbcType=VARCHAR},
</if>
<if test="privateKey != null">
private_key = #{privateKey,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_tall.bean.po.IdcDomain">
update t_idc_domain
set name = #{name,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
intro = #{intro,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
host = #{host,jdbcType=VARCHAR},
self = #{self,jdbcType=TINYINT},
pub = #{pub,jdbcType=TINYINT},
polling = #{polling,jdbcType=TINYINT},
answer = #{answer,jdbcType=TINYINT},
last_update_time = #{lastUpdateTime,jdbcType=BIGINT},
last_ask_time = #{lastAskTime,jdbcType=BIGINT},
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT},
public_key = #{publicKey,jdbcType=VARCHAR},
private_key = #{privateKey,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

291
ptos_tall/src/main/resources/mapper_raw/SysAuthMapper.xml

@ -0,0 +1,291 @@
<?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.ccsens.ptos_tall.persist.mapper.SysAuthMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_tall.bean.po.SysAuth">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="identify_type" jdbcType="TINYINT" property="identifyType" />
<result column="identifier" jdbcType="VARCHAR" property="identifier" />
<result column="credential" jdbcType="VARCHAR" property="credential" />
<result column="salt" jdbcType="VARCHAR" property="salt" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, identify_type, identifier, credential, salt, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysAuthExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_auth
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_auth
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysAuthExample">
delete from t_sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_tall.bean.po.SysAuth">
insert into t_sys_auth (id, user_id, identify_type,
identifier, credential, salt,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{identifyType,jdbcType=TINYINT},
#{identifier,jdbcType=VARCHAR}, #{credential,jdbcType=VARCHAR}, #{salt,jdbcType=VARCHAR},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_tall.bean.po.SysAuth">
insert into t_sys_auth
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="identifyType != null">
identify_type,
</if>
<if test="identifier != null">
identifier,
</if>
<if test="credential != null">
credential,
</if>
<if test="salt != null">
salt,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="identifyType != null">
#{identifyType,jdbcType=TINYINT},
</if>
<if test="identifier != null">
#{identifier,jdbcType=VARCHAR},
</if>
<if test="credential != null">
#{credential,jdbcType=VARCHAR},
</if>
<if test="salt != null">
#{salt,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysAuthExample" resultType="java.lang.Long">
select count(*) from t_sys_auth
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_auth
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.identifyType != null">
identify_type = #{record.identifyType,jdbcType=TINYINT},
</if>
<if test="record.identifier != null">
identifier = #{record.identifier,jdbcType=VARCHAR},
</if>
<if test="record.credential != null">
credential = #{record.credential,jdbcType=VARCHAR},
</if>
<if test="record.salt != null">
salt = #{record.salt,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_auth
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
identify_type = #{record.identifyType,jdbcType=TINYINT},
identifier = #{record.identifier,jdbcType=VARCHAR},
credential = #{record.credential,jdbcType=VARCHAR},
salt = #{record.salt,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_tall.bean.po.SysAuth">
update t_sys_auth
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="identifyType != null">
identify_type = #{identifyType,jdbcType=TINYINT},
</if>
<if test="identifier != null">
identifier = #{identifier,jdbcType=VARCHAR},
</if>
<if test="credential != null">
credential = #{credential,jdbcType=VARCHAR},
</if>
<if test="salt != null">
salt = #{salt,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_tall.bean.po.SysAuth">
update t_sys_auth
set user_id = #{userId,jdbcType=BIGINT},
identify_type = #{identifyType,jdbcType=TINYINT},
identifier = #{identifier,jdbcType=VARCHAR},
credential = #{credential,jdbcType=VARCHAR},
salt = #{salt,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

306
ptos_tall/src/main/resources/mapper_raw/SysSigninLogMapper.xml

@ -0,0 +1,306 @@
<?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.ccsens.ptos_tall.persist.mapper.SysSigninLogMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_tall.bean.po.SysSigninLog">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="auth_id" jdbcType="BIGINT" property="authId" />
<result column="time" jdbcType="BIGINT" property="time" />
<result column="device_id" jdbcType="VARCHAR" property="deviceId" />
<result column="client_type" jdbcType="TINYINT" property="clientType" />
<result column="ip_address" jdbcType="VARCHAR" property="ipAddress" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, auth_id, time, device_id, client_type, ip_address, operator, created_at,
updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLogExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_signin_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_signin_log
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_signin_log
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLogExample">
delete from t_sys_signin_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLog">
insert into t_sys_signin_log (id, user_id, auth_id,
time, device_id, client_type,
ip_address, operator, created_at,
updated_at, rec_status)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{authId,jdbcType=BIGINT},
#{time,jdbcType=BIGINT}, #{deviceId,jdbcType=VARCHAR}, #{clientType,jdbcType=TINYINT},
#{ipAddress,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLog">
insert into t_sys_signin_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="authId != null">
auth_id,
</if>
<if test="time != null">
time,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="clientType != null">
client_type,
</if>
<if test="ipAddress != null">
ip_address,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="authId != null">
#{authId,jdbcType=BIGINT},
</if>
<if test="time != null">
#{time,jdbcType=BIGINT},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
#{clientType,jdbcType=TINYINT},
</if>
<if test="ipAddress != null">
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLogExample" resultType="java.lang.Long">
select count(*) from t_sys_signin_log
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_signin_log
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.authId != null">
auth_id = #{record.authId,jdbcType=BIGINT},
</if>
<if test="record.time != null">
time = #{record.time,jdbcType=BIGINT},
</if>
<if test="record.deviceId != null">
device_id = #{record.deviceId,jdbcType=VARCHAR},
</if>
<if test="record.clientType != null">
client_type = #{record.clientType,jdbcType=TINYINT},
</if>
<if test="record.ipAddress != null">
ip_address = #{record.ipAddress,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_signin_log
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
auth_id = #{record.authId,jdbcType=BIGINT},
time = #{record.time,jdbcType=BIGINT},
device_id = #{record.deviceId,jdbcType=VARCHAR},
client_type = #{record.clientType,jdbcType=TINYINT},
ip_address = #{record.ipAddress,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLog">
update t_sys_signin_log
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="authId != null">
auth_id = #{authId,jdbcType=BIGINT},
</if>
<if test="time != null">
time = #{time,jdbcType=BIGINT},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
client_type = #{clientType,jdbcType=TINYINT},
</if>
<if test="ipAddress != null">
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_tall.bean.po.SysSigninLog">
update t_sys_signin_log
set user_id = #{userId,jdbcType=BIGINT},
auth_id = #{authId,jdbcType=BIGINT},
time = #{time,jdbcType=BIGINT},
device_id = #{deviceId,jdbcType=VARCHAR},
client_type = #{clientType,jdbcType=TINYINT},
ip_address = #{ipAddress,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

276
ptos_tall/src/main/resources/mapper_raw/SysUserDeviceMapper.xml

@ -0,0 +1,276 @@
<?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.ccsens.ptos_tall.persist.mapper.SysUserDeviceMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_tall.bean.po.SysUserDevice">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="device_id" jdbcType="VARCHAR" property="deviceId" />
<result column="client_type" jdbcType="TINYINT" property="clientType" />
<result column="refresh_token" jdbcType="VARCHAR" property="refreshToken" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, user_id, device_id, client_type, refresh_token, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDeviceExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_user_device
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_user_device
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_user_device
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDeviceExample">
delete from t_sys_user_device
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDevice">
insert into t_sys_user_device (id, user_id, device_id,
client_type, refresh_token, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{deviceId,jdbcType=VARCHAR},
#{clientType,jdbcType=TINYINT}, #{refreshToken,jdbcType=VARCHAR}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDevice">
insert into t_sys_user_device
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="clientType != null">
client_type,
</if>
<if test="refreshToken != null">
refresh_token,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
#{clientType,jdbcType=TINYINT},
</if>
<if test="refreshToken != null">
#{refreshToken,jdbcType=VARCHAR},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDeviceExample" resultType="java.lang.Long">
select count(*) from t_sys_user_device
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_user_device
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.deviceId != null">
device_id = #{record.deviceId,jdbcType=VARCHAR},
</if>
<if test="record.clientType != null">
client_type = #{record.clientType,jdbcType=TINYINT},
</if>
<if test="record.refreshToken != null">
refresh_token = #{record.refreshToken,jdbcType=VARCHAR},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_user_device
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
device_id = #{record.deviceId,jdbcType=VARCHAR},
client_type = #{record.clientType,jdbcType=TINYINT},
refresh_token = #{record.refreshToken,jdbcType=VARCHAR},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDevice">
update t_sys_user_device
<set>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
client_type = #{clientType,jdbcType=TINYINT},
</if>
<if test="refreshToken != null">
refresh_token = #{refreshToken,jdbcType=VARCHAR},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_tall.bean.po.SysUserDevice">
update t_sys_user_device
set user_id = #{userId,jdbcType=BIGINT},
device_id = #{deviceId,jdbcType=VARCHAR},
client_type = #{clientType,jdbcType=TINYINT},
refresh_token = #{refreshToken,jdbcType=VARCHAR},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

385
ptos_tall/src/main/resources/mapper_raw/SysUserMapper.xml

@ -0,0 +1,385 @@
<?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.ccsens.ptos_tall.persist.mapper.SysUserMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_tall.bean.po.SysUser">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="gender" jdbcType="TINYINT" property="gender" />
<result column="avatar_url" jdbcType="VARCHAR" property="avatarUrl" />
<result column="country" jdbcType="VARCHAR" property="country" />
<result column="province" jdbcType="VARCHAR" property="province" />
<result column="city" jdbcType="VARCHAR" property="city" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="power" jdbcType="TINYINT" property="power" />
<result column="device_id" jdbcType="VARCHAR" property="deviceId" />
<result column="auth_type" jdbcType="TINYINT" property="authType" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, gender, avatar_url, country, province, city, phone, id_card, power, device_id,
auth_type, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_sys_user
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_sys_user
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserExample">
delete from t_sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_tall.bean.po.SysUser">
insert into t_sys_user (id, name, gender,
avatar_url, country, province,
city, phone, id_card,
power, device_id, auth_type,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
#{avatarUrl,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{province,jdbcType=VARCHAR},
#{city,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
#{power,jdbcType=TINYINT}, #{deviceId,jdbcType=VARCHAR}, #{authType,jdbcType=TINYINT},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_tall.bean.po.SysUser">
insert into t_sys_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="gender != null">
gender,
</if>
<if test="avatarUrl != null">
avatar_url,
</if>
<if test="country != null">
country,
</if>
<if test="province != null">
province,
</if>
<if test="city != null">
city,
</if>
<if test="phone != null">
phone,
</if>
<if test="idCard != null">
id_card,
</if>
<if test="power != null">
power,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="authType != null">
auth_type,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
#{gender,jdbcType=TINYINT},
</if>
<if test="avatarUrl != null">
#{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="country != null">
#{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
#{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
#{city,jdbcType=VARCHAR},
</if>
<if test="phone != null">
#{phone,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
#{idCard,jdbcType=VARCHAR},
</if>
<if test="power != null">
#{power,jdbcType=TINYINT},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="authType != null">
#{authType,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_tall.bean.po.SysUserExample" resultType="java.lang.Long">
select count(*) from t_sys_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_sys_user
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.gender != null">
gender = #{record.gender,jdbcType=TINYINT},
</if>
<if test="record.avatarUrl != null">
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
</if>
<if test="record.country != null">
country = #{record.country,jdbcType=VARCHAR},
</if>
<if test="record.province != null">
province = #{record.province,jdbcType=VARCHAR},
</if>
<if test="record.city != null">
city = #{record.city,jdbcType=VARCHAR},
</if>
<if test="record.phone != null">
phone = #{record.phone,jdbcType=VARCHAR},
</if>
<if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR},
</if>
<if test="record.power != null">
power = #{record.power,jdbcType=TINYINT},
</if>
<if test="record.deviceId != null">
device_id = #{record.deviceId,jdbcType=VARCHAR},
</if>
<if test="record.authType != null">
auth_type = #{record.authType,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_sys_user
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
gender = #{record.gender,jdbcType=TINYINT},
avatar_url = #{record.avatarUrl,jdbcType=VARCHAR},
country = #{record.country,jdbcType=VARCHAR},
province = #{record.province,jdbcType=VARCHAR},
city = #{record.city,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
id_card = #{record.idCard,jdbcType=VARCHAR},
power = #{record.power,jdbcType=TINYINT},
device_id = #{record.deviceId,jdbcType=VARCHAR},
auth_type = #{record.authType,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_tall.bean.po.SysUser">
update t_sys_user
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="gender != null">
gender = #{gender,jdbcType=TINYINT},
</if>
<if test="avatarUrl != null">
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
</if>
<if test="country != null">
country = #{country,jdbcType=VARCHAR},
</if>
<if test="province != null">
province = #{province,jdbcType=VARCHAR},
</if>
<if test="city != null">
city = #{city,jdbcType=VARCHAR},
</if>
<if test="phone != null">
phone = #{phone,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if test="power != null">
power = #{power,jdbcType=TINYINT},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="authType != null">
auth_type = #{authType,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_tall.bean.po.SysUser">
update t_sys_user
set name = #{name,jdbcType=VARCHAR},
gender = #{gender,jdbcType=TINYINT},
avatar_url = #{avatarUrl,jdbcType=VARCHAR},
country = #{country,jdbcType=VARCHAR},
province = #{province,jdbcType=VARCHAR},
city = #{city,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR},
power = #{power,jdbcType=TINYINT},
device_id = #{deviceId,jdbcType=VARCHAR},
auth_type = #{authType,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

21
util/src/main/java/com/ccsens/util/JsonResponse.java

@ -48,6 +48,17 @@ public class JsonResponse<T> {
private boolean success;
@ApiModelProperty(value = "md5校验状态 0:未校验 1:校验一致 2:校验不一致")
private byte md5Status = 0;
@ApiModelProperty(value = "token信息")
private TokenObj tokenObj = new TokenObj();
@Data
@ApiModel("token信息")
public static class TokenObj{
@ApiModelProperty(value = "token")
private String token;
@ApiModelProperty(value = "refreshToken")
private String refreshToken;
}
public static class MD5Status{
public final static byte UNCHECK = 0;
@ -65,6 +76,8 @@ public class JsonResponse<T> {
// return new JsonResponse<T>();
// }
public JsonResponse ok(){
this.code = CodeEnum.SUCCESS.getCode();
this.msg = CodeEnum.SUCCESS.getMsg();
@ -72,6 +85,14 @@ public class JsonResponse<T> {
return this;
}
public JsonResponse ok(T data, String token, String refreshToken){
ok();
this.data = data;
this.tokenObj.token = token;
this.tokenObj.refreshToken = refreshToken;
return this;
}
public JsonResponse ok(T data){
ok();
this.data = data;

Loading…
Cancel
Save