From 103c7af9b7222fe5d4fa129197e0da451cdc3160 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Sat, 7 Sep 2024 17:51:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=94=A8=E6=88=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E3=80=81=E7=BB=91=E5=AE=9A/=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E3=80=81=E6=9F=A5=E8=AF=A2=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hfkj/config/AuthConfig.java | 3 +- .../com/hfkj/controller/LoginController.java | 2 +- .../hfkj/controller/SecMenuController.java | 2 +- .../hfkj/controller/SecUserController.java | 4 +- .../main/java/com/hfkj/config/AuthConfig.java | 9 +- .../com/hfkj/controller/ClientController.java | 96 ++ .../com/hfkj/controller/SmsController.java | 1 + .../com/hfkj/controller/UserController.java | 150 ++ .../hfkj/common/security/SecUserCenter.java | 148 ++ .../com/hfkj/common/security/UserCenter.java | 18 +- .../com/hfkj/dao/BsUserLoginLogMapper.java | 148 ++ .../com/hfkj/dao/BsUserLoginLogMapperExt.java | 7 + .../hfkj/dao/BsUserLoginLogSqlProvider.java | 416 +++++ .../main/java/com/hfkj/dao/BsUserMapper.java | 120 ++ .../java/com/hfkj/dao/BsUserMapperExt.java | 7 + .../java/com/hfkj/dao/BsUserSqlProvider.java | 318 ++++ .../src/main/java/com/hfkj/entity/BsUser.java | 216 +++ .../java/com/hfkj/entity/BsUserExample.java | 943 +++++++++++ .../java/com/hfkj/entity/BsUserLoginLog.java | 328 ++++ .../hfkj/entity/BsUserLoginLogExample.java | 1443 +++++++++++++++++ .../com/hfkj/model/UserSessionObject.java | 16 + .../com/hfkj/service/sec/SecMenuService.java | 2 +- .../com/hfkj/service/sec/SecUserService.java | 2 +- .../service/sec/impl/SecMenuServiceImpl.java | 2 +- .../sec/impl/SecUserLoginLogServiceImpl.java | 2 +- .../service/sec/impl/SecUserServiceImpl.java | 9 +- .../service/user/BsUserLoginLogService.java | 36 + .../com/hfkj/service/user/BsUserService.java | 61 + .../user/impl/BsUserLoginLogServiceImpl.java | 94 ++ .../service/user/impl/BsUserServiceImpl.java | 156 ++ .../sysenum/{ => sec}/SecMenuTypeEnum.java | 2 +- .../{ => sec}/SecUserLoginLogStatusEnum.java | 2 +- .../{ => sec}/SecUserObjectTypeEnum.java | 2 +- .../sysenum/{ => sec}/SecUserStatusEnum.java | 2 +- .../com/hfkj/sysenum/user/UserGradeEnum.java | 42 + .../com/hfkj/sysenum/user/UserLoginType.java | 46 + .../com/hfkj/sysenum/user/UserStatusEnum.java | 50 + 37 files changed, 4873 insertions(+), 32 deletions(-) create mode 100644 cweb/src/main/java/com/hfkj/controller/ClientController.java create mode 100644 cweb/src/main/java/com/hfkj/controller/SmsController.java create mode 100644 cweb/src/main/java/com/hfkj/controller/UserController.java create mode 100644 service/src/main/java/com/hfkj/common/security/SecUserCenter.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserLoginLogMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserLoginLogMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserLoginLogSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserMapper.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserMapperExt.java create mode 100644 service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java create mode 100644 service/src/main/java/com/hfkj/entity/BsUser.java create mode 100644 service/src/main/java/com/hfkj/entity/BsUserExample.java create mode 100644 service/src/main/java/com/hfkj/entity/BsUserLoginLog.java create mode 100644 service/src/main/java/com/hfkj/entity/BsUserLoginLogExample.java create mode 100644 service/src/main/java/com/hfkj/model/UserSessionObject.java create mode 100644 service/src/main/java/com/hfkj/service/user/BsUserLoginLogService.java create mode 100644 service/src/main/java/com/hfkj/service/user/BsUserService.java create mode 100644 service/src/main/java/com/hfkj/service/user/impl/BsUserLoginLogServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java rename service/src/main/java/com/hfkj/sysenum/{ => sec}/SecMenuTypeEnum.java (95%) rename service/src/main/java/com/hfkj/sysenum/{ => sec}/SecUserLoginLogStatusEnum.java (95%) rename service/src/main/java/com/hfkj/sysenum/{ => sec}/SecUserObjectTypeEnum.java (96%) rename service/src/main/java/com/hfkj/sysenum/{ => sec}/SecUserStatusEnum.java (96%) create mode 100644 service/src/main/java/com/hfkj/sysenum/user/UserGradeEnum.java create mode 100644 service/src/main/java/com/hfkj/sysenum/user/UserLoginType.java create mode 100644 service/src/main/java/com/hfkj/sysenum/user/UserStatusEnum.java diff --git a/bweb/src/main/java/com/hfkj/config/AuthConfig.java b/bweb/src/main/java/com/hfkj/config/AuthConfig.java index 856bcb0..e2e7c82 100644 --- a/bweb/src/main/java/com/hfkj/config/AuthConfig.java +++ b/bweb/src/main/java/com/hfkj/config/AuthConfig.java @@ -3,6 +3,7 @@ package com.hfkj.config; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; +import com.hfkj.common.security.SecUserCenter; import com.hfkj.common.security.UserCenter; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -27,7 +28,7 @@ public class AuthConfig implements WebMvcConfigurer { private static Logger log = LoggerFactory.getLogger(AuthConfig.class); @Resource - private UserCenter userCenter; + private SecUserCenter userCenter; /** * 获取配置文件debug变量 diff --git a/bweb/src/main/java/com/hfkj/controller/LoginController.java b/bweb/src/main/java/com/hfkj/controller/LoginController.java index 38c7967..71097b9 100644 --- a/bweb/src/main/java/com/hfkj/controller/LoginController.java +++ b/bweb/src/main/java/com/hfkj/controller/LoginController.java @@ -33,7 +33,7 @@ public class LoginController { private SecUserService secUserService; @Resource - private UserCenter userCenter; + private SecUserCenter userCenter; @RequestMapping(value="/login",method = RequestMethod.POST) @ResponseBody diff --git a/bweb/src/main/java/com/hfkj/controller/SecMenuController.java b/bweb/src/main/java/com/hfkj/controller/SecMenuController.java index 1151859..87863b2 100644 --- a/bweb/src/main/java/com/hfkj/controller/SecMenuController.java +++ b/bweb/src/main/java/com/hfkj/controller/SecMenuController.java @@ -9,7 +9,7 @@ import com.hfkj.entity.SecMenu; import com.hfkj.model.ResponseData; import com.hfkj.service.sec.SecMenuService; import com.hfkj.service.sec.SecRoleMenuRelService; -import com.hfkj.sysenum.SecMenuTypeEnum; +import com.hfkj.sysenum.sec.SecMenuTypeEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; diff --git a/bweb/src/main/java/com/hfkj/controller/SecUserController.java b/bweb/src/main/java/com/hfkj/controller/SecUserController.java index f87a7b2..78801a1 100644 --- a/bweb/src/main/java/com/hfkj/controller/SecUserController.java +++ b/bweb/src/main/java/com/hfkj/controller/SecUserController.java @@ -12,8 +12,8 @@ import com.hfkj.entity.SecUser; import com.hfkj.model.ResponseData; import com.hfkj.service.sec.SecUserLoginLogService; import com.hfkj.service.sec.SecUserService; -import com.hfkj.sysenum.SecUserObjectTypeEnum; -import com.hfkj.sysenum.SecUserStatusEnum; +import com.hfkj.sysenum.sec.SecUserObjectTypeEnum; +import com.hfkj.sysenum.sec.SecUserStatusEnum; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; diff --git a/cweb/src/main/java/com/hfkj/config/AuthConfig.java b/cweb/src/main/java/com/hfkj/config/AuthConfig.java index 629672d..9843536 100644 --- a/cweb/src/main/java/com/hfkj/config/AuthConfig.java +++ b/cweb/src/main/java/com/hfkj/config/AuthConfig.java @@ -89,14 +89,9 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/**/api-docs") .excludePathPatterns("/**/springfox-swagger-ui/**") .excludePathPatterns("/**/swagger-ui.html") - .excludePathPatterns("/client/*") + .excludePathPatterns("/common/*") .excludePathPatterns("/sms/*") - .excludePathPatterns("/gas/*") - .excludePathPatterns("/order/*") - .excludePathPatterns("/gasOrder/*") - .excludePathPatterns("/pay/*") - .excludePathPatterns("/user/*") - .excludePathPatterns("/notify/*") + .excludePathPatterns("/client/*") ; } diff --git a/cweb/src/main/java/com/hfkj/controller/ClientController.java b/cweb/src/main/java/com/hfkj/controller/ClientController.java new file mode 100644 index 0000000..aa26a45 --- /dev/null +++ b/cweb/src/main/java/com/hfkj/controller/ClientController.java @@ -0,0 +1,96 @@ +package com.hfkj.controller; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.MemberValidateUtil; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.user.BsUserService; +import com.hfkj.sysenum.user.UserLoginType; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; + +/** + * @className: ClientController + * @author: HuRui + * @date: 2024/9/6 + **/ +@Controller +@RequestMapping(value="/client") +@Api(value="客户端业务") +public class ClientController { + @Resource + private BsUserService userService; + @Resource + private RedisUtil redisUtil; + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/smsLogin", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "登录并注册 { 'phone': '手机号', 'smsCode': '短信验证码'}") + public ResponseData smsLogin(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("phone")) + || StringUtils.isBlank(body.getString("smsCode")) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + String phone = body.getString("phone"); + // 校验手机号格式 + if (!MemberValidateUtil.validatePhone(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); + } + if (StringUtils.isBlank(body.getString("smsCode"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); + } + // 手机号的验证码 + Object phoneCodeObject = redisUtil.get("SMS_LOGIN_CODE:" + phone); + if (phoneCodeObject == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + if (!body.getString("smsCode").equals(phoneCodeObject.toString())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + redisUtil.del("SMS_LOGIN_CODE:" + phone); + + return ResponseMsgUtil.success(userService.login(phone, UserLoginType.SMS, new HashMap<>())); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/loginOut",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "退出登录") + public ResponseData loginOut(HttpServletRequest request) { + try { + SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class); + if (session != null) { + userCenter.remove(request); + } + return ResponseMsgUtil.success("退出成功"); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/cweb/src/main/java/com/hfkj/controller/SmsController.java b/cweb/src/main/java/com/hfkj/controller/SmsController.java new file mode 100644 index 0000000..3e3a6be --- /dev/null +++ b/cweb/src/main/java/com/hfkj/controller/SmsController.java @@ -0,0 +1 @@ +package com.hfkj.controller; import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.utils.MemberValidateUtil; import com.hfkj.common.utils.RedisUtil; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.model.ResponseData; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.Random; @Controller @RequestMapping(value = "/sms") @Api(value = "短信服务") public class SmsController { private static Logger log = LoggerFactory.getLogger(SmsController.class); @Resource private RedisUtil redisUtil; @RequestMapping(value = "/sendLoginCode", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "获取登录验证码 {'phone': '手机号'}") public ResponseData sendLoginCode(@RequestBody JSONObject body) { try { if (body == null || StringUtils.isBlank(body.getString("phone"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } String phone = body.getString("phone"); // 校验手机号格式 if (!MemberValidateUtil.validatePhone(phone)) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); } // 生成随机6位验证码 String smsCode = String.valueOf(new Random().nextInt(899999) + 100000); // 验证码缓存5分钟 redisUtil.set("SMS_LOGIN_CODE:"+phone, 123456, 60*5); return ResponseMsgUtil.success("短信发送成功"); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendBindPhoneCode", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "发送绑定手机号验证码 {'phone': '手机号'}") public ResponseData sendBindPhoneCode(@RequestBody JSONObject body) { try { if (body == null || StringUtils.isBlank(body.getString("phone"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } String phone = body.getString("phone"); // 校验手机号格式 if (!MemberValidateUtil.validatePhone(phone)) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); } // 生成随机6位验证码 String smsCode = String.valueOf(new Random().nextInt(899999) + 100000); // 验证码缓存5分钟 redisUtil.set("SMS_BIND_PHONE_CODE:"+phone, 123456, 60*5); return ResponseMsgUtil.success("短信发送成功"); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } @RequestMapping(value = "/sendUpdatePhoneCode", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "发送修改手机号验证码 {'phone': '手机号'}") public ResponseData sendUpdatePhoneCode(@RequestBody JSONObject body) { try { if (body == null || StringUtils.isBlank(body.getString("phone"))) { throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); } String phone = body.getString("phone"); // 校验手机号格式 if (!MemberValidateUtil.validatePhone(phone)) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); } // 生成随机6位验证码 String smsCode = String.valueOf(new Random().nextInt(899999) + 100000); // 验证码缓存5分钟 redisUtil.set("SMS_UPDATE_PHONE_CODE:"+phone, 123456, 60*5); return ResponseMsgUtil.success("短信发送成功"); } catch (Exception e) { return ResponseMsgUtil.exception(e); } } } \ No newline at end of file diff --git a/cweb/src/main/java/com/hfkj/controller/UserController.java b/cweb/src/main/java/com/hfkj/controller/UserController.java new file mode 100644 index 0000000..2baa7cd --- /dev/null +++ b/cweb/src/main/java/com/hfkj/controller/UserController.java @@ -0,0 +1,150 @@ +package com.hfkj.controller; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.MemberValidateUtil; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsUser; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.UserSessionObject; +import com.hfkj.service.user.BsUserService; +import com.hfkj.sysenum.user.UserLoginType; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +/** + * @className: ClientController + * @author: HuRui + * @date: 2024/9/6 + **/ +@Controller +@RequestMapping(value="/user") +@Api(value="客户端业务") +public class UserController { + @Resource + private BsUserService userService; + @Resource + private RedisUtil redisUtil; + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/getUser", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询用户信息") + public ResponseData getUser() { + try { + Map param = new HashMap<>(); + // 用户信息 + param.put("user", userCenter.getSessionModel(UserSessionObject.class)); + + return ResponseMsgUtil.success(param); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/bindPhone", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "绑定手机号") + public ResponseData bindPhone(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("phone")) + || StringUtils.isBlank(body.getString("smsCode"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + if (StringUtils.isNotBlank(userSession.getUser().getPhone())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已绑定"); + } + String phone = body.getString("phone"); + // 校验手机号格式 + if (!MemberValidateUtil.validatePhone(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); + } + if (StringUtils.isBlank(body.getString("smsCode"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); + } + // 手机号的验证码 + Object phoneCodeObject = redisUtil.get("SMS_BIND_PHONE_CODE:" + phone); + if (phoneCodeObject == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + if (!body.getString("smsCode").equals(phoneCodeObject.toString())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + redisUtil.del("SMS_BIND_PHONE_CODE:" + phone); + + // 更新手机号 + userService.updatePhone(userSession.getUser().getId(), body.getString("phone")); + + return ResponseMsgUtil.success(userCenter.getSessionModel(UserSessionObject.class)); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updatePhone", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改手机号") + public ResponseData updatePhone(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("newPhone")) + || StringUtils.isBlank(body.getString("smsCode"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + if (StringUtils.isBlank(userSession.getUser().getPhone())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户未绑定手机号"); + } + String phone = body.getString("newPhone"); + if (userSession.getUser().getPhone().equals(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "新手机号与现绑定手机号相同"); + } + // 校验手机号格式 + if (!MemberValidateUtil.validatePhone(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); + } + if (StringUtils.isBlank(body.getString("smsCode"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入短信验证码"); + } + // 手机号的验证码 + Object phoneCodeObject = redisUtil.get("SMS_UPDATE_PHONE_CODE:" + phone); + if (phoneCodeObject == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + if (!body.getString("smsCode").equals(phoneCodeObject.toString())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "短信验证码错误"); + } + redisUtil.del("SMS_UPDATE_PHONE_CODE:" + phone); + + // 更新手机号 + userService.updatePhone(userSession.getUser().getId(), body.getString("phone")); + + return ResponseMsgUtil.success(userCenter.getSessionModel(UserSessionObject.class)); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/service/src/main/java/com/hfkj/common/security/SecUserCenter.java b/service/src/main/java/com/hfkj/common/security/SecUserCenter.java new file mode 100644 index 0000000..d0b6b27 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/SecUserCenter.java @@ -0,0 +1,148 @@ +package com.hfkj.common.security; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.RedisUtil; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +@Component +public class SecUserCenter { + + private static Logger log = LoggerFactory.getLogger(SecUserCenter.class); + + @Autowired + private RedisUtil redisUtil; + private final int EXPIRE = 3600 * 24 * 90; // 登录过期时间为90天 + + private final static String LOGIN_CACHE_KEY = "SEC_USER_LOGIN:"; + + /** + * 保存登录信息 + * @throws Exception + */ + public void save(SessionObject seObj) { + redisUtil.set(LOGIN_CACHE_KEY+seObj.getToken(), seObj, EXPIRE); + } + + /** + * 刷新登录缓存时间 + * @throws Exception + */ + public void refresh(HttpServletRequest request) { + String token = request.getHeader("Authorization"); + if(StringUtils.isNotBlank(token)) { + redisUtil.expire(LOGIN_CACHE_KEY+token, EXPIRE); + } + } + + /** + * 是否登录 + * @param request + * @return + */ + public boolean isLogin(HttpServletRequest request){ + String token = request.getHeader("Authorization"); + if(StringUtils.isBlank(token)) { + return false; + } + return redisUtil.hasKey(LOGIN_CACHE_KEY+token); + } + + /** + * 是否登录 + * @param token 账户token + * @return + */ + public boolean isLogin(String token){ + if(StringUtils.isBlank(token)) { + return false; + } + return redisUtil.hasKey(LOGIN_CACHE_KEY+token); + } + + /** + * 退出登录 + * @param request + */ + public void remove(HttpServletRequest request) { + String token = request.getHeader("Authorization"); + if (StringUtils.isNotBlank(token)) { + //通过token方式登录 + redisUtil.del(LOGIN_CACHE_KEY+token); + } + } + + /** + * 退出登录 + * @param token + */ + public void remove(String token) { + if (StringUtils.isNotBlank(token)) { + //通过token方式登录 + redisUtil.del(LOGIN_CACHE_KEY+token); + } + } + + /** + * 获取session信息 + * @param clazz + * @return + * @param + */ + public E getSessionModel(Class clazz){ + if (RequestContextHolder.getRequestAttributes()!=null) { + HttpServletRequest req = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + SessionObject sessionObject = getSessionObject(req); + if (sessionObject == null){ + return null; + } + if (clazz.equals(sessionObject.getObject().getClass())) { + return (E)sessionObject.getObject(); + } + } + return null; + } + + /** + * 获取session信息 + * @param request + * @return + */ + public SessionObject getSessionObject(HttpServletRequest request) { + String token = request.getHeader("Authorization"); + if (StringUtils.isBlank(token)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); + } + Object obj = redisUtil.get(LOGIN_CACHE_KEY+token); + if (obj == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); + } + return (SessionObject) obj; + } + + /** + * 获取session信息 + * @param token + * @return + */ + public SessionObject getSessionObject(String token) { + if (StringUtils.isBlank(token)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); + } + Object obj = redisUtil.get(LOGIN_CACHE_KEY+token); + if (obj == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); + } + return (SessionObject) obj; + } + +} diff --git a/service/src/main/java/com/hfkj/common/security/UserCenter.java b/service/src/main/java/com/hfkj/common/security/UserCenter.java index 1433c4e..01295d9 100644 --- a/service/src/main/java/com/hfkj/common/security/UserCenter.java +++ b/service/src/main/java/com/hfkj/common/security/UserCenter.java @@ -23,12 +23,14 @@ public class UserCenter { private RedisUtil redisUtil; private final int EXPIRE = 3600 * 24 * 90; // 登录过期时间为90天 + private final static String LOGIN_CACHE_KEY = "USER_LOGIN:"; + /** * 保存登录信息 * @throws Exception */ public void save(SessionObject seObj) { - redisUtil.set(seObj.getToken(), seObj, EXPIRE); + redisUtil.set(LOGIN_CACHE_KEY+seObj.getToken(), seObj, EXPIRE); } /** @@ -38,7 +40,7 @@ public class UserCenter { public void refresh(HttpServletRequest request) { String token = request.getHeader("Authorization"); if(StringUtils.isNotBlank(token)) { - redisUtil.expire(token, EXPIRE); + redisUtil.expire(LOGIN_CACHE_KEY+token, EXPIRE); } } @@ -52,7 +54,7 @@ public class UserCenter { if(StringUtils.isBlank(token)) { return false; } - return redisUtil.hasKey(token); + return redisUtil.hasKey(LOGIN_CACHE_KEY+token); } /** @@ -64,7 +66,7 @@ public class UserCenter { if(StringUtils.isBlank(token)) { return false; } - return redisUtil.hasKey(token); + return redisUtil.hasKey(LOGIN_CACHE_KEY+token); } /** @@ -75,7 +77,7 @@ public class UserCenter { String token = request.getHeader("Authorization"); if (StringUtils.isNotBlank(token)) { //通过token方式登录 - redisUtil.del(token); + redisUtil.del(LOGIN_CACHE_KEY+token); } } @@ -86,7 +88,7 @@ public class UserCenter { public void remove(String token) { if (StringUtils.isNotBlank(token)) { //通过token方式登录 - redisUtil.del(token); + redisUtil.del(LOGIN_CACHE_KEY+token); } } @@ -120,7 +122,7 @@ public class UserCenter { if (StringUtils.isBlank(token)) { throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); } - Object obj = redisUtil.get(token); + Object obj = redisUtil.get(LOGIN_CACHE_KEY+token); if (obj == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); } @@ -136,7 +138,7 @@ public class UserCenter { if (StringUtils.isBlank(token)) { throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); } - Object obj = redisUtil.get(token); + Object obj = redisUtil.get(LOGIN_CACHE_KEY+token); if (obj == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); } diff --git a/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapper.java b/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapper.java new file mode 100644 index 0000000..9ee481f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapper.java @@ -0,0 +1,148 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsUserLoginLog; +import com.hfkj.entity.BsUserLoginLogExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface BsUserLoginLogMapper extends BsUserLoginLogMapperExt { + @SelectProvider(type=BsUserLoginLogSqlProvider.class, method="countByExample") + long countByExample(BsUserLoginLogExample example); + + @DeleteProvider(type=BsUserLoginLogSqlProvider.class, method="deleteByExample") + int deleteByExample(BsUserLoginLogExample example); + + @Delete({ + "delete from bs_user_login_log", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_user_login_log (user_id, user_phone, ", + "login_type_code, login_type_name, ", + "ip, country, region_id, ", + "region_name, city_id, ", + "city_name, isp, `status`, ", + "remark, create_time, ", + "ext_1, ext_2, ext_3)", + "values (#{userId,jdbcType=BIGINT}, #{userPhone,jdbcType=VARCHAR}, ", + "#{loginTypeCode,jdbcType=VARCHAR}, #{loginTypeName,jdbcType=VARCHAR}, ", + "#{ip,jdbcType=VARCHAR}, #{country,jdbcType=VARCHAR}, #{regionId,jdbcType=VARCHAR}, ", + "#{regionName,jdbcType=VARCHAR}, #{cityId,jdbcType=VARCHAR}, ", + "#{cityName,jdbcType=VARCHAR}, #{isp,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsUserLoginLog record); + + @InsertProvider(type=BsUserLoginLogSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsUserLoginLog record); + + @SelectProvider(type=BsUserLoginLogSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="login_type_code", property="loginTypeCode", jdbcType=JdbcType.VARCHAR), + @Result(column="login_type_name", property="loginTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), + @Result(column="country", property="country", jdbcType=JdbcType.VARCHAR), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR), + @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR), + @Result(column="isp", property="isp", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(BsUserLoginLogExample example); + + @Select({ + "select", + "id, user_id, user_phone, login_type_code, login_type_name, ip, country, region_id, ", + "region_name, city_id, city_name, isp, `status`, remark, create_time, ext_1, ", + "ext_2, ext_3", + "from bs_user_login_log", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="login_type_code", property="loginTypeCode", jdbcType=JdbcType.VARCHAR), + @Result(column="login_type_name", property="loginTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), + @Result(column="country", property="country", jdbcType=JdbcType.VARCHAR), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.VARCHAR), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="city_id", property="cityId", jdbcType=JdbcType.VARCHAR), + @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR), + @Result(column="isp", property="isp", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + BsUserLoginLog selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsUserLoginLog record, @Param("example") BsUserLoginLogExample example); + + @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsUserLoginLog record, @Param("example") BsUserLoginLogExample example); + + @UpdateProvider(type=BsUserLoginLogSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsUserLoginLog record); + + @Update({ + "update bs_user_login_log", + "set user_id = #{userId,jdbcType=BIGINT},", + "user_phone = #{userPhone,jdbcType=VARCHAR},", + "login_type_code = #{loginTypeCode,jdbcType=VARCHAR},", + "login_type_name = #{loginTypeName,jdbcType=VARCHAR},", + "ip = #{ip,jdbcType=VARCHAR},", + "country = #{country,jdbcType=VARCHAR},", + "region_id = #{regionId,jdbcType=VARCHAR},", + "region_name = #{regionName,jdbcType=VARCHAR},", + "city_id = #{cityId,jdbcType=VARCHAR},", + "city_name = #{cityName,jdbcType=VARCHAR},", + "isp = #{isp,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "remark = #{remark,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsUserLoginLog record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapperExt.java b/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapperExt.java new file mode 100644 index 0000000..4197777 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserLoginLogMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsUserLoginLogMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsUserLoginLogSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsUserLoginLogSqlProvider.java new file mode 100644 index 0000000..a2f37eb --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserLoginLogSqlProvider.java @@ -0,0 +1,416 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsUserLoginLog; +import com.hfkj.entity.BsUserLoginLogExample.Criteria; +import com.hfkj.entity.BsUserLoginLogExample.Criterion; +import com.hfkj.entity.BsUserLoginLogExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsUserLoginLogSqlProvider { + + public String countByExample(BsUserLoginLogExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_user_login_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsUserLoginLogExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_user_login_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsUserLoginLog record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_user_login_log"); + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeCode() != null) { + sql.VALUES("login_type_code", "#{loginTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeName() != null) { + sql.VALUES("login_type_name", "#{loginTypeName,jdbcType=VARCHAR}"); + } + + if (record.getIp() != null) { + sql.VALUES("ip", "#{ip,jdbcType=VARCHAR}"); + } + + if (record.getCountry() != null) { + sql.VALUES("country", "#{country,jdbcType=VARCHAR}"); + } + + if (record.getRegionId() != null) { + sql.VALUES("region_id", "#{regionId,jdbcType=VARCHAR}"); + } + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + + if (record.getCityId() != null) { + sql.VALUES("city_id", "#{cityId,jdbcType=VARCHAR}"); + } + + if (record.getCityName() != null) { + sql.VALUES("city_name", "#{cityName,jdbcType=VARCHAR}"); + } + + if (record.getIsp() != null) { + sql.VALUES("isp", "#{isp,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getRemark() != null) { + sql.VALUES("remark", "#{remark,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(BsUserLoginLogExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("user_id"); + sql.SELECT("user_phone"); + sql.SELECT("login_type_code"); + sql.SELECT("login_type_name"); + sql.SELECT("ip"); + sql.SELECT("country"); + sql.SELECT("region_id"); + sql.SELECT("region_name"); + sql.SELECT("city_id"); + sql.SELECT("city_name"); + sql.SELECT("isp"); + sql.SELECT("`status`"); + sql.SELECT("remark"); + sql.SELECT("create_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_user_login_log"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsUserLoginLog record = (BsUserLoginLog) parameter.get("record"); + BsUserLoginLogExample example = (BsUserLoginLogExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_user_login_log"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeCode() != null) { + sql.SET("login_type_code = #{record.loginTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeName() != null) { + sql.SET("login_type_name = #{record.loginTypeName,jdbcType=VARCHAR}"); + } + + if (record.getIp() != null) { + sql.SET("ip = #{record.ip,jdbcType=VARCHAR}"); + } + + if (record.getCountry() != null) { + sql.SET("country = #{record.country,jdbcType=VARCHAR}"); + } + + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=VARCHAR}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + + if (record.getCityId() != null) { + sql.SET("city_id = #{record.cityId,jdbcType=VARCHAR}"); + } + + if (record.getCityName() != null) { + sql.SET("city_name = #{record.cityName,jdbcType=VARCHAR}"); + } + + if (record.getIsp() != null) { + sql.SET("isp = #{record.isp,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getRemark() != null) { + sql.SET("remark = #{record.remark,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("bs_user_login_log"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("login_type_code = #{record.loginTypeCode,jdbcType=VARCHAR}"); + sql.SET("login_type_name = #{record.loginTypeName,jdbcType=VARCHAR}"); + sql.SET("ip = #{record.ip,jdbcType=VARCHAR}"); + sql.SET("country = #{record.country,jdbcType=VARCHAR}"); + sql.SET("region_id = #{record.regionId,jdbcType=VARCHAR}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("city_id = #{record.cityId,jdbcType=VARCHAR}"); + sql.SET("city_name = #{record.cityName,jdbcType=VARCHAR}"); + sql.SET("isp = #{record.isp,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("remark = #{record.remark,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsUserLoginLogExample example = (BsUserLoginLogExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsUserLoginLog record) { + SQL sql = new SQL(); + sql.UPDATE("bs_user_login_log"); + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeCode() != null) { + sql.SET("login_type_code = #{loginTypeCode,jdbcType=VARCHAR}"); + } + + if (record.getLoginTypeName() != null) { + sql.SET("login_type_name = #{loginTypeName,jdbcType=VARCHAR}"); + } + + if (record.getIp() != null) { + sql.SET("ip = #{ip,jdbcType=VARCHAR}"); + } + + if (record.getCountry() != null) { + sql.SET("country = #{country,jdbcType=VARCHAR}"); + } + + if (record.getRegionId() != null) { + sql.SET("region_id = #{regionId,jdbcType=VARCHAR}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + + if (record.getCityId() != null) { + sql.SET("city_id = #{cityId,jdbcType=VARCHAR}"); + } + + if (record.getCityName() != null) { + sql.SET("city_name = #{cityName,jdbcType=VARCHAR}"); + } + + if (record.getIsp() != null) { + sql.SET("isp = #{isp,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getRemark() != null) { + sql.SET("remark = #{remark,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, BsUserLoginLogExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsUserMapper.java b/service/src/main/java/com/hfkj/dao/BsUserMapper.java new file mode 100644 index 0000000..7f0738a --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserMapper.java @@ -0,0 +1,120 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserExample; +import java.util.List; +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.DeleteProvider; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.InsertProvider; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; +import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.SelectProvider; +import org.apache.ibatis.annotations.Update; +import org.apache.ibatis.annotations.UpdateProvider; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface BsUserMapper extends BsUserMapperExt { + @SelectProvider(type=BsUserSqlProvider.class, method="countByExample") + long countByExample(BsUserExample example); + + @DeleteProvider(type=BsUserSqlProvider.class, method="deleteByExample") + int deleteByExample(BsUserExample example); + + @Delete({ + "delete from bs_user", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_user (head_img, `name`, ", + "phone, grade, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{headImg,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, ", + "#{phone,jdbcType=VARCHAR}, #{grade,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsUser record); + + @InsertProvider(type=BsUserSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsUser record); + + @SelectProvider(type=BsUserSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="head_img", property="headImg", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), + @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(BsUserExample example); + + @Select({ + "select", + "id, head_img, `name`, phone, grade, `status`, create_time, update_time, ext_1, ", + "ext_2, ext_3", + "from bs_user", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="head_img", property="headImg", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="phone", property="phone", jdbcType=JdbcType.VARCHAR), + @Result(column="grade", property="grade", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + BsUser selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsUserSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsUser record, @Param("example") BsUserExample example); + + @UpdateProvider(type=BsUserSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsUser record, @Param("example") BsUserExample example); + + @UpdateProvider(type=BsUserSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsUser record); + + @Update({ + "update bs_user", + "set head_img = #{headImg,jdbcType=VARCHAR},", + "`name` = #{name,jdbcType=VARCHAR},", + "phone = #{phone,jdbcType=VARCHAR},", + "grade = #{grade,jdbcType=INTEGER},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsUser record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsUserMapperExt.java b/service/src/main/java/com/hfkj/dao/BsUserMapperExt.java new file mode 100644 index 0000000..4078eb8 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsUserMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java new file mode 100644 index 0000000..ad9e866 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsUserSqlProvider.java @@ -0,0 +1,318 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserExample.Criteria; +import com.hfkj.entity.BsUserExample.Criterion; +import com.hfkj.entity.BsUserExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsUserSqlProvider { + + public String countByExample(BsUserExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsUserExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsUser record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_user"); + + if (record.getHeadImg() != null) { + sql.VALUES("head_img", "#{headImg,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); + } + + if (record.getPhone() != null) { + sql.VALUES("phone", "#{phone,jdbcType=VARCHAR}"); + } + + if (record.getGrade() != null) { + sql.VALUES("grade", "#{grade,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.VALUES("ext_1", "#{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.VALUES("ext_2", "#{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.VALUES("ext_3", "#{ext3,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(BsUserExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("head_img"); + sql.SELECT("`name`"); + sql.SELECT("phone"); + sql.SELECT("grade"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_user"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsUser record = (BsUser) parameter.get("record"); + BsUserExample example = (BsUserExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_user"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getHeadImg() != null) { + sql.SET("head_img = #{record.headImg,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + } + + if (record.getPhone() != null) { + sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); + } + + if (record.getGrade() != null) { + sql.SET("grade = #{record.grade,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("bs_user"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("head_img = #{record.headImg,jdbcType=VARCHAR}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("phone = #{record.phone,jdbcType=VARCHAR}"); + sql.SET("grade = #{record.grade,jdbcType=INTEGER}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsUserExample example = (BsUserExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsUser record) { + SQL sql = new SQL(); + sql.UPDATE("bs_user"); + + if (record.getHeadImg() != null) { + sql.SET("head_img = #{headImg,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); + } + + if (record.getPhone() != null) { + sql.SET("phone = #{phone,jdbcType=VARCHAR}"); + } + + if (record.getGrade() != null) { + sql.SET("grade = #{grade,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getExt1() != null) { + sql.SET("ext_1 = #{ext1,jdbcType=VARCHAR}"); + } + + if (record.getExt2() != null) { + sql.SET("ext_2 = #{ext2,jdbcType=VARCHAR}"); + } + + if (record.getExt3() != null) { + sql.SET("ext_3 = #{ext3,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, BsUserExample example, boolean includeExamplePhrase) { + if (example == null) { + return; + } + + String parmPhrase1; + String parmPhrase1_th; + String parmPhrase2; + String parmPhrase2_th; + String parmPhrase3; + String parmPhrase3_th; + if (includeExamplePhrase) { + parmPhrase1 = "%s #{example.oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{example.oredCriteria[%d].allCriteria[%d].value} and #{example.oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{example.oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{example.oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{example.oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{example.oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } else { + parmPhrase1 = "%s #{oredCriteria[%d].allCriteria[%d].value}"; + parmPhrase1_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s}"; + parmPhrase2 = "%s #{oredCriteria[%d].allCriteria[%d].value} and #{oredCriteria[%d].criteria[%d].secondValue}"; + parmPhrase2_th = "%s #{oredCriteria[%d].allCriteria[%d].value,typeHandler=%s} and #{oredCriteria[%d].criteria[%d].secondValue,typeHandler=%s}"; + parmPhrase3 = "#{oredCriteria[%d].allCriteria[%d].value[%d]}"; + parmPhrase3_th = "#{oredCriteria[%d].allCriteria[%d].value[%d],typeHandler=%s}"; + } + + StringBuilder sb = new StringBuilder(); + List oredCriteria = example.getOredCriteria(); + boolean firstCriteria = true; + for (int i = 0; i < oredCriteria.size(); i++) { + Criteria criteria = oredCriteria.get(i); + if (criteria.isValid()) { + if (firstCriteria) { + firstCriteria = false; + } else { + sb.append(" or "); + } + + sb.append('('); + List criterions = criteria.getAllCriteria(); + boolean firstCriterion = true; + for (int j = 0; j < criterions.size(); j++) { + Criterion criterion = criterions.get(j); + if (firstCriterion) { + firstCriterion = false; + } else { + sb.append(" and "); + } + + if (criterion.isNoValue()) { + sb.append(criterion.getCondition()); + } else if (criterion.isSingleValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase1, criterion.getCondition(), i, j)); + } else { + sb.append(String.format(parmPhrase1_th, criterion.getCondition(), i, j,criterion.getTypeHandler())); + } + } else if (criterion.isBetweenValue()) { + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase2, criterion.getCondition(), i, j, i, j)); + } else { + sb.append(String.format(parmPhrase2_th, criterion.getCondition(), i, j, criterion.getTypeHandler(), i, j, criterion.getTypeHandler())); + } + } else if (criterion.isListValue()) { + sb.append(criterion.getCondition()); + sb.append(" ("); + List listItems = (List) criterion.getValue(); + boolean comma = false; + for (int k = 0; k < listItems.size(); k++) { + if (comma) { + sb.append(", "); + } else { + comma = true; + } + if (criterion.getTypeHandler() == null) { + sb.append(String.format(parmPhrase3, i, j, k)); + } else { + sb.append(String.format(parmPhrase3_th, i, j, k, criterion.getTypeHandler())); + } + } + sb.append(')'); + } + } + sb.append(')'); + } + } + + if (sb.length() > 0) { + sql.WHERE(sb.toString()); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUser.java b/service/src/main/java/com/hfkj/entity/BsUser.java new file mode 100644 index 0000000..8edfedd --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsUser.java @@ -0,0 +1,216 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_user + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsUser implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 头像 + */ + private String headImg; + + /** + * 名称 + */ + private String name; + + /** + * 手机号 + */ + private String phone; + + /** + * 等级 1:见习会员 2:正式会员 3:团长 4:渠道 + */ + private Integer grade; + + /** + * 状态 0:删除 1:正常 2:禁用 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public Integer getGrade() { + return grade; + } + + public void setGrade(Integer grade) { + this.grade = grade; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + BsUser other = (BsUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getHeadImg() == null ? other.getHeadImg() == null : this.getHeadImg().equals(other.getHeadImg())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone())) + && (this.getGrade() == null ? other.getGrade() == null : this.getGrade().equals(other.getGrade())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getHeadImg() == null) ? 0 : getHeadImg().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode()); + result = prime * result + ((getGrade() == null) ? 0 : getGrade().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @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(", headImg=").append(headImg); + sb.append(", name=").append(name); + sb.append(", phone=").append(phone); + sb.append(", grade=").append(grade); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUserExample.java b/service/src/main/java/com/hfkj/entity/BsUserExample.java new file mode 100644 index 0000000..6ec95c8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsUserExample.java @@ -0,0 +1,943 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsUserExample() { + oredCriteria = new ArrayList(); + } + + 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 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; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 andHeadImgIsNull() { + addCriterion("head_img is null"); + return (Criteria) this; + } + + public Criteria andHeadImgIsNotNull() { + addCriterion("head_img is not null"); + return (Criteria) this; + } + + public Criteria andHeadImgEqualTo(String value) { + addCriterion("head_img =", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgNotEqualTo(String value) { + addCriterion("head_img <>", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgGreaterThan(String value) { + addCriterion("head_img >", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgGreaterThanOrEqualTo(String value) { + addCriterion("head_img >=", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgLessThan(String value) { + addCriterion("head_img <", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgLessThanOrEqualTo(String value) { + addCriterion("head_img <=", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgLike(String value) { + addCriterion("head_img like", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgNotLike(String value) { + addCriterion("head_img not like", value, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgIn(List values) { + addCriterion("head_img in", values, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgNotIn(List values) { + addCriterion("head_img not in", values, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgBetween(String value1, String value2) { + addCriterion("head_img between", value1, value2, "headImg"); + return (Criteria) this; + } + + public Criteria andHeadImgNotBetween(String value1, String value2) { + addCriterion("head_img not between", value1, value2, "headImg"); + return (Criteria) this; + } + + public Criteria andNameIsNull() { + addCriterion("`name` is null"); + return (Criteria) this; + } + + public Criteria andNameIsNotNull() { + addCriterion("`name` is not null"); + return (Criteria) this; + } + + public Criteria andNameEqualTo(String value) { + addCriterion("`name` =", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotEqualTo(String value) { + addCriterion("`name` <>", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThan(String value) { + addCriterion("`name` >", value, "name"); + return (Criteria) this; + } + + public Criteria andNameGreaterThanOrEqualTo(String value) { + addCriterion("`name` >=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThan(String value) { + addCriterion("`name` <", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLessThanOrEqualTo(String value) { + addCriterion("`name` <=", value, "name"); + return (Criteria) this; + } + + public Criteria andNameLike(String value) { + addCriterion("`name` like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameNotLike(String value) { + addCriterion("`name` not like", value, "name"); + return (Criteria) this; + } + + public Criteria andNameIn(List values) { + addCriterion("`name` in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameNotIn(List values) { + addCriterion("`name` not in", values, "name"); + return (Criteria) this; + } + + public Criteria andNameBetween(String value1, String value2) { + addCriterion("`name` between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andNameNotBetween(String value1, String value2) { + addCriterion("`name` not between", value1, value2, "name"); + return (Criteria) this; + } + + public Criteria andPhoneIsNull() { + addCriterion("phone is null"); + return (Criteria) this; + } + + public Criteria andPhoneIsNotNull() { + addCriterion("phone is not null"); + return (Criteria) this; + } + + public Criteria andPhoneEqualTo(String value) { + addCriterion("phone =", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotEqualTo(String value) { + addCriterion("phone <>", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThan(String value) { + addCriterion("phone >", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneGreaterThanOrEqualTo(String value) { + addCriterion("phone >=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThan(String value) { + addCriterion("phone <", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLessThanOrEqualTo(String value) { + addCriterion("phone <=", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneLike(String value) { + addCriterion("phone like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotLike(String value) { + addCriterion("phone not like", value, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneIn(List values) { + addCriterion("phone in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotIn(List values) { + addCriterion("phone not in", values, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneBetween(String value1, String value2) { + addCriterion("phone between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andPhoneNotBetween(String value1, String value2) { + addCriterion("phone not between", value1, value2, "phone"); + return (Criteria) this; + } + + public Criteria andGradeIsNull() { + addCriterion("grade is null"); + return (Criteria) this; + } + + public Criteria andGradeIsNotNull() { + addCriterion("grade is not null"); + return (Criteria) this; + } + + public Criteria andGradeEqualTo(Integer value) { + addCriterion("grade =", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeNotEqualTo(Integer value) { + addCriterion("grade <>", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeGreaterThan(Integer value) { + addCriterion("grade >", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeGreaterThanOrEqualTo(Integer value) { + addCriterion("grade >=", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeLessThan(Integer value) { + addCriterion("grade <", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeLessThanOrEqualTo(Integer value) { + addCriterion("grade <=", value, "grade"); + return (Criteria) this; + } + + public Criteria andGradeIn(List values) { + addCriterion("grade in", values, "grade"); + return (Criteria) this; + } + + public Criteria andGradeNotIn(List values) { + addCriterion("grade not in", values, "grade"); + return (Criteria) this; + } + + public Criteria andGradeBetween(Integer value1, Integer value2) { + addCriterion("grade between", value1, value2, "grade"); + return (Criteria) this; + } + + public Criteria andGradeNotBetween(Integer value1, Integer value2) { + addCriterion("grade not between", value1, value2, "grade"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Date value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Date value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Date value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Date value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Date value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Date value1, Date value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Date value1, Date value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + 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); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUserLoginLog.java b/service/src/main/java/com/hfkj/entity/BsUserLoginLog.java new file mode 100644 index 0000000..aae3a4f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsUserLoginLog.java @@ -0,0 +1,328 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_user_login_log + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsUserLoginLog implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 登录账户id + */ + private Long userId; + + /** + * 登录账户手机号 + */ + private String userPhone; + + /** + * 登录方式code + */ + private String loginTypeCode; + + /** + * 登录方式名称 + */ + private String loginTypeName; + + /** + * ip + */ + private String ip; + + /** + * 国家 + */ + private String country; + + /** + * 省份编号 + */ + private String regionId; + + /** + * 省份名称 + */ + private String regionName; + + /** + * 城市编号 + */ + private String cityId; + + /** + * 城市名称 + */ + private String cityName; + + /** + * 运营商 + */ + private String isp; + + /** + * 状态 1:正常 2:风险 + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + + /** + * 创建时间 + */ + private Date createTime; + + private String ext1; + + private String ext2; + + private String ext3; + + 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 getUserPhone() { + return userPhone; + } + + public void setUserPhone(String userPhone) { + this.userPhone = userPhone; + } + + public String getLoginTypeCode() { + return loginTypeCode; + } + + public void setLoginTypeCode(String loginTypeCode) { + this.loginTypeCode = loginTypeCode; + } + + public String getLoginTypeName() { + return loginTypeName; + } + + public void setLoginTypeName(String loginTypeName) { + this.loginTypeName = loginTypeName; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public String getRegionId() { + return regionId; + } + + public void setRegionId(String regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + public String getCityId() { + return cityId; + } + + public void setCityId(String cityId) { + this.cityId = cityId; + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public String getIsp() { + return isp; + } + + public void setIsp(String isp) { + this.isp = isp; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getExt1() { + return ext1; + } + + public void setExt1(String ext1) { + this.ext1 = ext1; + } + + public String getExt2() { + return ext2; + } + + public void setExt2(String ext2) { + this.ext2 = ext2; + } + + public String getExt3() { + return ext3; + } + + public void setExt3(String ext3) { + this.ext3 = ext3; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + BsUserLoginLog other = (BsUserLoginLog) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getLoginTypeCode() == null ? other.getLoginTypeCode() == null : this.getLoginTypeCode().equals(other.getLoginTypeCode())) + && (this.getLoginTypeName() == null ? other.getLoginTypeName() == null : this.getLoginTypeName().equals(other.getLoginTypeName())) + && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp())) + && (this.getCountry() == null ? other.getCountry() == null : this.getCountry().equals(other.getCountry())) + && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getCityId() == null ? other.getCityId() == null : this.getCityId().equals(other.getCityId())) + && (this.getCityName() == null ? other.getCityName() == null : this.getCityName().equals(other.getCityName())) + && (this.getIsp() == null ? other.getIsp() == null : this.getIsp().equals(other.getIsp())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getExt1() == null ? other.getExt1() == null : this.getExt1().equals(other.getExt1())) + && (this.getExt2() == null ? other.getExt2() == null : this.getExt2().equals(other.getExt2())) + && (this.getExt3() == null ? other.getExt3() == null : this.getExt3().equals(other.getExt3())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getLoginTypeCode() == null) ? 0 : getLoginTypeCode().hashCode()); + result = prime * result + ((getLoginTypeName() == null) ? 0 : getLoginTypeName().hashCode()); + result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); + result = prime * result + ((getCountry() == null) ? 0 : getCountry().hashCode()); + result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getCityId() == null) ? 0 : getCityId().hashCode()); + result = prime * result + ((getCityName() == null) ? 0 : getCityName().hashCode()); + result = prime * result + ((getIsp() == null) ? 0 : getIsp().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getExt1() == null) ? 0 : getExt1().hashCode()); + result = prime * result + ((getExt2() == null) ? 0 : getExt2().hashCode()); + result = prime * result + ((getExt3() == null) ? 0 : getExt3().hashCode()); + return result; + } + + @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(", userPhone=").append(userPhone); + sb.append(", loginTypeCode=").append(loginTypeCode); + sb.append(", loginTypeName=").append(loginTypeName); + sb.append(", ip=").append(ip); + sb.append(", country=").append(country); + sb.append(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); + sb.append(", cityId=").append(cityId); + sb.append(", cityName=").append(cityName); + sb.append(", isp=").append(isp); + sb.append(", status=").append(status); + sb.append(", remark=").append(remark); + sb.append(", createTime=").append(createTime); + sb.append(", ext1=").append(ext1); + sb.append(", ext2=").append(ext2); + sb.append(", ext3=").append(ext3); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/entity/BsUserLoginLogExample.java b/service/src/main/java/com/hfkj/entity/BsUserLoginLogExample.java new file mode 100644 index 0000000..4fe13ea --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsUserLoginLogExample.java @@ -0,0 +1,1443 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsUserLoginLogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsUserLoginLogExample() { + oredCriteria = new ArrayList(); + } + + 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 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; + } + + public void setLimit(Integer limit) { + this.limit = limit; + } + + public Integer getLimit() { + return limit; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public Long getOffset() { + return offset; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List 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 values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List 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 values) { + addCriterion("user_id in", values, "userId"); + return (Criteria) this; + } + + public Criteria andUserIdNotIn(List 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 andUserPhoneIsNull() { + addCriterion("user_phone is null"); + return (Criteria) this; + } + + public Criteria andUserPhoneIsNotNull() { + addCriterion("user_phone is not null"); + return (Criteria) this; + } + + public Criteria andUserPhoneEqualTo(String value) { + addCriterion("user_phone =", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotEqualTo(String value) { + addCriterion("user_phone <>", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThan(String value) { + addCriterion("user_phone >", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("user_phone >=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThan(String value) { + addCriterion("user_phone <", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLessThanOrEqualTo(String value) { + addCriterion("user_phone <=", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneLike(String value) { + addCriterion("user_phone like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotLike(String value) { + addCriterion("user_phone not like", value, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneIn(List values) { + addCriterion("user_phone in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotIn(List values) { + addCriterion("user_phone not in", values, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneBetween(String value1, String value2) { + addCriterion("user_phone between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andUserPhoneNotBetween(String value1, String value2) { + addCriterion("user_phone not between", value1, value2, "userPhone"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeIsNull() { + addCriterion("login_type_code is null"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeIsNotNull() { + addCriterion("login_type_code is not null"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeEqualTo(String value) { + addCriterion("login_type_code =", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeNotEqualTo(String value) { + addCriterion("login_type_code <>", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeGreaterThan(String value) { + addCriterion("login_type_code >", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeGreaterThanOrEqualTo(String value) { + addCriterion("login_type_code >=", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeLessThan(String value) { + addCriterion("login_type_code <", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeLessThanOrEqualTo(String value) { + addCriterion("login_type_code <=", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeLike(String value) { + addCriterion("login_type_code like", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeNotLike(String value) { + addCriterion("login_type_code not like", value, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeIn(List values) { + addCriterion("login_type_code in", values, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeNotIn(List values) { + addCriterion("login_type_code not in", values, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeBetween(String value1, String value2) { + addCriterion("login_type_code between", value1, value2, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeCodeNotBetween(String value1, String value2) { + addCriterion("login_type_code not between", value1, value2, "loginTypeCode"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameIsNull() { + addCriterion("login_type_name is null"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameIsNotNull() { + addCriterion("login_type_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameEqualTo(String value) { + addCriterion("login_type_name =", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameNotEqualTo(String value) { + addCriterion("login_type_name <>", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameGreaterThan(String value) { + addCriterion("login_type_name >", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("login_type_name >=", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameLessThan(String value) { + addCriterion("login_type_name <", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameLessThanOrEqualTo(String value) { + addCriterion("login_type_name <=", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameLike(String value) { + addCriterion("login_type_name like", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameNotLike(String value) { + addCriterion("login_type_name not like", value, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameIn(List values) { + addCriterion("login_type_name in", values, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameNotIn(List values) { + addCriterion("login_type_name not in", values, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameBetween(String value1, String value2) { + addCriterion("login_type_name between", value1, value2, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andLoginTypeNameNotBetween(String value1, String value2) { + addCriterion("login_type_name not between", value1, value2, "loginTypeName"); + return (Criteria) this; + } + + public Criteria andIpIsNull() { + addCriterion("ip is null"); + return (Criteria) this; + } + + public Criteria andIpIsNotNull() { + addCriterion("ip is not null"); + return (Criteria) this; + } + + public Criteria andIpEqualTo(String value) { + addCriterion("ip =", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotEqualTo(String value) { + addCriterion("ip <>", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThan(String value) { + addCriterion("ip >", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpGreaterThanOrEqualTo(String value) { + addCriterion("ip >=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThan(String value) { + addCriterion("ip <", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLessThanOrEqualTo(String value) { + addCriterion("ip <=", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpLike(String value) { + addCriterion("ip like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotLike(String value) { + addCriterion("ip not like", value, "ip"); + return (Criteria) this; + } + + public Criteria andIpIn(List values) { + addCriterion("ip in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotIn(List values) { + addCriterion("ip not in", values, "ip"); + return (Criteria) this; + } + + public Criteria andIpBetween(String value1, String value2) { + addCriterion("ip between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andIpNotBetween(String value1, String value2) { + addCriterion("ip not between", value1, value2, "ip"); + return (Criteria) this; + } + + public Criteria andCountryIsNull() { + addCriterion("country is null"); + return (Criteria) this; + } + + public Criteria andCountryIsNotNull() { + addCriterion("country is not null"); + return (Criteria) this; + } + + public Criteria andCountryEqualTo(String value) { + addCriterion("country =", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotEqualTo(String value) { + addCriterion("country <>", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThan(String value) { + addCriterion("country >", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryGreaterThanOrEqualTo(String value) { + addCriterion("country >=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThan(String value) { + addCriterion("country <", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLessThanOrEqualTo(String value) { + addCriterion("country <=", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryLike(String value) { + addCriterion("country like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotLike(String value) { + addCriterion("country not like", value, "country"); + return (Criteria) this; + } + + public Criteria andCountryIn(List values) { + addCriterion("country in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotIn(List values) { + addCriterion("country not in", values, "country"); + return (Criteria) this; + } + + public Criteria andCountryBetween(String value1, String value2) { + addCriterion("country between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andCountryNotBetween(String value1, String value2) { + addCriterion("country not between", value1, value2, "country"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(String value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(String value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(String value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(String value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(String value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(String value) { + addCriterion("region_id <=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLike(String value) { + addCriterion("region_id like", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotLike(String value) { + addCriterion("region_id not like", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdIn(List values) { + addCriterion("region_id in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotIn(List values) { + addCriterion("region_id not in", values, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdBetween(String value1, String value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(String value1, String value2) { + addCriterion("region_id not between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNull() { + addCriterion("region_name is null"); + return (Criteria) this; + } + + public Criteria andRegionNameIsNotNull() { + addCriterion("region_name is not null"); + return (Criteria) this; + } + + public Criteria andRegionNameEqualTo(String value) { + addCriterion("region_name =", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotEqualTo(String value) { + addCriterion("region_name <>", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThan(String value) { + addCriterion("region_name >", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameGreaterThanOrEqualTo(String value) { + addCriterion("region_name >=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThan(String value) { + addCriterion("region_name <", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLessThanOrEqualTo(String value) { + addCriterion("region_name <=", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameLike(String value) { + addCriterion("region_name like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotLike(String value) { + addCriterion("region_name not like", value, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameIn(List values) { + addCriterion("region_name in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotIn(List values) { + addCriterion("region_name not in", values, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameBetween(String value1, String value2) { + addCriterion("region_name between", value1, value2, "regionName"); + return (Criteria) this; + } + + public Criteria andRegionNameNotBetween(String value1, String value2) { + addCriterion("region_name not between", value1, value2, "regionName"); + return (Criteria) this; + } + + public Criteria andCityIdIsNull() { + addCriterion("city_id is null"); + return (Criteria) this; + } + + public Criteria andCityIdIsNotNull() { + addCriterion("city_id is not null"); + return (Criteria) this; + } + + public Criteria andCityIdEqualTo(String value) { + addCriterion("city_id =", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdNotEqualTo(String value) { + addCriterion("city_id <>", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdGreaterThan(String value) { + addCriterion("city_id >", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdGreaterThanOrEqualTo(String value) { + addCriterion("city_id >=", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdLessThan(String value) { + addCriterion("city_id <", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdLessThanOrEqualTo(String value) { + addCriterion("city_id <=", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdLike(String value) { + addCriterion("city_id like", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdNotLike(String value) { + addCriterion("city_id not like", value, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdIn(List values) { + addCriterion("city_id in", values, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdNotIn(List values) { + addCriterion("city_id not in", values, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdBetween(String value1, String value2) { + addCriterion("city_id between", value1, value2, "cityId"); + return (Criteria) this; + } + + public Criteria andCityIdNotBetween(String value1, String value2) { + addCriterion("city_id not between", value1, value2, "cityId"); + return (Criteria) this; + } + + public Criteria andCityNameIsNull() { + addCriterion("city_name is null"); + return (Criteria) this; + } + + public Criteria andCityNameIsNotNull() { + addCriterion("city_name is not null"); + return (Criteria) this; + } + + public Criteria andCityNameEqualTo(String value) { + addCriterion("city_name =", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameNotEqualTo(String value) { + addCriterion("city_name <>", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameGreaterThan(String value) { + addCriterion("city_name >", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameGreaterThanOrEqualTo(String value) { + addCriterion("city_name >=", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameLessThan(String value) { + addCriterion("city_name <", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameLessThanOrEqualTo(String value) { + addCriterion("city_name <=", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameLike(String value) { + addCriterion("city_name like", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameNotLike(String value) { + addCriterion("city_name not like", value, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameIn(List values) { + addCriterion("city_name in", values, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameNotIn(List values) { + addCriterion("city_name not in", values, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameBetween(String value1, String value2) { + addCriterion("city_name between", value1, value2, "cityName"); + return (Criteria) this; + } + + public Criteria andCityNameNotBetween(String value1, String value2) { + addCriterion("city_name not between", value1, value2, "cityName"); + return (Criteria) this; + } + + public Criteria andIspIsNull() { + addCriterion("isp is null"); + return (Criteria) this; + } + + public Criteria andIspIsNotNull() { + addCriterion("isp is not null"); + return (Criteria) this; + } + + public Criteria andIspEqualTo(String value) { + addCriterion("isp =", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspNotEqualTo(String value) { + addCriterion("isp <>", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspGreaterThan(String value) { + addCriterion("isp >", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspGreaterThanOrEqualTo(String value) { + addCriterion("isp >=", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspLessThan(String value) { + addCriterion("isp <", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspLessThanOrEqualTo(String value) { + addCriterion("isp <=", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspLike(String value) { + addCriterion("isp like", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspNotLike(String value) { + addCriterion("isp not like", value, "isp"); + return (Criteria) this; + } + + public Criteria andIspIn(List values) { + addCriterion("isp in", values, "isp"); + return (Criteria) this; + } + + public Criteria andIspNotIn(List values) { + addCriterion("isp not in", values, "isp"); + return (Criteria) this; + } + + public Criteria andIspBetween(String value1, String value2) { + addCriterion("isp between", value1, value2, "isp"); + return (Criteria) this; + } + + public Criteria andIspNotBetween(String value1, String value2) { + addCriterion("isp not between", value1, value2, "isp"); + return (Criteria) this; + } + + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); + return (Criteria) this; + } + + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); + return (Criteria) this; + } + + public Criteria andStatusEqualTo(Integer value) { + addCriterion("`status` =", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotEqualTo(Integer value) { + addCriterion("`status` <>", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThan(Integer value) { + addCriterion("`status` >", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusGreaterThanOrEqualTo(Integer value) { + addCriterion("`status` >=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThan(Integer value) { + addCriterion("`status` <", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusLessThanOrEqualTo(Integer value) { + addCriterion("`status` <=", value, "status"); + return (Criteria) this; + } + + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); + return (Criteria) this; + } + + public Criteria andStatusBetween(Integer value1, Integer value2) { + addCriterion("`status` between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andStatusNotBetween(Integer value1, Integer value2) { + addCriterion("`status` not between", value1, value2, "status"); + return (Criteria) this; + } + + public Criteria andRemarkIsNull() { + addCriterion("remark is null"); + return (Criteria) this; + } + + public Criteria andRemarkIsNotNull() { + addCriterion("remark is not null"); + return (Criteria) this; + } + + public Criteria andRemarkEqualTo(String value) { + addCriterion("remark =", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotEqualTo(String value) { + addCriterion("remark <>", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThan(String value) { + addCriterion("remark >", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkGreaterThanOrEqualTo(String value) { + addCriterion("remark >=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThan(String value) { + addCriterion("remark <", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLessThanOrEqualTo(String value) { + addCriterion("remark <=", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkLike(String value) { + addCriterion("remark like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotLike(String value) { + addCriterion("remark not like", value, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkIn(List values) { + addCriterion("remark in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotIn(List values) { + addCriterion("remark not in", values, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkBetween(String value1, String value2) { + addCriterion("remark between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andRemarkNotBetween(String value1, String value2) { + addCriterion("remark not between", value1, value2, "remark"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Date value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Date value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Date value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Date value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Date value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Date value1, Date value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Date value1, Date value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andExt1IsNull() { + addCriterion("ext_1 is null"); + return (Criteria) this; + } + + public Criteria andExt1IsNotNull() { + addCriterion("ext_1 is not null"); + return (Criteria) this; + } + + public Criteria andExt1EqualTo(String value) { + addCriterion("ext_1 =", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotEqualTo(String value) { + addCriterion("ext_1 <>", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThan(String value) { + addCriterion("ext_1 >", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1GreaterThanOrEqualTo(String value) { + addCriterion("ext_1 >=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThan(String value) { + addCriterion("ext_1 <", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1LessThanOrEqualTo(String value) { + addCriterion("ext_1 <=", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Like(String value) { + addCriterion("ext_1 like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotLike(String value) { + addCriterion("ext_1 not like", value, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1In(List values) { + addCriterion("ext_1 in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotIn(List values) { + addCriterion("ext_1 not in", values, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1Between(String value1, String value2) { + addCriterion("ext_1 between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt1NotBetween(String value1, String value2) { + addCriterion("ext_1 not between", value1, value2, "ext1"); + return (Criteria) this; + } + + public Criteria andExt2IsNull() { + addCriterion("ext_2 is null"); + return (Criteria) this; + } + + public Criteria andExt2IsNotNull() { + addCriterion("ext_2 is not null"); + return (Criteria) this; + } + + public Criteria andExt2EqualTo(String value) { + addCriterion("ext_2 =", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotEqualTo(String value) { + addCriterion("ext_2 <>", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThan(String value) { + addCriterion("ext_2 >", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2GreaterThanOrEqualTo(String value) { + addCriterion("ext_2 >=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThan(String value) { + addCriterion("ext_2 <", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2LessThanOrEqualTo(String value) { + addCriterion("ext_2 <=", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Like(String value) { + addCriterion("ext_2 like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotLike(String value) { + addCriterion("ext_2 not like", value, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2In(List values) { + addCriterion("ext_2 in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotIn(List values) { + addCriterion("ext_2 not in", values, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2Between(String value1, String value2) { + addCriterion("ext_2 between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt2NotBetween(String value1, String value2) { + addCriterion("ext_2 not between", value1, value2, "ext2"); + return (Criteria) this; + } + + public Criteria andExt3IsNull() { + addCriterion("ext_3 is null"); + return (Criteria) this; + } + + public Criteria andExt3IsNotNull() { + addCriterion("ext_3 is not null"); + return (Criteria) this; + } + + public Criteria andExt3EqualTo(String value) { + addCriterion("ext_3 =", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotEqualTo(String value) { + addCriterion("ext_3 <>", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThan(String value) { + addCriterion("ext_3 >", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3GreaterThanOrEqualTo(String value) { + addCriterion("ext_3 >=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThan(String value) { + addCriterion("ext_3 <", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3LessThanOrEqualTo(String value) { + addCriterion("ext_3 <=", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Like(String value) { + addCriterion("ext_3 like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotLike(String value) { + addCriterion("ext_3 not like", value, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3In(List values) { + addCriterion("ext_3 in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotIn(List values) { + addCriterion("ext_3 not in", values, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3Between(String value1, String value2) { + addCriterion("ext_3 between", value1, value2, "ext3"); + return (Criteria) this; + } + + public Criteria andExt3NotBetween(String value1, String value2) { + addCriterion("ext_3 not between", value1, value2, "ext3"); + 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); + } + } +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/model/UserSessionObject.java b/service/src/main/java/com/hfkj/model/UserSessionObject.java new file mode 100644 index 0000000..1b9f688 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/UserSessionObject.java @@ -0,0 +1,16 @@ +package com.hfkj.model; + +import com.hfkj.entity.BsUser; +import lombok.Data; + +/** + * 用户登录session对象 + */ +@Data +public class UserSessionObject { + + /** + * 登录账户 + */ + private BsUser user; +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecMenuService.java b/service/src/main/java/com/hfkj/service/sec/SecMenuService.java index 04d4dc3..3deed09 100644 --- a/service/src/main/java/com/hfkj/service/sec/SecMenuService.java +++ b/service/src/main/java/com/hfkj/service/sec/SecMenuService.java @@ -2,7 +2,7 @@ package com.hfkj.service.sec; import com.hfkj.entity.SecMenu; import com.hfkj.model.MenuTreeModel; -import com.hfkj.sysenum.SecMenuTypeEnum; +import com.hfkj.sysenum.sec.SecMenuTypeEnum; import java.util.List; import java.util.Map; diff --git a/service/src/main/java/com/hfkj/service/sec/SecUserService.java b/service/src/main/java/com/hfkj/service/sec/SecUserService.java index 99715b1..5425250 100644 --- a/service/src/main/java/com/hfkj/service/sec/SecUserService.java +++ b/service/src/main/java/com/hfkj/service/sec/SecUserService.java @@ -2,7 +2,7 @@ package com.hfkj.service.sec; import com.hfkj.common.security.SessionObject; import com.hfkj.entity.SecUser; -import com.hfkj.sysenum.SecUserObjectTypeEnum; +import com.hfkj.sysenum.sec.SecUserObjectTypeEnum; import java.util.List; import java.util.Map; diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecMenuServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecMenuServiceImpl.java index c640379..4146723 100644 --- a/service/src/main/java/com/hfkj/service/sec/impl/SecMenuServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecMenuServiceImpl.java @@ -14,7 +14,7 @@ import com.hfkj.model.MenuTreeModel; import com.hfkj.service.sec.SecMenuService; import com.hfkj.service.sec.SecRoleMenuRelService; import com.hfkj.service.sec.SecRoleService; -import com.hfkj.sysenum.SecMenuTypeEnum; +import com.hfkj.sysenum.sec.SecMenuTypeEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java index 6aa9d51..87de16f 100644 --- a/service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java @@ -8,7 +8,7 @@ import com.hfkj.entity.SecUser; import com.hfkj.entity.SecUserLoginLog; import com.hfkj.entity.SecUserLoginLogExample; import com.hfkj.service.sec.SecUserLoginLogService; -import com.hfkj.sysenum.SecUserLoginLogStatusEnum; +import com.hfkj.sysenum.sec.SecUserLoginLogStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java index b136d9a..fb81cd2 100644 --- a/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java @@ -4,6 +4,7 @@ import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; import com.hfkj.common.security.AESEncodeUtil; +import com.hfkj.common.security.SecUserCenter; import com.hfkj.common.security.SessionObject; import com.hfkj.common.security.UserCenter; import com.hfkj.common.utils.MD5Util; @@ -15,9 +16,9 @@ import com.hfkj.service.sec.SecMenuService; import com.hfkj.service.sec.SecRoleService; import com.hfkj.service.sec.SecUserLoginLogService; import com.hfkj.service.sec.SecUserService; -import com.hfkj.sysenum.SecMenuTypeEnum; -import com.hfkj.sysenum.SecUserObjectTypeEnum; -import com.hfkj.sysenum.SecUserStatusEnum; +import com.hfkj.sysenum.sec.SecMenuTypeEnum; +import com.hfkj.sysenum.sec.SecUserObjectTypeEnum; +import com.hfkj.sysenum.sec.SecUserStatusEnum; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -41,7 +42,7 @@ public class SecUserServiceImpl implements SecUserService { @Resource private SecUserMapper secUserMapper; @Resource - private UserCenter userCenter; + private SecUserCenter userCenter; @Resource private SecUserLoginLogService secUserLoginLogService; @Resource diff --git a/service/src/main/java/com/hfkj/service/user/BsUserLoginLogService.java b/service/src/main/java/com/hfkj/service/user/BsUserLoginLogService.java new file mode 100644 index 0000000..641256f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/BsUserLoginLogService.java @@ -0,0 +1,36 @@ +package com.hfkj.service.user; + +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserLoginLog; +import com.hfkj.sysenum.user.UserLoginType; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * @className: BsUserLoginLogService + * @author: HuRui + * @date: 2024/5/6 + **/ +public interface BsUserLoginLogService { + + /** + * 创建 + * @param userLoginLog + */ + void create(BsUserLoginLog userLoginLog); + + /** + * 异步创建登录日志 + * @param user + */ + void asyncCreateLog(UserLoginType loginType, BsUser user, HttpServletRequest request); + + /** + * 查询日志列表 + * @param param + * @return + */ + List getLogList(Map param); +} diff --git a/service/src/main/java/com/hfkj/service/user/BsUserService.java b/service/src/main/java/com/hfkj/service/user/BsUserService.java new file mode 100644 index 0000000..0620a93 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/BsUserService.java @@ -0,0 +1,61 @@ +package com.hfkj.service.user; + +import com.hfkj.common.security.SessionObject; +import com.hfkj.entity.BsUser; +import com.hfkj.sysenum.user.UserLoginType; + +import java.util.Map; + +/** + * @className: BsUserService + * @author: HuRui + * @date: 2024/9/6 + **/ +public interface BsUserService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsUser data); + + /** + * 更新手机号 + * @param userId + * @param newPhone + */ + void updatePhone(Long userId, String newPhone) throws Exception; + + /** + * 查询详情 + * @param userId + * @return + */ + BsUser getUser(Long userId); + + /** + * 查询详情SmsController + * @param userPhone + * @return + */ + BsUser getUser(String userPhone); + + /** + * 用户注册 + * @param phone 手机号 + * @param other 其他参数 + * @return + * @throws Exception + */ + BsUser register(String phone, Map other); + + /** + * 用户登录 + * @param phone 用户手机号 + * @param other 其他参数 + * @return + * @throws Exception + */ + SessionObject login(String phone, UserLoginType loginType, Map other) throws Exception; + +} diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserLoginLogServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserLoginLogServiceImpl.java new file mode 100644 index 0000000..bff6112 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserLoginLogServiceImpl.java @@ -0,0 +1,94 @@ +package com.hfkj.service.user.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.alipay.AliyunService; +import com.hfkj.common.utils.RequestUtils; +import com.hfkj.dao.BsUserLoginLogMapper; +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserLoginLog; +import com.hfkj.entity.BsUserLoginLogExample; +import com.hfkj.service.user.BsUserLoginLogService; +import com.hfkj.sysenum.sec.SecUserLoginLogStatusEnum; +import com.hfkj.sysenum.user.UserLoginType; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; + +/** + * @className: BsUserLoginLogServiceImpl + * @author: HuRui + * @date: 2024/5/6 + **/ +@Service("userLoginLogService") +public class BsUserLoginLogServiceImpl implements BsUserLoginLogService { + @Resource + private BsUserLoginLogMapper userLoginLogMapper; + + @Override + public void create(BsUserLoginLog userLoginLog) { + userLoginLog.setCreateTime(new Date()); + userLoginLogMapper.insert(userLoginLog); + } + + @Override + public void asyncCreateLog(UserLoginType loginType, BsUser user, HttpServletRequest request) { + // 创建一个单线程的线程池 + ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); + // 异步记录登录信息 + singleThreadExecutor.submit(new Runnable() { + @Override + public void run() { + BsUserLoginLog loginLog = new BsUserLoginLog(); + loginLog.setUserId(user.getId()); + loginLog.setUserPhone(user.getPhone()); + loginLog.setLoginTypeCode(loginType.getCode()); + loginLog.setLoginTypeName(loginType.getName()); + loginLog.setIp(RequestUtils.getIpAddress(request)); + // 查询ip归属地 + JSONObject ipAddress = AliyunService.queryAddress(loginLog.getIp()); + if (ipAddress != null) { + loginLog.setCountry(StringUtils.isNotBlank(ipAddress.getString("country"))?ipAddress.getString("country"):"未知"); + loginLog.setRegionId(StringUtils.isNotBlank(ipAddress.getString("region_id"))?ipAddress.getString("region_id"):null); + loginLog.setRegionName(StringUtils.isNotBlank(ipAddress.getString("region"))?ipAddress.getString("region"):"未知"); + loginLog.setCityId(StringUtils.isNotBlank(ipAddress.getString("city_id"))?ipAddress.getString("city_id"):null); + loginLog.setCityName(StringUtils.isNotBlank(ipAddress.getString("city"))?ipAddress.getString("city"):"未知"); + loginLog.setIsp(StringUtils.isNotBlank(ipAddress.getString("isp"))?ipAddress.getString("isp"):"未知"); + loginLog.setStatus(SecUserLoginLogStatusEnum.status1.getCode()); + } else { + loginLog.setCountry("未知"); + loginLog.setRegionName("未知"); + loginLog.setCityName("未知"); + loginLog.setIsp("未知"); + loginLog.setStatus(SecUserLoginLogStatusEnum.status2.getCode()); + } + create(loginLog); + } + }); + singleThreadExecutor.shutdown(); + } + + @Override + public List getLogList(Map param) { + BsUserLoginLogExample example = new BsUserLoginLogExample(); + BsUserLoginLogExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(param, "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return userLoginLogMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java new file mode 100644 index 0000000..0b3b4de --- /dev/null +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java @@ -0,0 +1,156 @@ +package com.hfkj.service.user.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.AESEncodeUtil; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsUserMapper; +import com.hfkj.entity.BsUser; +import com.hfkj.entity.BsUserExample; +import com.hfkj.model.UserSessionObject; +import com.hfkj.service.user.BsUserLoginLogService; +import com.hfkj.service.user.BsUserService; +import com.hfkj.sysenum.user.UserGradeEnum; +import com.hfkj.sysenum.user.UserLoginType; +import com.hfkj.sysenum.user.UserStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsUserServiceImpl + * @author: HuRui + * @date: 2024/9/6 + **/ +@Service("userService") +public class BsUserServiceImpl implements BsUserService { + @Resource + private BsUserMapper userMapper; + @Resource + private RedisUtil redisUtil; + @Resource + private UserCenter userCenter; + @Resource + private BsUserLoginLogService userLoginLogService; + private final static String CACHE_KEY = "USER"; + + /** + * 用户token + * @param userId + * @return + */ + public static String userToken(Long userId) throws Exception { + return AESEncodeUtil.aesEncrypt(userId.toString()); + } + + @Override + public void editData(BsUser data) { + data.setUpdateTime(new Date()); + if (data.getId() == null) { + data.setCreateTime(new Date()); + userMapper.insert(data); + } else { + userMapper.updateByPrimaryKey(data); + } + if (StringUtils.isNotBlank(data.getPhone())) { + // 加入缓存 + redisUtil.hset(CACHE_KEY, data.getPhone(), data); + } + } + + @Override + public void updatePhone(Long userId, String newPhone) throws Exception { + // 查询用户 + BsUser user = getUser(userId); + if (user == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); + } + user.setPhone(newPhone); + editData(user); + + // 更新session + UserSessionObject session = new UserSessionObject(); + session.setUser(user); + SessionObject sessionObject = new SessionObject(userToken(user.getId()), session); + userCenter.save(sessionObject); + } + + @Override + public BsUser getUser(Long userId) { + + BsUser user = userMapper.selectByPrimaryKey(userId); + // 加入缓存 + redisUtil.hset(CACHE_KEY, user.getId().toString(), user); + return user; + } + + @Override + public BsUser getUser(String userPhone) { + // 查询缓存 + Object cacheObj = redisUtil.hget(CACHE_KEY, userPhone); + if (cacheObj != null) { + return (BsUser) cacheObj; + } + BsUserExample example = new BsUserExample(); + example.createCriteria().andPhoneEqualTo(userPhone).andStatusNotEqualTo(UserStatusEnum.status0.getCode()); + List list = userMapper.selectByExample(example); + if (!list.isEmpty()) { + BsUser user = list.get(0); + // 加入缓存 + redisUtil.hset(CACHE_KEY, user.getPhone(), user); + return user; + } + return null; + } + + @Override + public BsUser register(String phone, Map other) { + // 查询手机号 + if (getUser(phone) != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "用户手机号已存在,请更换"); + } + BsUser user = new BsUser(); + user.setHeadImg(MapUtils.getString(other,"headImg")); + user.setName( + StringUtils.isNotBlank(MapUtils.getString(other,"name")) + ? MapUtils.getString(other,"name") + : "元气优淘" + ); + user.setPhone(phone); + user.setGrade(UserGradeEnum.grade1.getCode()); + user.setStatus(UserStatusEnum.status1.getCode()); + editData(user); + return user; + } + + + @Override + public SessionObject login(String phone, UserLoginType loginType, Map other) throws Exception { + // 查询用户 + BsUser user = getUser(phone); + if (user == null) { + user = register(phone, other); + } + // 缓存 + UserSessionObject session = new UserSessionObject(); + session.setUser(user); + + SessionObject sessionObject = new SessionObject(userToken(user.getId()), session); + userCenter.save(sessionObject); + + // 异步记录登录信息 + userLoginLogService.asyncCreateLog(loginType, user, (HttpServletRequest) RequestContextHolder.getRequestAttributes().resolveReference(RequestAttributes.REFERENCE_REQUEST)); + return sessionObject; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/sec/SecMenuTypeEnum.java similarity index 95% rename from service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java rename to service/src/main/java/com/hfkj/sysenum/sec/SecMenuTypeEnum.java index 1aa9b97..2904588 100644 --- a/service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/sec/SecMenuTypeEnum.java @@ -1,4 +1,4 @@ -package com.hfkj.sysenum; +package com.hfkj.sysenum.sec; /** * 菜单类型 diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/sec/SecUserLoginLogStatusEnum.java similarity index 95% rename from service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java rename to service/src/main/java/com/hfkj/sysenum/sec/SecUserLoginLogStatusEnum.java index a7174dd..1ac2541 100644 --- a/service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/sec/SecUserLoginLogStatusEnum.java @@ -1,4 +1,4 @@ -package com.hfkj.sysenum; +package com.hfkj.sysenum.sec; /** * 登录日志状态 diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/sec/SecUserObjectTypeEnum.java similarity index 96% rename from service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java rename to service/src/main/java/com/hfkj/sysenum/sec/SecUserObjectTypeEnum.java index 9089eb0..bb2d58a 100644 --- a/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/sec/SecUserObjectTypeEnum.java @@ -1,4 +1,4 @@ -package com.hfkj.sysenum; +package com.hfkj.sysenum.sec; /** * 账户类型 diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/sec/SecUserStatusEnum.java similarity index 96% rename from service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java rename to service/src/main/java/com/hfkj/sysenum/sec/SecUserStatusEnum.java index 5796eb5..e114b3b 100644 --- a/service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/sec/SecUserStatusEnum.java @@ -1,4 +1,4 @@ -package com.hfkj.sysenum; +package com.hfkj.sysenum.sec; /** * 系统用户状态 diff --git a/service/src/main/java/com/hfkj/sysenum/user/UserGradeEnum.java b/service/src/main/java/com/hfkj/sysenum/user/UserGradeEnum.java new file mode 100644 index 0000000..da117b6 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/user/UserGradeEnum.java @@ -0,0 +1,42 @@ +package com.hfkj.sysenum.user; + +import lombok.Getter; + +/** + * 用户等级 + * @className: UserStatusEnum + * @author: HuRui + * @date: 2024/9/6 + **/ +@Getter +public enum UserGradeEnum { + /** + * 见习会员 + */ + grade1(1, "见习会员"), + + /** + * 正式会员 + */ + grade2(2, "正式会员"), + + /** + * 团长 + */ + grade3(3, "团长"), + + /** + * 渠道 + */ + grade4(4, "渠道"), + ; + + private int code; + + private String name; + + UserGradeEnum(int code, String name) { + this.code = code; + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/user/UserLoginType.java b/service/src/main/java/com/hfkj/sysenum/user/UserLoginType.java new file mode 100644 index 0000000..2e6e833 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/user/UserLoginType.java @@ -0,0 +1,46 @@ +package com.hfkj.sysenum.user; + +import lombok.Getter; + +import java.util.Objects; + +/** + * 登录方式 + * @className: LoginType + * @author: HuRui + * @date: 2022/10/20 + **/ +@Getter +public enum UserLoginType { + /** + * 短信登录 + */ + SMS("SMS", "短信登录"), + /** + * 微信授权 + */ + WECHAT_EMPOWER("WECHAT_EMPOWER", "微信授权"), + ; + + private String code; + + private String name; + + UserLoginType(String code, String name) { + this.code = code; + this.name = name; + } + + /** + * 根据类型查询数据 + * @param code + * @return + */ + public static UserLoginType getDataByType(String code) { + for (UserLoginType ele : values()) { + if (Objects.equals(code,ele.getCode())) return ele; + } + return null; + } + +} diff --git a/service/src/main/java/com/hfkj/sysenum/user/UserStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/user/UserStatusEnum.java new file mode 100644 index 0000000..a4d9e34 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/user/UserStatusEnum.java @@ -0,0 +1,50 @@ +package com.hfkj.sysenum.user; + +/** + * @className: UserStatusEnum + * @author: HuRui + * @date: 2024/5/6 + **/ +public enum UserStatusEnum { + /** + * 删除 + */ + status0(0, "删除"), + + /** + * 正常 + */ + status1(1, "正常"), + + /** + * 禁用 + */ + status2(2, "禁用"), + ; + + private int code; + + private String name; + + + UserStatusEnum(int code, String name) { + this.code = code; + this.name = name; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +}