diff --git a/bweb/pom.xml b/bweb/pom.xml new file mode 100644 index 0000000..5795716 --- /dev/null +++ b/bweb/pom.xml @@ -0,0 +1,45 @@ + + + + com.hfkj + hai-oil-parent + 1.0-SNAPSHOT + + 4.0.0 + + com.hfkj + oil-bweb + + + + com.hfkj + service + PACKT-SNAPSHOT + + + + + + + src/main/resources/${env} + false + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/bweb/src/main/java/com/BWebApplication.java b/bweb/src/main/java/com/BWebApplication.java new file mode 100644 index 0000000..539efbc --- /dev/null +++ b/bweb/src/main/java/com/BWebApplication.java @@ -0,0 +1,32 @@ +package com; + +import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; +import com.alicp.jetcache.anno.config.EnableMethodCache; +import com.hfkj.common.utils.SpringContextUtil; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.EnableAspectJAutoProxy; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +// @ComponentScan +@EnableTransactionManagement +@EnableScheduling +@EnableMethodCache(basePackages = "com.hfkj") +@EnableCreateCacheAnnotation +@ServletComponentScan +@EnableAspectJAutoProxy(proxyTargetClass = true) +@MapperScan("com.hfkj.dao") +public class BWebApplication +{ + public static void main( String[] args ) + { + ApplicationContext app = SpringApplication.run(BWebApplication.class, args); + SpringContextUtil.setApplicationContext(app); + } + +} diff --git a/bweb/src/main/java/com/bweb/config/AuthConfig.java b/bweb/src/main/java/com/bweb/config/AuthConfig.java new file mode 100644 index 0000000..3bee573 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/AuthConfig.java @@ -0,0 +1,127 @@ +package com.bweb.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.UserCenter; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@Configuration +public class AuthConfig implements WebMvcConfigurer { + + private static Logger log = LoggerFactory.getLogger(AuthConfig.class); + + @Resource + private UserCenter userCenter; + + /** + * 获取配置文件debug变量 + */ + @Value("${debug}") + private boolean debug = false; + + /** + * 解决18位long类型数据转json失去精度问题 + * @param converters + */ + @Override + public void configureMessageConverters(List> converters){ + MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter(); + + ObjectMapper objectMapper = jsonConverter.getObjectMapper(); + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + objectMapper.registerModule(simpleModule); + + converters.add(jsonConverter); + } + + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new HandlerInterceptorAdapter() { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, + Object handler) throws Exception { + if(debug){ + return true; + } + String token = request.getHeader("Authorization"); + if(StringUtils.isNotBlank(token) && userCenter.isLogin(token)){//如果未登录,将无法使用任何接口 + return true; + } else if(request instanceof StandardMultipartHttpServletRequest) { + StandardMultipartHttpServletRequest re = (StandardMultipartHttpServletRequest)request; + if(userCenter.isLogin(re.getRequest())){ + return true; + } else { + log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL()); + response.setStatus(401); + return false; + } + } else{ + log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL()); + response.setStatus(401); + return false; + } + } + }) + .addPathPatterns("/**") + .excludePathPatterns("/swagger-resources/**") + .excludePathPatterns("/**/api-docs") + .excludePathPatterns("/**/springfox-swagger-ui/**") + .excludePathPatterns("/**/swagger-ui.html") + .excludePathPatterns("/client/*") + .excludePathPatterns("/sms/*") + .excludePathPatterns("/secUser/login") + .excludePathPatterns("/secUser/loginOut") + ; + } + + public String getIpAddress(HttpServletRequest request) { + // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 + String ip = request.getHeader("X-Forwarded-For"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + for (int index = 0; index < ips.length; index++) { + String strIp = ips[index]; + if (!("unknown".equalsIgnoreCase(strIp))) { + ip = strIp; + break; + } + } + } + return ip; + } + +} diff --git a/bweb/src/main/java/com/bweb/config/ConfigListener.java b/bweb/src/main/java/com/bweb/config/ConfigListener.java new file mode 100644 index 0000000..fb81053 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/ConfigListener.java @@ -0,0 +1,24 @@ +package com.bweb.config; + +import org.springframework.beans.factory.annotation.Autowired; + +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +@WebListener +public class ConfigListener implements ServletContextListener { + + @Autowired + private SysConfig sysConfig; + + @Override + public void contextInitialized(ServletContextEvent sce) { + SysConst.setSysConfig(sysConfig); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + } + +} diff --git a/bweb/src/main/java/com/bweb/config/CorsConfig.java b/bweb/src/main/java/com/bweb/config/CorsConfig.java new file mode 100644 index 0000000..5f46ab3 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/CorsConfig.java @@ -0,0 +1,49 @@ +package com.bweb.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName CorsConfig + * @Description: TODO () + * @Author 胡锐 + * @Date 2020/12/16 + **/ +@Configuration +public class CorsConfig extends WebMvcConfigurerAdapter { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "DELETE", "PUT") + .maxAge(3600); + } + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + List list = new ArrayList<>(); + list.add("*"); + corsConfiguration.setAllowedOrigins(list); + /* + // 请求常用的三种配置,*代表允许所有,当时你也可以自定义属性(比如header只能带什么,只能是post方式等等) + */ + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + return corsConfiguration; + } + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); + return new CorsFilter(source); + } +} diff --git a/bweb/src/main/java/com/bweb/config/MultipartConfig.java b/bweb/src/main/java/com/bweb/config/MultipartConfig.java new file mode 100644 index 0000000..267de74 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/MultipartConfig.java @@ -0,0 +1,26 @@ +package com.bweb.config; + +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.MultipartConfigElement; + +@Configuration +public class MultipartConfig { + + /** + * 文件上传配置 + * @return + */ + @Bean + public MultipartConfigElement multipartConfigElement() { + MultipartConfigFactory factory = new MultipartConfigFactory(); + //文件最大 + factory.setMaxFileSize("300MB"); //KB,MB + //设置总上传数据总大小 + factory.setMaxRequestSize("350MB"); + return factory.createMultipartConfig(); + } + +} diff --git a/bweb/src/main/java/com/bweb/config/RedisConfig.java b/bweb/src/main/java/com/bweb/config/RedisConfig.java new file mode 100644 index 0000000..0c5f530 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/RedisConfig.java @@ -0,0 +1,109 @@ +package com.bweb.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + + +@Configuration +@EnableCaching //开启注解 +public class RedisConfig extends CachingConfigurerSupport { + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + + RedisTemplate template = new RedisTemplate<>(); + // 配置连接工厂 + template.setConnectionFactory(factory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) + Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); + + ObjectMapper om = new ObjectMapper(); + // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jacksonSeial.setObjectMapper(om); + + // 值采用json序列化 + template.setValueSerializer(jacksonSeial); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + + // 设置hash key 和value序列化模式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(jacksonSeial); + template.afterPropertiesSet(); + + return template; + } + + /** + * 对hash类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + /** + * 对redis字符串类型数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + /** + * 对链表类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + /** + * 对无序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + /** + * 对有序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } +} \ No newline at end of file diff --git a/bweb/src/main/java/com/bweb/config/SwaggerConfig.java b/bweb/src/main/java/com/bweb/config/SwaggerConfig.java new file mode 100644 index 0000000..b46dc9a --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/SwaggerConfig.java @@ -0,0 +1,47 @@ +package com.bweb.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** +* SwaggerConfig.java +* 项目名称: +* 包: +* 类名称: SwaggerConfig.java +* 类描述: 构建restful api接口文档 +* 创建人: +* 创建时间: 2017 下午4:23:45 +*/ +@Configuration +@EnableSwagger2 +public class SwaggerConfig +{ + + /** + * 描述api的基本信息 + * 基本信息会展现在文档页面中 + * @return [api的基本信息] + */ + ApiInfo apiInfo() + { + return new ApiInfoBuilder().title("hgj-BWeb").description("提供给管理平台的接口").termsOfServiceUrl("").version("1.0.0") + .contact(new Contact("", "", "")).build(); + } + + @Bean + public Docket customImplementation() + { + return new Docket(DocumentationType.SWAGGER_2).select() + .apis(RequestHandlerSelectors.basePackage("com")) + .build().directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class).apiInfo(apiInfo()); + } + +} diff --git a/bweb/src/main/java/com/bweb/config/SysConfig.java b/bweb/src/main/java/com/bweb/config/SysConfig.java new file mode 100644 index 0000000..1535c40 --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/SysConfig.java @@ -0,0 +1,31 @@ +package com.bweb.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Component("sysConfig") +@ConfigurationProperties +@PropertySource("classpath:/config.properties") +public class SysConfig { + + private String fileUrl; + + private String cmsPath; + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public String getCmsPath() { + return cmsPath; + } + + public void setCmsPath(String cmsPath) { + this.cmsPath = cmsPath; + } +} diff --git a/bweb/src/main/java/com/bweb/config/SysConst.java b/bweb/src/main/java/com/bweb/config/SysConst.java new file mode 100644 index 0000000..948513a --- /dev/null +++ b/bweb/src/main/java/com/bweb/config/SysConst.java @@ -0,0 +1,19 @@ +package com.bweb.config; + +public class SysConst { + + private static SysConfig sysConfig; + + public static void setSysConfig(SysConfig arg){ + sysConfig = arg; + } + + public static SysConfig getSysConfig(){ + if (null == sysConfig) { + //防止空指针异常 + sysConfig = new SysConfig(); + return sysConfig; + } + return sysConfig; + } +} diff --git a/bweb/src/main/java/com/bweb/controller/AliyuncsSmsController.java b/bweb/src/main/java/com/bweb/controller/AliyuncsSmsController.java new file mode 100644 index 0000000..2c32ba4 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/AliyuncsSmsController.java @@ -0,0 +1,67 @@ +package com.bweb.controller; + +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.hfkj.common.security.VerifyCode; +import com.hfkj.common.security.VerifyCodeStorage; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import java.util.Random; + +@RestController +@RequestMapping(value="/sms") +@Api(value="阿里云短信") +public class AliyuncsSmsController { + + Logger log = LoggerFactory.getLogger(AliyuncsSmsController.class); + + @RequestMapping(value="/sendVerificationCode",method= RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "发送验证码") + public ResponseData sendVerificationCode(@RequestParam(value = "phone", required = true) String phone) { + try { + + VerifyCode verifyCode = VerifyCodeStorage.getDate(phone); + String code; + if (verifyCode != null){ + code = verifyCode.getObject(); + }else{ + // 生成随机6位验证码 + code = String.valueOf(new Random().nextInt(899999) + 100000); + } + DefaultProfile profile = DefaultProfile.getProfile("default", "LTAI4FzFiDCZsspxJfQYoHxC", "tkS64fUpgK0Lr2R8ps0AVYRWZloFLl"); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + //request.setProtocol(ProtocolType.HTTPS); + request.setMethod(MethodType.POST); + request.setDomain("dysmsapi.aliyuncs.com"); + request.setVersion("2017-05-25"); + request.setAction("SendSms"); + request.putQueryParameter("PhoneNumbers", phone); + request.putQueryParameter("SignName", "银企服"); + request.putQueryParameter("TemplateCode", "SMS_210765573"); + request.putQueryParameter("TemplateParam", "{\"code\":\""+code+"\"}"); + + //发送短信 + CommonResponse response = client.getCommonResponse(request); + // 存入VerifyCodeStorage + verifyCode = new VerifyCode(phone,code); + VerifyCodeStorage.save(verifyCode); + return ResponseMsgUtil.success(response.getData()); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/bweb/src/main/java/com/bweb/controller/BsAgentController.java b/bweb/src/main/java/com/bweb/controller/BsAgentController.java new file mode 100644 index 0000000..d92a034 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsAgentController.java @@ -0,0 +1,174 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.entity.BsAgent; +import com.hfkj.entity.SecUser; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsAgentService; +import com.hfkj.service.SecUserService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@Controller +@RequestMapping(value = "/agent") +@Api(value = "代理商管理") +public class BsAgentController { + + private static Logger log = LoggerFactory.getLogger(BsAgentController.class); + + @Resource + private BsAgentService agentService; + @Resource + private SecUserService secUserService; + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/createAgent", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建代理商") + public ResponseData createAgent(@RequestBody JSONObject body) { + try { + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || !userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type2.getNumber())) { + log.error("BsAgentController --> createAgent() error!", "用户身份错误或已过期"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + if (body == null + || StringUtils.isBlank(body.getString("loginName")) + || StringUtils.isBlank(body.getString("name")) + || StringUtils.isBlank(body.getString("contactsName")) + || StringUtils.isBlank(body.getString("contactsTelephone")) + ) { + log.error("BsAgentController --> createAgent() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + BsAgent agent = new BsAgent(); + agent.setCompanyId(userInfoModel.getBsCompany().getId()); + agent.setCompanyName(userInfoModel.getBsCompany().getName()); + agent.setName(body.getString("name")); + agent.setContactsName(body.getString("contactsName")); + agent.setContactsTelephone(body.getString("contactsTelephone")); + + agentService.createAgent(body.getString("loginName"), agent); + return ResponseMsgUtil.success("创建成功"); + } catch (Exception e) { + log.error("BsAgentController --> createAgent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateAgent", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改代理商") + public ResponseData updateAgent(@RequestBody JSONObject body) { + try { + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || !userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type2.getNumber())) { + log.error("BsAgentController --> updateAgent() error!", "用户身份错误或已过期"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + if (body == null + || StringUtils.isBlank(body.getString("agentNo")) + || StringUtils.isBlank(body.getString("name")) + || StringUtils.isBlank(body.getString("contactsName")) + || StringUtils.isBlank(body.getString("contactsTelephone")) + ) { + log.error("BsAgentController --> updateAgent() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询代理商 + BsAgent agent = agentService.getAgentByAgentNo(body.getString("agentNo")); + if (agent == null) { + log.error("BsAgentController --> updateAgent() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的代理商"); + } + agent.setName(body.getString("name")); + agent.setContactsName(body.getString("contactsName")); + agent.setContactsTelephone(body.getString("contactsTelephone")); + agentService.updateAgent(agent); + + return ResponseMsgUtil.success("修改成功"); + } catch (Exception e) { + log.error("BsAgentController --> updateAgent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/queryAgentDetail", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询代理商详情") + public ResponseData queryAgentDetail(@RequestParam(name = "agentNo", required = true) String agentNo) { + try { + // 查询代理商 + BsAgent agent = agentService.getAgentByAgentNo(agentNo); + if (agent == null) { + log.error("BsAgentController --> queryAgentDetail() error!", "未找到代理商"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商"); + } + Map param = new HashMap<>(); + param.put("agent", agent); + + SecUser secUser = secUserService.getMainAccount(SecUserObjectTypeEnum.type3.getNumber(), agent.getId()); + if (secUser == null) { + log.error("BsAgentController --> queryAgentDetail() error!", "未找到代理商登录账户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到代理商登录账户"); + } + secUser.setPassword(null); + param.put("account", secUser); + + return ResponseMsgUtil.success(param); + } catch (Exception e) { + log.error("BsAgentController --> queryAgentDetail() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryAgentList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询代理商列表") + public ResponseData queryAgentList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "agentNo", required = false) String agentNo, + @RequestParam(name = "agentName", required = false) String agentName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("companyId", companyId); + param.put("agentNo", agentNo); + param.put("agentName", agentName); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(agentService.getAgentList(param))); + } catch (Exception e) { + log.error("BsAgentController --> queryAgentList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsDeviceController.java b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java new file mode 100644 index 0000000..1d97e70 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsDeviceController.java @@ -0,0 +1,237 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.config.SpPrinterConfig; +import com.hfkj.entity.*; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsCompanyService; +import com.hfkj.service.BsDeviceService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.sysenum.DeviceTypeEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/device") +@Api(value = "设备管理") +public class BsDeviceController { + + private static Logger log = LoggerFactory.getLogger(BsDeviceController.class); + + @Resource + private UserCenter userCenter; + @Resource + private BsDeviceService deviceService; + @Resource + private BsMerchantService merchantService; + @Resource + private BsCompanyService companyService; + + @RequestMapping(value="/editDevice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑设备") + public ResponseData editDevice(@RequestBody BsDevice body) { + try { + + if (StringUtils.isBlank(body.getMerNo()) || body.getType() == null) { + log.error("BsDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (DeviceTypeEnum.getNameByType(body.getType()) == null) { + log.error("BsDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的设备类型"); + } + + if (body.getType().equals(DeviceTypeEnum.type1.getType()) + && (StringUtils.isBlank(body.getDeviceSn()) || StringUtils.isBlank(body.getDeviceKey()))) { + log.error("BsDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + + } + + BsDevice device; + if (body.getId() != null) { + // 查询设备 + device = deviceService.getDetailById(body.getId()); + if (device == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + device = new BsDevice(); + } + + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + // 查询分公司 + BsCompany company = companyService.getCompanyById(merchant.getCompanyId()); + if (company == null) { + log.error("HighDeviceController -> editDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的分公司"); + } + + if (body.getId() == null) { + if (body.getType().equals(DeviceTypeEnum.type1.getType())) { + SpPrinterConfig sp = new SpPrinterConfig(); + JSONObject jsonObject = JSONObject.parseObject(sp.addPrinter(body.getDeviceSn(), body.getDeviceKey(), merchant.getMerName())); + if (!jsonObject.getInteger("errorcode").equals(0)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg")); + } + } + } + + device.setCompanyId(company.getId()); + device.setCompanyName(company.getName()); + device.setAgentId(merchant.getAgentId()); + device.setAgentName(merchant.getAgentName()); + device.setMerId(merchant.getId()); + device.setMerNo(merchant.getMerNo()); + device.setMerName(merchant.getMerName()); + device.setType(body.getType()); + device.setDeviceName(merchant.getMerName()); + device.setDeviceSn(body.getDeviceSn()); + device.setDeviceKey(body.getDeviceKey()); + device.setDeviceImei(body.getDeviceImei()); + device.setDeviceIccid(body.getDeviceIccid()); + device.setReceiptTop(body.getReceiptTop()); + device.setReceiptSource(body.getReceiptSource()); + device.setReceiptBottom(body.getReceiptBottom()); + deviceService.editDevice(device); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighDeviceController -> editDevice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delDevice",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除设备") + public ResponseData delDevice(@RequestBody JSONObject body) { + try { + + if (body.getLong("deviceId") == null) { + log.error("BsDeviceController -> delDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询设备 + BsDevice device = deviceService.getDetailById(body.getLong("deviceId")); + if (device == null) { + log.error("HighDeviceCBsDeviceControllerontroller -> delDevice() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + if (device.getType().equals(DeviceTypeEnum.type1.getType())) { + SpPrinterConfig sp = new SpPrinterConfig(); + JSONObject jsonObject = JSONObject.parseObject(sp.deletePrinter(device.getDeviceSn())); + if (!jsonObject.getInteger("errorcode").equals(0)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, jsonObject.getString("errormsg")); + } + } + + device.setStatus(0); + deviceService.editDevice(device); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDeviceController -> delDevice() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDetailById",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据id查询设备详情") + public ResponseData getDetailById(@RequestParam(name = "deviceId", required = true) Long deviceId) { + try { + + return ResponseMsgUtil.success(deviceService.getDetailById(deviceId)); + + } catch (Exception e) { + log.error("HighDeviceController -> getDetailById() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getDeviceList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询设备列表") + public ResponseData getDeviceList(@RequestParam(name = "companyId", required = false) Long companyId, + @RequestParam(name = "merNo", required = false) String merNo, + @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "deviceName", required = false) String deviceName, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + + UserInfoModel sessionModel = userCenter.getSessionModel(UserInfoModel.class); + if (sessionModel == null) { + log.error("HighDeviceController -> getDeviceList() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到"); + } + + Map param = new HashMap<>(); + param.put("deviceName", deviceName); + + if (sessionModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type0.getNumber()) + || sessionModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type1.getNumber())) { + param.put("companyId", companyId); + param.put("merNo", merNo); + param.put("merName", merName); + + } else if (sessionModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type2.getNumber())) { + param.put("companyId", sessionModel.getBsCompany().getId()); + param.put("merNo", merNo); + param.put("merName", merName); + + } else if (sessionModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type3.getNumber())) { + param.put("agentId", sessionModel.getAgent().getId()); + param.put("merNo", merNo); + param.put("merName", merName); + + }else if (sessionModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type4.getNumber())) { + param.put("merNo", sessionModel.getMerchant().getMerNo()); + + } else { + log.error("HighDeviceController -> getDeviceList() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(deviceService.getDeviceList(param))); + + } catch (Exception e) { + log.error("HighDeviceController -> getDeviceList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsDiscountController.java b/bweb/src/main/java/com/bweb/controller/BsDiscountController.java new file mode 100644 index 0000000..0440336 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsDiscountController.java @@ -0,0 +1,253 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.config.SpPrinterConfig; +import com.hfkj.entity.BsCompany; +import com.hfkj.entity.BsDevice; +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsMerchant; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsCompanyService; +import com.hfkj.service.BsDeviceService; +import com.hfkj.service.BsDiscountService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.sysenum.*; +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.*; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/discount") +@Api(value = "优惠券管理") +public class BsDiscountController { + + private static Logger log = LoggerFactory.getLogger(BsDiscountController.class); + @Resource + private BsDiscountService discountService; + @Resource + private BsMerchantService merchantService; + + @RequestMapping(value="/editDiscount",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑优惠券") + public ResponseData editDiscount(@RequestBody BsDiscount body) { + try { + + if (StringUtils.isBlank(body.getMerNo()) + || StringUtils.isBlank(body.getDiscountName()) + || body.getDiscountType() == null + || body.getDiscountPrice() == null + || StringUtils.isBlank(body.getUseScope()) + || body.getStartTime() == null + || body.getEndTime() == null + ) { + log.error("BsDiscountController -> editDiscount() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (DiscountTypeEnum.getNameByType(body.getDiscountType()) == null) { + log.error("BsDiscountController -> editDiscount() error!","未知优惠券类型"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知优惠券类型"); + } + // 满减条件 + if (DiscountTypeEnum.type1.getCode().equals(body.getDiscountType()) && body.getDiscountCondition() == null) { + log.error("BsDiscountController -> editDiscount() error!","未设置满减条件"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未设置满减条件"); + } + if (DiscountUseScopeEnum.type1.getCode().equals(body.getDiscountType()) && body.getDiscountCondition() == null) { + log.error("BsDiscountController -> editDiscount() error!","未设置满减条件"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未设置满减条件"); + } + BsDiscount discount; + if (StringUtils.isNotBlank(body.getDiscountNo())) { + // 查询优惠券 + discount = discountService.getDetail(body.getDiscountNo()); + if (discount == null) { + log.error("BsDiscountController -> editDiscount() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + discount = new BsDiscount(); + } + + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + log.error("BsDiscountController -> editDiscount() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + + discount.setMerId(merchant.getId()); + discount.setMerNo(merchant.getMerNo()); + discount.setMerName(merchant.getMerName()); + discount.setDiscountType(body.getDiscountType()); + discount.setDiscountName(body.getDiscountName()); + discount.setDiscountCondition(body.getDiscountCondition()); + discount.setDiscountPrice(body.getDiscountPrice()); + discount.setUseScope(body.getUseScope()); + discount.setStartTime(body.getStartTime()); + discount.setEndTime(body.getEndTime()); + discount.setStatus(DiscountStatusEnum.status1.getCode()); + discountService.editDiscount(discount); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountController -> editDiscount() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/updateEndTime",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "修改结束时间") + public ResponseData updateEndTime(@RequestBody JSONObject body) { + try { + + if (body == null + || StringUtils.isBlank(body.getString("discountNo")) + || body.getLong("endTime") == null) { + log.error("BsDiscountController -> updateEndTime() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询详情 + BsDiscount discount = discountService.getDetail(body.getString("discountNo")); + if (discount == null) { + log.error("BsDiscountController -> updateEndTime() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券"); + } + if (!discount.getStatus().equals(DiscountStatusEnum.status2.getCode())) { + log.error("BsDiscountController -> updateEndTime() error!","无法修改,优惠不处于上线状态"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "无法修改,优惠不处于上线状态"); + } + discount.setEndTime(new Date(body.getLong("endTime"))); + discountService.editDiscount(discount); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountController -> updateEndTime() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/online",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "上线优惠券") + public ResponseData online(@RequestBody JSONObject body) { + try { + + if (body == null || StringUtils.isBlank(body.getString("discountNo"))) { + log.error("BsDiscountController -> online() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + discountService.online(body.getString("discountNo")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountController -> online() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/done",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "结束优惠券") + public ResponseData done(@RequestBody JSONObject body) { + try { + + if (body == null || StringUtils.isBlank(body.getString("discountNo"))) { + log.error("BsDiscountController -> done() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + discountService.done(body.getString("discountNo")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountController -> done() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delete",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除优惠券") + public ResponseData delete(@RequestBody JSONObject body) { + try { + + if (body == null || StringUtils.isBlank(body.getString("discountNo"))) { + log.error("BsDiscountController -> delDiscount() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + discountService.delete(body.getString("discountNo")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountController -> delDiscount() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询详情") + public ResponseData queryDetail(@RequestParam(name = "discountNo", required = true) String discountNo) { + try { + + return ResponseMsgUtil.success(discountService.getDetail(discountNo)); + + } catch (Exception e) { + log.error("BsDiscountController -> delDiscount() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData queryList(@RequestParam(name = "merNo", required = false) String merNo, + @RequestParam(name = "discountName", required = false) String discountName, + @RequestParam(name = "discountType", required = false) Integer discountType, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("merNo", merNo); + param.put("discountName", discountName); + param.put("discountType", discountType); + param.put("status", status); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(discountService.getList(param))); + + } catch (Exception e) { + log.error("BsDiscountController -> queryList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java b/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java new file mode 100644 index 0000000..d78114e --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsDiscountStockController.java @@ -0,0 +1,130 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsDiscountStockCode; +import com.hfkj.entity.BsMerchant; +import com.hfkj.model.ResponseData; +import com.hfkj.service.BsDiscountService; +import com.hfkj.service.BsDiscountStockBatchService; +import com.hfkj.service.BsDiscountStockCodeService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.sysenum.DiscountStatusEnum; +import com.hfkj.sysenum.DiscountTypeEnum; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.models.auth.In; +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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/discountStock") +@Api(value = "优惠券库存管理") +public class BsDiscountStockController { + + private static Logger log = LoggerFactory.getLogger(BsDiscountStockController.class); + @Resource + private BsDiscountStockBatchService discountStockBatchService; + + @Resource + private BsDiscountStockCodeService discountStockCodeService; + + @RequestMapping(value="/addStock",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "增加优惠券库存") + public ResponseData addStock(@RequestBody JSONObject body) { + try { + + if (body == null + || StringUtils.isBlank(body.getString("discountNo")) + || body.getInteger("stockCount") == null) { + log.error("BsDiscountController -> editDiscount() error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + discountStockBatchService.addStock(body.getString("discountNo"), body.getInteger("stockCount")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsDiscountStockController -> addStock() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryStockBatchList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询库存批次") + public ResponseData queryStockBatchList(@RequestParam(name = "discountNo", required = false) String discountNo, + @RequestParam(name = "discountName", required = false) String discountName, + @RequestParam(name = "batchNo", required = false) String batchNo, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("discountNo", discountNo); + param.put("discountName", discountName); + param.put("batchNo", batchNo); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(discountStockBatchService.getStockBatchList(param))); + + } catch (Exception e) { + log.error("BsDiscountStockController -> queryStockBatchList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryStockBatchDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询库存批次详情") + public ResponseData queryStockBatchDetail(@RequestParam(name = "batchNo", required = true) String batchNo) { + try { + + return ResponseMsgUtil.success(discountStockBatchService.getStockBatchDetail(batchNo)); + + } catch (Exception e) { + log.error("BsDiscountStockController -> queryStockBatchDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + + @RequestMapping(value="/queryStockBatchCodeList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询库存批次优惠券code") + public ResponseData queryStockBatchCodeList(@RequestParam(name = "codeId", required = false) String codeId, + @RequestParam(name = "discountNo", required = false) String discountNo, + @RequestParam(name = "batchNo", required = false) String batchNo, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("codeId", codeId); + param.put("discountNo", discountNo); + param.put("batchNo", batchNo); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(discountStockCodeService.getCodeList(param))); + + } catch (Exception e) { + log.error("BsDiscountStockController -> queryStockBatchCodeList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java new file mode 100644 index 0000000..355187d --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilGunNoController.java @@ -0,0 +1,167 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.entity.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.SecDictionary; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsGasOilGunNoService; +import com.hfkj.service.BsGasOilPriceService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.service.CommonService; +import com.hfkj.sysenum.GasOilPriceStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Controller +@RequestMapping(value = "/gasOilGunNo") +@Api(value = "加油站价格") +public class BsGasOilGunNoController { + private static Logger log = LoggerFactory.getLogger(BsGasOilGunNoController.class); + + @Resource + private BsGasOilPriceService gasOilPriceService; + @Resource + private BsGasOilGunNoService gasOilGunNoService; + @Resource + private BsMerchantService merchantService; + @Resource + private UserCenter userCenter; + + @RequestMapping(value = "/createOilGunNo", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建油品枪号") + public ResponseData createOilGunNo(@RequestBody BsGasOilGunNo body) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || !userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type4.getNumber())) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "用户身份错误或已过期"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + if (body == null + || body.getMerNo() == null + || StringUtils.isBlank(body.getOilNo()) + || StringUtils.isBlank(body.getGunNo())){ + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "未知的商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + if (!merchant.getId().equals(userInfoModel.getMerchant().getId())) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "权限不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + // 油品 + BsGasOilPrice oilPrice = gasOilPriceService.getGasOilPrice(merchant.getId(), body.getOilNo()); + if (oilPrice == null) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "商户未添加" + body.getOilNo() + "油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "商户未添加" + body.getOilNo() + "油品"); + } + if (gasOilGunNoService.getDetail(body.getMerNo(), body.getOilNo(), body.getGunNo()) != null) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", "油品枪号已存在"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油品枪号已存在"); + } + + BsGasOilGunNo oilGunNo = new BsGasOilGunNo(); + oilGunNo.setGasOilPriceId(oilPrice.getId()); + oilGunNo.setMerId(oilPrice.getMerId()); + oilGunNo.setMerNo(oilPrice.getMerNo()); + oilGunNo.setOilType(oilPrice.getOilType()); + oilGunNo.setOilTypeName(oilPrice.getOilTypeName()); + oilGunNo.setOilNo(oilPrice.getOilNo()); + oilGunNo.setOilNoName(oilPrice.getOilNoName()); + oilGunNo.setGunNo(body.getGunNo()); + oilGunNo.setStatus(1); + gasOilGunNoService.editData(oilGunNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsGasOilGunNoController --> createOilGunNo() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delete", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除抢号") + public ResponseData delete(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("gunNoId") == null) { + log.error("BsGasOilGunNoController --> delete() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasOilGunNoService.delete(body.getLong("gunNoId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsGasOilGunNoController --> delete() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryOilDetail", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品详情") + public ResponseData queryOilDetail(@RequestParam(value = "gunNoId", required = true) Long gunNoId) { + try { + + return ResponseMsgUtil.success(gasOilGunNoService.getDetail(gunNoId)); + + } catch (Exception e) { + log.error("BsGasOilGunNoController --> queryOilDetail() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryGunNoList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品列表") + public ResponseData queryGunNoList(@RequestParam(value = "merNo", required = true) String merNo, + @RequestParam(value = "oilNo", required = false) String oilNo) { + try { + // 查询枪号 + List list = gasOilGunNoService.getOilGunNoList(merNo); + + if (StringUtils.isNotBlank(oilNo)) { + return ResponseMsgUtil.success(list.stream().filter(o -> o.getOilNo().equals(oilNo)).collect(Collectors.toList())); + } + + return ResponseMsgUtil.success(list); + + } catch (Exception e) { + log.error("BsGasOilGunNoController --> queryGunNoList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java new file mode 100644 index 0000000..be1c2bc --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceController.java @@ -0,0 +1,251 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.entity.*; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsGasOilPriceService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.service.CommonService; +import com.hfkj.sysenum.GasOilPriceStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/gasOilPrice") +@Api(value = "加油站价格") +public class BsGasOilPriceController { + private static Logger log = LoggerFactory.getLogger(BsGasOilPriceController.class); + + @Resource + private BsGasOilPriceService gasOilPriceService; + @Resource + private BsMerchantService merchantService; + @Resource + private UserCenter userCenter; + @Resource + private CommonService commonService; + + @RequestMapping(value = "/createOil", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建油品") + public ResponseData createOil(@RequestBody BsGasOilPrice body) { + try { + + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null || !userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type4.getNumber())) { + log.error("BsGasOilPriceController --> createOil() error!", "用户身份错误或已过期"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + + if (body == null + || body.getMerNo() == null + || StringUtils.isBlank(body.getOilNo()) + || body.getPriceOfficial() == null + || body.getGasStationDrop() == null){ + log.error("BsGasOilPriceController --> createOil() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + log.error("BsGasOilPriceController --> createOil() error!", "未知的商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + if (!merchant.getId().equals(userInfoModel.getMerchant().getId())) { + log.error("BsGasOilPriceController --> createOil() error!", "权限不足"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + // 是否重复添加商户油品 + if (gasOilPriceService.getGasOilPrice(merchant.getId(), body.getOilNo()) != null) { + log.error("BsGasOilPriceController --> createOil() error!", "重复添加" + body.getOilNo() + "油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "重复添加" + body.getOilNo() + "油品"); + } + // 获取油品信息 + SecDictionary oilNo = commonService.mappingSysCode("OIL_NO", body.getOilNo()); + if (oilNo == null) { + log.error("BsGasOilPriceController --> createOil() error!", "油品不存在"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油品不存在"); + } + // 获取油品类型 + SecDictionary oilNoType = commonService.mappingSysCode("OIL_NO_TYPE", oilNo.getExt1()); + if (oilNoType == null) { + log.error("BsGasOilPriceController --> createOil() error!", "未知的的油品类型"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的的油品类型"); + } + + BsGasOilPrice oilPrice = new BsGasOilPrice(); + oilPrice.setMerId(merchant.getId()); + oilPrice.setMerNo(merchant.getMerNo()); + oilPrice.setOilType(Integer.valueOf(oilNoType.getCodeValue())); + oilPrice.setOilTypeName(oilNoType.getCodeName()); + oilPrice.setOilNo(oilNo.getCodeValue()); + oilPrice.setOilNoName(oilNo.getCodeName()); + oilPrice.setPreferentialMargin(new BigDecimal("0")); + oilPrice.setGasStationDrop(body.getGasStationDrop()); + oilPrice.setPriceOfficial(body.getPriceOfficial()); + oilPrice.setPriceGun(oilPrice.getPriceOfficial().subtract(body.getGasStationDrop())); + oilPrice.setPriceVip(oilPrice.getPriceGun()); + oilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber()); + gasOilPriceService.editOilPrice(oilPrice); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsGasOilPriceController --> createOil() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/restore", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "恢复") + public ResponseData restore(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("merNo")) + || StringUtils.isBlank(body.getString("oilNo"))) { + log.error("BsMerchantController --> restoreMer() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getString("merNo")); + if (merchant == null) { + log.error("BsGasOilPriceController --> restoreOil() error!", "未知的商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + BsGasOilPrice oilPrice = gasOilPriceService.getGasOilPrice(merchant.getId(), body.getString("oilNo")); + if (oilPrice == null) { + log.error("BsGasOilPriceController --> restoreOil() error!", "未知的油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油品"); + } + oilPrice.setStatus(GasOilPriceStatusEnum.status1.getNumber()); + gasOilPriceService.editOilPrice(oilPrice); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantController --> restoreMer() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/disable", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用油品") + public ResponseData disable(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("merNo")) + || StringUtils.isBlank(body.getString("oilNo"))) { + log.error("BsMerchantController --> disableOil() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getString("merNo")); + if (merchant == null) { + log.error("BsGasOilPriceController --> disableOil() error!", "未知的商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + BsGasOilPrice oilPrice = gasOilPriceService.getGasOilPrice(merchant.getId(), body.getString("oilNo")); + if (oilPrice == null) { + log.error("BsGasOilPriceController --> disableOil() error!", "未知的油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油品"); + } + oilPrice.setStatus(GasOilPriceStatusEnum.status2.getNumber()); + gasOilPriceService.editOilPrice(oilPrice); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("BsMerchantController --> disableOil() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delete", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除油品") + public ResponseData delete(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("merNo")) + || StringUtils.isBlank(body.getString("oilNo"))) { + log.error("BsMerchantController --> disableOil() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getString("merNo")); + if (merchant == null) { + log.error("BsGasOilPriceController --> disableOil() error!", "未知的商户"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户"); + } + BsGasOilPrice oilPrice = gasOilPriceService.getGasOilPrice(merchant.getId(), body.getString("oilNo")); + if (oilPrice == null) { + log.error("BsGasOilPriceController --> disableOil() error!", "未知的油品"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的油品"); + } + gasOilPriceService.delete(oilPrice); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("BsMerchantController --> disableOil() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryOilDetail", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品详情") + public ResponseData queryOilDetail(@RequestParam(value = "oilId", required = true) Long oilId) { + try { + + return ResponseMsgUtil.success(gasOilPriceService.getGasOilPrice(oilId)); + + } catch (Exception e) { + log.error("BsMerchantController --> queryOilDetail() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryOilList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询油品列表") + public ResponseData queryOilList(@RequestParam(value = "merNo", required = true) String merNo, + @RequestParam(value = "oilNo", required = false) String oilNo, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("merNo", merNo); + map.put("oilNo", oilNo); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasOilPriceService.getGasOilPriceList(map))); + + } catch (Exception e) { + log.error("BsMerchantController --> queryOilList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java new file mode 100644 index 0000000..1b903ce --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsGasOilPriceTaskController.java @@ -0,0 +1,269 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.entity.BsGasOilPriceTask; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecRegion; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsAgentService; +import com.hfkj.service.BsGasOilPriceTaskService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.service.CommonService; +import com.hfkj.sysenum.GasOilPriceTaskExecutionTypeEnum; +import com.hfkj.sysenum.GasTaskPriceTypeEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@RequestMapping(value = "/gasOilPriceTask") +@Api(value = "油品价格配置") +public class BsGasOilPriceTaskController { + + private static Logger log = LoggerFactory.getLogger(BsGasOilPriceTaskController.class); + + @Resource + private BsGasOilPriceTaskService gasOilPriceTaskService; + @Resource + private BsMerchantService merchantService; + @Resource + private UserCenter userCenter; + @Resource + private CommonService commonService; + + @RequestMapping(value="/batchAddTask",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "批量增加任务") + public ResponseData batchAddTask(@RequestBody List taskList) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + log.error("BsGasOilPriceTaskController -> batchAddTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + if (taskList == null || taskList.size() == 0) { + log.error("BsGasOilPriceTaskController -> batchAddTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + for (BsGasOilPriceTask task : taskList) { + if (task.getPriceType() == null + || task.getPrice() == null + || task.getOilNo() == null + || task.getExecutionType() == null) { + log.error("BsGasOilPriceTaskController -> batchAddTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 执行方式 1. 立刻执行 2. 定时执行 + if (task.getExecutionType().equals(GasOilPriceTaskExecutionTypeEnum.type2.getNumber()) && task.getStartTime() == null) { + log.error("BsGasOilPriceTaskController -> batchAddTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置执行时间"); + } + + // 价格类型 1. 国标价 2. 油站价 3. 平台优惠 4. 油站直降 + if (task.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { + if (task.getRegionId() == null) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置区域"); + } + // 加油站 + SecRegion region = commonService.getRegionsById(task.getRegionId()); + if (region == null) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到区域"); + } + task.setRegionId(region.getRegionId()); + task.setRegionName(region.getRegionName()); + } + + // 价格类型 1. 国标价 2. 油站价 3. 平台优惠 4. 油站直降 + if (task.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus()) + || task.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus()) + || task.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus()) ) { + + if (StringUtils.isBlank(task.getMerNo())) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未配置加油站"); + } + // 加油站 + BsMerchant merchant = merchantService.getMerchant(task.getMerNo()); + if (merchant == null) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到加油站"); + } + task.setRegionId(merchant.getProvinceCode()); + task.setRegionName(merchant.getProvinceName()); + task.setMerId(merchant.getId()); + task.setMerNo(merchant.getMerNo()); + task.setMerName(merchant.getMerName()); + task.setMerAddress(merchant.getAddress()); + } + // 查询油品 + SecDictionary oil = commonService.mappingSysCode("OIL_NO", task.getOilNo().toString()); + if (oil == null) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询油品 + SecDictionary oilNoType = commonService.mappingSysCode("OIL_NO_TYPE", ""+oil.getExt1()); + if (oilNoType == null) { + log.error("HighGasDiscountOilPriceController -> updateOilPriceOfficial() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + task.setOilType(Integer.valueOf(oilNoType.getCodeValue())); + task.setOilTypeName(oilNoType.getCodeName()); + task.setOilNoName(oil.getCodeName()); + task.setOpUserId(userInfoModel.getSecUser().getId()); + task.setOpUserName(userInfoModel.getSecUser().getUserName()); + + if (task.getOilPriceZoneId() != null) { + // 查询价区 + SecDictionary oilPriceZone = commonService.mappingSysCode("OIL_PRICE_ZONE", "" + task.getOilPriceZoneId()); + if (oilPriceZone != null) { + task.setOilPriceZoneId(Integer.valueOf(oilPriceZone.getCodeValue())); + task.setOilPriceZoneName(oilPriceZone.getCodeName()); + } + } + } + + gasOilPriceTaskService.batchAddTask(taskList); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> addTask() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delTask",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除任务") + public ResponseData delTask(@RequestBody JSONObject body) { + try { + if (body.getLong("taskId") == null) { + log.error("HighGasOilPriceTaskController -> delTask() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + gasOilPriceTaskService.delTask(body.getLong("taskId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> delTask() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTaskDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询任务详情") + public ResponseData getTaskDetail(@RequestParam(name = "taskId", required = true) Long taskId) { + try { + + return ResponseMsgUtil.success(gasOilPriceTaskService.getDetailById(taskId)); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> getTaskDetail() error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/getTaskList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询任务列表") + public ResponseData getTaskList(@RequestParam(name = "regionId", required = false) Long regionId, + @RequestParam(name = "regionName", required = false) String regionName, + @RequestParam(name = "merId", required = false) Long merId, + @RequestParam(name = "merNo", required = false) String merNo, + @RequestParam(name = "merName", required = false) String merName, + @RequestParam(name = "oilType", required = false) Integer oilType, + @RequestParam(name = "oilNo", required = false) Integer oilNo, + @RequestParam(name = "priceType", required = false) Integer priceType, + @RequestParam(name = "executionType", required = false) Integer executionType, + @RequestParam(name = "status", required = false) Integer status, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + UserInfoModel userInfoModel = userCenter.getSessionModel(UserInfoModel.class); + if (userInfoModel == null) { + log.error("HighGasController -> disabledOil() error!",""); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); + } + + Map param = new HashMap<>(); + param.put("regionId", regionId); + param.put("regionName", regionName); + param.put("merId", merId); + param.put("merNo", merNo); + param.put("merName", merName); + + if (userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type0.getNumber()) + || userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type1.getNumber())) { + + } else if (userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type2.getNumber())) { + param.put("regionId", userInfoModel.getBsCompany().getRegionId()); + + } else if (userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type3.getNumber())) { + if (merId == null) { + Map merParam = new HashMap<>(); + merParam.put("agentId", userInfoModel.getAgent().getId()); + // 查询代理商下的商户 + List merchantList = merchantService.getMerchantList(merParam); + String merNoListStr = ""; + if (merchantList.size() > 0) { + for (BsMerchant merchant : merchantList) { + if (StringUtils.isBlank(merNoListStr)) { + merNoListStr += merchant.getMerNo(); + } else { + merNoListStr += ","+merchant.getMerNo(); + } + } + param.put("merNoList", merNoListStr); + } else { + // 代理商没有商户 直接返回空数据 + return ResponseMsgUtil.success(new PageInfo<>(new ArrayList<>())); + } + } else { + param.put("merId", merId); + } + } else if (userInfoModel.getSecUser().getObjectType().equals(SecUserObjectTypeEnum.type4.getNumber())) { + param.put("merId", userInfoModel.getMerchant().getId()); + } + param.put("oilType", oilType); + param.put("oilNo", oilNo); + param.put("priceType", priceType); + param.put("executionType", executionType); + param.put("status", status); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(gasOilPriceTaskService.getTaskList(param))); + + } catch (Exception e) { + log.error("HighGasOilPriceTaskController -> getTaskList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java new file mode 100644 index 0000000..59e8e7f --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantController.java @@ -0,0 +1,250 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ResponseMsgUtil; +import com.hfkj.entity.*; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.*; +import com.hfkj.sysenum.MerchantStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Controller +@RequestMapping(value = "/merchant") +@Api(value = "商户管理") +public class BsMerchantController { + private static Logger log = LoggerFactory.getLogger(BsMerchantController.class); + + @Resource + private BsMerchantService merchantService; + @Resource + private BsGasOilPriceService gasOilPriceService; + @Resource + private BsGasOilGunNoService gasOilGunNoService; + @Resource + private UserCenter userCenter; + @Resource + private CommonService commonService; + + @RequestMapping(value = "/editMerchant", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑商户") + public ResponseData editMerchant(@RequestBody BsMerchant body) { + try { + if (body == null + || body.getAreaCode() == null + || StringUtils.isBlank(body.getMerLogo()) + || StringUtils.isBlank(body.getMerName()) + || StringUtils.isBlank(body.getContactsName()) + || StringUtils.isBlank(body.getContactsTel()) + || StringUtils.isBlank(body.getCustomerServiceTel()) + || StringUtils.isBlank(body.getAddress()) + || StringUtils.isBlank(body.getLongitude()) + || StringUtils.isBlank(body.getLatitude()) + || StringUtils.isBlank(body.getMerLabel()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + BsMerchant merchant = null; + if (StringUtils.isNotBlank(body.getMerNo())) { + // 查询商户 + merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "未知商户"); + } + } else { + merchant = new BsMerchant(); + merchant.setStatus(MerchantStatusEnum.status1.getNumber()); + } + + if (body.getOilPriceZoneId() != null) { + // 查询价区 + SecDictionary oilPriceZone = commonService.mappingSysCode("OIL_PRICE_ZONE", body.getOilPriceZoneId().toString()); + if (oilPriceZone == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的价区"); + } + merchant.setOilPriceZoneId(Integer.valueOf(oilPriceZone.getCodeValue())); + merchant.setOilPriceZoneName(oilPriceZone.getCodeName()); + } + // 查询区域 + SecRegion areaRegion = commonService.getRegionsById(body.getAreaCode()); + if (areaRegion == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知地区"); + } + // 查询市 + SecRegion cityRegion = commonService.getRegionsById(areaRegion.getParentId()); + if (cityRegion == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的市级"); + } + // 查询省 + SecRegion provinceRegion = commonService.getRegionsById(cityRegion.getParentId()); + if (provinceRegion == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的省级"); + } + + merchant.setProvinceCode(provinceRegion.getRegionId()); + merchant.setProvinceName(provinceRegion.getRegionName()); + merchant.setCityCode(cityRegion.getRegionId()); + merchant.setCityName(cityRegion.getRegionName()); + merchant.setAreaCode(areaRegion.getRegionId()); + merchant.setAreaName(areaRegion.getRegionName()); + merchant.setMerLogo(body.getMerLogo()); + merchant.setMerName(body.getMerName()); + merchant.setContactsName(body.getContactsName()); + merchant.setContactsTel(body.getContactsTel()); + merchant.setCustomerServiceTel(body.getCustomerServiceTel()); + merchant.setAddress(body.getAddress()); + merchant.setLatitude(body.getLatitude()); + merchant.setLongitude(body.getLongitude()); + merchant.setMerLabel(body.getMerLabel()); + + if (merchant.getMerNo() == null) { + merchantService.createMerchant(merchant); + } else { + merchantService.updateMerchant(merchant); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantController --> editMerchant() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/restoreMer", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "恢复商户") + public ResponseData restoreMer(@RequestBody JSONObject body) { + try { + if (body == null || StringUtils.isBlank(body.getString("merNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merchantService.updateMerStatus(body.getString("merNo"), MerchantStatusEnum.status1); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("BsMerchantController --> restoreMer() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/disableMer", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用商户") + public ResponseData disableMer(@RequestBody JSONObject body) { + try { + if (body == null || StringUtils.isBlank(body.getString("merNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merchantService.updateMerStatus(body.getString("merNo"), MerchantStatusEnum.status2); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("BsMerchantController --> disableMer() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/resetMerPwd", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "重置商户密码") + public ResponseData resetMerPwd(@RequestBody JSONObject body) { + try { + if (body == null || StringUtils.isBlank(body.getString("merNo"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merchantService.resetMerPwd(body.getString("merNo")); + + return ResponseMsgUtil.success("操作成功"); + } catch (Exception e) { + log.error("BsMerchantController --> resetMerPwd() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryMerDetail", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户详情") + public ResponseData queryMerDetail(@RequestParam(value = "merNo", required = true) String merNo) { + try { + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(merNo); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的商户号"); + } + + Map param = new HashMap<>(); + param.put("merNo", merNo); + // 查询油品 + List priceList = gasOilPriceService.getGasOilPriceList(param); + // 查询枪号 + List oilGunNoList = gasOilGunNoService.getOilGunNoList(merNo); + + // 获取枪号 + List oilsList = new ArrayList<>(); + for (BsGasOilPrice oilPrice : priceList) { + JSONObject oil = JSONObject.parseObject(JSONObject.toJSONString(oilPrice)); + // 获取枪号 + oil.put("gunNoList", oilGunNoList.stream().filter(o -> o.getOilNo().equals(oilPrice.getOilNo())).collect(Collectors.toList())); + oilsList.add(oil); + } + + Map map = new HashMap<>(); + map.put("merchant", merchant); + map.put("oils", oilsList); + return ResponseMsgUtil.success(map); + + } catch (Exception e) { + log.error("BsMerchantController --> queryMer() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryMerList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户列表") + public ResponseData queryMerList(@RequestParam(value = "merNo", required = false) String merNo, + @RequestParam(value = "merName", required = false) String merName, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("merNo", merNo); + map.put("merName", merName); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merchantService.getMerchantList(map))); + + } catch (Exception e) { + log.error("BsMerchantController --> queryMerList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java new file mode 100644 index 0000000..194950c --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantPayConfigController.java @@ -0,0 +1,94 @@ +package com.bweb.controller; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantPayConfig; +import com.hfkj.model.ResponseData; +import com.hfkj.service.BsMerchantPayConfigService; +import com.hfkj.service.BsMerchantService; +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.*; + +import javax.annotation.Resource; + +/** + * @className: BsMerchantPayConfigController + * @author: HuRui + * @date: 2024/3/13 + **/ +@Controller +@RequestMapping(value = "/merchantPayConfig") +@Api(value = "商户支付配置") +public class BsMerchantPayConfigController { + + private static Logger log = LoggerFactory.getLogger(BsMerchantPayConfigController.class); + + @Resource + private BsMerchantPayConfigService merchantPayConfigService; + @Resource + private BsMerchantService merchantService; + + @RequestMapping(value = "/editConfig", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑配置") + public ResponseData editConfig(@RequestBody BsMerchantPayConfig body) { + try { + if (body == null + || body.getMerNo() == null + || StringUtils.isBlank(body.getChannelMerNo()) + || StringUtils.isBlank(body.getChannelMerKey())) { + log.error("BsMerchantPayConfigController --> editConfig() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询商户 + BsMerchant merchant = merchantService.getMerchant(body.getMerNo()); + if (merchant == null) { + log.error("BsMerchantPayConfigController --> editConfig() error!", "参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询配置 + BsMerchantPayConfig config = merchantPayConfigService.getConfig(body.getMerNo()); + if (config == null) { + config = new BsMerchantPayConfig(); + } + config.setMerId(merchant.getId()); + config.setMerNo(merchant.getMerNo()); + config.setMerName(merchant.getMerName()); + config.setChannelName("惠支付"); + config.setChannelCode("HUI_PAY"); + config.setChannelMerNo(body.getChannelMerNo()); + config.setChannelMerKey(body.getChannelMerKey()); + merchantPayConfigService.editData(config); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantPayConfigController --> editConfig() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/queryConfig", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取配置") + public ResponseData queryConfig(@RequestParam(value = "merNo", required = true) String merNo) { + try { + + return ResponseMsgUtil.success(merchantPayConfigService.getConfig(merNo)); + + } catch (Exception e) { + log.error("BsMerchantPayConfigController --> queryConfig() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java new file mode 100644 index 0000000..b00f9d0 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantQrCodeController.java @@ -0,0 +1,108 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.BsMerchantQrCodeService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.sysenum.MerchantQrCodeStatusEnum; +import com.hfkj.sysenum.MerchantStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/merchantQrCode") +@Api(value = "商户二维码管理") +public class BsMerchantQrCodeController { + + private static Logger log = LoggerFactory.getLogger(BsMerchantQrCodeController.class); + + @Resource + private BsMerchantQrCodeService merchantQrCodeService; + + @RequestMapping(value = "/restore", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "恢复") + public ResponseData restore(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("qrCodeId") == null) { + log.error("BsMerchantQrCodeController --> restore() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merchantQrCodeService.updateQrCodeStatus(body.getLong("qrCodeId"), MerchantQrCodeStatusEnum.status1); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantQrCodeController --> restore() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/disable", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用") + public ResponseData disable(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("qrCodeId") == null) { + log.error("BsMerchantQrCodeController --> disable() error!", "请求参数校验失败"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + merchantQrCodeService.updateQrCodeStatus(body.getLong("qrCodeId"), MerchantQrCodeStatusEnum.status2); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("BsMerchantQrCodeController --> disable() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryQrCode", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户二维码详情") + public ResponseData queryQrCode(@RequestParam(value = "qrCodeId", required = true) Long qrCodeId) { + try { + + return ResponseMsgUtil.success(merchantQrCodeService.getMerQrCode(qrCodeId)); + + } catch (Exception e) { + log.error("BsMerchantController --> queryQrCode() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/queryQrCodeList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询商户二维码列表") + public ResponseData queryQrCodeList(@RequestParam(value = "merNo", required = true) String merNo) { + try { + return ResponseMsgUtil.success(merchantQrCodeService.getMerQrCodeList(merNo)); + + } catch (Exception e) { + log.error("BsMerchantQrCodeController --> queryQrCodeList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + +} diff --git a/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java b/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java new file mode 100644 index 0000000..095982b --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/BsMerchantUserController.java @@ -0,0 +1,53 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsMerchantUser; +import com.hfkj.model.ResponseData; +import com.hfkj.service.BsMerchantUserService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value = "/merUser") +@Api(value = "商户管理") +public class BsMerchantUserController { + + private static Logger log = LoggerFactory.getLogger(BsMerchantUserController.class); + + @Resource + private BsMerchantUserService merchantUserService; + + @RequestMapping(value = "/queryList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData queryList(@RequestParam(value = "merId", required = false) Long merId, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("merId", merId); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(merchantUserService.getList(param))); + + } catch (Exception e) { + log.error("BsMerchantUserController --> queryList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/CmsCategoryController.java b/bweb/src/main/java/com/bweb/controller/CmsCategoryController.java new file mode 100644 index 0000000..2aaf1f4 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/CmsCategoryController.java @@ -0,0 +1,187 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONArray; +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.ResponseMsgUtil; +import com.hfkj.entity.CmsCategory; +import com.hfkj.model.ResponseData; +import com.hfkj.service.CmsCategoryService; +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.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Controller +@Api(value = "内容分类管理") +@RequestMapping(value = "/cmsCategory") +public class CmsCategoryController { + + private static Logger log = LoggerFactory.getLogger(CmsCategoryController.class); + @Resource + private CmsCategoryService cmsCategoryService; + + @RequestMapping(value = "/addCategory", method = RequestMethod.POST) + @ApiOperation(value = "增加 分类") + @ResponseBody + public ResponseData addCategory(@RequestBody JSONObject jsonObject) { + try { + + CmsCategory cmsCategory = jsonObject.getObject("category", CmsCategory.class); + JSONArray jsonArray = jsonObject.getJSONArray("roles"); + Object[] roleArray = jsonArray.toArray(); + + if (cmsCategory == null || roleArray == null || roleArray.length == 0 + || StringUtils.isBlank(cmsCategory.getName()) + || StringUtils.isBlank(cmsCategory.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + List roleList = new ArrayList<>(); + for (Object object : roleArray) { + roleList.add(Integer.valueOf(object.toString())); + } + + if (cmsCategoryService.addCategory(cmsCategory, roleList) > 0) { + return ResponseMsgUtil.success("添加数据成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ADD_DATA_ERROR, ""); + } + + } catch (Exception e) { + log.error("CmsCategoryController --> addCategory() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateCategory", method = RequestMethod.POST) + @ApiOperation(value = "修改 内容分类") + @ResponseBody + public ResponseData updateCategory(@RequestBody JSONObject jsonObject) { + try { + + CmsCategory cmsCategory = jsonObject.getObject("category", CmsCategory.class); + JSONArray jsonArray = jsonObject.getJSONArray("roles"); + Object[] roleArray = jsonArray.toArray(); + + if (cmsCategory == null || roleArray == null || roleArray.length == 0 + || cmsCategory.getId() == null + || StringUtils.isBlank(cmsCategory.getName()) + || StringUtils.isBlank(cmsCategory.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + List roleList = new ArrayList<>(); + for (Object object : roleArray) { + roleList.add(Integer.valueOf(object.toString())); + } + + if (cmsCategoryService.updateCategory(cmsCategory, roleList) > 0) { + return ResponseMsgUtil.success("修改数据成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + + } catch (Exception e) { + log.error("CmsCategoryController --> updateCategory() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delCategory", method = RequestMethod.GET) + @ApiOperation(value = "删除 内容分类") + @ResponseBody + public ResponseData delCategory(@RequestParam(value = "id", required = true) Long id) { + try { + if (cmsCategoryService.delCategory(id) > 0) { + return ResponseMsgUtil.success("删除成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.DELETE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsCategoryController --> updateCategory() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCategoryById", method = RequestMethod.GET) + @ApiOperation(value = "查询 分类详情") + @ResponseBody + public ResponseData getCategoryById(@RequestParam(value = "id", required = true) Long id) { + try { + return ResponseMsgUtil.success(cmsCategoryService.getCategoryById(id)); + } catch (Exception e) { + log.error("CmsCategoryController --> getCategoryById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCategoryTree", method = RequestMethod.GET) + @ApiOperation(value = "获取分类树") + @ResponseBody + public ResponseData getCategoryTree(@RequestParam(value = "roleType", required = false) Integer roleType, + @RequestParam(value = "parentCode", required = false) String parentCode) { + try { + Map paramMap = new HashMap<>(); + if (roleType != null) { + paramMap.put("roleType", roleType); + } + if (StringUtils.isNotBlank(parentCode)) { + paramMap.put("parentCode", parentCode); + } + + return ResponseMsgUtil.success(cmsCategoryService.getCategoryTree(paramMap)); + } catch (Exception e) { + log.error("CmsCategoryController --> getCategoryTree() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getOwnCategoryTree", method = RequestMethod.GET) + @ApiOperation(value = "获取拥有的分类树") + @ResponseBody + public ResponseData getOwnCategoryTree(@RequestParam(value = "roleType", required = false) Integer roleType) { + try { + Map paramMap = new HashMap<>(); + if (roleType != null) { + paramMap.put("roleType", roleType); + } + + return ResponseMsgUtil.success(cmsCategoryService.getOwnCategoryTree(paramMap)); + } catch (Exception e) { + log.error("CmsCategoryController --> getCategoryTree() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getRolesOfCategory", method = RequestMethod.GET) + @ApiOperation(value = "根据id查询 分类角色列表") + @ResponseBody + public ResponseData getRolesOfCategory(@RequestParam(value = "id", required = false) Long id) { + try { + List roleList = new ArrayList<>(); + if (id != null) { + roleList = cmsCategoryService.getRolesOfCategory(id); + } else { + roleList.add(1); + } + + return ResponseMsgUtil.success(roleList); + } catch (Exception e) { + log.error("CmsCategoryController --> getCategoryById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/CmsCategoryModuleController.java b/bweb/src/main/java/com/bweb/controller/CmsCategoryModuleController.java new file mode 100644 index 0000000..307379b --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/CmsCategoryModuleController.java @@ -0,0 +1,220 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.CmsCategoryModule; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.CmsCategoryModuleService; +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.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@Api(value = "内容管理 模板") +@RequestMapping(value = "/cmsCategoryModule") +public class CmsCategoryModuleController { + + private static Logger log = LoggerFactory.getLogger(CmsCategoryModuleController.class); + + @Resource + private UserCenter userCenter; + + @Resource + private CmsCategoryModuleService cmsCategoryModuleService; + + @RequestMapping(value = "/addCategoryModule", method = RequestMethod.POST) + @ApiOperation(value = "增加 模板") + @ResponseBody + public ResponseData addCategoryModule(@RequestBody CmsCategoryModule cmsCategoryModule, + HttpServletRequest request + ) { + try { + if (cmsCategoryModule == null + || cmsCategoryModule.getCategoryId() == null + || StringUtils.isBlank(cmsCategoryModule.getModuleName()) + || StringUtils.isBlank(cmsCategoryModule.getModulePath()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 获取操作者 + SessionObject sessionObject = userCenter.getSessionObject(request); + if(sessionObject == null){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + cmsCategoryModule.setStatus(1); + cmsCategoryModule.setCreateTime(new Date()); + cmsCategoryModule.setOpId(userInfoModel.getSecUser().getId()); + if (cmsCategoryModuleService.addCategoryModule(cmsCategoryModule) > 0) { + return ResponseMsgUtil.success("添加成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ADD_DATA_ERROR, ""); + } + + } catch (Exception e) { + log.error("CmsCategoryModuleController --> addCategoryModule() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateCategoryModule", method = RequestMethod.POST) + @ApiOperation(value = "修改 模板") + @ResponseBody + public ResponseData updateCategoryModule(@RequestBody CmsCategoryModule cmsCategoryModule) { + try { + if (cmsCategoryModule == null + || cmsCategoryModule.getId() == null + || cmsCategoryModule.getCategoryId() == null + || StringUtils.isBlank(cmsCategoryModule.getModuleName()) + || StringUtils.isBlank(cmsCategoryModule.getModulePath()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + CmsCategoryModule categoryModule = cmsCategoryModuleService.getCategoryModuleById(cmsCategoryModule.getId()); + if (categoryModule == null || categoryModule.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CMS_CATEGORY_MODULE_NOT_FOUND, ""); + } + + cmsCategoryModule.setStatus(categoryModule.getStatus()); + cmsCategoryModule.setCreateTime(categoryModule.getCreateTime()); + cmsCategoryModule.setOpId(categoryModule.getOpId()); + if (cmsCategoryModuleService.updateCategoryModule(cmsCategoryModule) > 0) { + return ResponseMsgUtil.success("修改成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsCategoryModuleController --> updateCategoryModule() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delCategoryModule", method = RequestMethod.GET) + @ApiOperation(value = "删除 模板") + @ResponseBody + public ResponseData delCategoryModule(@RequestParam(value = "id", required = true) Long id) { + try { + if (cmsCategoryModuleService.delCategoryModule(id) > 0) { + return ResponseMsgUtil.success("删除成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.DELETE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsCategoryModuleController --> delCategoryModule() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCategoryModuleById", method = RequestMethod.GET) + @ApiOperation(value = "根据id 查询模板") + @ResponseBody + public ResponseData getCategoryModuleById(@RequestParam(value = "id", required = true) Long id) { + try { + return ResponseMsgUtil.success(cmsCategoryModuleService.getCategoryModuleById(id)); + } catch (Exception e) { + log.error("CmsCategoryModuleController --> getCategoryModuleById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getModuleByCategoryId", method = RequestMethod.GET) + @ApiOperation(value = "根据分类id 查询模板列表") + @ResponseBody + public ResponseData getModuleByCategoryId(@RequestParam(value = "categoryId", required = true) Long categoryId) { + try { + Map paramsMap = new HashMap<>(); + paramsMap.put("categoryId", categoryId); + + return ResponseMsgUtil.success(cmsCategoryModuleService.getListCategoryModule(paramsMap)); + } catch (Exception e) { + log.error("CmsCategoryModuleController --> getCategoryModuleById() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getListCategoryModule", method = RequestMethod.GET) + @ApiOperation(value = "查询列表 模板") + @ResponseBody + public ResponseData getListCategoryModule(@RequestParam(value = "categoryId", required = false) Long categoryId, + @RequestParam(value = "categoryCode", required = false) String categoryCode, + @RequestParam(value = "moduleName", required = false) String moduleName, + @RequestParam(value = "status", required = false) Integer status, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map paramsMap = new HashMap<>(); + if (categoryId != null) { + paramsMap.put("categoryId", categoryId); + } + if (StringUtils.isNotBlank(categoryCode)) { + paramsMap.put("categoryCode", categoryCode); + } + if (StringUtils.isNotBlank(moduleName)) { + paramsMap.put("moduleName", moduleName); + } + if (status != null) { + paramsMap.put("status", status); + } + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(cmsCategoryModuleService.getListCategoryModule(paramsMap))); + } catch (Exception e) { + log.error("CmsCategoryModuleController --> getListCategoryModule() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateStatusOfModule", method = RequestMethod.POST) + @ApiOperation(value = "更新 模板状态") + @ResponseBody + public ResponseData updateStatusOfContent(@RequestBody JSONObject jsonObject) { + try { + Long id = jsonObject.getLong("id"); + Integer status = jsonObject.getInteger("status"); + + if (id == null + || status == null + || (status != 1 && status != 2) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + CmsCategoryModule categoryModule = cmsCategoryModuleService.getCategoryModuleById(id); + if (categoryModule == null || categoryModule.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CMS_CATEGORY_MODULE_NOT_FOUND, ""); + } + + categoryModule.setStatus(status); + if (cmsCategoryModuleService.updateCategoryModule(categoryModule) > 0) { + return ResponseMsgUtil.success("修改成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> updateStatusOfContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/CmsContentController.java b/bweb/src/main/java/com/bweb/controller/CmsContentController.java new file mode 100644 index 0000000..03a508d --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/CmsContentController.java @@ -0,0 +1,392 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.bweb.config.SysConfig; +import com.hfkj.entity.CmsContent; +import com.hfkj.entity.CmsPatch; +import com.hfkj.model.CmsContentModel; +import com.hfkj.model.ResponseData; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.CmsContentService; +import com.hfkj.service.CmsPatchService; +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.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.*; + +@Controller +@Api(value = "内容管理 内容发布") +@RequestMapping(value = "/cmsContent") +public class CmsContentController { + + private static Logger log = LoggerFactory.getLogger(CmsContentController.class); + + @Resource + private SysConfig sysConfig; + + @Resource + private UserCenter userCenter; + + @Resource + private CmsContentService cmsContentService; + @Resource + private CmsPatchService cmsPatchService; + + @RequestMapping(value = "/addContent", method = RequestMethod.POST) + @ApiOperation(value = "创建内容") + @ResponseBody + public ResponseData addContent(@RequestBody JSONObject jsonObject, HttpServletRequest request) { + try { + CmsContent cmsContent = jsonObject.getObject("cmsContent", CmsContent.class); + Long moduleId = jsonObject.getLong("moduleId"); + JSONArray jsonArray = jsonObject.getJSONArray("patches"); + List patchList = new ArrayList<>(); + if (jsonArray != null) { + patchList = JSONObject.parseArray(jsonArray.toJSONString(), CmsPatch.class); + } + + if (cmsContent == null + || StringUtils.isBlank(cmsContent.getTitle()) + || cmsContent.getCategoryId() == null + || cmsContent.getStatus() == null + || (cmsContent.getStatus() != 1 && cmsContent.getStatus() != 2) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 获取操作者 + SessionObject sessionObject = userCenter.getSessionObject(request); + if(sessionObject == null){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.SEC_USER_EXPIRED, ""); + } + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + Map paramsMap = new HashMap<>(); + if (moduleId != null) { + paramsMap.put("moduleId", moduleId.toString()); + } + + cmsContent.setCreateTime(new Date()); + cmsContent.setVisitCount(0); + cmsContent.setUpdateTime(cmsContent.getCreateTime()); + cmsContent.setCompanyId(userInfoModel.getBsCompany().getId()); + cmsContent.setOpId(userInfoModel.getSecUser().getId()); + if (cmsContentService.addContent(cmsContent, patchList, paramsMap,sysConfig.getFileUrl()) > 0) { + return ResponseMsgUtil.success("添加成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ADD_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> addContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateContent", method = RequestMethod.POST) + @ApiOperation(value = "修改内容") + @ResponseBody + public ResponseData updateContent(@RequestBody CmsContent cmsContent) { + try { + if (cmsContent == null + || cmsContent.getId() == null + || StringUtils.isBlank(cmsContent.getTitle()) + || cmsContent.getCategoryId() == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + CmsContent content = cmsContentService.getContentById(cmsContent.getId()); + if (content == null || content.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CMS_CONTENT_NOT_FOUND, ""); + } else if (content.getStatus() != 1 && content.getStatus() != 3) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.STATUS_ERROR, ""); + } + + cmsContent.setCreateTime(content.getCreateTime()); + cmsContent.setStatus(content.getStatus()); + cmsContent.setVisitCount(content.getVisitCount()); + cmsContent.setJumpUrl(content.getJumpUrl()); + cmsContent.setUpdateTime(new Date()); + cmsContent.setCompanyId(content.getCompanyId()); + cmsContent.setOpId(content.getOpId()); + if (cmsContentService.updateContent(cmsContent, "updateContent", null,sysConfig.getFileUrl()) > 0) { + return ResponseMsgUtil.success("修改成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> updateContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delContent", method = RequestMethod.GET) + @ApiOperation(value = "删除 内容") + @ResponseBody + public ResponseData delContent(@RequestParam(value = "id", required = true) Long id) { + try { + if (cmsContentService.delContent(id,sysConfig.getFileUrl()) > 0) { + return ResponseMsgUtil.success("删除成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.DELETE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> delContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getContentById", method = RequestMethod.GET) + @ApiOperation(value = "根据id 查询内容基础信息") + @ResponseBody + public ResponseData getContentById(@RequestParam(value = "id", required = true) Long id) { + try { + return ResponseMsgUtil.success(cmsContentService.getContentDetail(id, null)); + } catch (Exception e) { + log.error("CmsContentController --> getContentDetail() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getContentDetail", method = RequestMethod.GET) + @ApiOperation(value = "根据id 查询内容详情(包括附件列表)") + @ResponseBody + public ResponseData getContentDetail(@RequestParam(value = "id", required = true) Long id) { + try { + return ResponseMsgUtil.success(cmsContentService.getContentDetail(id, "queryWithPatches")); + } catch (Exception e) { + log.error("CmsContentController --> getContentDetail() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getListContent", method = RequestMethod.GET) + @ApiOperation(value = "查询内容列表(不包括附件)") + @ResponseBody + public ResponseData getListContent(@RequestParam(value = "title", required = false) String title, + @RequestParam(value = "category", required = false) Long category, + @RequestParam(value = "categoryCode", required = false) String categoryCode, + @RequestParam(value = "tag", required = false) String tag, + @RequestParam(value = "status", required = false) Integer status, + @RequestParam(value = "companyId", required = false) Long companyId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map paramsMap = new HashMap<>(); + if (StringUtils.isNotBlank(title)) { + paramsMap.put("title", title); + } + if (category != null) { + paramsMap.put("category", category.toString()); + } + if (categoryCode != null) { + paramsMap.put("categoryCode", categoryCode); + } + if (StringUtils.isNotBlank(tag)) { + paramsMap.put("tag", tag); + } + if (status != null) { + paramsMap.put("status", status.toString()); + } + if (companyId != null) { + paramsMap.put("companyId", companyId.toString()); + } + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(cmsContentService.getListContent(paramsMap))); + } catch (Exception e) { + log.error("CmsContentController --> getListContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateStatusOfContent", method = RequestMethod.POST) + @ApiOperation(value = "更新 内容发布状态") + @ResponseBody + public ResponseData updateStatusOfContent(@RequestBody JSONObject jsonObject) { + try { + Long id = jsonObject.getLong("id"); + Integer status = jsonObject.getInteger("status"); + Long moduleId = jsonObject.getLong("moduleId"); + + if (id == null + || status == null + || (status != 1 && status != 2 && status != 3) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + CmsContent content = cmsContentService.getContentById(id); + if (content == null || content.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CMS_CONTENT_NOT_FOUND, ""); + } + + Map paramsMap = new HashMap<>(); + if (moduleId != null) { + paramsMap.put("moduleId", moduleId.toString()); + } + + content.setStatus(status); + if (cmsContentService.updateContent(content, "updateStatusOfContent", paramsMap,sysConfig.getFileUrl()) > 0) { + return ResponseMsgUtil.success("修改成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> updateStatusOfContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/updateContentQuantity", method = RequestMethod.GET) + @ApiOperation(value = "内容访问量+1") + @ResponseBody + public ResponseData updateContentQuantity(@RequestParam(value = "id", required = true) Long id) { + try { + CmsContent content = cmsContentService.getContentById(id); + if (content == null || content.getStatus() == 0) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.CMS_CONTENT_NOT_FOUND, ""); + } + + if (content.getVisitCount() != null) { + content.setVisitCount(content.getVisitCount() + 1); + } else { + content.setVisitCount(1); + } + if (cmsContentService.updateContent(content, "updateContent", null,null) > 0) { + return ResponseMsgUtil.success("修改成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.UPDATE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsContentController --> updateContentQuantity() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getListPatches", method = RequestMethod.GET) + @ApiOperation(value = "查询内容附件列表") + @ResponseBody + public ResponseData getListPatches(@RequestParam(value = "contentId", required = true) Long contentId, + @RequestParam(value = "patchType", required = false) Integer patchType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map paramsMap = new HashMap<>(); + if (contentId != null) { + paramsMap.put("contentId", contentId.toString()); + } + if (patchType != null) { + paramsMap.put("patchType", patchType.toString()); + } + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(cmsPatchService.getListPatch(paramsMap))); + } catch (Exception e) { + log.error("CmsContentController --> getListContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCompleteContentList", method = RequestMethod.GET) + @ApiOperation(value = "查询内容列表(包括附件)") + @ResponseBody + public ResponseData getCompleteContentList(@RequestParam(value = "title", required = false) String title, + @RequestParam(value = "category", required = false) Long category, + @RequestParam(value = "categoryCode", required = false) String categoryCode, + @RequestParam(value = "tag", required = false) String tag, + @RequestParam(value = "status", required = false) Integer status, + @RequestParam(value = "companyId", required = false) Long companyId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map paramsMap = new HashMap<>(); + if (StringUtils.isNotBlank(title)) { + paramsMap.put("title", title); + } + if (category != null) { + paramsMap.put("category", category.toString()); + } + if (categoryCode != null) { + paramsMap.put("categoryCode", categoryCode); + } + if (StringUtils.isNotBlank(tag)) { + paramsMap.put("tag", tag); + } + if (status != null) { + paramsMap.put("status", status.toString()); + } + if (companyId != null) { + paramsMap.put("companyId", companyId.toString()); + } + PageHelper.startPage(pageNum, pageSize); + List result = cmsContentService.getListContent(paramsMap); + + // 查询附件列表 + Map params = new HashMap<>(); + List patchList = cmsPatchService.getListPatch(params); + // 将附件按类型挂到对应的内容 + for (CmsContentModel item : result) { + item.setPictures(new ArrayList<>()); + item.setMusics(new ArrayList<>()); + item.setVideos(new ArrayList<>()); + item.setDocuments(new ArrayList<>()); + item.setOthers(new ArrayList<>()); + + patchList.stream().filter(patch -> item.getId().equals(patch.getContentId())) + .forEach(patch -> { + switch (patch.getPatchType()){ + case 1: + item.getPictures().add(patch); + break; + case 2: + item.getMusics().add(patch); + break; + case 3: + item.getVideos().add(patch); + break; + case 4: + item.getDocuments().add(patch); + break; + case 5: + item.getOthers().add(patch); + break; + } + }); + } + + return ResponseMsgUtil.success(new PageInfo<>(result)); + } catch (Exception e) { + log.error("CmsContentController --> getListContent() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/getCorporateAdvertising", method = RequestMethod.GET) + @ApiOperation(value = "查询首页轮播图") + @ResponseBody + public ResponseData getCorporateAdvertising() { + try { + return ResponseMsgUtil.success(cmsContentService.getCorporateAdvertising()); + } catch (Exception e) { + log.error("CmsContentController --> getCorporateAdvertising() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/bweb/src/main/java/com/bweb/controller/CmsPatchController.java b/bweb/src/main/java/com/bweb/controller/CmsPatchController.java new file mode 100644 index 0000000..3d7e4f1 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/CmsPatchController.java @@ -0,0 +1,73 @@ +package com.bweb.controller; + + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.CmsPatch; +import com.hfkj.model.ResponseData; +import com.hfkj.service.CmsPatchService; +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.*; + +import javax.annotation.Resource; +import java.util.Date; + +@Controller +@RequestMapping(value = "/cmsPatch") +@Api(value = "内容管理->附件") +public class CmsPatchController { + + private static Logger log = LoggerFactory.getLogger(CmsPatchController.class); + @Resource + private CmsPatchService cmsPatchService; + + @RequestMapping(value = "/addPatch", method = RequestMethod.POST) + @ApiOperation(value = "添加 附件") + @ResponseBody + public ResponseData addPatch(@RequestBody CmsPatch cmsPatch) { + try { + if (cmsPatch == null + || cmsPatch.getContentId() == null + || StringUtils.isBlank(cmsPatch.getPatchName()) + || cmsPatch.getPatchType() == null + || StringUtils.isBlank(cmsPatch.getPatchPath()) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + cmsPatch.setAddTime(new Date()); + if (cmsPatchService.addPatch(cmsPatch) > 0) { + return ResponseMsgUtil.success("添加成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ADD_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsPatchController --> addPatch() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value = "/delPatch", method = RequestMethod.GET) + @ApiOperation(value = "删除附件") + @ResponseBody + public ResponseData delPatch(@RequestParam(value = "id", required = true) Long id) { + try { + if (cmsPatchService.delPatch(id) > 0) { + return ResponseMsgUtil.success("删除成功"); + } else { + throw ErrorHelp.genException(SysCode.System, ErrorCode.DELETE_DATA_ERROR, ""); + } + } catch (Exception e) { + log.error("CmsPatchController --> delPatch() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/CommonController.java b/bweb/src/main/java/com/bweb/controller/CommonController.java new file mode 100644 index 0000000..6997384 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/CommonController.java @@ -0,0 +1,52 @@ +package com.bweb.controller; + +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.service.sec.SecDictionaryService; +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.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; + +@Controller +@RequestMapping(value="/common") +@Api(value="共用接口") +public class CommonController { + Logger log = LoggerFactory.getLogger(CommonController.class); + @Resource + private SecDictionaryService secDictionaryService; + + @RequestMapping(value="/queryDictionary",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询数据字典") + public ResponseData queryDictionary(@RequestParam(value = "codeType" , required = false) String codeType, + @RequestParam(value = "codeValue" , required = false) String codeValue) { + try { + + if (StringUtils.isBlank(codeType) && StringUtils.isBlank(codeValue)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary()); + + } else if (StringUtils.isNotBlank(codeType) && StringUtils.isNotBlank(codeValue)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary(codeType, codeValue)); + + } else if (StringUtils.isNotBlank(codeType)) { + return ResponseMsgUtil.success(secDictionaryService.getDictionary(codeType)); + } + + return ResponseMsgUtil.success(null); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/bweb/controller/FileUploadController.java b/bweb/src/main/java/com/bweb/controller/FileUploadController.java new file mode 100644 index 0000000..e9b2e31 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/FileUploadController.java @@ -0,0 +1,138 @@ +package com.bweb.controller; + +import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.bweb.config.SysConfig; +import com.hfkj.model.ResponseData; +import com.hfkj.service.FileUploadService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.multipart.commons.CommonsMultipartResolver; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.File; +import java.io.FileOutputStream; +import java.util.*; + +@RestController +@RequestMapping(value="/fileUpload") +@Api(value="文件上传") +public class FileUploadController { + + private static Logger log = LoggerFactory.getLogger(FileUploadController.class); + + @Resource + private SysConfig sysConfig; + + @Resource + private FileUploadService fileUploadService; + + @RequestMapping(value="/uploadfile",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "文件上传") + public ResponseData uploadFile(@RequestParam(value = "files" , required = false) MultipartFile files, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + try { + response.setHeader("Access-Control-Allow-Origin", "*"); + CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver( + request.getSession().getServletContext()); + // 判断 request 是否有文件上传,即多部分请求 + List fileNames = new ArrayList(); + if (multipartResolver.isMultipart(request)) { + // 转换成多部分request + MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request; + Iterator iterator = multiRequest.getFileNames(); + + while (iterator.hasNext()) { + MultipartFile file = multiRequest.getFile(iterator.next()); + if (file != null) { + FileOutputStream out = null; + try { + String fileType = file.getOriginalFilename() + .substring(file.getOriginalFilename().lastIndexOf(".") + 1); + String fileName = file.getOriginalFilename().substring(0, file.getOriginalFilename().lastIndexOf(".")) + System.currentTimeMillis() + "." + fileType; + String childPath = DateUtil.date2String(new Date(), "yyyyMM"); + String destDirName = sysConfig.getFileUrl() + File.separator + childPath; + File dir = new File(destDirName); + if (!dir.exists()) { + dir.mkdirs(); + } + out = new FileOutputStream(destDirName + File.separator + fileName); + out.write(file.getBytes()); + out.flush(); + fileNames.add(childPath + "/" + fileName); + } catch (Exception e) { + log.error(e.getMessage(), e); + } finally { + if (out != null) { + out.close(); + } + } + } + } + } + return ResponseMsgUtil.success(fileNames); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + + } + + @RequestMapping(value = "/fileUpload", method = RequestMethod.POST) + @ApiOperation(value = "上传文件(新接口)") + @ResponseBody + public ResponseData fileUpload(@RequestParam(name = "requestFile") MultipartFile requestFile, + @RequestParam(value = "uploadType", required = true) String uploadType, + HttpServletRequest request + ) { + try { + CommonsMultipartResolver multipartResolver = + new CommonsMultipartResolver(request.getSession().getServletContext()); + + // 提取文件列表 + List files = new ArrayList<>(); + if (multipartResolver.isMultipart(request)) { + MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request; + Iterator iterator = multiRequest.getFileNames(); + + while (iterator.hasNext()) { + MultipartFile file = multiRequest.getFile(iterator.next()); + files.add(file); + } + } + + // 定制参数 + Map paramsMap = new HashMap<>(); + if ("cmsModule".equals(uploadType)) { + paramsMap.put("pathPrefix", sysConfig.getFileUrl()); + paramsMap.put("childPath", "/CMS/module/"); + paramsMap.put("fileNameGenerator", "generateFileNameAndTimeStamp"); + } else if ("cmsPatch".equals(uploadType)) { + paramsMap.put("pathPrefix", sysConfig.getFileUrl()); + paramsMap.put("childPath", "/CMS/html/"); + paramsMap.put("fileNameGenerator", "generateFileNameAndTimeStamp"); + } else if ("cmsImg".equals(uploadType)) { + paramsMap.put("pathPrefix", sysConfig.getFileUrl()); + paramsMap.put("childPath", "/CMS/img/"); + paramsMap.put("fileNameGenerator", "generateFileNameAndTimeStamp"); + } + + return ResponseMsgUtil.success(fileUploadService.upload(files, paramsMap)); + } catch (Exception e) { + log.error("FileUploadController --> addCategoryModule() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/LoginController.java b/bweb/src/main/java/com/bweb/controller/LoginController.java new file mode 100644 index 0000000..673eeb5 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/LoginController.java @@ -0,0 +1,98 @@ +package com.bweb.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.*; +import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.*; +import com.hfkj.model.MenuTreeModel; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.UserInfoModel; +import com.hfkj.service.*; +import com.hfkj.service.sec.SecUserService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +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 javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@Controller +@RequestMapping(value = "/login") +@Api(value = "登录") +public class LoginController { + + Logger log = LoggerFactory.getLogger(SecUserController.class); + @Resource + private SecUserService secUserService; + + @Resource + private UserCenter userCenter; + + @RequestMapping(value="/login",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "登录") + public ResponseData login(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("loginName")) + || StringUtils.isBlank(body.getString("password")) + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + return ResponseMsgUtil.success(secUserService.login(body.getString("loginName"), body.getString("password"))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryUser",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询账户") + public ResponseData queryUser() { + try { + + return ResponseMsgUtil.success(userCenter.getSessionModel(SecUserSessionObject.class)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/loginOut",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "退出登录") + public ResponseData loginOut(HttpServletRequest request) { + try { + try { + SecUserSessionObject session = userCenter.getSessionModel(SecUserSessionObject.class); + if (session != null) { + userCenter.remove(request); + } + } catch (Exception e) {} + return ResponseMsgUtil.success("退出成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/bweb/src/main/java/com/bweb/controller/SecMenuController.java b/bweb/src/main/java/com/bweb/controller/SecMenuController.java new file mode 100644 index 0000000..a2e6e2e --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/SecMenuController.java @@ -0,0 +1,295 @@ +package com.bweb.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.ResponseMsgUtil; +import com.hfkj.entity.SecMenu; +import com.hfkj.model.ResponseData; +import com.hfkj.service.SecMenuService; +import com.hfkj.service.SecRoleMenuRelService; +import com.hfkj.sysenum.SecMenuTypeEnum; +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.*; + +import javax.annotation.Resource; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @className: SecMenu + * @author: HuRui + * @date: 2024/3/28 + **/ +@Controller +@RequestMapping(value="/secMenu") +@Api(value="系统菜单管理") +public class SecMenuController { + + Logger log = LoggerFactory.getLogger(SecUserController.class); + + @Resource + private SecMenuService secMenuService; + @Resource + private SecRoleMenuRelService secRoleMenuRelService; + + @RequestMapping(value="/editMenu",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑菜单") + public ResponseData editMenu(@RequestBody SecMenu body) { + try { + if (body == null + || body.getMenuType() == null + || StringUtils.isBlank(body.getMenuName()) + || StringUtils.isBlank(body.getMenuUrl()) + || body.getMenuSort() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + SecMenu secMenu; + + if (body.getId() != null) { + // 查询菜单 + secMenu = secMenuService.queryDetail(body.getId()); + if (secMenu == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + secMenu = new SecMenu(); + } + if (secMenu.getMenuPSid() != null) { + // 查询父类菜单 + SecMenu parentMenu = secMenuService.queryDetail(secMenu.getMenuPSid()); + if (parentMenu == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } + + secMenu.setMenuType(body.getMenuType()); + secMenu.setMenuName(body.getMenuName()); + secMenu.setMenuUrl(body.getMenuUrl()); + secMenu.setMenuUrlImg(body.getMenuUrlImg()); + secMenu.setMenuPSid(body.getMenuPSid()); + secMenu.setMenuSort(body.getMenuSort()); + secMenu.setMenuDesc(body.getMenuDesc()); + if (secMenu.getId() == null) { + secMenuService.create(secMenu); + } else { + secMenuService.update(secMenu); + } + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryDetail",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询详情") + public ResponseData queryDetail(@RequestParam(value = "menuId" , required = true) Long menuId) { + try { + + return ResponseMsgUtil.success(secMenuService.queryDetail(menuId)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delMenu",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除菜单") + public ResponseData delMenu(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("menuId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + secMenuService.delete(body.getLong("menuId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/assignMenu",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "分配菜单") + public ResponseData assignMenu(@RequestBody JSONObject body) { + try { + if (body == null + || body.getLong("roleId") == null + || body.getJSONArray("menuIds").isEmpty()) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + List list = body.getJSONArray("menuIds") + .stream().map(o -> Long.parseLong(o.toString())) + .collect(Collectors.toList()); + + secMenuService.assignMenu(body.getLong("roleId"),list ); + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryMenuList",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询菜单列表") + public ResponseData queryMenuList() { + try { + + return ResponseMsgUtil.success(secMenuService.getAllList()); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryRoleMenuArray",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询分配菜单树") + public ResponseData queryRoleMenuArray(@RequestParam(value = "roleId" , required = true) Long roleId) { + try { + + // 查询角色菜单权限 + Map roleMenu = secMenuService.queryRoleMenu(roleId, SecMenuTypeEnum.type1).stream() + .collect(Collectors.toMap(SecMenu::getId, Function.identity())); + + // 系统菜单叶节点 + List menuLeafList = new ArrayList<>(); + + // 角色菜单叶节点 + List roleLeafList = new ArrayList<>(); + + // 获取全部菜单 + List menuList = secMenuService.getAllList(); + + // 获取最顶层菜单 + List topLevelMenuList = menuList.stream() + .filter(o -> o.getMenuPSid() == null) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + // 递归获取系统菜单叶子节点 + for (SecMenu topLevelMenu : topLevelMenuList) { + if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + recursionMenu(menuList, topLevelMenu.getId(), menuLeafList); + } + } + + // 筛选角色菜单叶节点 + for (String leaf : menuLeafList) { + SecMenu menu = roleMenu.get(Long.parseLong(leaf)); + if (menu != null) { + roleLeafList.add(""+menu.getId()); + } + } + + return ResponseMsgUtil.success(roleLeafList); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryRoleMenuTree",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询角色菜单树") + public ResponseData queryRoleMenuTree(@RequestParam(value = "roleId" , required = false) Long roleId) { + try { + + return ResponseMsgUtil.success(secMenuService.queryMenuTree(roleId)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryMenuTree",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "查询角色菜单树") + public ResponseData queryMenuTree() { + try { + List> mapList = new ArrayList<>(); + Map map; + + // 获取全部菜单 + List menuList = secMenuService.getAllList(); + + // 获取最顶层菜单 + List topLevelMenuList = menuList.stream() + .filter(o -> o.getMenuPSid() == null) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + + for (SecMenu topLevelMenu : topLevelMenuList) { + if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + map = new LinkedHashMap<>(); + map.put("key", ""+topLevelMenu.getId()); + map.put("title", topLevelMenu.getMenuName()); + // 获取下级菜单 + map.put("children", recursionMenu(menuList, topLevelMenu.getId(), new ArrayList<>())); + mapList.add(map); + } + } + + return ResponseMsgUtil.success(mapList); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + /** + * 递归获取菜单 + * @param dataSource 数据源 + * @param parentMenuId 父级菜单id + * @return + */ + public List> recursionMenu(List dataSource, Long parentMenuId, List leaf) { + List> mapList = new ArrayList<>(); + Map map; + + List collect = dataSource.stream() + .filter(o -> o.getMenuPSid() != null && o.getMenuPSid().equals(parentMenuId)) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + for (SecMenu menu : collect) { + if (menu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + map = new LinkedHashMap<>(); + map.put("key", ""+menu.getId()); + map.put("title", menu.getMenuName()); + // 获取下级菜单 + List> recursioned = recursionMenu(dataSource, menu.getId(), leaf); + if (recursioned.isEmpty()) { + leaf.add(""+menu.getId()); + map.put("isLeaf", true); + } else { + map.put("children", recursioned); + } + mapList.add(map); + } + } + return mapList; + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/SecRoleController.java b/bweb/src/main/java/com/bweb/controller/SecRoleController.java new file mode 100644 index 0000000..7bcd380 --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/SecRoleController.java @@ -0,0 +1,139 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.SecRole; +import com.hfkj.model.ResponseData; +import com.hfkj.service.SecRoleService; +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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +/** + * @className: SecRoleController + * @author: HuRui + * @date: 2024/3/27 + **/ +@Controller +@RequestMapping(value="/secRole") +@Api(value="系统用户角色管理") +public class SecRoleController { + + Logger log = LoggerFactory.getLogger(SecUserController.class); + + @Resource + private SecRoleService secRoleService; + + @RequestMapping(value="/editRole",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑角色") + public ResponseData editRole(@RequestBody SecRole body) { + try { + if (body == null || StringUtils.isBlank(body.getRoleName())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + SecRole secRole; + if (body.getId() != null) { + // 查询角色 + secRole = secRoleService.getDetail(body.getId()); + if (secRole == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + } else { + secRole = new SecRole(); + secRole.setStatus(1); + } + secRole.setRoleName(body.getRoleName()); + secRole.setRoleDesc(body.getRoleDesc()); + secRoleService.editData(secRole); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delRole",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除角色") + public ResponseData delRole(@RequestBody SecRole body) { + try { + if (body == null || body.getId() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + secRoleService.delete(body.getId()); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询详情") + public ResponseData queryDetail(@RequestParam(value = "roleId" , required = true) Long roleId) { + try { + + secRoleService.delete(roleId); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData queryList(@RequestParam(value = "roleName" , required = false) String roleName, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize) { + try { + Map param = new HashMap<>(); + param.put("roleName", roleName); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(secRoleService.getList(param))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryAllRole",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询全部角色") + public ResponseData queryAllRole() { + try { + + return ResponseMsgUtil.success(secRoleService.getList(new HashMap<>())); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/java/com/bweb/controller/SecUserController.java b/bweb/src/main/java/com/bweb/controller/SecUserController.java new file mode 100644 index 0000000..703005f --- /dev/null +++ b/bweb/src/main/java/com/bweb/controller/SecUserController.java @@ -0,0 +1,251 @@ +package com.bweb.controller; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.ResponseMsgUtil; +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 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.*; + +import javax.annotation.Resource; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/secUser") +@Api(value="系统用户管理") +public class SecUserController { + Logger log = LoggerFactory.getLogger(SecUserController.class); + + @Resource + private SecUserService secUserService; + @Resource + private SecUserLoginLogService secUserLoginLogService; + + @RequestMapping(value="/editUser",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑用户") + public ResponseData editUser(@RequestBody JSONObject body) { + try { + if (body == null + || StringUtils.isBlank(body.getString("userName")) + || StringUtils.isBlank(body.getString("loginName")) + || body.getLong("roleId") == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + SecUser secUser; + if (body.getLong("id") != null) { + // 查询账户 + secUser = secUserService.getDetail(body.getLong("id")); + // 校验重复登录账户 + SecUser user = secUserService.getDetailByLoginName(body.getString("loginName")); + if (user != null && !user.getId().equals(body.getLong("id"))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户已存在"); + } + } else { + secUser = new SecUser(); + secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setObjectType(SecUserObjectTypeEnum.type1.getCode()); + secUser.setStatus(SecUserStatusEnum.status1.getCode()); + + // 校验重复登录账户 + if (secUserService.getDetailByLoginName(body.getString("loginName")) != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户已存在"); + } + } + + secUser.setUserName(body.getString("userName")); + secUser.setLoginName(body.getString("loginName")); + secUser.setTelephone(body.getString("telephone")); + secUser.setRoleId(body.getLong("roleId")); + secUserService.editUser(secUser); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/delete",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "删除用户") + public ResponseData delete(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("userId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询用户详情 + SecUser secUser = secUserService.getDetail(body.getLong("userId")); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + secUser.setStatus(SecUserStatusEnum.status0.getCode()); + secUserService.editUser(secUser); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/restore",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "恢复") + public ResponseData restore(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("userId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询用户详情 + SecUser secUser = secUserService.getDetail(body.getLong("userId")); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + secUser.setStatus(SecUserStatusEnum.status1.getCode()); + secUserService.editUser(secUser); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/resetPwd",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "账户密码重置") + public ResponseData resetPwd(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("userId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + secUserService.resetPwd(body.getLong("userId")); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/disable",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "禁用") + public ResponseData disable(@RequestBody JSONObject body) { + try { + if (body == null || body.getLong("userId") == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + // 查询用户详情 + SecUser secUser = secUserService.getDetail(body.getLong("userId")); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + secUser.setStatus(SecUserStatusEnum.status2.getCode()); + secUserService.editUser(secUser); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryDetail",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询详情") + public ResponseData queryDetail(@RequestParam(value = "userId" , required = true) Long userId) { + try { + // 查询详情 + SecUser secUser = secUserService.getDetail(userId); + if (secUser != null) { + secUser.setPassword(null); + } + return ResponseMsgUtil.success(secUser); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/queryList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData queryList(@RequestParam(value = "userName", required = false) String userName, + @RequestParam(value = "loginName", required = false) String loginName, + @RequestParam(value = "telephone", required = false) String telephone, + @RequestParam(value = "objectType", required = false) Integer objectType, + @RequestParam(value = "status", required = false) Integer status, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("userName", userName); + param.put("loginName", loginName); + param.put("telephone", telephone); + param.put("objectType", objectType); + param.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(secUserService.getList(param))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/queryLoginLogList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询登录日志列表") + public ResponseData queryLoginLogList(@RequestParam(value = "userId", required = true) String userId, + @RequestParam(value = "status", required = false) Integer status, + @RequestParam(value = "pageNum", required = true) Integer pageNum, + @RequestParam(value = "pageSize", required = true) Integer pageSize) { + try { + + Map param = new HashMap<>(); + param.put("userId", userId); + param.put("status", status); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(secUserLoginLogService.getLogList(param)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/bweb/src/main/resources/dev/application.yml b/bweb/src/main/resources/dev/application.yml new file mode 100644 index 0000000..fc387be --- /dev/null +++ b/bweb/src/main/resources/dev/application.yml @@ -0,0 +1,80 @@ +server: + port: 9802 + servlet: + context-path: /brest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.9.154.68:3306/hai_oil?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + redis: + database: 0 + host: 139.9.154.68 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true + +jetcache: + statIntervalMinutes: 15 + areaInCacheName: false + local: + default: + type: linkedhashmap + keyConvertor: fastjson + remote: + default: + type: redis + host: 139.9.154.68 + port: 36379 + password: HF123456.Redis + database: 0 + keyConvertor: fastjson + broadcastChannel: projectA + valueEncoder: java + valueDecoder: java + poolConfig: + minIdle: 5 + maxIdle: 20 + maxTotal: 50 + +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/bweb/src/main/resources/dev/config.properties b/bweb/src/main/resources/dev/config.properties new file mode 100644 index 0000000..29bda5b --- /dev/null +++ b/bweb/src/main/resources/dev/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/oil/filesystem +cmsPath=/home/project/oil/filesystem/cmsPath diff --git a/bweb/src/main/resources/dev/logback.xml b/bweb/src/main/resources/dev/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/bweb/src/main/resources/dev/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/bweb/src/main/resources/pre/application.yml b/bweb/src/main/resources/pre/application.yml new file mode 100644 index 0000000..4c2e5f6 --- /dev/null +++ b/bweb/src/main/resources/pre/application.yml @@ -0,0 +1,56 @@ +server: + port: 9302 + servlet: + context-path: /brest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + redis: + database: 1 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/bweb/src/main/resources/pre/config.properties b/bweb/src/main/resources/pre/config.properties new file mode 100644 index 0000000..44ea8fc --- /dev/null +++ b/bweb/src/main/resources/pre/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/hsg/filesystem +cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/bweb/src/main/resources/pre/logback.xml b/bweb/src/main/resources/pre/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/bweb/src/main/resources/pre/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/bweb/src/main/resources/prod/application.yml b/bweb/src/main/resources/prod/application.yml new file mode 100644 index 0000000..18a5cc0 --- /dev/null +++ b/bweb/src/main/resources/prod/application.yml @@ -0,0 +1,57 @@ +server: + port: 9302 + servlet: + context-path: /brest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + redis: + database: 0 + host: 127.0.0.1 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true + +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/bweb/src/main/resources/prod/config.properties b/bweb/src/main/resources/prod/config.properties new file mode 100644 index 0000000..44ea8fc --- /dev/null +++ b/bweb/src/main/resources/prod/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/hsg/filesystem +cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/bweb/src/main/resources/prod/logback.xml b/bweb/src/main/resources/prod/logback.xml new file mode 100644 index 0000000..e509de0 --- /dev/null +++ b/bweb/src/main/resources/prod/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/bweb/src/test/common/DemoDataListener.java b/bweb/src/test/common/DemoDataListener.java new file mode 100644 index 0000000..1612a14 --- /dev/null +++ b/bweb/src/test/common/DemoDataListener.java @@ -0,0 +1,34 @@ +package common; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/20 20:51 + */ +public class DemoDataListener extends AnalysisEventListener { + + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + + List list = new ArrayList<>(); + + @Override + public void invoke(ExcelModel excelModel, AnalysisContext analysisContext) { + System.out.println(JSON.toJSONString(excelModel)); + list.add(excelModel); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + LOGGER.info("所有数据解析完成!"); + System.out.println("所有数据解析完成"); + } +} diff --git a/bweb/src/test/common/ExcelModel.java b/bweb/src/test/common/ExcelModel.java new file mode 100644 index 0000000..363a791 --- /dev/null +++ b/bweb/src/test/common/ExcelModel.java @@ -0,0 +1,22 @@ +package common; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/20 20:26 + */ +public class ExcelModel { + + @ExcelProperty("二维码地址") + private String codeUrl; + + public String getCodeUrl() { + return codeUrl; + } + + public void setCodeUrl(String codeUrl) { + this.codeUrl = codeUrl; + } +} diff --git a/bweb/src/test/common/ExcelTest.java b/bweb/src/test/common/ExcelTest.java new file mode 100644 index 0000000..37215cc --- /dev/null +++ b/bweb/src/test/common/ExcelTest.java @@ -0,0 +1,44 @@ +package common; + +import com.BWebApplication; +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSON; +import com.hfkj.entity.SecRegion; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/20 20:26 + */ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest(classes = BWebApplication.class) +@WebAppConfiguration +public class ExcelTest { + + + @Test + public void test(){ + try { + + List list = new ArrayList<>(); + EasyExcel.read("F:\\卡券列表记录.xlsx", ExcelModel.class, new DemoDataListener()).sheet().doRead(); + + + }catch (Exception e){ + e.printStackTrace(); + } + } + +} diff --git a/bweb/src/test/common/RegionTest.java b/bweb/src/test/common/RegionTest.java new file mode 100644 index 0000000..254a7dd --- /dev/null +++ b/bweb/src/test/common/RegionTest.java @@ -0,0 +1,106 @@ +package common; + +import com.BWebApplication; +import com.alibaba.excel.EasyExcel; +import com.alibaba.fastjson.JSON; +import com.hfkj.common.Base64Util; +import com.hfkj.common.security.AESEncodeUtil; +import com.hfkj.entity.HighDiscountAgentCode; +import com.hfkj.entity.SecRegion; +import com.hfkj.service.CommonService; + +import com.hfkj.service.HighDiscountAgentCodeService; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +import javax.annotation.Resource; +import java.io.FileOutputStream; +import java.io.OutputStreamWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @ClassName RegionTest + * @Description: TODO () + * @Author 胡锐 + * @Date 2020/12/29 + **/ +@RunWith(SpringJUnit4ClassRunner.class) +@SpringBootTest(classes = BWebApplication.class) +@WebAppConfiguration +public class RegionTest { + + @Resource + private CommonService commonService; + + @Resource + private HighDiscountAgentCodeService highDiscountAgentCodeService; + + @Test + public void addLogs(){ + try { + OutputStreamWriter osw = new OutputStreamWriter(new FileOutputStream("exampleWrite.json"),"UTF-8"); + List> jobTypeList = new ArrayList<>(); + List> children1; + + List parentRegion = commonService.getCities(); + for (SecRegion parent : parentRegion) { + Map map = new HashMap<>(); + map.put("value", parent.getRegionId()); + map.put("label", parent.getRegionName()); + + // 查询二级 + List chinRegion = commonService.getRegionsByParentId(parent.getRegionId()); + children1 = new ArrayList<>(); + for (SecRegion chin : chinRegion) { + Map map1 = new HashMap<>(); + map1.put("value", chin.getRegionId()); + map1.put("label", chin.getRegionName()); + children1.add(map1); + } + + map.put("children", children1); + jobTypeList.add(map); + } + + osw.write(JSON.toJSONString(jobTypeList)); + osw.flush();//清空缓冲区,强制输出数据 + osw.close();//关闭输出流 + }catch (Exception e){ + e.printStackTrace(); + } + } + + @Test + public void simpleWrite() throws Exception { + // 写法1 + String fileName = "D:\\simpleWrite.xlsx"; + + + Map paramMap = new HashMap<>(); + paramMap.put("discountAgentId", ""); + List codeList = highDiscountAgentCodeService.getDiscountCode(paramMap); + + List list = new ArrayList<>(); + ExcelModel excelModel; + + Map map = new HashMap<>(); + map.put("type", "DISCOUNT"); + + for (HighDiscountAgentCode code : codeList) { + excelModel = new ExcelModel(); + map.put("id", code.getId()); + String param = "https://hsg.dctpay.com/wx/?action=gogogo&id=" + Base64Util.encode(AESEncodeUtil.aesEncrypt(JSON.toJSONString(map))); + excelModel.setCodeUrl(param); + list.add(excelModel); + } + // 这里 需要指定写用哪个class去写,然后写到第一个sheet,名字为模板 然后文件流会自动关闭 + // 如果这里想使用03 则 传入excelType参数即可 + EasyExcel.write(fileName, ExcelModel.class).sheet("模板").doWrite(list); + } +} diff --git a/cweb/pom.xml b/cweb/pom.xml new file mode 100644 index 0000000..e5322d6 --- /dev/null +++ b/cweb/pom.xml @@ -0,0 +1,45 @@ + + + + com.hfkj + hai-oil-parent + 1.0-SNAPSHOT + + 4.0.0 + + com.hfkj + oil-cweb + + + + com.hfkj + service + PACKT-SNAPSHOT + + + + + + + src/main/resources/${env} + false + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/cweb/src/main/java/com/CWebApplication.java b/cweb/src/main/java/com/CWebApplication.java new file mode 100644 index 0000000..de6b8a0 --- /dev/null +++ b/cweb/src/main/java/com/CWebApplication.java @@ -0,0 +1,26 @@ +package com; + +import com.hfkj.common.utils.SpringContextUtil; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.ApplicationContext; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +//@ComponentScan +@EnableTransactionManagement +@EnableScheduling +@ServletComponentScan +@MapperScan("com.hfkj.dao") +public class CWebApplication +{ + public static void main( String[] args ) + { + ApplicationContext app = SpringApplication.run(CWebApplication.class, args); + SpringContextUtil.setApplicationContext(app); + } + +} diff --git a/cweb/src/main/java/com/cweb/config/AuthConfig.java b/cweb/src/main/java/com/cweb/config/AuthConfig.java new file mode 100644 index 0000000..5441d5d --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -0,0 +1,127 @@ +package com.cweb.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.UserCenter; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.multipart.support.StandardMultipartHttpServletRequest; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +@Configuration +public class AuthConfig implements WebMvcConfigurer { + + private static Logger log = LoggerFactory.getLogger(AuthConfig.class); + + @Resource + private UserCenter userCenter; + + /** + * 获取配置文件debug变量 + */ + @Value("${debug}") + private boolean debug = false; + + /** + * 解决18位long类型数据转json失去精度问题 + * @param converters + */ + @Override + public void configureMessageConverters(List> converters){ + MappingJackson2HttpMessageConverter jsonConverter = new MappingJackson2HttpMessageConverter(); + + ObjectMapper objectMapper = jsonConverter.getObjectMapper(); + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(Long.class, ToStringSerializer.instance); + simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance); + objectMapper.registerModule(simpleModule); + + converters.add(jsonConverter); + } + + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(new HandlerInterceptorAdapter() { + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, + Object handler) throws Exception { + if(debug){ + return true; + } + String token = request.getHeader("Authorization"); + if(StringUtils.isNotBlank(token) && userCenter.isLogin(token)){//如果未登录,将无法使用任何接口 + return true; + } else if(request instanceof StandardMultipartHttpServletRequest) { + StandardMultipartHttpServletRequest re = (StandardMultipartHttpServletRequest)request; + if(userCenter.isLogin(re.getRequest())){ + return true; + } else { + log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL()); + response.setStatus(401); + return false; + } + } else{ + log.error("the user is not logged in,remoteAddr:"+getIpAddress(request)+",requestUrl:"+request.getRequestURL()); + response.setStatus(401); + return false; + } + } + }) + .addPathPatterns("/**") + .excludePathPatterns("/swagger-resources/**") + .excludePathPatterns("/**/api-docs") + .excludePathPatterns("/**/springfox-swagger-ui/**") + .excludePathPatterns("/**/swagger-ui.html") + .excludePathPatterns("/client/*") + .excludePathPatterns("/sms/*") + .excludePathPatterns("/secUser/login") + .excludePathPatterns("/secUser/loginOut") + ; + } + + public String getIpAddress(HttpServletRequest request) { + // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 + String ip = request.getHeader("X-Forwarded-For"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + for (int index = 0; index < ips.length; index++) { + String strIp = ips[index]; + if (!("unknown".equalsIgnoreCase(strIp))) { + ip = strIp; + break; + } + } + } + return ip; + } + +} diff --git a/cweb/src/main/java/com/cweb/config/ConfigListener.java b/cweb/src/main/java/com/cweb/config/ConfigListener.java new file mode 100644 index 0000000..cb92b19 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/ConfigListener.java @@ -0,0 +1,25 @@ +package com.cweb.config; + +import org.springframework.beans.factory.annotation.Autowired; + +import javax.annotation.Resource; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +@WebListener +public class ConfigListener implements ServletContextListener { + + @Resource + private SysConfig sysConfig; + + @Override + public void contextInitialized(ServletContextEvent sce) { + SysConst.setSysConfig(sysConfig); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + } + +} diff --git a/cweb/src/main/java/com/cweb/config/CorsConfig.java b/cweb/src/main/java/com/cweb/config/CorsConfig.java new file mode 100644 index 0000000..14e87c0 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/CorsConfig.java @@ -0,0 +1,49 @@ +package com.cweb.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName CorsConfig + * @Description: TODO () + * @Author 胡锐 + * @Date 2020/12/16 + **/ +@Configuration +public class CorsConfig extends WebMvcConfigurerAdapter { + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowCredentials(true) + .allowedMethods("GET", "POST", "DELETE", "PUT") + .maxAge(3600); + } + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + List list = new ArrayList<>(); + list.add("*"); + corsConfiguration.setAllowedOrigins(list); + /* + // 请求常用的三种配置,*代表允许所有,当时你也可以自定义属性(比如header只能带什么,只能是post方式等等) + */ + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + return corsConfiguration; + } + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); + return new CorsFilter(source); + } +} diff --git a/cweb/src/main/java/com/cweb/config/MultipartConfig.java b/cweb/src/main/java/com/cweb/config/MultipartConfig.java new file mode 100644 index 0000000..97794e9 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/MultipartConfig.java @@ -0,0 +1,26 @@ +package com.cweb.config; + +import org.springframework.boot.web.servlet.MultipartConfigFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import javax.servlet.MultipartConfigElement; + +@Configuration +public class MultipartConfig { + + /** + * 文件上传配置 + * @return + */ + @Bean + public MultipartConfigElement multipartConfigElement() { + MultipartConfigFactory factory = new MultipartConfigFactory(); + //文件最大 + factory.setMaxFileSize("300MB"); //KB,MB + //设置总上传数据总大小 + factory.setMaxRequestSize("350MB"); + return factory.createMultipartConfig(); + } + +} diff --git a/cweb/src/main/java/com/cweb/config/RedisConfig.java b/cweb/src/main/java/com/cweb/config/RedisConfig.java new file mode 100644 index 0000000..c6db7fc --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/RedisConfig.java @@ -0,0 +1,110 @@ +package com.cweb.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + + +@Configuration +@EnableCaching //开启注解 +public class RedisConfig extends CachingConfigurerSupport { + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + + RedisTemplate template = new RedisTemplate<>(); + // 配置连接工厂 + template.setConnectionFactory(factory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) + Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); + + ObjectMapper om = new ObjectMapper(); + // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jacksonSeial.setObjectMapper(om); + + // 值采用json序列化 + template.setValueSerializer(jacksonSeial); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + + // 设置hash key 和value序列化模式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(jacksonSeial); + template.afterPropertiesSet(); + + return template; + } + + /** + * 对hash类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + /** + * 对redis字符串类型数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + /** + * 对链表类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + /** + * 对无序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + /** + * 对有序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } + +} \ No newline at end of file diff --git a/cweb/src/main/java/com/cweb/config/SessionKeyCache.java b/cweb/src/main/java/com/cweb/config/SessionKeyCache.java new file mode 100644 index 0000000..fd8071b --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/SessionKeyCache.java @@ -0,0 +1,53 @@ +package com.cweb.config; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class SessionKeyCache { + + private static Map CACHE_DATA = new ConcurrentHashMap<>(); + + public static T getData(String key) { + CacheData data = CACHE_DATA.get(key); + if (data != null){ + if(data.getExpire() <= 0 || data.getSaveTime() >= System.currentTimeMillis()) { + return data.getData(); + }else{ + clear(key); + } + } + return null; + } + + public static void setData(String key, T data, int expire) { + CACHE_DATA.put(key, new CacheData(data, expire)); + } + + public static void clear(String key) { + CACHE_DATA.remove(key); + } + + private static class CacheData { + CacheData(T t, int expire) { + this.data = t; + this.expire = expire <= 0 ? 0 : expire*1000; + this.saveTime = System.currentTimeMillis() + this.expire; + } + + private T data; + private long saveTime; // 存活时间 + private long expire; // 过期时间 小于等于0标识永久存活 + + public T getData() { + return data; + } + + public long getExpire() { + return expire; + } + + public long getSaveTime() { + return saveTime; + } + } +} diff --git a/cweb/src/main/java/com/cweb/config/SwaggerConfig.java b/cweb/src/main/java/com/cweb/config/SwaggerConfig.java new file mode 100644 index 0000000..95ebf13 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/SwaggerConfig.java @@ -0,0 +1,47 @@ +package com.cweb.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +/** +* SwaggerConfig.java +* 项目名称: +* 包: +* 类名称: SwaggerConfig.java +* 类描述: 构建restful api接口文档 +* 创建人: +* 创建时间: 2017 下午4:23:45 +*/ +@Configuration +@EnableSwagger2 +public class SwaggerConfig +{ + + /** + * 描述api的基本信息 + * 基本信息会展现在文档页面中 + * @return [api的基本信息] + */ + ApiInfo apiInfo() + { + return new ApiInfoBuilder().title("hgj-CWeb").description("提供给用户端的接口").termsOfServiceUrl("").version("1.0.0") + .contact(new Contact("", "", "")).build(); + } + + @Bean + public Docket customImplementation() + { + return new Docket(DocumentationType.SWAGGER_2).select() + .apis(RequestHandlerSelectors.basePackage("com")) + .build().directModelSubstitute(org.joda.time.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(org.joda.time.DateTime.class, java.util.Date.class).apiInfo(apiInfo()); + } + +} diff --git a/cweb/src/main/java/com/cweb/config/SysConfig.java b/cweb/src/main/java/com/cweb/config/SysConfig.java new file mode 100644 index 0000000..3be648e --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/SysConfig.java @@ -0,0 +1,31 @@ +package com.cweb.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Component("sysConfig") +@ConfigurationProperties +@PropertySource("classpath:/config.properties") +public class SysConfig { + + private String fileUrl; + + private String cmsPath; + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public String getCmsPath() { + return cmsPath; + } + + public void setCmsPath(String cmsPath) { + this.cmsPath = cmsPath; + } +} diff --git a/cweb/src/main/java/com/cweb/config/SysConst.java b/cweb/src/main/java/com/cweb/config/SysConst.java new file mode 100644 index 0000000..23c919a --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/SysConst.java @@ -0,0 +1,19 @@ +package com.cweb.config; + +public class SysConst { + + private static SysConfig sysConfig; + + public static void setSysConfig(SysConfig arg){ + sysConfig = arg; + } + + public static SysConfig getSysConfig(){ + if (null == sysConfig) { + //防止空指针异常 + sysConfig = new SysConfig(); + return sysConfig; + } + return sysConfig; + } +} diff --git a/cweb/src/main/java/com/cweb/config/WxMaConfiguration.java b/cweb/src/main/java/com/cweb/config/WxMaConfiguration.java new file mode 100644 index 0000000..b877321 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/WxMaConfiguration.java @@ -0,0 +1,33 @@ +package com.cweb.config; + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl; +import org.springframework.context.annotation.Configuration; + +import javax.annotation.PostConstruct; + +@Configuration +public class WxMaConfiguration { + + private static WxMaService maService; + + public static WxMaService getMaService() { + if (maService == null) { + throw new IllegalArgumentException(String.format("未找到对应的配置,请核实!")); + } + + return maService; + } + + @PostConstruct + public void init() { + /*WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl(); + config.setAppid(SysConst.getSysConfig().getWxAppId()); + config.setSecret(SysConst.getSysConfig().getWxAppSecret()); + + maService = new WxMaServiceImpl(); + maService.setWxMaConfig(config);*/ + } + +} diff --git a/cweb/src/main/java/com/cweb/config/WxMsgConfig.java b/cweb/src/main/java/com/cweb/config/WxMsgConfig.java new file mode 100644 index 0000000..b882ab3 --- /dev/null +++ b/cweb/src/main/java/com/cweb/config/WxMsgConfig.java @@ -0,0 +1,55 @@ +package com.cweb.config; + +import cn.binarywang.wx.miniapp.api.WxMaMsgService; +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.bean.WxMaSubscribeMessage; +import com.hfkj.common.utils.DateUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; + +public class WxMsgConfig { + + private static Logger log = LoggerFactory.getLogger(WxMsgConfig.class); + + public static void pushOneUser(String orderName , String price , String orderNo , Date payTime , String remark , Long orderId , String openId) { + + try { + List list = new ArrayList<>(); + + Map m = new HashMap<>(); + + m.put("thing1", orderName); + m.put("amount2", price + "元"); + m.put("character_string3", orderNo); + m.put("time4", DateUtil.date2String(payTime , "yyyy年MM月dd日 HH:mm:ss")); + m.put("thing6", remark); + + for (String key: m.keySet()) { + WxMaSubscribeMessage.Data msgElement = new WxMaSubscribeMessage.Data(); + msgElement.setName(key); + msgElement.setValue(m.get(key)); + list.add(msgElement); + } + + WxMaSubscribeMessage subscribeMessage = new WxMaSubscribeMessage(); + subscribeMessage.setToUser(openId); // 小程序openId + subscribeMessage.setTemplateId("oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U"); + subscribeMessage.setData(list); + subscribeMessage.setPage("pages/user/order_details/order_details?id=" + orderId); + subscribeMessage.setMiniprogramState("developer"); + + final WxMaService wxService = WxMaConfiguration.getMaService(); + WxMaMsgService maMsgService = wxService.getMsgService(); + maMsgService.sendSubscribeMsg(subscribeMessage); + } catch (Exception e) { + log.error(String.valueOf(e)); + } + + } + + + + +} diff --git a/cweb/src/main/java/com/cweb/controller/CommonController.java b/cweb/src/main/java/com/cweb/controller/CommonController.java new file mode 100644 index 0000000..37da2d7 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/CommonController.java @@ -0,0 +1,25 @@ +package com.cweb.controller; + +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.service.CommonService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + + +@RestController +@RequestMapping(value="/common") +@Api(value="共用接口") +public class CommonController { + + Logger log = LoggerFactory.getLogger(CommonController.class); + + @Resource + private CommonService commonService; + +} diff --git a/cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java b/cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java new file mode 100644 index 0000000..c640600 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java @@ -0,0 +1,79 @@ +package com.cweb.controller.pay; + +import com.hfkj.common.pay.WechatPayUtil; +import com.hfkj.common.pay.util.IOUtil; +import com.hfkj.common.pay.util.XmlUtil; +import com.hfkj.common.pay.util.sdk.WXPayConstants; +import com.hfkj.service.pay.NotifyService; +import com.hfkj.service.pay.PayRecordService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedOutputStream; +import java.util.*; + +@Controller +@RequestMapping(value = "/wechatpay") +@Api(value = "微信支付") +public class WechatPayController { + + private static Logger log = LoggerFactory.getLogger(WechatPayController.class); + + private WXPayConstants.SignType signType; + + @Resource + private NotifyService notifyService; + + @Resource + private PayRecordService payRecordService; + + @Resource + private WechatPayUtil wechatPayUtil; + + + @RequestMapping(value = "/notify", method = RequestMethod.POST) + @ApiOperation(value = "微信支付 -> 异步回调") + public void wechatNotify(HttpServletRequest request, HttpServletResponse response) { + try { + log.info("微信支付 -> 异步通知:处理开始"); + + String resXml = ""; // 反馈给微信服务器 + String notifyXml = null; // 微信支付系统发送的数据(格式) + notifyXml = IOUtil.inputStreamToString(request.getInputStream(), "UTF-8"); + + log.info("微信支付系统发送的数据:" + notifyXml); + SortedMap map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8"); + + resXml = notifyService.wechatNotify(map); + +/* if (SignatureUtil.reCheckIsSignValidFromWeiXin(notifyXml, SysConst.getSysConfig().getWxApiKey(), "UTF-8")) { + log.info("微信支付系统发送的数据:" + notifyXml); + SortedMap map = XmlUtil.parseXmlToTreeMap(notifyXml, "UTF-8"); + + resXml = notifyService.wechatNotify(map); + } else { + log.error("微信支付 -> 异步通知:验签失败"); + log.error("apiKey:" + SysConst.getSysConfig().getWxApiKey()); + log.error("返回信息:" + notifyXml); + resXml = "" + "" + + "" + " "; + }*/ + + BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream()); + out.write(resXml.getBytes()); + out.flush(); + out.close(); + log.info("微信支付 -> 异步通知:处理完成"); + } catch (Exception e) { + log.error("WechatPayController --> wechatNotify() error!", e); + } + } +} diff --git a/cweb/src/main/resources/dev/application.yml b/cweb/src/main/resources/dev/application.yml new file mode 100644 index 0000000..ac95283 --- /dev/null +++ b/cweb/src/main/resources/dev/application.yml @@ -0,0 +1,56 @@ +server: + port: 9801 + servlet: + context-path: /crest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hfkj?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + redis: + database: 0 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/cweb/src/main/resources/dev/config.properties b/cweb/src/main/resources/dev/config.properties new file mode 100644 index 0000000..44ea8fc --- /dev/null +++ b/cweb/src/main/resources/dev/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/hsg/filesystem +cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/cweb/src/main/resources/dev/logback.xml b/cweb/src/main/resources/dev/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/cweb/src/main/resources/dev/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/cweb/src/main/resources/pre/application.yml b/cweb/src/main/resources/pre/application.yml new file mode 100644 index 0000000..1012ea5 --- /dev/null +++ b/cweb/src/main/resources/pre/application.yml @@ -0,0 +1,56 @@ +server: + port: 9301 + servlet: + context-path: /crest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + redis: + database: 1 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/cweb/src/main/resources/pre/config.properties b/cweb/src/main/resources/pre/config.properties new file mode 100644 index 0000000..44ea8fc --- /dev/null +++ b/cweb/src/main/resources/pre/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/hsg/filesystem +cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/cweb/src/main/resources/pre/logback.xml b/cweb/src/main/resources/pre/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/cweb/src/main/resources/pre/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/cweb/src/main/resources/prod/application.yml b/cweb/src/main/resources/prod/application.yml new file mode 100644 index 0000000..f3e38c7 --- /dev/null +++ b/cweb/src/main/resources/prod/application.yml @@ -0,0 +1,57 @@ +server: + port: 9301 + servlet: + context-path: /crest + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + + redis: + database: 0 + host: 127.0.0.1 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/cweb/src/main/resources/prod/config.properties b/cweb/src/main/resources/prod/config.properties new file mode 100644 index 0000000..44ea8fc --- /dev/null +++ b/cweb/src/main/resources/prod/config.properties @@ -0,0 +1,2 @@ +fileUrl=/home/project/hsg/filesystem +cmsPath=/home/project/hsg/filesystem/cmsPath diff --git a/cweb/src/main/resources/prod/logback.xml b/cweb/src/main/resources/prod/logback.xml new file mode 100644 index 0000000..e509de0 --- /dev/null +++ b/cweb/src/main/resources/prod/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..f71fa2f --- /dev/null +++ b/pom.xml @@ -0,0 +1,67 @@ + + + 4.0.0 + + com.hfkj + hai-oil-parent + pom + 1.0-SNAPSHOT + + + org.springframework.boot + spring-boot-starter-parent + 2.0.5.RELEASE + + + + + UTF-8 + UTF-8 + 2.6.1 + 2.9.9 + + + + + commons-net + commons-net + 3.6 + + + net.coobird + thumbnailator + 0.4.8 + + + junit + junit + 4.12 + + test + + + org.springframework.boot + spring-boot-starter-test + test + + + com.github.binarywang + weixin-java-mp + 3.8.0 + + + + compile + + + + service + cweb + bweb + schedule + + + + diff --git a/schedule/pom.xml b/schedule/pom.xml new file mode 100644 index 0000000..14b4856 --- /dev/null +++ b/schedule/pom.xml @@ -0,0 +1,47 @@ + + + 4.0.0 + + com.hfkj + hai-oil-parent + 1.0-SNAPSHOT + + + com.hfkj + oil-schedule + schedule + 1.0-SNAPSHOT + + + + com.hfkj + service + PACKT-SNAPSHOT + + + + + + + src/main/resources/${env} + false + + + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/schedule/src/main/java/com/hfkj/ScheduleApplication.java b/schedule/src/main/java/com/hfkj/ScheduleApplication.java new file mode 100644 index 0000000..dae4baf --- /dev/null +++ b/schedule/src/main/java/com/hfkj/ScheduleApplication.java @@ -0,0 +1,30 @@ +package com.hfkj; + +import com.alicp.jetcache.anno.config.EnableCreateCacheAnnotation; +import com.alicp.jetcache.anno.config.EnableMethodCache; +import com.hfkj.common.utils.SpringContextUtil; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletComponentScan; +import org.springframework.context.ApplicationContext; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; + +@SpringBootApplication +//@ComponentScan +@EnableTransactionManagement +@EnableScheduling +@EnableMethodCache(basePackages = "com.hfkj") +@EnableCreateCacheAnnotation +@ServletComponentScan +@MapperScan("com.hfkj.dao") +public class ScheduleApplication +{ + public static void main( String[] args ) + { + ApplicationContext app = SpringApplication.run(ScheduleApplication.class, args); + SpringContextUtil.setApplicationContext(app); + } + +} diff --git a/schedule/src/main/java/com/hfkj/config/RedisConfig.java b/schedule/src/main/java/com/hfkj/config/RedisConfig.java new file mode 100644 index 0000000..a6ecfad --- /dev/null +++ b/schedule/src/main/java/com/hfkj/config/RedisConfig.java @@ -0,0 +1,123 @@ +package com.hfkj.config; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import com.fasterxml.jackson.annotation.PropertyAccessor; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.springframework.cache.annotation.CachingConfigurerSupport; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.listener.PatternTopic; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; +import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; + + +@Configuration +@EnableCaching //开启注解 +public class RedisConfig extends CachingConfigurerSupport { + + + @Bean + public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory factory) { + RedisMessageListenerContainer container = new RedisMessageListenerContainer(); + container.setConnectionFactory(factory); + + //可以添加多个 messageListener + // container.addMessageListener(new OilPriceTaskMsgListener(), new PatternTopic(MsgTopic.oilPriceTask.getName())); + + return container; + } + + /** + * retemplate相关配置 + * @param factory + * @return + */ + @Bean + public RedisTemplate redisTemplate(RedisConnectionFactory factory) { + + RedisTemplate template = new RedisTemplate<>(); + // 配置连接工厂 + template.setConnectionFactory(factory); + + //使用Jackson2JsonRedisSerializer来序列化和反序列化redis的value值(默认使用JDK的序列化方式) + Jackson2JsonRedisSerializer jacksonSeial = new Jackson2JsonRedisSerializer(Object.class); + + ObjectMapper om = new ObjectMapper(); + // 指定要序列化的域,field,get和set,以及修饰符范围,ANY是都有包括private和public + om.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); + // 指定序列化输入的类型,类必须是非final修饰的,final修饰的类,比如String,Integer等会跑出异常 + om.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL); + jacksonSeial.setObjectMapper(om); + + // 值采用json序列化 + template.setValueSerializer(jacksonSeial); + //使用StringRedisSerializer来序列化和反序列化redis的key值 + template.setKeySerializer(new StringRedisSerializer()); + + // 设置hash key 和value序列化模式 + template.setHashKeySerializer(new StringRedisSerializer()); + template.setHashValueSerializer(jacksonSeial); + template.afterPropertiesSet(); + + return template; + } + + /** + * 对hash类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public HashOperations hashOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForHash(); + } + + /** + * 对redis字符串类型数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ValueOperations valueOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForValue(); + } + + /** + * 对链表类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ListOperations listOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForList(); + } + + /** + * 对无序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public SetOperations setOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForSet(); + } + + /** + * 对有序集合类型的数据操作 + * + * @param redisTemplate + * @return + */ + @Bean + public ZSetOperations zSetOperations(RedisTemplate redisTemplate) { + return redisTemplate.opsForZSet(); + } +} diff --git a/schedule/src/main/java/com/hfkj/config/SysConfig.java b/schedule/src/main/java/com/hfkj/config/SysConfig.java new file mode 100644 index 0000000..ed24ece --- /dev/null +++ b/schedule/src/main/java/com/hfkj/config/SysConfig.java @@ -0,0 +1,199 @@ +package com.hfkj.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; + +@Component("sysConfig") +@ConfigurationProperties +@PropertySource("classpath:/config.properties") +public class SysConfig { + + private String wxAppId; + private String wxAppSecret; + + private String ys7AppKey; + private String ys7AppSecret; + + private String classVideoPath; + + private String app_id; + + private String app_secret; + + private String notify_url; + + private String api_key; + + private String mch_id; + + private String unified_order_url; + + private String rectifyPath; + + private String graduatePath; + + private String fileUrl; + + private String arcsoftlibUrl; + + private String arcsoftAppId; + + private String arcsoftKey; + + private String ffmpegPath; + + private String tmpFilePath; + + public String getGraduatePath() { + return graduatePath; + } + + public void setGraduatePath(String graduatePath) { + this.graduatePath = graduatePath; + } + + public String getArcsoftAppId() { + return arcsoftAppId; + } + + public void setArcsoftAppId(String arcsoftAppId) { + this.arcsoftAppId = arcsoftAppId; + } + + public String getArcsoftKey() { + return arcsoftKey; + } + + public void setArcsoftKey(String arcsoftKey) { + this.arcsoftKey = arcsoftKey; + } + + public String getArcsoftlibUrl() { + return arcsoftlibUrl; + } + + public void setArcsoftlibUrl(String arcsoftlibUrl) { + this.arcsoftlibUrl = arcsoftlibUrl; + } + + public String getFileUrl() { + return fileUrl; + } + + public void setFileUrl(String fileUrl) { + this.fileUrl = fileUrl; + } + + public String getRectifyPath() { + return rectifyPath; + } + + public void setRectifyPath(String rectifyPath) { + this.rectifyPath = rectifyPath; + } + + public String getWxAppId() { + return wxAppId; + } + + public void setWxAppId(String wxAppId) { + this.wxAppId = wxAppId; + } + + public String getWxAppSecret() { + return wxAppSecret; + } + + public void setWxAppSecret(String wxAppSecret) { + this.wxAppSecret = wxAppSecret; + } + + public String getYs7AppKey() { + return ys7AppKey; + } + + public void setYs7AppKey(String ys7AppKey) { + this.ys7AppKey = ys7AppKey; + } + + public String getYs7AppSecret() { + return ys7AppSecret; + } + + public void setYs7AppSecret(String ys7AppSecret) { + this.ys7AppSecret = ys7AppSecret; + } + + public String getClassVideoPath() { + return classVideoPath; + } + + public void setClassVideoPath(String classVideoPath) { + this.classVideoPath = classVideoPath; + } + + public String getApp_id() { + return app_id; + } + + public void setApp_id(String app_id) { + this.app_id = app_id; + } + + public String getApp_secret() { + return app_secret; + } + + public void setApp_secret(String app_secret) { + this.app_secret = app_secret; + } + + public String getNotify_url() { + return notify_url; + } + + public void setNotify_url(String notify_url) { + this.notify_url = notify_url; + } + + public String getApi_key() { + return api_key; + } + + public void setApi_key(String api_key) { + this.api_key = api_key; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getUnified_order_url() { + return unified_order_url; + } + + public void setUnified_order_url(String unified_order_url) { + this.unified_order_url = unified_order_url; + } + + public String getFfmpegPath() { + return ffmpegPath; + } + + public void setFfmpegPath(String ffmpegPath) { + this.ffmpegPath = ffmpegPath; + } + + public String getTmpFilePath() { + return tmpFilePath; + } + + public void setTmpFilePath(String tmpFilePath) { + this.tmpFilePath = tmpFilePath; + } +} diff --git a/schedule/src/main/java/com/hfkj/msg/OilPriceTaskMsgListener.java b/schedule/src/main/java/com/hfkj/msg/OilPriceTaskMsgListener.java new file mode 100644 index 0000000..53f14b6 --- /dev/null +++ b/schedule/src/main/java/com/hfkj/msg/OilPriceTaskMsgListener.java @@ -0,0 +1,20 @@ +package com.hfkj.msg; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.connection.MessageListener; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; + +@Service(value = "driverLBSMsgListener") +public class OilPriceTaskMsgListener implements MessageListener { + + private static Logger logger = LoggerFactory.getLogger(OilPriceTaskMsgListener.class); + private RedisTemplate redisTemplate; + + @Override + public void onMessage(Message message, byte[] pattern) { + System.out.println(message); + } +} diff --git a/schedule/src/main/java/com/hfkj/msg/RedisKeyExpirationListener.java b/schedule/src/main/java/com/hfkj/msg/RedisKeyExpirationListener.java new file mode 100644 index 0000000..5132e41 --- /dev/null +++ b/schedule/src/main/java/com/hfkj/msg/RedisKeyExpirationListener.java @@ -0,0 +1,48 @@ +package com.hfkj.msg; + +import com.hfkj.entity.BsGasOilPriceTask; +import com.hfkj.service.BsGasOilPriceTaskService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.data.redis.connection.Message; +import org.springframework.data.redis.listener.KeyExpirationEventMessageListener; +import org.springframework.data.redis.listener.RedisMessageListenerContainer; +import org.springframework.stereotype.Component; +import javax.annotation.Resource; + + +@Component +public class RedisKeyExpirationListener extends KeyExpirationEventMessageListener { + + private static Logger logger = LoggerFactory.getLogger(RedisKeyExpirationListener.class); + + @Resource + private BsGasOilPriceTaskService gasOilPriceTaskService; + + public RedisKeyExpirationListener(RedisMessageListenerContainer listenerContainer) { + super(listenerContainer); + } + + public void onMessage(Message message, byte[] pattern) { + try { + if (message != null && StringUtils.isNotBlank(message.toString())) { + // 加油站价格任务 + if (message.toString().contains(MsgTopic.oilPriceTask.getName())) { + // 截取任务id + Long taskId = Long.parseLong(StringUtils.substringAfterLast(message.toString(), MsgTopic.oilPriceTask.getName() + "-")); + if (taskId != null) { + // 查询任务 + BsGasOilPriceTask gasOilPriceTask = gasOilPriceTaskService.getDetailById(taskId); + if (gasOilPriceTask != null) { + // 任务处理 + gasOilPriceTaskService.businessHandle(gasOilPriceTask); + } + } + } + } + } catch (Exception e) { + logger.error("redis过期事件异常:", e); + } + } +} diff --git a/schedule/src/main/resources/dev/application.yml b/schedule/src/main/resources/dev/application.yml new file mode 100644 index 0000000..91a4d85 --- /dev/null +++ b/schedule/src/main/resources/dev/application.yml @@ -0,0 +1,59 @@ +server: + port: 9303 + servlet: + context-path: /schedule + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + + redis: + database: 0 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true + + mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + + pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/schedule/src/main/resources/dev/config.properties b/schedule/src/main/resources/dev/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/schedule/src/main/resources/dev/logback.xml b/schedule/src/main/resources/dev/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/schedule/src/main/resources/dev/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/schedule/src/main/resources/pre/application.yml b/schedule/src/main/resources/pre/application.yml new file mode 100644 index 0000000..f44a550 --- /dev/null +++ b/schedule/src/main/resources/pre/application.yml @@ -0,0 +1,59 @@ +server: + port: 9303 + servlet: + context-path: /schedule + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://139.159.177.244:3306/hsg_pre?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + + redis: + database: 0 + host: 139.159.177.244 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true + + mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + + pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/schedule/src/main/resources/pre/config.properties b/schedule/src/main/resources/pre/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/schedule/src/main/resources/pre/logback.xml b/schedule/src/main/resources/pre/logback.xml new file mode 100644 index 0000000..9382585 --- /dev/null +++ b/schedule/src/main/resources/pre/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/schedule/src/main/resources/prod/application.yml b/schedule/src/main/resources/prod/application.yml new file mode 100644 index 0000000..54fea1f --- /dev/null +++ b/schedule/src/main/resources/prod/application.yml @@ -0,0 +1,59 @@ +server: + port: 9303 + servlet: + context-path: /schedule + +#配置是否为debug模式,debug模式下,不开启权限校验 +debug: false + +#datasource数据源设置 +spring: + datasource: + url: jdbc:mysql://127.0.0.1:3306/hsg?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 + username: root + password: HF123456. + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.jdbc.Driver + filters: stat + maxActive: 10 + initialSize: 5 + maxWait: 60000 + minIdle: 5 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + + redis: + database: 0 + host: 127.0.0.1 + port: 36379 + password: HF123456.Redis + timeout: 1000 + jedis: + pool: + max-active: 20 + max-wait: -1 + max-idle: 10 + min-idle: 0 + + #配置日期返回至前台为时间戳 + jackson: + serialization: + write-dates-as-timestamps: true + +mybatis: + mapperLocations: + - classpath*:sqlmap*/*.xml + type-aliases-package: + org.springboot.sample.entity + +pagehelper: + helperDialect: mysql + reasonable: true + supportMethodsArguments: true + params: count=countSql diff --git a/schedule/src/main/resources/prod/config.properties b/schedule/src/main/resources/prod/config.properties new file mode 100644 index 0000000..e69de29 diff --git a/schedule/src/main/resources/prod/logback.xml b/schedule/src/main/resources/prod/logback.xml new file mode 100644 index 0000000..e509de0 --- /dev/null +++ b/schedule/src/main/resources/prod/logback.xml @@ -0,0 +1,72 @@ + + + + + %d %p (%file:%line\)- %m%n + UTF-8 + + + + log/base.log + + log/base.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/dao.log + + log/dao.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + log/error.log + + log/error.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + + + + + + + diff --git a/service/pom.xml b/service/pom.xml new file mode 100644 index 0000000..0390f61 --- /dev/null +++ b/service/pom.xml @@ -0,0 +1,271 @@ + + + + com.hfkj + hai-oil-parent + 1.0-SNAPSHOT + + 4.0.0 + + service + PACKT-SNAPSHOT + + + UTF-8 + UTF-8 + 1.8 + 2.6.1 + 2.9.9 + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-jdbc + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 1.3.1 + + + org.springframework.boot + spring-boot-starter-test + test + + + org.springframework.boot + spring-boot-starter-data-redis + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.thymeleaf + thymeleaf + 3.0.9.RELEASE + + + org.thymeleaf + thymeleaf-spring4 + 3.0.9.RELEASE + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.2.10 + + + org.aspectj + aspectjweaver + 1.8.13 + + + tk.mybatis + mapper + 3.3.0 + + + + + org.apache.httpcomponents + httpclient + 4.5.3 + + + + + mysql + mysql-connector-java + 5.1.34 + + + + + com.alibaba + druid + 1.0.20 + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + + joda-time + joda-time + ${joda-time-version} + + + + org.slf4j + slf4j-api + 1.7.25 + + + org.slf4j + slf4j-simple + 1.7.25 + provided + + + org.apache.commons + commons-lang3 + 3.7 + + + org.apache.commons + commons-collections4 + 4.2 + + + commons-codec + commons-codec + 1.10 + + + commons-logging + commons-logging + 1.2 + + + + commons-fileupload + commons-fileupload + 1.4 + + + junit + junit + 4.12 + test + + + commons-io + commons-io + 2.6 + + + com.alibaba + fastjson + 1.2.7 + + + org.apache.httpcomponents + httpmime + 4.5.6 + + + dom4j + dom4j + 1.6.1 + + + org.apache.poi + poi + 4.1.2 + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + com.google.zxing + core + 3.3.0 + + + com.aliyun + aliyun-java-sdk-core + 4.1.0 + + + com.google.zxing + javase + 3.3.0 + + + com.google.code.gson + gson + + + org.slf4j + slf4j-api + 1.7.7 + + + + com.alipay.sdk + alipay-sdk-java + 4.9.79.ALL + + + + com.thoughtworks.xstream + xstream + 1.4.11.1 + + + com.github.binarywang + weixin-java-miniapp + 3.8.0 + + + com.alibaba + easyexcel + 2.2.6 + + + com.github.wechatpay-apiv3 + wechatpay-apache-httpclient + 0.2.2 + + + com.sun.jersey + jersey-client + 1.16 + + + com.alicp.jetcache + jetcache-starter-redis + 2.5.0 + + + org.projectlombok + lombok + + + + + + src/main/resources/${env} + false + + + + diff --git a/service/src/main/java/com/hfkj/common/Base64Util.java b/service/src/main/java/com/hfkj/common/Base64Util.java new file mode 100644 index 0000000..9c0d71e --- /dev/null +++ b/service/src/main/java/com/hfkj/common/Base64Util.java @@ -0,0 +1,42 @@ +package com.hfkj.common; + +import java.util.Base64; + +public class Base64Util { + /** + * @param data + * @return str + * @throws Exception + */ + public static String encode(String data) throws Exception{ +// String encodeBase64 = new BASE64Encoder().encode(data.getBytes("utf-8")); + String encodeBase64 = Base64.getEncoder().encodeToString(data.getBytes("utf-8")); + String safeBase64Str = encodeBase64.replace('+', '-'); + safeBase64Str = safeBase64Str.replace('/', '_'); + safeBase64Str = safeBase64Str.replaceAll("=", ""); + return safeBase64Str.replaceAll("\\s*", ""); + } + + /** + * @param safeBase64Str + * @return str + * @throws Exception + */ + public static String decode(final String safeBase64Str) throws Exception{ + String base64Str = safeBase64Str.replace('-', '+'); + base64Str = base64Str.replace('_', '/'); + int mod4 = base64Str.length() % 4; + if(mod4 > 0){ + base64Str += "====".substring(mod4); + } + +// byte[] ret = new BASE64Decoder().decodeBuffer(base64Str); + byte[] ret = Base64.getDecoder().decode(base64Str); + return new String(ret, "utf-8"); + } + + public static void main(String[] args) throws Exception { + System.out.println(encode("abcd1234")); + System.out.println(decode("YWJjZDEyMzQ")); + } +} diff --git a/service/src/main/java/com/hfkj/common/QRCodeGenerator.java b/service/src/main/java/com/hfkj/common/QRCodeGenerator.java new file mode 100644 index 0000000..0e08f01 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/QRCodeGenerator.java @@ -0,0 +1,43 @@ +package com.hfkj.common; + +import com.google.zxing.BarcodeFormat; +import com.google.zxing.WriterException; +import com.google.zxing.client.j2se.MatrixToImageWriter; +import com.google.zxing.common.BitMatrix; +import com.google.zxing.qrcode.QRCodeWriter; + +import java.io.File; +import java.io.IOException; + +/** + * @Auther: 胡锐 + * @Description: 生成二维码 + * @Date: 2021/3/27 12:07 + */ +public class QRCodeGenerator { + + public static void generateQRCodeImage(String text, int width, int height, String filePath) throws WriterException, IOException { + QRCodeWriter qrCodeWriter = new QRCodeWriter(); + + BitMatrix bitMatrix = qrCodeWriter.encode(text, BarcodeFormat.QR_CODE, width, height); + + File file = new File(filePath); + if(!file.exists()){ + file.mkdirs(); + } + //Path path = FileSystems.getDefault().getPath(filePath); + MatrixToImageWriter.writeToFile(bitMatrix, "PNG", file); + + } + + public static void main(String[] args) { + try { + generateQRCodeImage("This is my first QR Code", 350, 350, "D:\\/ss/qr1.png"); + } catch (WriterException e) { + System.out.println("Could not generate QR Code, WriterException :: " + e.getMessage()); + } catch (IOException e) { + System.out.println("Could not generate QR Code, IOException :: " + e.getMessage()); + } + + } +} diff --git a/service/src/main/java/com/hfkj/common/exception/AppException.java b/service/src/main/java/com/hfkj/common/exception/AppException.java new file mode 100644 index 0000000..307f7e6 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/AppException.java @@ -0,0 +1,10 @@ +package com.hfkj.common.exception; + +/** + * 数据异常,只影响部分功能的异常,例如本应该为x的数据,莫名其妙为Y + */ +public class AppException extends BaseException { + AppException(String errorCode, String errorMsg) { + super(errorCode,errorMsg); + } +} diff --git a/service/src/main/java/com/hfkj/common/exception/BaseException.java b/service/src/main/java/com/hfkj/common/exception/BaseException.java new file mode 100644 index 0000000..4af58db --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/BaseException.java @@ -0,0 +1,23 @@ +package com.hfkj.common.exception; + +/** + * sl框架基础异常,不允许自己new实例,需要同步工具类进行实例化 + */ +public class BaseException extends RuntimeException { + protected String errorCode; + protected String errorMsg; + + BaseException(String errorCode, String errorMsg) { + super("errorCode="+errorCode+", errorMsg="+errorMsg); + this.errorCode = errorCode; + this.errorMsg = errorMsg; + } + + public String getErrorCode() { + return errorCode; + } + + public String getErrorMsg() { + return errorMsg; + } +} diff --git a/service/src/main/java/com/hfkj/common/exception/BizException.java b/service/src/main/java/com/hfkj/common/exception/BizException.java new file mode 100644 index 0000000..87b00f8 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/BizException.java @@ -0,0 +1,10 @@ +package com.hfkj.common.exception; + +/** + * 用户操作异常 + */ +public class BizException extends BaseException { + BizException(String errorCode, String errorMsg) { + super(errorCode,errorMsg); + } +} diff --git a/service/src/main/java/com/hfkj/common/exception/ErrorCode.java b/service/src/main/java/com/hfkj/common/exception/ErrorCode.java new file mode 100644 index 0000000..7cbafb6 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/ErrorCode.java @@ -0,0 +1,66 @@ +package com.hfkj.common.exception; + +/** + * + * @ClassName: ErrorCode + * @Description: + * 代码code规则: + * 0000-0999 系统异常 + * 1000-1999 app异常 + * 2000-2999 biz异常 + * 999999 未知异常 + * @author: 机器猫 + * @date: 2018年8月12日 上午11:43:30 + * + * @Copyright: 2018 www.shinwoten.com Inc. All rights reserved. + */ +public enum ErrorCode { + + //////////////////sys//////////////// + DB_CONNECT_ERROR("0000","数据库连接异常"), + FTP_CONNECT_ERROR("0001","FTP服务器连接失败"), + FTP_CONFIG_NOT_FOUND("0002","FTP服务地址路径配置缺失"), + + //////////////////APP/////////////// + WECHAT_DECRYPT_ERROR("3001","微信解密错误->%s"), + WECHAT_LOGIN_ERROR("3002","微信登录失败"), + WECHAT_LOGIN_TEACHER_ERROR("3003","当前微信用户不是老师,请联系管理员"), + SERVER_BUSY_ERROR("3004","服务器繁忙,请稍后重试"), + + //////////////////业务异常///////////// + COMMON_ERROR("2000",""), + REQ_PARAMS_ERROR("2001","请求参数校验失败"), + ACCOUNT_LOGIN_EXPIRE("2002","登录账户已过期"), + ACCOUNT_LOGIN_NOT("2003","账户未登录"), + + MSG_EVENT_NULL("2999","消息类型为空"), + USE_VISIT_ILLEGAL("4001","用户身份错误"), + RC_VISIT_ERROR("2998",""), + UNKNOW_ERROR("999999","未知异常"), + EXCEL_ERROR("80000","Excel处理异常"), + ;//注意:上面为逗号,此次为分号 + + + private String code; + private String msg; + ErrorCode(String code, String msg){ + this.code = code; + this.msg = msg; + } + + public String getCode() { + return code; + } + +// public void setCode(String code) { +// this.code = code; +// } + + public String getMsg() { + return msg; + } + +// public void setMsg(String msg) { +// this.msg = msg; +// } +} diff --git a/service/src/main/java/com/hfkj/common/exception/ErrorHelp.java b/service/src/main/java/com/hfkj/common/exception/ErrorHelp.java new file mode 100644 index 0000000..19716be --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/ErrorHelp.java @@ -0,0 +1,23 @@ +package com.hfkj.common.exception; + +public class ErrorHelp { + + public static BaseException genException(SysCode sc, ErrorCode ec, Object... args){ + String errorCode = sc.getCode()+ec.getCode(); + StringBuilder sb = new StringBuilder(); + if (args != null && args.length != 0) { + for(Object o : args){ + sb.append(o.toString()); + } + } + String errorMsg = ec.getMsg()+sb.toString();//@TODO 这里需要处理变参 + char a = ec.getCode().charAt(0); + if (a == '0') {//系统异常 + return new SysException(errorCode,errorMsg); + } else if (a == '1') {//APP异常 + return new AppException(errorCode,errorMsg); + } else {//业务异常 + return new BizException(errorCode,errorMsg); + } + } +} diff --git a/service/src/main/java/com/hfkj/common/exception/SysCode.java b/service/src/main/java/com/hfkj/common/exception/SysCode.java new file mode 100644 index 0000000..5e0eaa9 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/SysCode.java @@ -0,0 +1,24 @@ +package com.hfkj.common.exception; + +public enum SysCode { + System("10","System"), + Auth("20","Auth"), + MiniProgram("30","小程序"); + + private String code; + private String name; + + SysCode(String code,String name){ + this.code = code; + this.name = name; + } + + public String getCode(){ + return this.code; + } + + public String getName() { + return this.name; + } + +} diff --git a/service/src/main/java/com/hfkj/common/exception/SysException.java b/service/src/main/java/com/hfkj/common/exception/SysException.java new file mode 100644 index 0000000..f0a07dc --- /dev/null +++ b/service/src/main/java/com/hfkj/common/exception/SysException.java @@ -0,0 +1,10 @@ +package com.hfkj.common.exception; + +/** + * 系统异常,例如网络断开,数据库不可访问等影响系统正常运行的异常 + */ +public class SysException extends BaseException { + SysException(String errorCode, String errorMsg) { + super(errorCode,errorMsg); + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/WechatPayUtil.java b/service/src/main/java/com/hfkj/common/pay/WechatPayUtil.java new file mode 100644 index 0000000..9d4f046 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/WechatPayUtil.java @@ -0,0 +1,72 @@ +package com.hfkj.common.pay; + +import com.hfkj.common.pay.entity.WeChatPayReqInfo; +import com.hfkj.common.pay.entity.WechatCallBackInfo; +import com.hfkj.common.pay.util.HttpReqUtil; +import com.hfkj.common.pay.util.SignatureUtil; +import com.hfkj.common.pay.util.XmlUtil; +import com.hfkj.service.pay.PayRecordService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import java.util.Map; +import java.util.SortedMap; +import java.util.TreeMap; + +@Component +public class WechatPayUtil { + + private static Logger log = LoggerFactory.getLogger(WechatPayUtil.class); + @Resource + private PayRecordService payRecordService; + + /** + * @throws + * @Title: goAlipay + * @Description: 微信支付请求体 + * @author: 魏真峰 + * @param: [orderId] + * @return: java.lang.String + */ + @RequestMapping("/goWechatPay") + @ResponseBody + public SortedMap goWechatPay(WeChatPayReqInfo weChatPayReqInfo, Map map) throws Exception{ + log.info("微信支付 -> 组装支付参数:开始"); + + String sign = SignatureUtil.createSign(weChatPayReqInfo, map.get("api_key"), "UTF-8"); + weChatPayReqInfo.setSign(sign); + String unifiedXmL = XmlUtil.toSplitXml(weChatPayReqInfo); + + String unifiedOrderResultXmL = HttpReqUtil.HttpsDefaultExecute("POST", map.get("unified_order_url"), null, unifiedXmL, null); + // 签名校验 + SortedMap sortedMap = null; + if (SignatureUtil.checkIsSignValidFromWeiXin(unifiedOrderResultXmL, map.get("api_key"), "UTF-8")) { + // 组装支付参数 + WechatCallBackInfo wechatCallBackInfo = XmlUtil.getObjectFromXML(unifiedOrderResultXmL, WechatCallBackInfo.class); + Long timeStamp = System.currentTimeMillis()/1000; + sortedMap = new TreeMap<>(); + sortedMap.put("appId",map.get("app_id")); +// sortedMap.put("partnerid",SysConst.getSysConfig().getMch_id()); +// sortedMap.put("prepayid",wechatCallBackInfo.getPrepay_id()); + sortedMap.put("nonceStr",wechatCallBackInfo.getNonce_str()); + sortedMap.put("timeStamp",timeStamp.toString()); + sortedMap.put("signType","MD5"); + sortedMap.put("package", "prepay_id=" + wechatCallBackInfo.getPrepay_id()); + String secondSign = SignatureUtil.createSign(sortedMap, map.get("api_key"), "UTF-8"); + sortedMap.put("sign",secondSign); + + + log.info("微信支付 -> 组装支付参数:完成"); + } else { + log.error("微信支付 -> 组装支付参数:支付信息错误"); + log.error("错误信息:" + unifiedOrderResultXmL); + } + + return sortedMap; + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/AliPayReqInfo.java b/service/src/main/java/com/hfkj/common/pay/entity/AliPayReqInfo.java new file mode 100644 index 0000000..da9e050 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/AliPayReqInfo.java @@ -0,0 +1,151 @@ +package com.hfkj.common.pay.entity; + +/** + * @Description: 支付宝統一下单参数 + */ +public class AliPayReqInfo { + private String timeout_express; //该笔订单允许的最晚付款时间,逾期将关闭交易。取值范围:1m~15d。m-分钟,h-小时,d-天,1c-当天(1c-当天的情况下,无论交易何时创建,都在0点关闭)。 该参数数值不接受小数点, 如 1.5h,可转换为 90m。 90m + private String total_amount; //必填。订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 9.00 + private String seller_id; //收款支付宝用户ID。 如果该值为空,则默认为商户签约账号对应的支付宝用户ID 2088102147948060 + private String product_code; //销售产品码,商家和支付宝签约的产品码 QUICK_MSECURITY_PAY + private String body; //对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。 Iphone6 16G + private String subject; //必填。商品的标题/交易标题/订单标题/订单关键字等。 大乐透 + private String out_trade_no; //必填。商户网站唯一订单号 70501111111S001111119 + private String time_expire; //绝对超时时间,格式为yyyy-MM-dd HH:mm。 2016-12-31 10:05 + private String goods_type; //商品主类型 :0-虚拟类商品,1-实物类商品 0 + private String promo_params; //优惠参数 + private String passback_params; //必填。公用回传参数,如果请求时传递了该参数,则返回给商户时会回传该参数。支付宝只会在同步返回(包括跳转回商户网站)和异步通知时将该参数原样返回。本参数必须进行UrlEncode之后才可以发送给支付宝。 merchantBizType%3d3C%26merchantBizNo%3d2016010101111 + private String enable_pay_channels; //可用渠道,用户只能在指定渠道范围内支付 + private String store_id; //商户门店编号 NJ_001 + private String specified_channel; //指定渠道,目前仅支持传入pcredit + private String disable_pay_channels; //禁用渠道,用户不可用指定渠道支付 + private String business_params; //商户传入业务信息,具体值要和支付宝约定,应用于安全,营销等参数直传场景,格式为json格式 + + public String getTimeout_express() { + return timeout_express; + } + + public void setTimeout_express(String timeout_express) { + this.timeout_express = timeout_express; + } + + public String getTotal_amount() { + return total_amount; + } + + public void setTotal_amount(String total_amount) { + this.total_amount = total_amount; + } + + public String getSeller_id() { + return seller_id; + } + + public void setSeller_id(String seller_id) { + this.seller_id = seller_id; + } + + public String getProduct_code() { + return product_code; + } + + public void setProduct_code(String product_code) { + this.product_code = product_code; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getSubject() { + return subject; + } + + public void setSubject(String subject) { + this.subject = subject; + } + + public String getOut_trade_no() { + return out_trade_no; + } + + public void setOut_trade_no(String out_trade_no) { + this.out_trade_no = out_trade_no; + } + + public String getTime_expire() { + return time_expire; + } + + public void setTime_expire(String time_expire) { + this.time_expire = time_expire; + } + + public String getGoods_type() { + return goods_type; + } + + public void setGoods_type(String goods_type) { + this.goods_type = goods_type; + } + + public String getPromo_params() { + return promo_params; + } + + public void setPromo_params(String promo_params) { + this.promo_params = promo_params; + } + + public String getPassback_params() { + return passback_params; + } + + public void setPassback_params(String passback_params) { + this.passback_params = passback_params; + } + + public String getEnable_pay_channels() { + return enable_pay_channels; + } + + public void setEnable_pay_channels(String enable_pay_channels) { + this.enable_pay_channels = enable_pay_channels; + } + + public String getStore_id() { + return store_id; + } + + public void setStore_id(String store_id) { + this.store_id = store_id; + } + + public String getSpecified_channel() { + return specified_channel; + } + + public void setSpecified_channel(String specified_channel) { + this.specified_channel = specified_channel; + } + + public String getDisable_pay_channels() { + return disable_pay_channels; + } + + public void setDisable_pay_channels(String disable_pay_channels) { + this.disable_pay_channels = disable_pay_channels; + } + + public String getBusiness_params() { + return business_params; + } + + public void setBusiness_params(String business_params) { + this.business_params = business_params; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/OrderType.java b/service/src/main/java/com/hfkj/common/pay/entity/OrderType.java new file mode 100644 index 0000000..0763530 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/OrderType.java @@ -0,0 +1,46 @@ +package com.hfkj.common.pay.entity; + +public enum OrderType { + // 建议将支付频率高的模块放在前面 + GOODS_ORDER("GOODS_ORDER", "goodsOrderService", "购买商品"), + RECHARGE_ORDER("RECHARGE_ORDER", "rechargeOrderService", "充值订单"), + KFC_ORDER("KFC", "kfcOrderService", "KFC订单"), + CINEMA_ORDER("CINEMA", "cinemaOrderService", "电影票订单"), + MOBILE_ORDER("MOBILE", "mobileOrderService", "话费充值订单"), + TEST("TEST", "testPayService", "支付测试"), + ; + + private String moduleCode; + private String service; + private String moduleName; + + private OrderType(String moduleCode, String service, String moduleName) { + this.moduleCode = moduleCode; + this.service = service; + this.moduleName = moduleName; + } + + public String getModuleCode() { + return moduleCode; + } + + private void setModuleCode(String moduleCode) { + this.moduleCode = moduleCode; + } + + public String getService() { + return service; + } + + private void setService(String service) { + this.service = service; + } + + public String getModuleName() { + return moduleName; + } + + private void setModuleName(String moduleName) { + this.moduleName = moduleName; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/WeChatPayReqInfo.java b/service/src/main/java/com/hfkj/common/pay/entity/WeChatPayReqInfo.java new file mode 100644 index 0000000..da672ce --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/WeChatPayReqInfo.java @@ -0,0 +1,240 @@ +package com.hfkj.common.pay.entity; +import java.io.Serializable; + +/** + * @Description: 微信統一下单参数 + */ +public class WeChatPayReqInfo implements Serializable { + + private static final long serialVersionUID = -7642108447915413137L; + private String appid; // 公众号id 必填 + private String mch_id; // 商户号 必填 + private String sub_appid; // 微信支付分配的子商户号 必填 + private String sub_mch_id; // 微信支付分配的子商户号 必填 + private String nonce_str; // 随机字符串 必填 + private String sign; // 签名 必填 + private String device_info; // 设备号 可以为终端设备号(门店号或收银设备ID),PC网页或公众号内支付可以传"WEB" + private String body; // 商品描述 必填 + private String detail; // 商品详情 + private String attach; // 附加数据 + private String out_trade_no; // 商户订单号 必填 + private String fee_type; // 货币类型 默认为人民币CNY + private Integer total_fee; // 总金额 传入int型的数据 必填 + private String spbill_create_ip; // 终端ip 必填 + private String time_start; // 交易起始时间 订单生成时间 + private String time_expire; // 交易结束时间 订单失效时间 + private String goods_tag; // 订单优惠标记 + private String notify_url; // 通知url 必填 + private String trade_type; // 交易类型 JSAPI,NATIVE,APP 必填 + private String product_id; //商品id trade_type=NATIVE时(即扫码支付),此参数必传 + private String limit_pay; // 指定支付方式 no_credit--可限制用户不能使用信用卡支付 + private String openid; // 用户标识(trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识) + private String sub_openid; // 用户标识(trade_type=JSAPI,此参数必传,用户在商户appid下的唯一标识) + private String profit_sharing; + + public String getProfit_sharing() { + return profit_sharing; + } + + public void setProfit_sharing(String profit_sharing) { + this.profit_sharing = profit_sharing; + } + + public String getSub_openid() { + return sub_openid; + } + + public void setSub_openid(String sub_openid) { + this.sub_openid = sub_openid; + } + + private String scene_info; // 该字段用于统一下单时上报场景信息,目前支持上报实际门店信息 格式{"store_id":// "SZT10000", "store_name":"腾讯大厦腾大餐厅"} + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getDevice_info() { + return device_info; + } + + public void setDevice_info(String device_info) { + this.device_info = device_info; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + + public String getOut_trade_no() { + return out_trade_no; + } + + public void setOut_trade_no(String out_trade_no) { + this.out_trade_no = out_trade_no; + } + + public String getFee_type() { + return fee_type; + } + + public void setFee_type(String fee_type) { + this.fee_type = fee_type; + } + + public Integer getTotal_fee() { + return total_fee; + } + + public void setTotal_fee(Integer total_fee) { + this.total_fee = total_fee; + } + + public String getSpbill_create_ip() { + return spbill_create_ip; + } + + public void setSpbill_create_ip(String spbill_create_ip) { + this.spbill_create_ip = spbill_create_ip; + } + + public String getTime_start() { + return time_start; + } + + public void setTime_start(String time_start) { + this.time_start = time_start; + } + + public String getTime_expire() { + return time_expire; + } + + public void setTime_expire(String time_expire) { + this.time_expire = time_expire; + } + + public String getGoods_tag() { + return goods_tag; + } + + public void setGoods_tag(String goods_tag) { + this.goods_tag = goods_tag; + } + + public String getNotify_url() { + return notify_url; + } + + public void setNotify_url(String notify_url) { + this.notify_url = notify_url; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + + public String getProduct_id() { + return product_id; + } + + public void setProduct_id(String product_id) { + this.product_id = product_id; + } + + public String getLimit_pay() { + return limit_pay; + } + + public void setLimit_pay(String limit_pay) { + this.limit_pay = limit_pay; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getScene_info() { + return scene_info; + } + + public void setScene_info(String scene_info) { + this.scene_info = scene_info; + } + + public String getSub_mch_id() { + return sub_mch_id; + } + + public void setSub_mch_id(String sub_mch_id) { + this.sub_mch_id = sub_mch_id; + } + + public String getSub_appid() { + return sub_appid; + } + + public void setSub_appid(String sub_appid) { + this.sub_appid = sub_appid; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/WechatCallBackInfo.java b/service/src/main/java/com/hfkj/common/pay/entity/WechatCallBackInfo.java new file mode 100644 index 0000000..3b73b6b --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/WechatCallBackInfo.java @@ -0,0 +1,154 @@ +package com.hfkj.common.pay.entity; + +/** + * 统一下单返回结果 + * @author phil + * @data 2017年6月27日 + * + */ +public class WechatCallBackInfo { + + private static final long serialVersionUID = 9030465964635155064L; + private String appid; // 公众号id + private String mch_id; // 商户号 + private String nonce_str; // 随机字符串 + private String sign; // 签名 + private String return_code; // 返回状态码 + private String return_msg; // 返回信息 + // 以下字段在return_code为SUCCESS的时候有返回(包括父类) + private String device_info; // 设备号 + private String result_code; // 业务结果 SUCCESS/FAIL + private String err_code; // 错误代码 + private String err_code_des; // 错误代码描述 + // 以下字段在return_code 和result_code都为SUCCESS的时候有返回 + private String trade_type; // 交易类型 + private String prepay_id; // 预支付交易会话标识,有效期为2小时 + private String code_url; // 二维码链接 + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getSign() { + return sign; + } + + public void setSign(String sign) { + this.sign = sign; + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getDevice_info() { + return device_info; + } + + public void setDevice_info(String device_info) { + this.device_info = device_info; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getErr_code() { + return err_code; + } + + public void setErr_code(String err_code) { + this.err_code = err_code; + } + + public String getErr_code_des() { + return err_code_des; + } + + public void setErr_code_des(String err_code_des) { + this.err_code_des = err_code_des; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + + public String getPrepay_id() { + return prepay_id; + } + + public void setPrepay_id(String prepay_id) { + this.prepay_id = prepay_id; + } + + public String getCode_url() { + return code_url; + } + + public void setCode_url(String code_url) { + this.code_url = code_url; + } + + @Override + public String toString() { + return "WechatCallBackInfo{" + + "appid='" + appid + '\'' + + ", mch_id='" + mch_id + '\'' + + ", nonce_str='" + nonce_str + '\'' + + ", sign='" + sign + '\'' + + ", return_code='" + return_code + '\'' + + ", return_msg='" + return_msg + '\'' + + ", device_info='" + device_info + '\'' + + ", result_code='" + result_code + '\'' + + ", err_code='" + err_code + '\'' + + ", err_code_des='" + err_code_des + '\'' + + ", trade_type='" + trade_type + '\'' + + ", prepay_id='" + prepay_id + '\'' + + ", code_url='" + code_url + '\'' + + '}'; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/WechatPayReturnParam.java b/service/src/main/java/com/hfkj/common/pay/entity/WechatPayReturnParam.java new file mode 100644 index 0000000..a0dff02 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/WechatPayReturnParam.java @@ -0,0 +1,151 @@ +package com.hfkj.common.pay.entity; +/** + * + * @Description: 微信支付异步回调参数 + */ +public class WechatPayReturnParam { + private String appid; //是 String(32) wx8888888888888888 微信开放平台审核通过的应用APPID + private String attach; //否 String(128) 123456 商家数据包,原样返回 + private String bank_type; //是 String(16) CMC 银行类型,采用字符串类型的银行标识,银行类型见银行列表 + private String cash_fee; //是 Int 100 现金支付金额订单现金支付金额,详见支付金额 + private String fee_type; //否 String(8) CNY 货币类型,符合ISO4217标准的三位字母代码,默认人民币:CNY,其他值列表详见货币类型 + private String is_subscribe; //是 String(1) Y 用户是否关注公众账号,Y-关注,N-未关注 + private String mch_id; //是 String(32) 1900000109 微信支付分配的商户号 + private String nonce_str; //是 String(32) 5K8264ILTKCH16CQ2502SI8ZNMTM67VS 随机字符串,不长于32位 + private String openid; //是 String(128) wxd930ea5d5a258f4f 用户在商户appid下的唯一标识 + private String out_trade_no; //是 String(32) 1212321211201407033568112322 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*@ ,且在同一个商户号下唯一。 + private String result_code; //是 String(16) SUCCESS SUCCESS/FAIL + private String return_code; + private String time_end; //是 String(14) 20141030133525 支付完成时间,格式为yyyyMMddHHmmss,如2009年12月25日9点10分10秒表示为20091225091010。其他详见时间规 + private String total_fee; //是 Int 100 订单总金额,单位为分 + private String trade_type; //是 String(16) APP APP + private String transaction_id; //微信支付订单号 + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach; + } + + public String getBank_type() { + return bank_type; + } + + public void setBank_type(String bank_type) { + this.bank_type = bank_type; + } + + public String getCash_fee() { + return cash_fee; + } + + public void setCash_fee(String cash_fee) { + this.cash_fee = cash_fee; + } + + public String getFee_type() { + return fee_type; + } + + public void setFee_type(String fee_type) { + this.fee_type = fee_type; + } + + public String getIs_subscribe() { + return is_subscribe; + } + + public void setIs_subscribe(String is_subscribe) { + this.is_subscribe = is_subscribe; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getOpenid() { + return openid; + } + + public void setOpenid(String openid) { + this.openid = openid; + } + + public String getOut_trade_no() { + return out_trade_no; + } + + public void setOut_trade_no(String out_trade_no) { + this.out_trade_no = out_trade_no; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getTime_end() { + return time_end; + } + + public void setTime_end(String time_end) { + this.time_end = time_end; + } + + public String getTotal_fee() { + return total_fee; + } + + public void setTotal_fee(String total_fee) { + this.total_fee = total_fee; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + + public String getTransaction_id() { + return transaction_id; + } + + public void setTransaction_id(String transaction_id) { + this.transaction_id = transaction_id; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/entity/WechatReturn.java b/service/src/main/java/com/hfkj/common/pay/entity/WechatReturn.java new file mode 100644 index 0000000..26ab2fe --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/entity/WechatReturn.java @@ -0,0 +1,77 @@ +package com.hfkj.common.pay.entity; + +public class WechatReturn { + private String appid; + private String mch_id; + private String nonce_str; + private String prepay_id; + private String result_code; + private String return_code; + private String return_msg; + private String trade_type; + + public String getAppid() { + return appid; + } + + public void setAppid(String appid) { + this.appid = appid; + } + + public String getMch_id() { + return mch_id; + } + + public void setMch_id(String mch_id) { + this.mch_id = mch_id; + } + + public String getNonce_str() { + return nonce_str; + } + + public void setNonce_str(String nonce_str) { + this.nonce_str = nonce_str; + } + + public String getPrepay_id() { + return prepay_id; + } + + public void setPrepay_id(String prepay_id) { + this.prepay_id = prepay_id; + } + + public String getResult_code() { + return result_code; + } + + public void setResult_code(String result_code) { + this.result_code = result_code; + } + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + + public String getTrade_type() { + return trade_type; + } + + public void setTrade_type(String trade_type) { + this.trade_type = trade_type; + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/HttpReqUtil.java b/service/src/main/java/com/hfkj/common/pay/util/HttpReqUtil.java new file mode 100644 index 0000000..1dd670a --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/HttpReqUtil.java @@ -0,0 +1,329 @@ +package com.hfkj.common.pay.util; + +import org.apache.commons.lang3.StringUtils; + +import javax.imageio.ImageIO; +import javax.net.ssl.*; +import javax.servlet.http.HttpServletRequest; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.HttpURLConnection; +import java.net.URL; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.TreeMap; + +/** + * Http连接工具类 + * + * @author phil + * @date 2017年7月2日 + * + */ +public class HttpReqUtil { + + private static int DEFAULT_CONNTIME = 5000; + private static int DEFAULT_READTIME = 5000; + private static int DEFAULT_UPLOAD_READTIME = 10 * 1000; + public static String POST = "POST"; + public static String GET = "GET"; + /** + * http请求 + * + * @param method + * 请求方法GET/POST + * @param path + * 请求路径 + * @param timeout + * 连接超时时间 默认为5000 + * @param readTimeout + * 读取超时时间 默认为5000 + * @param data + * 数据 + * @return + */ + private static String defaultConnection(String method, String path, int timeout, int readTimeout, String data, String encoding) + throws Exception { + String result = ""; + URL url = new URL(path); + if (url != null) { + HttpURLConnection conn = getConnection(method, url); + conn.setConnectTimeout(timeout == 0 ? DEFAULT_CONNTIME : timeout); + conn.setReadTimeout(readTimeout == 0 ? DEFAULT_READTIME : readTimeout); + if (data != null && !"".equals(data)) { + OutputStream output = conn.getOutputStream(); + output.write(data.getBytes("UTF-8")); + output.flush(); + output.close(); + } + if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { + InputStream input = conn.getInputStream(); + result = IOUtil.inputStreamToString(input, encoding); + input.close(); + conn.disconnect(); + } + } + return result; + } + + /** + * 根据url的协议选择对应的请求方式 + * + * @param method + * 请求的方法 + * @return + * @throws IOException + */ + private static HttpURLConnection getConnection(String method, URL url) throws IOException { + HttpURLConnection conn = null; + if ("https".equals(url.getProtocol())) { + SSLContext context = null; + try { + context = SSLContext.getInstance("SSL", "SunJSSE"); + context.init(new KeyManager[0], new TrustManager[] { new MyX509TrustManager() }, + new java.security.SecureRandom()); + } catch (Exception e) { + throw new IOException(e); + } + HttpsURLConnection connHttps = (HttpsURLConnection) url.openConnection(); + connHttps.setSSLSocketFactory(context.getSocketFactory()); + connHttps.setHostnameVerifier(new HostnameVerifier() { + @Override + public boolean verify(String arg0, SSLSession arg1) { + return true; + } + }); + conn = connHttps; + } else { + conn = (HttpURLConnection) url.openConnection(); + } + conn.setRequestMethod(method); + conn.setUseCaches(false); + conn.setDoInput(true); + conn.setDoOutput(true); + return conn; + } + + /** + * 设置参数 + * + * @param map + * 参数map + * @param path + * 需要赋值的path + * @param charset + * 编码格式 默认编码为utf-8(取消默认) + * @return 已经赋值好的url 只需要访问即可 + */ + public static String setParmas(Map map, String path, String charset) throws Exception { + String result = ""; + boolean hasParams = false; + if (path != null && !"".equals(path)) { + if (map != null && map.size() > 0) { + StringBuilder builder = new StringBuilder(); + Set> params = map.entrySet(); + for (Entry entry : params) { + String key = entry.getKey().trim(); + String value = entry.getValue().trim(); + if (hasParams) { + builder.append("&"); + } else { + hasParams = true; + } + if (charset != null && !"".equals(charset)) { + // builder.append(key).append("=").append(URLDecoder.(value,charset)); + builder.append(key).append("=").append(IOUtil.urlEncode(value, charset)); + } else { + builder.append(key).append("=").append(value); + } + } + result = builder.toString(); + } + } + return doUrlPath(path, result).toString(); + } + + /** + * 设置连接参数 + * + * @param path + * 路径 + * @return + */ + private static URL doUrlPath(String path, String query) throws Exception { + URL url = new URL(path); + if (StringUtils.isEmpty(path)) { + return url; + } + if (StringUtils.isEmpty(url.getQuery())) { + if (path.endsWith("?")) { + path += query; + } else { + path = path + "?" + query; + } + } else { + if (path.endsWith("&")) { + path += query; + } else { + path = path + "&" + query; + } + } + return new URL(path); + } + + /** + * 默认的http请求执行方法,返回 + * + * @param method + * 请求的方法 POST/GET + * @param path + * 请求path 路径 + * @param map + * 请求参数集合 + * @param data + * 输入的数据 允许为空 + * @return + */ + public static String HttpDefaultExecute(String method, String path, Map map, String data, String encoding) { + String result = ""; + try { + String url = setParmas((TreeMap) map, path, ""); + result = defaultConnection(method, url, DEFAULT_CONNTIME, DEFAULT_READTIME, data, encoding); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** + * 默认的https执行方法,返回 + * + * @param method + * 请求的方法 POST/GET + * @param path + * 请求path 路径 + * @param map + * 请求参数集合 + * @param data + * 输入的数据 允许为空 + * @return + */ + public static String HttpsDefaultExecute(String method, String path, Map map, String data, String encoding) { + String result = ""; + try { + String url = setParmas((TreeMap) map, path, ""); + result = defaultConnection(method, url, DEFAULT_CONNTIME, DEFAULT_READTIME, data, encoding); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** + * 文件路径 + * + * @param mediaUrl + * url 例如 + * http://su.bdimg.com/static/superplus/img/logo_white_ee663702.png + * @return logo_white_ee663702.png + */ + private static String getFileName(String mediaUrl) { + String result = mediaUrl.substring(mediaUrl.lastIndexOf("/") + 1, mediaUrl.length()); + return result; + } + + /** + * 根据内容类型判断文件扩展名 + * + * @param ContentType + * 内容类型 + * @return + */ + private static String getFileExt(String contentType) { + String fileExt = ""; + if (contentType == null) { + return null; + } + if (contentType.contains("image/jpeg")) { + fileExt = ".jpg"; + } else if (contentType.contains("audio/mpeg")) { + fileExt = ".mp3"; + } else if (contentType.contains("audio/amr")) { + fileExt = ".amr"; + } else if (contentType.contains("video/mp4")) { + fileExt = ".mp4"; + } else if (contentType.contains("video/mpeg4")) { + fileExt = ".mp4"; + } else if (contentType.contains("image/png")) { + fileExt = ".png"; + } + return fileExt; + } + + + + + /** + * 改变图片大小、格式 + * + * @param is + * @param os + * @param size + * @param format + * @return + * @throws IOException + */ + public static OutputStream resizeImage(InputStream inputStream, OutputStream outputStream, int size, String format) + throws IOException { + BufferedImage prevImage = ImageIO.read(inputStream); + double width = prevImage.getWidth(); + double height = prevImage.getHeight(); + double percent = size / width; + int newWidth = (int) (width * percent); + int newHeight = (int) (height * percent); + BufferedImage image = new BufferedImage(newWidth, newHeight, BufferedImage.TYPE_INT_BGR); + Graphics graphics = image.createGraphics(); + graphics.drawImage(prevImage, 0, 0, newWidth, newHeight, null); + ImageIO.write(image, format, outputStream); + outputStream.flush(); + return outputStream; + } + + /** + * 获取客户端ip + * + * @param request + * @return + */ + public static String getRemortIP(HttpServletRequest request) { + String ip = request.getHeader("x-forwarded-for"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + + // squid的squid.conf 的配制文件中forwarded_for项改为off时 + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + + // 多级反向代理 + if (ip != null && ip.indexOf(",") > 0 && ip.split(",").length > 1) { + ip = ip.split(",")[0]; + } + return ip; + } + + + + + +} + diff --git a/service/src/main/java/com/hfkj/common/pay/util/IOUtil.java b/service/src/main/java/com/hfkj/common/pay/util/IOUtil.java new file mode 100644 index 0000000..f8dba18 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/IOUtil.java @@ -0,0 +1,73 @@ +package com.hfkj.common.pay.util; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; + +/** + * IO流工具类 + * @author 魏真峰 + */ +public class IOUtil { + + /** + * 将输入流转换为字符串 + *待转换为字符串的输入流 + * @return 由输入流转换String的字符串 + * @throws IOException + */ + public static String inputStreamToString(InputStream inputStream, String encoding) throws IOException { + if(StringUtils.isEmpty(encoding)) { + encoding = "UTF-8"; + } + return IOUtils.toString(inputStream, encoding); + } + + /** + * 将字符串转换为输入流 + * 待转换为输入流的字符串 + * @return + * @throws IOException + */ + public static InputStream toInputStream(String inputStr, String encoding) throws IOException { + if (StringUtils.isEmpty(inputStr)) { + return null; + } + if(StringUtils.isEmpty(encoding)) { + encoding = "UTF-8"; + } + return IOUtils.toInputStream(inputStr, encoding); + } + + + /** + * 编码 + * + * @param source + * @param encode + * @return + */ + public static String urlEncode(String source, String encode) { + String result = source; + try { + result = URLEncoder.encode(source, encode); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return result; + } + + /** + * 将输入流转换字节数组 + * @return + * @throws IOException + */ + public static byte[] inputStreamToByteArray(InputStream inputStream) throws IOException { + return IOUtils.toByteArray(inputStream); + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/MD5Util.java b/service/src/main/java/com/hfkj/common/pay/util/MD5Util.java new file mode 100644 index 0000000..720af70 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/MD5Util.java @@ -0,0 +1,55 @@ +package com.hfkj.common.pay.util; + +import org.apache.commons.lang3.StringUtils; + +import java.security.MessageDigest; + +/** + * MD5加密工具类 + * + * @author phil + * @date 2017年7月2日 + * + */ +public class MD5Util { + + private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", + "e", "f" }; + + private static String byteArrayToHexString(byte b[]) { + StringBuffer buffer = new StringBuffer(); + for (int i = 0; i < b.length; i++) + buffer.append(byteToHexString(b[i])); + return buffer.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if(StringUtils.isEmpty(charsetname)) { + resultString = byteArrayToHexString(md.digest(resultString.getBytes("UTF-8"))); + } else { + resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname))); + } + } catch (Exception exception) { + + } + return resultString; + } + + public static void main(String args[]) { + System.out.println(MD5Encode("ceshi", "gbk")); + System.out.println(MD5Encode("ceshi", "utf-8")); + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/MyX509TrustManager.java b/service/src/main/java/com/hfkj/common/pay/util/MyX509TrustManager.java new file mode 100644 index 0000000..6fde0b0 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/MyX509TrustManager.java @@ -0,0 +1,24 @@ +package com.hfkj.common.pay.util; + +import javax.net.ssl.X509TrustManager; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; + +/** + * 自定义信任管理器 + * + * @author phil + * @date 2017年7月2日 + */ +class MyX509TrustManager implements X509TrustManager { + + public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + + public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException { + } + + public X509Certificate[] getAcceptedIssuers() { + return null; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/SignatureUtil.java b/service/src/main/java/com/hfkj/common/pay/util/SignatureUtil.java new file mode 100644 index 0000000..07758e1 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/SignatureUtil.java @@ -0,0 +1,358 @@ +package com.hfkj.common.pay.util; + +import com.hfkj.common.pay.entity.WechatPayReturnParam; +import com.hfkj.common.pay.entity.WechatReturn; +import org.apache.commons.lang3.StringUtils; +import org.dom4j.DocumentException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.xml.sax.SAXException; + +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Map; +import java.util.SortedMap; + +/** + * + * @Title: + * @Description: 微信支付签名工具类 + * @author: 魏真峰 + * @param: + * @return: + * @throws + */ +public class SignatureUtil { + + private static Logger logger = LoggerFactory.getLogger(SignatureUtil.class); + + /** + * 将字节数组转换为十六进制字符串 + * @param byteArray + * @return + */ + private static String byteToStr(byte[] byteArray) { + String strDigest = ""; + for (int i = 0; i < byteArray.length; i++) { + strDigest += byteToHexStr(byteArray[i]); + } + return strDigest; + } + + /** + * 将字节转换为十六进制字符串 + * + * @param mByte + * @return + */ + private static String byteToHexStr(byte mByte) { + char[] Digit = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + char[] tempArr = new char[2]; + tempArr[0] = Digit[(mByte >>> 4) & 0X0F]; + tempArr[1] = Digit[mByte & 0X0F]; + return new String(tempArr); + } + + /** + * 获取签名 + * + * @param o + * 待加密的对象 该处仅限于Class + * @return + */ + public static String createSign(Object o, String apiKey, String encoding) { + String result = notSignParams(o, apiKey); + result = MD5Util.MD5Encode(result, encoding).toUpperCase(); + return result; + } + + /** + * 签名算法 + * + * @param o + * 要参与签名的数据对象 + * @param apiKey + * API密匙 + * @return 签名 + * @throws IllegalAccessException + */ + public static String notSignParams(Object o, String apiKey) { + ArrayList list = new ArrayList<>(); + String result = ""; + try { + Class cls = o.getClass(); + Field[] fields = cls.getDeclaredFields(); + list = getFieldList(fields, o); + Field[] superFields = cls.getSuperclass().getDeclaredFields(); // 获取父类的私有属性 + list.addAll(getFieldList(superFields, o)); + int size = list.size(); + String[] arrayToSort = list.toArray(new String[size]); + Arrays.sort(arrayToSort, String.CASE_INSENSITIVE_ORDER); // 严格按字母表顺序排序 + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append(arrayToSort[i]); + } + result = sb.toString(); + if (apiKey != null && !"".equals(apiKey)) { + result += "key=" + apiKey; + } else { + result = result.substring(0, result.lastIndexOf("&")); + } + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** + * 将字段集合方法转换 + * + * @param array + * @param object + * @return + * @throws IllegalArgumentException + * @throws IllegalAccessException + */ + private static ArrayList getFieldList(Field[] array, Object object) + throws IllegalArgumentException, IllegalAccessException { + ArrayList list = new ArrayList(); + for (Field f : array) { + f.setAccessible(true); + if (f.get(object) != null && f.get(object) != "" && !f.getName().equals("serialVersionUID") + && !f.getName().equals("sign")) { + if (f.getName().equals("packageStr")) { + list.add("package" + "=" + f.get(object) + "&"); + } else { + list.add(f.getName() + "=" + f.get(object) + "&"); + } + } + } + return list; + } + + /** + * 通过Map中的所有元素参与签名 + * + * @param map + * 待参与签名的map集合 + * @params apikey apikey中 如果为空则不参与签名,如果不为空则参与签名 + * @return + */ + public static String createSign(Map map, String apiKey, String characterEncoding) { + String result = notSignParams(map, apiKey); + result = MD5Util.MD5Encode(result, characterEncoding).toUpperCase(); + logger.debug("sign result {}", result); + return result; + } + + /** + * 通过Map中的所有元素参与签名 + * + * @param map + * 待参与签名的map集合 + * @params apikey apikey中 如果为空则不参与签名,如果不为空则参与签名 + * @return + */ + public static String createSign(SortedMap map, String apiKey, String characterEncoding) { + String result = notSignParams(map, apiKey); + result = MD5Util.MD5Encode(result, characterEncoding).toUpperCase(); + logger.debug("sign result {}", result); + return result; + } + + /** + * 通过Map中的所有元素参与签名 + * + * @param map + * 待参与签名的map集合 + * @params apikey apikey中 如果为空则不参与签名,如果不为空则参与签名 + * @return + */ + public static String createSha1Sign(SortedMap map, String apiKey, String characterEncoding) { + String result = notSignParams(map, apiKey); + MessageDigest md = null; + try { + md = MessageDigest.getInstance("SHA-1"); + byte[] digest = md.digest(result.getBytes(characterEncoding)); + result = byteToStr(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return result; + } + + /** + * 返回未加密的字符串 + * + * @param params + * @param apiKey + * @return 待加密的字符串 + */ + private static String notSignParams(SortedMap params, String apiKey) { + StringBuffer buffer = new StringBuffer(); + for (Map.Entry entry : params.entrySet()) { + if (!org.springframework.util.StringUtils.isEmpty(entry.getValue())) { + buffer.append(entry.getKey() + "=" + entry.getValue() + "&"); + } + } + buffer.append("key=" + apiKey); + return buffer.toString(); + } + + /** + * 返回未加密的字符串 + * + * @param params + * @param apiKey + * @return 待加密的字符串 + */ + public static String notSignParams(Map params, String apiKey) { + ArrayList list = new ArrayList<>(); + for (Map.Entry entry : params.entrySet()) { + if (entry.getValue() != "" && entry.getValue() != null) { + list.add(entry.getKey() + "=" + entry.getValue() + "&"); + } + } + int size = list.size(); + String[] arrayToSort = list.toArray(new String[size]); + Arrays.sort(arrayToSort, String.CASE_INSENSITIVE_ORDER); + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < size; i++) { + sb.append(arrayToSort[i]); + } + String result = sb.toString(); + if (apiKey != null && !"".equals(apiKey)) { + result += "key=" + apiKey; + } else { + result = result.substring(0, result.lastIndexOf("&")); + } + return result; + } + + /** + * 从API返回的XML数据里面重新计算一次签名 + * + * @param responseString + * API返回的XML数据 + * @param apiKey + * Key + * @return 新的签名 + * @throws ParserConfigurationException + * @throws IOException + * @throws SAXException + */ + public static String reCreateSign(String responseString, String apiKey, String encoding) + throws IOException, SAXException, ParserConfigurationException { + Map map = XmlUtil.parseXmlToMap(responseString, encoding); + // 清掉返回数据对象里面的Sign数据(不能把这个数据也加进去进行签名),然后用签名算法进行签名 + map.replace("sign",""); + // 将API返回的数据根据用签名算法进行计算新的签名,用来跟API返回的签名进行比较 + return createSign(map, apiKey, encoding); + } + + + /** + * 检验API返回的数据里面的签名是否合法,规则是:按参数名称a-z排序,遇到空值的参数不参加签名 + * + * @param resultXml + * API返回的XML数据字符串 + * @param apiKey + * Key + * @return API签名是否合法 + * @throws ParserConfigurationException + * @throws IOException + * @throws SAXException + * @throws DocumentException + */ + public static boolean checkIsSignValidFromWeiXin(String checktXml, String apiKey, String encoding) + throws ParserConfigurationException, IOException, SAXException, DocumentException { + SortedMap map = XmlUtil.parseXmlToTreeMap(checktXml,encoding); + String signFromresultXml = (String) map.get("sign"); + WechatReturn wechatReturn = new WechatReturn(); + wechatReturn.setAppid((String) map.get("appid")); + wechatReturn.setMch_id((String) map.get("mch_id")); + wechatReturn.setNonce_str((String) map.get("nonce_str")); + wechatReturn.setPrepay_id((String) map.get("prepay_id")); + wechatReturn.setResult_code((String) map.get("result_code")); + wechatReturn.setReturn_code((String) map.get("return_code")); + wechatReturn.setReturn_msg((String) map.get("return_msg")); + wechatReturn.setTrade_type((String) map.get("trade_type")); + if (StringUtils.isEmpty(signFromresultXml)) { + logger.debug("API返回的数据签名数据不存在"); + return false; + } + if(!("SUCCESS".equals(map.get("return_code"))) || !("SUCCESS".equals(map.get("result_code")))){ + logger.debug("返回代码不成功!"); + return false; + } + logger.debug("服务器回包里面的签名{}", signFromresultXml); + // 清掉返回数据对象里面的Sign数据(不能把这个数据也加进去进行签名),然后用签名算法进行签名 + // 将API返回的数据根据用签名算法进行计算新的签名,用来跟API返回的签名进行比较 +// String signForAPIResponse = createSign(wechatReturn, apiKey, encoding); +// if (!signForAPIResponse.equals(signFromresultXml)) { +// // 签名验不过,表示这个API返回的数据有可能已经被篡改了 +// logger.debug("API返回的数据签名验证不通过"); +// return false; +// } + logger.debug("API返回的数据签名验证通过"); + return true; + } + /** + * + * @Title: reCheckIsSignValidFromWeiXin + * @Description: 微信支付异步回调,检验签名是否正确 + * @author: 魏真峰 + * @param: [checktXml, apiKey, encoding] + * @return: boolean + * @throws + */ + public static boolean reCheckIsSignValidFromWeiXin(String checktXml, String apiKey, String encoding) + throws ParserConfigurationException, IOException, SAXException, DocumentException { + SortedMap map = XmlUtil.parseXmlToTreeMap(checktXml,encoding); + String signFromresultXml = (String) map.get("sign"); + WechatPayReturnParam wechatPayReturnParam = new WechatPayReturnParam(); + wechatPayReturnParam.setAppid((String) map.get("appid")); + wechatPayReturnParam.setAttach((String) map.get("attach")); + wechatPayReturnParam.setBank_type((String) map.get("bank_type")); + wechatPayReturnParam.setCash_fee((String) map.get("cash_fee")); + wechatPayReturnParam.setFee_type((String) map.get("fee_type")); + wechatPayReturnParam.setIs_subscribe((String) map.get("is_subscribe")); + wechatPayReturnParam.setMch_id((String) map.get("mch_id")); + wechatPayReturnParam.setNonce_str((String) map.get("nonce_str")); + wechatPayReturnParam.setOpenid((String) map.get("openid")); + wechatPayReturnParam.setOut_trade_no((String) map.get("out_trade_no")); + wechatPayReturnParam.setResult_code((String) map.get("result_code")); + wechatPayReturnParam.setReturn_code((String) map.get("return_code")); + wechatPayReturnParam.setTime_end((String) map.get("time_end")); + wechatPayReturnParam.setTotal_fee((String) map.get("total_fee")); + wechatPayReturnParam.setTrade_type((String) map.get("trade_type")); + wechatPayReturnParam.setTransaction_id((String) map.get("transaction_id")); + if (StringUtils.isEmpty(signFromresultXml)) { + logger.debug("API返回的数据签名数据不存在"); + return false; + } + if(!("SUCCESS".equals(map.get("return_code"))) || !("SUCCESS".equals(map.get("result_code")))){ + logger.debug("返回代码不成功!"); + return false; + } + logger.debug("服务器回包里面的签名{}", signFromresultXml); + // 清掉返回数据对象里面的Sign数据(不能把这个数据也加进去进行签名),然后用签名算法进行签名 + // 将API返回的数据根据用签名算法进行计算新的签名,用来跟API返回的签名进行比较 + String signForAPIResponse = createSign(wechatPayReturnParam, apiKey, encoding); + if (!signForAPIResponse.equals(signFromresultXml)) { + // 签名验不过,表示这个API返回的数据有可能已经被篡改了 + logger.debug("API返回的数据签名验证不通过"); + return false; + } + logger.debug("API返回的数据签名验证通过"); + return true; + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/XmlUtil.java b/service/src/main/java/com/hfkj/common/pay/util/XmlUtil.java new file mode 100644 index 0000000..ba7c038 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/XmlUtil.java @@ -0,0 +1,274 @@ +package com.hfkj.common.pay.util; + +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.core.util.QuickWriter; +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.io.xml.PrettyPrintWriter; +import com.thoughtworks.xstream.io.xml.XmlFriendlyNameCoder; +import com.thoughtworks.xstream.io.xml.XppDriver; +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.Element; +import org.dom4j.io.SAXReader; +import org.xml.sax.SAXException; + +import javax.servlet.http.HttpServletRequest; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Writer; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + +/** + * XML解析工具类 + * + * @author phil + * @date 2017年7月3日 + * + */ +public class XmlUtil { + + /** + * 解析微信发来的请求(XML) xml示例 + * + * 123456789 + * + * + * + * @param request + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public static Map parseXmlToMap(HttpServletRequest request){ + Map map = new HashMap<>(); + InputStream inputStream = null; + try { + // 从request中取得输入流 + inputStream = request.getInputStream(); + // 读取输入流 + SAXReader reader = new SAXReader(); + Document document = reader.read(inputStream); + // 得到xml根元素 + Element root = document.getRootElement(); + // 得到根元素的所有子节点 + List elementList = root.elements(); + // 遍历所有子节点 + for (Element e : elementList) { + map.put(e.getName(), e.getText()); + } + } catch (IOException | DocumentException e) { + e.printStackTrace(); + } + return map; + } + + /** + * 解析微信发来的请求(XML) xml示例 + * + * 123456789 + * + * + * + * @param request + * @return + * @throws Exception + */ + @SuppressWarnings("unchecked") + public static Map parseStreamToMap(InputStream inputStream) throws Exception { + Map map = new HashMap<>(); + try { + // 读取输入流 + SAXReader reader = new SAXReader(); + Document document = reader.read(inputStream); + // 得到xml根元素 + Element root = document.getRootElement(); + // 得到根元素的所有子节点 + List elementList = root.elements(); + // 遍历所有子节点 + for (Element e : elementList) { + map.put(e.getName(), e.getText()); + } + } catch (DocumentException e) { + e.printStackTrace(); + } + return map; + } + + /** + * 使用dom4将xml文件中的数据转换成SortedMap + * + * @param xmlString + * xml格式的字符串 + * @throws ParserConfigurationException + * @throws IOException + * @throws SAXException + */ + public static TreeMap parseXmlToTreeMap(String xml, String encoding) + throws ParserConfigurationException, IOException, SAXException { + // 这里用Dom的方式解析回包的最主要目的是防止API新增回包字段 + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + InputStream is = IOUtil.toInputStream(xml, encoding); + org.w3c.dom.Document document = builder.parse(is); + // 获取到document里面的全部结点 + org.w3c.dom.NodeList allNodes = document.getFirstChild().getChildNodes(); + org.w3c.dom.Node node; + TreeMap map = new TreeMap<>(); + int i = 0; + while (i < allNodes.getLength()) { + node = allNodes.item(i); + if (node instanceof org.w3c.dom.Element) { + map.put(node.getNodeName(), node.getTextContent()); + } + i++; + } + return map; + } + + /** + * 使用dom4将xml文件中的数据转换成Map + * + * @param xmlString xml格式的字符串 + * @throws ParserConfigurationException + * @throws IOException + * @throws SAXException + */ + public static Map parseXmlToMap(String xml, String encoding) + throws ParserConfigurationException, IOException, SAXException { + // 这里用Dom的方式解析回包的最主要目的是防止API新增回包字段 + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder builder = factory.newDocumentBuilder(); + InputStream is = IOUtil.toInputStream(xml, encoding); + org.w3c.dom.Document document = builder.parse(is); + // 获取到document里面的全部结点 + org.w3c.dom.NodeList allNodes = document.getFirstChild().getChildNodes(); + org.w3c.dom.Node node; + Map map = new HashMap<>(); + int i = 0; + while (i < allNodes.getLength()) { + node = allNodes.item(i); + if (node instanceof org.w3c.dom.Element) { + map.put(node.getNodeName(), node.getTextContent()); + } + i++; + } + return map; + } + + /** + * 示例 + * + * + * + * + * + * + * + * + * + * + * 将xml数据(格式)映射到java对象中 + * + * @param xml + * 待转换的xml格式的数据 + * @param t + * 待转换为的java对象 + * @return + */ + public static T getObjectFromXML(String xml, Class t) { + // 将从API返回的XML数据映射到Java对象 + XStream xstream = XStreamFactroy.init(true); + xstream.alias("xml", t); + xstream.ignoreUnknownElements();// 暂时忽略掉一些新增的字段 +// if(Objects.equals(xstream.fromXML(xml).getClass(), t.getClass())) { +// return t.cast(xstream.fromXML(xml)); +// } +// return null; + return t.cast(xstream.fromXML(xml)); + } + + /** + * 将java对象转换为xml(格式) + * + * @param obj + * @return + */ + public static String toXml(Object obj) { + String result = ""; + XStream xstream = XStreamFactroy.init(true); + xstream.alias("xml", obj.getClass()); + result = xstream.toXML(obj); + return result; + } + + /** + * 将java对象转换为xml文件,并去除 _ 应用场景是 去除实体中有_划线的实体, 默认会有两个_,调用该方法则会去除一个 + * + * @param obj + * @return + */ + public static String toSplitXml(Object obj) { + String result = ""; + XStream xstream = XStreamFactroy.initSplitLine(); + xstream.alias("xml", obj.getClass()); + result = xstream.toXML(obj); + return result.replaceAll(""","\""); + } + + /** + * XStream工具类 + * @author phil + * + */ + static class XStreamFactroy { + + private static final String START_CADA = ""; + + /** + * 是否启用 + * + * @param flag true 表示启用 false表示不启用 + * @return + */ + static XStream init(boolean flag) { + XStream xstream = null; + if (flag) { + xstream = new XStream(new XppDriver() { + public HierarchicalStreamWriter createWriter(Writer out) { + return new PrettyPrintWriter(out) { + @Override + protected void writeText(QuickWriter writer, String text) { + if (!text.startsWith(START_CADA)) { + text = START_CADA + text + END_CADA; + } + writer.write(text); + } + }; + } + }); + } else { + xstream = new XStream(); + } + return xstream; + } + + /** + * 用于处理在实体对象中带有_的属性,如果用上述方法,会出现有两个__,导致结果不正确! 属性中有_的属性一定要有改方法 + * + * @return 返回xstream 对象 new DomDriver("UTF-8", new + * XmlFriendlyNameCoder("-_", "_") + */ + public static XStream initSplitLine() { + XStream xstream = new XStream(new DomDriver("UTF-8", new XmlFriendlyNameCoder("-_", "_"))); + return xstream; + } + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/IWXPayDomain.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/IWXPayDomain.java new file mode 100644 index 0000000..947b077 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/IWXPayDomain.java @@ -0,0 +1,42 @@ +package com.hfkj.common.pay.util.sdk; + +/** + * 域名管理,实现主备域名自动切换 + */ +public abstract interface IWXPayDomain { + /** + * 上报域名网络状况 + * @param domain 域名。 比如:api.mch.weixin.qq.com + * @param elapsedTimeMillis 耗时 + * @param ex 网络请求中出现的异常。 + * null表示没有异常 + * ConnectTimeoutException,表示建立网络连接异常 + * UnknownHostException, 表示dns解析异常 + */ + abstract void report(final String domain, long elapsedTimeMillis, final Exception ex); + + /** + * 获取域名 + * @param config 配置 + * @return 域名 + */ + abstract DomainInfo getDomain(final WXPayConfig config); + + static class DomainInfo{ + public String domain; //域名 + public boolean primaryDomain; //该域名是否为主域名。例如:api.mch.weixin.qq.com为主域名 + public DomainInfo(String domain, boolean primaryDomain) { + this.domain = domain; + this.primaryDomain = primaryDomain; + } + + @Override + public String toString() { + return "DomainInfo{" + + "domain='" + domain + '\'' + + ", primaryDomain=" + primaryDomain + + '}'; + } + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPay.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPay.java new file mode 100644 index 0000000..078487b --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPay.java @@ -0,0 +1,689 @@ +package com.hfkj.common.pay.util.sdk; + +import com.hfkj.common.pay.util.sdk.WXPayConstants.SignType; + +import java.util.HashMap; +import java.util.Map; + +public class WXPay { + + private WXPayConfig config; + private SignType signType; + private boolean autoReport; + private boolean useSandbox; + private String notifyUrl; + private WXPayRequest wxPayRequest; + + public WXPay(final WXPayConfig config) throws Exception { + this(config, null, true, false); + } + + public WXPay(final WXPayConfig config, final boolean autoReport) throws Exception { + this(config, null, autoReport, false); + } + + + public WXPay(final WXPayConfig config, final boolean autoReport, final boolean useSandbox) throws Exception{ + this(config, null, autoReport, useSandbox); + } + + public WXPay(final WXPayConfig config, final String notifyUrl) throws Exception { + this(config, notifyUrl, true, false); + } + + public WXPay(final WXPayConfig config, final String notifyUrl, final boolean autoReport) throws Exception { + this(config, notifyUrl, autoReport, false); + } + + public WXPay(final WXPayConfig config, final String notifyUrl, final boolean autoReport, final boolean useSandbox) throws Exception { + this.config = config; + this.notifyUrl = notifyUrl; + this.autoReport = autoReport; + this.useSandbox = useSandbox; + if (useSandbox) { + this.signType = SignType.MD5; // 沙箱环境 + } + else { + this.signType = SignType.HMACSHA256; + } + this.wxPayRequest = new WXPayRequest(config); + } + + private void checkWXPayConfig() throws Exception { + if (this.config == null) { + throw new Exception("config is null"); + } + if (this.config.getAppID() == null || this.config.getAppID().trim().length() == 0) { + throw new Exception("appid in config is empty"); + } + if (this.config.getMchID() == null || this.config.getMchID().trim().length() == 0) { + throw new Exception("appid in config is empty"); + } + if (this.config.getCertStream() == null) { + throw new Exception("cert stream in config is empty"); + } + if (this.config.getWXPayDomain() == null){ + throw new Exception("config.getWXPayDomain() is null"); + } + + if (this.config.getHttpConnectTimeoutMs() < 10) { + throw new Exception("http connect timeout is too small"); + } + if (this.config.getHttpReadTimeoutMs() < 10) { + throw new Exception("http read timeout is too small"); + } + + } + + /** + * 向 Map 中添加 appid、mch_id、nonce_str、sign_type、sign
+ * 该函数适用于商户适用于统一下单等接口,不适用于红包、代金券接口 + * + * @param reqData + * @return + * @throws Exception + */ + public Map fillRequestData(Map reqData) throws Exception { + reqData.put("appid", config.getAppID()); + reqData.put("mch_id", config.getMchID()); + reqData.put("nonce_str", WXPayUtil.generateNonceStr()); + if (SignType.MD5.equals(this.signType)) { + reqData.put("sign_type", WXPayConstants.MD5); + } + else if (SignType.HMACSHA256.equals(this.signType)) { + reqData.put("sign_type", WXPayConstants.HMACSHA256); + } + reqData.put("sign", WXPayUtil.generateSignature(reqData, config.getKey(), this.signType)); + return reqData; + } + + /** + * 判断xml数据的sign是否有效,必须包含sign字段,否则返回false。 + * + * @param reqData 向wxpay post的请求数据 + * @return 签名是否有效 + * @throws Exception + */ + public boolean isResponseSignatureValid(Map reqData) throws Exception { + // 返回数据的签名方式和请求中给定的签名方式是一致的 + return WXPayUtil.isSignatureValid(reqData, this.config.getKey(), this.signType); + } + + /** + * 判断支付结果通知中的sign是否有效 + * + * @param reqData 向wxpay post的请求数据 + * @return 签名是否有效 + * @throws Exception + */ + public boolean isPayResultNotifySignatureValid(Map reqData) throws Exception { + String signTypeInData = reqData.get(WXPayConstants.FIELD_SIGN_TYPE); + SignType signType; + if (signTypeInData == null) { + signType = SignType.MD5; + } + else { + signTypeInData = signTypeInData.trim(); + if (signTypeInData.length() == 0) { + signType = SignType.MD5; + } + else if (WXPayConstants.MD5.equals(signTypeInData)) { + signType = SignType.MD5; + } + else if (WXPayConstants.HMACSHA256.equals(signTypeInData)) { + signType = SignType.HMACSHA256; + } + else { + throw new Exception(String.format("Unsupported sign_type: %s", signTypeInData)); + } + } + return WXPayUtil.isSignatureValid(reqData, this.config.getKey(), signType); + } + + + /** + * 不需要证书的请求 + * @param urlSuffix String + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 超时时间,单位是毫秒 + * @param readTimeoutMs 超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public String requestWithoutCert(String urlSuffix, Map reqData, + int connectTimeoutMs, int readTimeoutMs) throws Exception { + String msgUUID = reqData.get("nonce_str"); + String reqBody = WXPayUtil.mapToXml(reqData); + + String resp = this.wxPayRequest.requestWithoutCert(urlSuffix, msgUUID, reqBody, connectTimeoutMs, readTimeoutMs, autoReport); + return resp; + } + + + /** + * 需要证书的请求 + * @param urlSuffix String + * @param reqData 向wxpay post的请求数据 Map + * @param connectTimeoutMs 超时时间,单位是毫秒 + * @param readTimeoutMs 超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public String requestWithCert(String urlSuffix, Map reqData, + int connectTimeoutMs, int readTimeoutMs) throws Exception { + String msgUUID= reqData.get("nonce_str"); + String reqBody = WXPayUtil.mapToXml(reqData); + + String resp = this.wxPayRequest.requestWithCert(urlSuffix, msgUUID, reqBody, connectTimeoutMs, readTimeoutMs, this.autoReport); + return resp; + } + + /** + * 处理 HTTPS API返回数据,转换成Map对象。return_code为SUCCESS时,验证签名。 + * @param xmlStr API返回的XML格式数据 + * @return Map类型数据 + * @throws Exception + */ + public Map processResponseXml(String xmlStr) throws Exception { + String RETURN_CODE = "return_code"; + String return_code; + Map respData = WXPayUtil.xmlToMap(xmlStr); + if (respData.containsKey(RETURN_CODE)) { + return_code = respData.get(RETURN_CODE); + } + else { + throw new Exception(String.format("No `return_code` in XML: %s", xmlStr)); + } + + if (return_code.equals(WXPayConstants.FAIL)) { + return respData; + } + else if (return_code.equals(WXPayConstants.SUCCESS)) { + if (this.isResponseSignatureValid(respData)) { + return respData; + } + else { + throw new Exception(String.format("Invalid sign value in XML: %s", xmlStr)); + } + } + else { + throw new Exception(String.format("return_code value %s is invalid in XML: %s", return_code, xmlStr)); + } + } + + /** + * 作用:提交刷卡支付
+ * 场景:刷卡支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map microPay(Map reqData) throws Exception { + return this.microPay(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:提交刷卡支付
+ * 场景:刷卡支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map microPay(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_MICROPAY_URL_SUFFIX; + } + else { + url = WXPayConstants.MICROPAY_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + /** + * 提交刷卡支付,针对软POS,尽可能做成功 + * 内置重试机制,最多60s + * @param reqData + * @return + * @throws Exception + */ + public Map microPayWithPos(Map reqData) throws Exception { + return this.microPayWithPos(reqData, this.config.getHttpConnectTimeoutMs()); + } + + /** + * 提交刷卡支付,针对软POS,尽可能做成功 + * 内置重试机制,最多60s + * @param reqData + * @param connectTimeoutMs + * @return + * @throws Exception + */ + public Map microPayWithPos(Map reqData, int connectTimeoutMs) throws Exception { + int remainingTimeMs = 60*1000; + long startTimestampMs = 0; + Map lastResult = null; + Exception lastException = null; + + while (true) { + startTimestampMs = WXPayUtil.getCurrentTimestampMs(); + int readTimeoutMs = remainingTimeMs - connectTimeoutMs; + if (readTimeoutMs > 1000) { + try { + lastResult = this.microPay(reqData, connectTimeoutMs, readTimeoutMs); + String returnCode = lastResult.get("return_code"); + if (returnCode.equals("SUCCESS")) { + String resultCode = lastResult.get("result_code"); + String errCode = lastResult.get("err_code"); + if (resultCode.equals("SUCCESS")) { + break; + } + else { + // 看错误码,若支付结果未知,则重试提交刷卡支付 + if (errCode.equals("SYSTEMERROR") || errCode.equals("BANKERROR") || errCode.equals("USERPAYING")) { + remainingTimeMs = remainingTimeMs - (int)(WXPayUtil.getCurrentTimestampMs() - startTimestampMs); + if (remainingTimeMs <= 100) { + break; + } + else { + WXPayUtil.getLogger().info("microPayWithPos: try micropay again"); + if (remainingTimeMs > 5*1000) { + Thread.sleep(5*1000); + } + else { + Thread.sleep(1*1000); + } + continue; + } + } + else { + break; + } + } + } + else { + break; + } + } + catch (Exception ex) { + lastResult = null; + lastException = ex; + } + } + else { + break; + } + } + + if (lastResult == null) { + throw lastException; + } + else { + return lastResult; + } + } + + + + /** + * 作用:统一下单
+ * 场景:公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map unifiedOrder(Map reqData) throws Exception { + return this.unifiedOrder(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:统一下单
+ * 场景:公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map unifiedOrder(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_UNIFIEDORDER_URL_SUFFIX; + } + else { + url = WXPayConstants.UNIFIEDORDER_URL_SUFFIX; + } + if(this.notifyUrl != null) { + reqData.put("notify_url", this.notifyUrl); + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:查询订单
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map orderQuery(Map reqData) throws Exception { + return this.orderQuery(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:查询订单
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 int + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map orderQuery(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_ORDERQUERY_URL_SUFFIX; + } + else { + url = WXPayConstants.ORDERQUERY_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:撤销订单
+ * 场景:刷卡支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map reverse(Map reqData) throws Exception { + return this.reverse(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:撤销订单
+ * 场景:刷卡支付
+ * 其他:需要证书 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map reverse(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_REVERSE_URL_SUFFIX; + } + else { + url = WXPayConstants.REVERSE_URL_SUFFIX; + } + String respXml = this.requestWithCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:关闭订单
+ * 场景:公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map closeOrder(Map reqData) throws Exception { + return this.closeOrder(reqData, config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:关闭订单
+ * 场景:公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map closeOrder(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_CLOSEORDER_URL_SUFFIX; + } + else { + url = WXPayConstants.CLOSEORDER_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:申请退款
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map refund(Map reqData) throws Exception { + return this.refund(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:申请退款
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付
+ * 其他:需要证书 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map refund(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_REFUND_URL_SUFFIX; + } + else { + url = WXPayConstants.REFUND_URL_SUFFIX; + } + String respXml = this.requestWithCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:退款查询
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map refundQuery(Map reqData) throws Exception { + return this.refundQuery(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:退款查询
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map refundQuery(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_REFUNDQUERY_URL_SUFFIX; + } + else { + url = WXPayConstants.REFUNDQUERY_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:对账单下载(成功时返回对账单数据,失败时返回XML格式数据)
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map downloadBill(Map reqData) throws Exception { + return this.downloadBill(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:对账单下载
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付
+ * 其他:无论是否成功都返回Map。若成功,返回的Map中含有return_code、return_msg、data, + * 其中return_code为`SUCCESS`,data为对账单数据。 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return 经过封装的API返回数据 + * @throws Exception + */ + public Map downloadBill(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_DOWNLOADBILL_URL_SUFFIX; + } + else { + url = WXPayConstants.DOWNLOADBILL_URL_SUFFIX; + } + String respStr = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs).trim(); + Map ret; + // 出现错误,返回XML数据 + if (respStr.indexOf("<") == 0) { + ret = WXPayUtil.xmlToMap(respStr); + } + else { + // 正常返回csv数据 + ret = new HashMap(); + ret.put("return_code", WXPayConstants.SUCCESS); + ret.put("return_msg", "ok"); + ret.put("data", respStr); + } + return ret; + } + + + /** + * 作用:交易保障
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map report(Map reqData) throws Exception { + return this.report(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:交易保障
+ * 场景:刷卡支付、公共号支付、扫码支付、APP支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map report(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_REPORT_URL_SUFFIX; + } + else { + url = WXPayConstants.REPORT_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return WXPayUtil.xmlToMap(respXml); + } + + + /** + * 作用:转换短链接
+ * 场景:刷卡支付、扫码支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map shortUrl(Map reqData) throws Exception { + return this.shortUrl(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:转换短链接
+ * 场景:刷卡支付、扫码支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map shortUrl(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_SHORTURL_URL_SUFFIX; + } + else { + url = WXPayConstants.SHORTURL_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + + /** + * 作用:授权码查询OPENID接口
+ * 场景:刷卡支付 + * @param reqData 向wxpay post的请求数据 + * @return API返回数据 + * @throws Exception + */ + public Map authCodeToOpenid(Map reqData) throws Exception { + return this.authCodeToOpenid(reqData, this.config.getHttpConnectTimeoutMs(), this.config.getHttpReadTimeoutMs()); + } + + + /** + * 作用:授权码查询OPENID接口
+ * 场景:刷卡支付 + * @param reqData 向wxpay post的请求数据 + * @param connectTimeoutMs 连接超时时间,单位是毫秒 + * @param readTimeoutMs 读超时时间,单位是毫秒 + * @return API返回数据 + * @throws Exception + */ + public Map authCodeToOpenid(Map reqData, int connectTimeoutMs, int readTimeoutMs) throws Exception { + String url; + if (this.useSandbox) { + url = WXPayConstants.SANDBOX_AUTHCODETOOPENID_URL_SUFFIX; + } + else { + url = WXPayConstants.AUTHCODETOOPENID_URL_SUFFIX; + } + String respXml = this.requestWithoutCert(url, this.fillRequestData(reqData), connectTimeoutMs, readTimeoutMs); + return this.processResponseXml(respXml); + } + + +} // end class diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConfig.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConfig.java new file mode 100644 index 0000000..bcecc47 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConfig.java @@ -0,0 +1,103 @@ +package com.hfkj.common.pay.util.sdk; + +import java.io.InputStream; + +public abstract class WXPayConfig { + + + + /** + * 获取 App ID + * + * @return App ID + */ + abstract String getAppID(); + + + /** + * 获取 Mch ID + * + * @return Mch ID + */ + abstract String getMchID(); + + + /** + * 获取 API 密钥 + * + * @return API密钥 + */ + abstract String getKey(); + + + /** + * 获取商户证书内容 + * + * @return 商户证书内容 + */ + abstract InputStream getCertStream(); + + /** + * HTTP(S) 连接超时时间,单位毫秒 + * + * @return + */ + public int getHttpConnectTimeoutMs() { + return 6*1000; + } + + /** + * HTTP(S) 读数据超时时间,单位毫秒 + * + * @return + */ + public int getHttpReadTimeoutMs() { + return 8*1000; + } + + /** + * 获取WXPayDomain, 用于多域名容灾自动切换 + * @return + */ + abstract IWXPayDomain getWXPayDomain(); + + /** + * 是否自动上报。 + * 若要关闭自动上报,子类中实现该函数返回 false 即可。 + * + * @return + */ + public boolean shouldAutoReport() { + return true; + } + + /** + * 进行健康上报的线程的数量 + * + * @return + */ + public int getReportWorkerNum() { + return 6; + } + + + /** + * 健康上报缓存消息的最大数量。会有线程去独立上报 + * 粗略计算:加入一条消息200B,10000消息占用空间 2000 KB,约为2MB,可以接受 + * + * @return + */ + public int getReportQueueMaxSize() { + return 10000; + } + + /** + * 批量上报,一次最多上报多个数据 + * + * @return + */ + public int getReportBatchSize() { + return 10; + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConstants.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConstants.java new file mode 100644 index 0000000..673ea63 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayConstants.java @@ -0,0 +1,59 @@ +package com.hfkj.common.pay.util.sdk; + +import org.apache.http.client.HttpClient; + +/** + * 常量 + */ +public class WXPayConstants { + + public enum SignType { + MD5, HMACSHA256 + } + + public static final String DOMAIN_API = "api.mch.weixin.qq.com"; + public static final String DOMAIN_API2 = "api2.mch.weixin.qq.com"; + public static final String DOMAIN_APIHK = "apihk.mch.weixin.qq.com"; + public static final String DOMAIN_APIUS = "apius.mch.weixin.qq.com"; + + + public static final String FAIL = "FAIL"; + public static final String SUCCESS = "SUCCESS"; + public static final String HMACSHA256 = "HMAC-SHA256"; + public static final String MD5 = "MD5"; + + public static final String FIELD_SIGN = "sign"; + public static final String FIELD_SIGN_TYPE = "sign_type"; + + public static final String WXPAYSDK_VERSION = "WXPaySDK/3.0.9"; + public static final String USER_AGENT = WXPAYSDK_VERSION + + " (" + System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version") + + ") Java/" + System.getProperty("java.version") + " HttpClient/" + HttpClient.class.getPackage().getImplementationVersion(); + + public static final String MICROPAY_URL_SUFFIX = "/pay/micropay"; + public static final String UNIFIEDORDER_URL_SUFFIX = "/pay/unifiedorder"; + public static final String ORDERQUERY_URL_SUFFIX = "/pay/orderquery"; + public static final String REVERSE_URL_SUFFIX = "/secapi/pay/reverse"; + public static final String CLOSEORDER_URL_SUFFIX = "/pay/closeorder"; + public static final String REFUND_URL_SUFFIX = "/secapi/pay/refund"; + public static final String REFUNDQUERY_URL_SUFFIX = "/pay/refundquery"; + public static final String DOWNLOADBILL_URL_SUFFIX = "/pay/downloadbill"; + public static final String REPORT_URL_SUFFIX = "/payitil/report"; + public static final String SHORTURL_URL_SUFFIX = "/tools/shorturl"; + public static final String AUTHCODETOOPENID_URL_SUFFIX = "/tools/authcodetoopenid"; + + // sandbox + public static final String SANDBOX_MICROPAY_URL_SUFFIX = "/sandboxnew/pay/micropay"; + public static final String SANDBOX_UNIFIEDORDER_URL_SUFFIX = "/sandboxnew/pay/unifiedorder"; + public static final String SANDBOX_ORDERQUERY_URL_SUFFIX = "/sandboxnew/pay/orderquery"; + public static final String SANDBOX_REVERSE_URL_SUFFIX = "/sandboxnew/secapi/pay/reverse"; + public static final String SANDBOX_CLOSEORDER_URL_SUFFIX = "/sandboxnew/pay/closeorder"; + public static final String SANDBOX_REFUND_URL_SUFFIX = "/sandboxnew/secapi/pay/refund"; + public static final String SANDBOX_REFUNDQUERY_URL_SUFFIX = "/sandboxnew/pay/refundquery"; + public static final String SANDBOX_DOWNLOADBILL_URL_SUFFIX = "/sandboxnew/pay/downloadbill"; + public static final String SANDBOX_REPORT_URL_SUFFIX = "/sandboxnew/payitil/report"; + public static final String SANDBOX_SHORTURL_URL_SUFFIX = "/sandboxnew/tools/shorturl"; + public static final String SANDBOX_AUTHCODETOOPENID_URL_SUFFIX = "/sandboxnew/tools/authcodetoopenid"; + +} + diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayReport.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayReport.java new file mode 100644 index 0000000..bb02326 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayReport.java @@ -0,0 +1,265 @@ +package com.hfkj.common.pay.util.sdk; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; + +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadFactory; + +/** + * 交易保障 + */ +public class WXPayReport { + + public static class ReportInfo { + + /** + * 布尔变量使用int。0为false, 1为true。 + */ + + // 基本信息 + private String version = "v1"; + private String sdk = WXPayConstants.WXPAYSDK_VERSION; + private String uuid; // 交易的标识 + private long timestamp; // 上报时的时间戳,单位秒 + private long elapsedTimeMillis; // 耗时,单位 毫秒 + + // 针对主域名 + private String firstDomain; // 第1次请求的域名 + private boolean primaryDomain; //是否主域名 + private int firstConnectTimeoutMillis; // 第1次请求设置的连接超时时间,单位 毫秒 + private int firstReadTimeoutMillis; // 第1次请求设置的读写超时时间,单位 毫秒 + private int firstHasDnsError; // 第1次请求是否出现dns问题 + private int firstHasConnectTimeout; // 第1次请求是否出现连接超时 + private int firstHasReadTimeout; // 第1次请求是否出现连接超时 + + public ReportInfo(String uuid, long timestamp, long elapsedTimeMillis, String firstDomain, boolean primaryDomain, int firstConnectTimeoutMillis, int firstReadTimeoutMillis, boolean firstHasDnsError, boolean firstHasConnectTimeout, boolean firstHasReadTimeout) { + this.uuid = uuid; + this.timestamp = timestamp; + this.elapsedTimeMillis = elapsedTimeMillis; + this.firstDomain = firstDomain; + this.primaryDomain = primaryDomain; + this.firstConnectTimeoutMillis = firstConnectTimeoutMillis; + this.firstReadTimeoutMillis = firstReadTimeoutMillis; + this.firstHasDnsError = firstHasDnsError?1:0; + this.firstHasConnectTimeout = firstHasConnectTimeout?1:0; + this.firstHasReadTimeout = firstHasReadTimeout?1:0; + } + + @Override + public String toString() { + return "ReportInfo{" + + "version='" + version + '\'' + + ", sdk='" + sdk + '\'' + + ", uuid='" + uuid + '\'' + + ", timestamp=" + timestamp + + ", elapsedTimeMillis=" + elapsedTimeMillis + + ", firstDomain='" + firstDomain + '\'' + + ", primaryDomain=" + primaryDomain + + ", firstConnectTimeoutMillis=" + firstConnectTimeoutMillis + + ", firstReadTimeoutMillis=" + firstReadTimeoutMillis + + ", firstHasDnsError=" + firstHasDnsError + + ", firstHasConnectTimeout=" + firstHasConnectTimeout + + ", firstHasReadTimeout=" + firstHasReadTimeout + + '}'; + } + + /** + * 转换成 csv 格式 + * + * @return + */ + public String toLineString(String key) { + String separator = ","; + Object[] objects = new Object[] { + version, sdk, uuid, timestamp, elapsedTimeMillis, + firstDomain, primaryDomain, firstConnectTimeoutMillis, firstReadTimeoutMillis, + firstHasDnsError, firstHasConnectTimeout, firstHasReadTimeout + }; + StringBuffer sb = new StringBuffer(); + for(Object obj: objects) { + sb.append(obj).append(separator); + } + try { + String sign = WXPayUtil.HMACSHA256(sb.toString(), key); + sb.append(sign); + return sb.toString(); + } + catch (Exception ex) { + return null; + } + + } + + } + + private static final String REPORT_URL = "http://report.mch.weixin.qq.com/wxpay/report/default"; + // private static final String REPORT_URL = "http://127.0.0.1:5000/test"; + + + private static final int DEFAULT_CONNECT_TIMEOUT_MS = 6*1000; + private static final int DEFAULT_READ_TIMEOUT_MS = 8*1000; + + private LinkedBlockingQueue reportMsgQueue = null; + private WXPayConfig config; + private ExecutorService executorService; + + private volatile static WXPayReport INSTANCE; + + private WXPayReport(final WXPayConfig config) { + this.config = config; + reportMsgQueue = new LinkedBlockingQueue(config.getReportQueueMaxSize()); + + // 添加处理线程 + executorService = Executors.newFixedThreadPool(config.getReportWorkerNum(), new ThreadFactory() { + public Thread newThread(Runnable r) { + Thread t = Executors.defaultThreadFactory().newThread(r); + t.setDaemon(true); + return t; + } + }); + + if (config.shouldAutoReport()) { + WXPayUtil.getLogger().info("report worker num: {}", config.getReportWorkerNum()); + for (int i = 0; i < config.getReportWorkerNum(); ++i) { + executorService.execute(new Runnable() { + public void run() { + while (true) { + // 先用 take 获取数据 + try { + StringBuffer sb = new StringBuffer(); + String firstMsg = reportMsgQueue.take(); + WXPayUtil.getLogger().info("get first report msg: {}", firstMsg); + String msg = null; + sb.append(firstMsg); //会阻塞至有消息 + int remainNum = config.getReportBatchSize() - 1; + for (int j=0; jcreate() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + HttpClient httpClient = HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + + HttpPost httpPost = new HttpPost(REPORT_URL); + + RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build(); + httpPost.setConfig(requestConfig); + + StringEntity postEntity = new StringEntity(data, "UTF-8"); + httpPost.addHeader("Content-Type", "text/xml"); + httpPost.addHeader("User-Agent", WXPayConstants.USER_AGENT); + httpPost.setEntity(postEntity); + + HttpResponse httpResponse = httpClient.execute(httpPost); + HttpEntity httpEntity = httpResponse.getEntity(); + return EntityUtils.toString(httpEntity, "UTF-8"); + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayRequest.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayRequest.java new file mode 100644 index 0000000..b4dd08f --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayRequest.java @@ -0,0 +1,258 @@ +package com.hfkj.common.pay.util.sdk; + +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.config.RegistryBuilder; +import org.apache.http.conn.ConnectTimeoutException; +import org.apache.http.conn.socket.ConnectionSocketFactory; +import org.apache.http.conn.socket.PlainConnectionSocketFactory; +import org.apache.http.conn.ssl.DefaultHostnameVerifier; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.HttpClientBuilder; +import org.apache.http.impl.conn.BasicHttpClientConnectionManager; +import org.apache.http.util.EntityUtils; + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import java.io.InputStream; +import java.net.SocketTimeoutException; +import java.net.UnknownHostException; +import java.security.KeyStore; +import java.security.SecureRandom; + +import static com.hfkj.common.pay.util.sdk.WXPayConstants.USER_AGENT; + +public class WXPayRequest { + private WXPayConfig config; + public WXPayRequest(WXPayConfig config) throws Exception{ + + this.config = config; + } + + /** + * 请求,只请求一次,不做重试 + * @param domain + * @param urlSuffix + * @param uuid + * @param data + * @param connectTimeoutMs + * @param readTimeoutMs + * @param useCert 是否使用证书,针对退款、撤销等操作 + * @return + * @throws Exception + */ + private String requestOnce(final String domain, String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean useCert) throws Exception { + BasicHttpClientConnectionManager connManager; + if (useCert) { + // 证书 + char[] password = config.getMchID().toCharArray(); + InputStream certStream = config.getCertStream(); + KeyStore ks = KeyStore.getInstance("PKCS12"); + ks.load(certStream, password); + + // 实例化密钥库 & 初始化密钥工厂 + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, password); + + // 创建 SSLContext + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(kmf.getKeyManagers(), null, new SecureRandom()); + + SSLConnectionSocketFactory sslConnectionSocketFactory = new SSLConnectionSocketFactory( + sslContext, + new String[]{"TLSv1"}, + null, + new DefaultHostnameVerifier()); + + connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", sslConnectionSocketFactory) + .build(), + null, + null, + null + ); + } + else { + connManager = new BasicHttpClientConnectionManager( + RegistryBuilder.create() + .register("http", PlainConnectionSocketFactory.getSocketFactory()) + .register("https", SSLConnectionSocketFactory.getSocketFactory()) + .build(), + null, + null, + null + ); + } + + HttpClient httpClient = HttpClientBuilder.create() + .setConnectionManager(connManager) + .build(); + + String url = "https://" + domain + urlSuffix; + HttpPost httpPost = new HttpPost(url); + + RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(readTimeoutMs).setConnectTimeout(connectTimeoutMs).build(); + httpPost.setConfig(requestConfig); + + StringEntity postEntity = new StringEntity(data, "UTF-8"); + httpPost.addHeader("Content-Type", "text/xml"); + httpPost.addHeader("User-Agent", USER_AGENT + " " + config.getMchID()); + httpPost.setEntity(postEntity); + + HttpResponse httpResponse = httpClient.execute(httpPost); + HttpEntity httpEntity = httpResponse.getEntity(); + return EntityUtils.toString(httpEntity, "UTF-8"); + + } + + + private String request(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean useCert, boolean autoReport) throws Exception { + Exception exception = null; + long elapsedTimeMillis = 0; + long startTimestampMs = WXPayUtil.getCurrentTimestampMs(); + boolean firstHasDnsErr = false; + boolean firstHasConnectTimeout = false; + boolean firstHasReadTimeout = false; + IWXPayDomain.DomainInfo domainInfo = config.getWXPayDomain().getDomain(config); + if(domainInfo == null){ + throw new Exception("WXPayConfig.getWXPayDomain().getDomain() is empty or null"); + } + try { + String result = requestOnce(domainInfo.domain, urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, useCert); + elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs; + config.getWXPayDomain().report(domainInfo.domain, elapsedTimeMillis, null); + WXPayReport.getInstance(config).report( + uuid, + elapsedTimeMillis, + domainInfo.domain, + domainInfo.primaryDomain, + connectTimeoutMs, + readTimeoutMs, + firstHasDnsErr, + firstHasConnectTimeout, + firstHasReadTimeout); + return result; + } + catch (UnknownHostException ex) { // dns 解析错误,或域名不存在 + exception = ex; + firstHasDnsErr = true; + elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs; + WXPayUtil.getLogger().warn("UnknownHostException for domainInfo {}", domainInfo); + WXPayReport.getInstance(config).report( + uuid, + elapsedTimeMillis, + domainInfo.domain, + domainInfo.primaryDomain, + connectTimeoutMs, + readTimeoutMs, + firstHasDnsErr, + firstHasConnectTimeout, + firstHasReadTimeout + ); + } + catch (ConnectTimeoutException ex) { + exception = ex; + firstHasConnectTimeout = true; + elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs; + WXPayUtil.getLogger().warn("connect timeout happened for domainInfo {}", domainInfo); + WXPayReport.getInstance(config).report( + uuid, + elapsedTimeMillis, + domainInfo.domain, + domainInfo.primaryDomain, + connectTimeoutMs, + readTimeoutMs, + firstHasDnsErr, + firstHasConnectTimeout, + firstHasReadTimeout + ); + } + catch (SocketTimeoutException ex) { + exception = ex; + firstHasReadTimeout = true; + elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs; + WXPayUtil.getLogger().warn("timeout happened for domainInfo {}", domainInfo); + WXPayReport.getInstance(config).report( + uuid, + elapsedTimeMillis, + domainInfo.domain, + domainInfo.primaryDomain, + connectTimeoutMs, + readTimeoutMs, + firstHasDnsErr, + firstHasConnectTimeout, + firstHasReadTimeout); + } + catch (Exception ex) { + exception = ex; + elapsedTimeMillis = WXPayUtil.getCurrentTimestampMs()-startTimestampMs; + WXPayReport.getInstance(config).report( + uuid, + elapsedTimeMillis, + domainInfo.domain, + domainInfo.primaryDomain, + connectTimeoutMs, + readTimeoutMs, + firstHasDnsErr, + firstHasConnectTimeout, + firstHasReadTimeout); + } + config.getWXPayDomain().report(domainInfo.domain, elapsedTimeMillis, exception); + throw exception; + } + + + /** + * 可重试的,非双向认证的请求 + * @param urlSuffix + * @param uuid + * @param data + * @return + */ + public String requestWithoutCert(String urlSuffix, String uuid, String data, boolean autoReport) throws Exception { + return this.request(urlSuffix, uuid, data, config.getHttpConnectTimeoutMs(), config.getHttpReadTimeoutMs(), false, autoReport); + } + + /** + * 可重试的,非双向认证的请求 + * @param urlSuffix + * @param uuid + * @param data + * @param connectTimeoutMs + * @param readTimeoutMs + * @return + */ + public String requestWithoutCert(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean autoReport) throws Exception { + return this.request(urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, false, autoReport); + } + + /** + * 可重试的,双向认证的请求 + * @param urlSuffix + * @param uuid + * @param data + * @return + */ + public String requestWithCert(String urlSuffix, String uuid, String data, boolean autoReport) throws Exception { + return this.request(urlSuffix, uuid, data, config.getHttpConnectTimeoutMs(), config.getHttpReadTimeoutMs(), true, autoReport); + } + + /** + * 可重试的,双向认证的请求 + * @param urlSuffix + * @param uuid + * @param data + * @param connectTimeoutMs + * @param readTimeoutMs + * @return + */ + public String requestWithCert(String urlSuffix, String uuid, String data, int connectTimeoutMs, int readTimeoutMs, boolean autoReport) throws Exception { + return this.request(urlSuffix, uuid, data, connectTimeoutMs, readTimeoutMs, true, autoReport); + } +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayUtil.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayUtil.java new file mode 100644 index 0000000..5528a35 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayUtil.java @@ -0,0 +1,295 @@ +package com.hfkj.common.pay.util.sdk; + +import com.hfkj.common.pay.util.sdk.WXPayConstants.SignType; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.StringWriter; +import java.security.MessageDigest; +import java.security.SecureRandom; +import java.util.*; + + +public class WXPayUtil { + + private static final String SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + private static final Random RANDOM = new SecureRandom(); + + /** + * XML格式字符串转换为Map + * + * @param strXML XML字符串 + * @return XML数据转换后的Map + * @throws Exception + */ + public static Map xmlToMap(String strXML) throws Exception { + try { + Map data = new HashMap(); + DocumentBuilder documentBuilder = WXPayXmlUtil.newDocumentBuilder(); + InputStream stream = new ByteArrayInputStream(strXML.getBytes("UTF-8")); + org.w3c.dom.Document doc = documentBuilder.parse(stream); + doc.getDocumentElement().normalize(); + NodeList nodeList = doc.getDocumentElement().getChildNodes(); + for (int idx = 0; idx < nodeList.getLength(); ++idx) { + Node node = nodeList.item(idx); + if (node.getNodeType() == Node.ELEMENT_NODE) { + org.w3c.dom.Element element = (org.w3c.dom.Element) node; + data.put(element.getNodeName(), element.getTextContent()); + } + } + try { + stream.close(); + } catch (Exception ex) { + // do nothing + } + return data; + } catch (Exception ex) { + WXPayUtil.getLogger().warn("Invalid XML, can not convert to map. Error message: {}. XML content: {}", ex.getMessage(), strXML); + throw ex; + } + + } + + /** + * 将Map转换为XML格式的字符串 + * + * @param data Map类型数据 + * @return XML格式的字符串 + * @throws Exception + */ + public static String mapToXml(Map data) throws Exception { + org.w3c.dom.Document document = WXPayXmlUtil.newDocument(); + org.w3c.dom.Element root = document.createElement("xml"); + document.appendChild(root); + for (String key: data.keySet()) { + String value = data.get(key); + if (value == null) { + value = ""; + } + value = value.trim(); + org.w3c.dom.Element filed = document.createElement(key); + filed.appendChild(document.createTextNode(value)); + root.appendChild(filed); + } + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + DOMSource source = new DOMSource(document); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + transformer.transform(source, result); + String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", ""); + try { + writer.close(); + } + catch (Exception ex) { + } + return output; + } + + + /** + * 生成带有 sign 的 XML 格式字符串 + * + * @param data Map类型数据 + * @param key API密钥 + * @return 含有sign字段的XML + */ + public static String generateSignedXml(final Map data, String key) throws Exception { + return generateSignedXml(data, key, SignType.MD5); + } + + /** + * 生成带有 sign 的 XML 格式字符串 + * + * @param data Map类型数据 + * @param key API密钥 + * @param signType 签名类型 + * @return 含有sign字段的XML + */ + public static String generateSignedXml(final Map data, String key, SignType signType) throws Exception { + String sign = generateSignature(data, key, signType); + data.put(WXPayConstants.FIELD_SIGN, sign); + return mapToXml(data); + } + + + /** + * 判断签名是否正确 + * + * @param xmlStr XML格式数据 + * @param key API密钥 + * @return 签名是否正确 + * @throws Exception + */ + public static boolean isSignatureValid(String xmlStr, String key) throws Exception { + Map data = xmlToMap(xmlStr); + if (!data.containsKey(WXPayConstants.FIELD_SIGN) ) { + return false; + } + String sign = data.get(WXPayConstants.FIELD_SIGN); + return generateSignature(data, key).equals(sign); + } + + /** + * 判断签名是否正确,必须包含sign字段,否则返回false。使用MD5签名。 + * + * @param data Map类型数据 + * @param key API密钥 + * @return 签名是否正确 + * @throws Exception + */ + public static boolean isSignatureValid(Map data, String key) throws Exception { + return isSignatureValid(data, key, SignType.MD5); + } + + /** + * 判断签名是否正确,必须包含sign字段,否则返回false。 + * + * @param data Map类型数据 + * @param key API密钥 + * @param signType 签名方式 + * @return 签名是否正确 + * @throws Exception + */ + public static boolean isSignatureValid(Map data, String key, SignType signType) throws Exception { + if (!data.containsKey(WXPayConstants.FIELD_SIGN) ) { + return false; + } + String sign = data.get(WXPayConstants.FIELD_SIGN); + return generateSignature(data, key, signType).equals(sign); + } + + /** + * 生成签名 + * + * @param data 待签名数据 + * @param key API密钥 + * @return 签名 + */ + public static String generateSignature(final Map data, String key) throws Exception { + return generateSignature(data, key, SignType.MD5); + } + + /** + * 生成签名. 注意,若含有sign_type字段,必须和signType参数保持一致。 + * + * @param data 待签名数据 + * @param key API密钥 + * @param signType 签名方式 + * @return 签名 + */ + public static String generateSignature(final Map data, String key, SignType signType) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k).trim().length() > 0) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k).trim()).append("&"); + } + sb.append("key=").append(key); + if (SignType.MD5.equals(signType)) { + return MD5(sb.toString()).toUpperCase(); + } + else if (SignType.HMACSHA256.equals(signType)) { + return HMACSHA256(sb.toString(), key); + } + else { + throw new Exception(String.format("Invalid sign_type: %s", signType)); + } + } + + + /** + * 获取随机字符串 Nonce Str + * + * @return String 随机字符串 + */ + public static String generateNonceStr() { + char[] nonceChars = new char[32]; + for (int index = 0; index < nonceChars.length; ++index) { + nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length())); + } + return new String(nonceChars); + } + + + /** + * 生成 MD5 + * + * @param data 待处理数据 + * @return MD5结果 + */ + public static String MD5(String data) throws Exception { + MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] array = md.digest(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + for (byte item : array) { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + return sb.toString().toUpperCase(); + } + + /** + * 生成 HMACSHA256 + * @param data 待处理数据 + * @param key 密钥 + * @return 加密结果 + * @throws Exception + */ + public static String HMACSHA256(String data, String key) throws Exception { + Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256"); + sha256_HMAC.init(secret_key); + byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + for (byte item : array) { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + return sb.toString().toUpperCase(); + } + + /** + * 日志 + * @return + */ + public static Logger getLogger() { + Logger logger = LoggerFactory.getLogger("wxpay java sdk"); + return logger; + } + + /** + * 获取当前时间戳,单位秒 + * @return + */ + public static long getCurrentTimestamp() { + return System.currentTimeMillis()/1000; + } + + /** + * 获取当前时间戳,单位毫秒 + * @return + */ + public static long getCurrentTimestampMs() { + return System.currentTimeMillis(); + } + +} diff --git a/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayXmlUtil.java b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayXmlUtil.java new file mode 100644 index 0000000..77f5f29 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/pay/util/sdk/WXPayXmlUtil.java @@ -0,0 +1,30 @@ +package com.hfkj.common.pay.util.sdk; + +import org.w3c.dom.Document; + +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +/** + * 2018/7/3 + */ +public final class WXPayXmlUtil { + public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + documentBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + documentBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); + documentBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + documentBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + documentBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + documentBuilderFactory.setXIncludeAware(false); + documentBuilderFactory.setExpandEntityReferences(false); + + return documentBuilderFactory.newDocumentBuilder(); + } + + public static Document newDocument() throws ParserConfigurationException { + return newDocumentBuilder().newDocument(); + } +} diff --git a/service/src/main/java/com/hfkj/common/security/AESEncodeUtil.java b/service/src/main/java/com/hfkj/common/security/AESEncodeUtil.java new file mode 100644 index 0000000..84199fa --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/AESEncodeUtil.java @@ -0,0 +1,80 @@ +package com.hfkj.common.security; + +import org.apache.commons.lang3.StringUtils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.math.BigInteger; +import java.security.SecureRandom; +import java.util.Base64; + +public class AESEncodeUtil { + + private static final String SEC_KEY="Skufk5oi85wDFGl888i6wsRSTkdd5df5"; + public static String binary(byte[] bytes, int radix){ + return new BigInteger(1, bytes).toString(radix); + } + + public static String base64Encode(byte[] bytes){ + return Base64.getEncoder().encodeToString(bytes);//.replaceAll("\\s*", ""); + } + + public static byte[] base64Decode(String base64Code) throws Exception{ + return StringUtils.isEmpty(base64Code) ? null : Base64.getDecoder().decode(base64Code); + } + + public static byte[] aesEncryptToBytes(String content, String encryptKey) throws Exception{ + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG"); + secureRandom.setSeed(encryptKey.getBytes()); + kgen.init(128, secureRandom); + Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); + cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(kgen.generateKey().getEncoded(), "AES")); + return cipher.doFinal(content.getBytes("utf-8")); + + } + + public static String aesEncrypt(String content) throws Exception{ + return base64Encode(aesEncryptToBytes(content, SEC_KEY)); + //return content; + } + + public static String aesEncrypt(String content, String key) throws Exception { + return base64Encode(aesEncryptToBytes(content, key)); + } + + public static String aesDecryptByBytes(byte[] encryptBytes, String decryptKey) throws Exception{ + KeyGenerator kgen = KeyGenerator.getInstance("AES"); + SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG"); + secureRandom.setSeed(decryptKey.getBytes()); + kgen.init(128, secureRandom); + +// byte[] key = {86, -42, -11, 12, 92, 41, 31, -48, 104, 31, -38, 106, -51, -16, -55, -96}; + + Cipher cipher = Cipher.getInstance("AES"); + cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(kgen.generateKey().getEncoded(), "AES")); + byte[] decryptBytes = cipher.doFinal(encryptBytes); + + return new String(decryptBytes); + } + + public static String aesDecrypt(String encryptStr) throws Exception{ + return StringUtils.isEmpty(encryptStr) ? null : aesDecryptByBytes(base64Decode(encryptStr), SEC_KEY); + } + + public static void main(String[] args) throws Exception{ + long currentTimeMillis = System.currentTimeMillis(); + + System.out.println(AESEncodeUtil.aesEncrypt("123456")); + /* String content = "{\"create_time\":1573544092110,\"order_serial_no\":\"40280e816db49c0b016db4a2c31f0004\",\"product_code\":\"8a9e80045cf85e54015cf8809fcd\",\"product_name\":\"平安发票贷\",\"uscc\":\"91370781687233838E\"}"; + System.out.println("加密前" + content); + + String encrypt = com.sun.org.apache.xml.internal.security.utils.Base64.encode(aesEncryptToBytes(content, "WdOjUqtRxcBshw")); + System.out.println("加密后" + encrypt);*/ + +/* String decrypt = aesDecryptByBytes(base64Decode("i98CPRG2UI2kRzP9WE6WyF7hQQmZB5nOvc9s8BoISUJlrt59R3TPFiDYI9FNpj3BtKKR8P9JMoTSRP0/lP+SzA=="), "WdOjUqtRxcBshw"); + System.out.println("解密后" + decrypt); + System.out.println(System.currentTimeMillis() - currentTimeMillis);*/ + } +} diff --git a/service/src/main/java/com/hfkj/common/security/AuthManager.java b/service/src/main/java/com/hfkj/common/security/AuthManager.java new file mode 100644 index 0000000..6ca9af4 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/AuthManager.java @@ -0,0 +1,13 @@ +package com.hfkj.common.security; + + +import java.lang.annotation.*; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface AuthManager { + + String desc() default ""; + +} diff --git a/service/src/main/java/com/hfkj/common/security/Base64Util.java b/service/src/main/java/com/hfkj/common/security/Base64Util.java new file mode 100644 index 0000000..a78fbaf --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/Base64Util.java @@ -0,0 +1,42 @@ +package com.hfkj.common.security; + +import java.util.Base64; + +public class Base64Util { + /** + * @param data + * @return str + * @throws Exception + */ + public static String encode(String data) throws Exception{ +// String encodeBase64 = new BASE64Encoder().encode(data.getBytes("utf-8")); + String encodeBase64 = Base64.getEncoder().encodeToString(data.getBytes("utf-8")); + String safeBase64Str = encodeBase64.replace('+', '-'); + safeBase64Str = safeBase64Str.replace('/', '_'); + safeBase64Str = safeBase64Str.replaceAll("=", ""); + return safeBase64Str.replaceAll("\\s*", ""); + } + + /** + * @param safeBase64Str + * @return str + * @throws Exception + */ + public static String decode(final String safeBase64Str) throws Exception{ + String base64Str = safeBase64Str.replace('-', '+'); + base64Str = base64Str.replace('_', '/'); + int mod4 = base64Str.length() % 4; + if(mod4 > 0){ + base64Str += "====".substring(mod4); + } + +// byte[] ret = new BASE64Decoder().decodeBuffer(base64Str); + byte[] ret = Base64.getDecoder().decode(base64Str); + return new String(ret, "utf-8"); + } + + public static void main(String[] args) throws Exception { + System.out.println(encode("abcd1234")); + System.out.println(decode("YWJjZDEyMzQ")); + } +} diff --git a/service/src/main/java/com/hfkj/common/security/CookieUtil.java b/service/src/main/java/com/hfkj/common/security/CookieUtil.java new file mode 100644 index 0000000..93618a9 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/CookieUtil.java @@ -0,0 +1,123 @@ +package com.hfkj.common.security; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.HashMap; +import java.util.Map; + +public class CookieUtil { + /** + * 保存cookie + * + * @param request + * @param response + * @param name + * @param value + * @param expire + * unit:second + */ + public static void saveCookie(HttpServletRequest request, HttpServletResponse response, String name, String value, int expire){ + Cookie cookie; + if(containsName(request, name)){ + cookie = getCookieByName(request, name); + cookie.setValue(value); + }else{ + cookie = new Cookie(name, value); + } + cookie.setMaxAge(expire); + cookie.setPath("/"); + response.addCookie(cookie); + } + + /** + * 保存cookie + * + * @param request + * @param response + * @param name + * @param value + * @param expire + */ + public static void saveCookie(HttpServletResponse response, String name, String value, int expire){ + Cookie cookie = new Cookie(name, value); + cookie.setMaxAge(expire); + cookie.setPath("/"); + response.addCookie(cookie); + } + + /** + * 根据名字获取cookie + * + * @param request + * @param name + * cookie名字 + * @return cookie + */ + public static Cookie getCookieByName(HttpServletRequest request, String name){ + Map cookieMap = readCookieMap(request); + if(cookieMap.containsKey(name)){ + return cookieMap.get(name); + } + return null; + } + + /** + * 判断cookie中是否存在该名字 + * + * @param request + * @param name + * @return true if contains + */ + public static boolean containsName(HttpServletRequest request, String name){ + Map cookieMap = readCookieMap(request); + return cookieMap.containsKey(name); + } + + /** + * 删除cookie + * + * @param request + * @param response + * @param name + */ + public static void delCookie(HttpServletResponse response, String name){ + saveCookie(response, name, null, 0); + } + + /** + * 刷新cookie + * + * @param request + * @param response + * @param name + * @param expire + */ + public static void refreshCookie(HttpServletRequest request, HttpServletResponse response, String name, int expire){ + if(containsName(request, name)){ + Cookie cookie = getCookieByName(request, name); + cookie.setMaxAge(expire); + cookie.setPath("/"); + response.addCookie(cookie); + } + } + + /** + * 将cookie封装到Map里面 + * + * @param request + * @return + */ + private static Map readCookieMap(HttpServletRequest request){ + Map cookieMap = new HashMap(); + Cookie[] cookies = request.getCookies(); + /* request.getCookies(); + Cookie[] cookies = request.getHeader("");*/ + if(cookies != null){ + for(Cookie cookie : cookies){ + cookieMap.put(cookie.getName(), cookie); + } + } + return cookieMap; + } +} diff --git a/service/src/main/java/com/hfkj/common/security/DesUtil.java b/service/src/main/java/com/hfkj/common/security/DesUtil.java new file mode 100644 index 0000000..e409578 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/DesUtil.java @@ -0,0 +1,277 @@ +package com.hfkj.common.security; + +import java.nio.charset.Charset; +import java.security.Key; +import java.security.SecureRandom; +import java.security.spec.AlgorithmParameterSpec; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESKeySpec; +import javax.crypto.spec.DESedeKeySpec; +import javax.crypto.spec.IvParameterSpec; + +import org.apache.commons.codec.binary.Base64; +//import org.apache.commons.lang3.RandomStringUtils; + + +import com.thoughtworks.xstream.core.util.Base64Encoder; + +public class DesUtil { + + public static final String ALGORITHM_DES = "DES/CBC/PKCS5Padding"; + + /** + * DES算法,加密 + * + * @param data + * 待加密字符串 + * @param key + * 加密私钥,长度不能够小于8位 + * @return 加密后的字节数组,一般结合Base64编码使用 + * @throws CryptException + * 异常 + */ + public static byte[] encode(String key, String data) throws Exception { + return encode(key, data.getBytes()); + } + + /** + * DES算法,加密 + * + * @param data + * 待加密字符串 + * @param key + * 加密私钥,长度不能够小于8位 + * @return 加密后的字节数组,一般结合Base64编码使用 + * @throws CryptException + * 异常 + */ + public static byte[] encode(String key, byte[] data) throws Exception { + try { + DESKeySpec dks = new DESKeySpec(key.getBytes()); + + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); + // key的长度不能够小于8位字节 + Key secretKey = keyFactory.generateSecret(dks); + Cipher cipher = Cipher.getInstance(ALGORITHM_DES); + IvParameterSpec iv = new IvParameterSpec(key.getBytes()); + AlgorithmParameterSpec paramSpec = iv; + cipher.init(Cipher.ENCRYPT_MODE, secretKey, paramSpec); + + byte[] bytes = cipher.doFinal(data); + return bytes; + // return byte2HexStr(bytes); + // return byte2hex(new String(bytes)); + // return new String(new BASE64Encoder().encode(bytes)); + // return new String(bytes); + } catch (Exception e) { + throw new Exception(e); + } + } + + /** + * DES算法,解密 + * + * @param data + * 待解密字符串 + * @param key + * 解密私钥,长度不能够小于8位 + * @return 解密后的字节数组 + * @throws Exception + * 异常 + */ + public static byte[] decode(String key, byte[] data) throws Exception { + try { + // SecureRandom sr = new SecureRandom(); + DESKeySpec dks = new DESKeySpec(key.getBytes()); + SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); + // key的长度不能够小于8位字节 + Key secretKey = keyFactory.generateSecret(dks); + Cipher cipher = Cipher.getInstance(ALGORITHM_DES); + IvParameterSpec iv = new IvParameterSpec(key.getBytes()); + AlgorithmParameterSpec paramSpec = iv; + cipher.init(Cipher.DECRYPT_MODE, secretKey, paramSpec); + return cipher.doFinal(data); + } catch (Exception e) { + throw new Exception(e); + } + } + + /** + * 获取编码后的值 + * + * @param key + * @param data + * @return + * @throws Exception + */ + public static String decode(String key, String data) { + byte[] datas; + String value = null; + try { + + datas = decode(key, new Base64Encoder().decode(data)); + + value = new String(datas); + } catch (Exception e) { + value = ""; + } + return value; + } + + public static String byte2HexStr(byte[] b) { + String hs = ""; + String stmp = ""; + for (int n = 0; n < b.length; n++) { + stmp = (Integer.toHexString(b[n] & 0XFF)); + if (stmp.length() == 1) + hs = hs + "0" + stmp; + else + hs = hs + stmp; + // if (n8800030132003900701123120457349857394500000188000301650001000402016-07-28 13:20:50150"; + // String s = HexUtil.byte2HexStr(DesUtil.encode(key, data)); + // System.err.println(s); + // System.err.println(DesUtil.encode(key, data.getBytes()).length); + // String s2 = new String(DesUtil.decode(key, HexUtil.hexStr2Bytes(s))); + // System.err.println(s2); + + // String s = encode("123", Charset.forName("GBK"), "d0fb65e5"); + // System.out.println(s); + // + // String e = decode("d0fb65e5", "258946d6143e30f9", + // Charset.forName("UTF-8")); + // System.out.println(e); + + /*String s = encode("中国", Charset.forName("UTF-8"),"12345678"); + System.out.println(s);*/ + //String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDwYfnUdBVz6Kj4HS2oCA1TTiqJkCUIYa5ckMhJeByBCAMsqu21LmFjb/hdW0y1Tt0Wk5PqmO8FAg=="; + String data = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YDMmj1rv5nOrkawWt8fskSihNw0wugKUT1xWjHhIN8af7NylRVfhJvbeja2Zjjxnwk3FEKgyvIvJnk3QgiY4aghqQcGKxDOlAxT/kjrkDd2ESu1IWkpi+0HGnG3rKSL6+a1Nu7aW+rPHwXUOmHSgWFZFb9HhlfKI/jml3GhMZBWsZFirayyMMi8UKrdYN7ANPEB/6uV9iVtpLF5Kz8M2+GpI0EqRhPFAH2u3Q/RSgW8ei2ZbOY9NnbkdwuOjU93wgJxdY1Y93hvLYNe1i9QkSM1"; + String data1 = "T3xbPEKEXV9+CbBw8D1B+N2jk8xwa55s0Bde48c49YBr4/b4yBwN2FIVZZn+Xg9KQTDoTCLu3YtByaWh7zPmdcpBr9FGARduhPrwSnYTFJ0VVVSK/UzPWdHN2YYd4yHGQRJ2HEr/1egt2JUHpWr0JA=="; +/* { + "success": true, + "message": "ok", + "cards": [{ + "cardNo": "8800030115015107746" + }, { + "cardNo": "8800030115015119428" + }, { + "cardNo": "8800030128003170055" + }, { + "cardNo": "8800030132003656709" + }, { + "cardNo": "8800030132004014510" + }, { + "cardNo": "8800031104000000248" + }] + }*/ + + String a = decode("F8E91A3C", data,Charset.forName("UTF-8")); + System.out.println(a); + System.out.println("完成"); + } +} diff --git a/service/src/main/java/com/hfkj/common/security/LoginCache.java b/service/src/main/java/com/hfkj/common/security/LoginCache.java new file mode 100644 index 0000000..34f9bce --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/LoginCache.java @@ -0,0 +1,60 @@ +package com.hfkj.common.security; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class LoginCache { + + private static Map CACHE_DATA = new ConcurrentHashMap<>(); + + public static T getData(String key) { + CacheData data = CACHE_DATA.get(key); + if (data != null){ + if(data.getExpire() <= 0 || data.getSaveTime() >= System.currentTimeMillis()) { + return data.getData(); + }else{ + clear(key); + } + } + return null; + } + + public static void setData(String key, T data, int expire) { + CACHE_DATA.put(key, new CacheData(data, expire)); + } + + public static void activeData(String key,int expire){ + Object data = getData(key); + if(data != null){ + setData(key,data,expire); + } + } + + public static void clear(String key) { + CACHE_DATA.remove(key); + } + + private static class CacheData { + CacheData(T t, int expire) { + this.data = t; + this.expire = expire <= 0 ? 0 : expire*1000; + this.saveTime = System.currentTimeMillis() + this.expire; + } + + private T data; + private long saveTime; // 存活时间 + private long expire; // 过期时间 小于等于0标识永久存活 + + public T getData() { + return data; + } + + public long getExpire() { + return expire; + } + + public long getSaveTime() { + return saveTime; + } + } +} diff --git a/service/src/main/java/com/hfkj/common/security/SessionObject.java b/service/src/main/java/com/hfkj/common/security/SessionObject.java new file mode 100644 index 0000000..c5d48d8 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/SessionObject.java @@ -0,0 +1,27 @@ +package com.hfkj.common.security; + +import lombok.Data; + +/** + * session 对象 + * @author hurui + */ +@Data +public class SessionObject { + + /** + * 登录用户的唯一标识 + */ + private String token; + + /** + * 存储用户基本信息 + */ + private Object object; + + public SessionObject(String token, Object object) { + this.token = token; + this.object = object; + } + +} diff --git a/service/src/main/java/com/hfkj/common/security/UserCenter.java b/service/src/main/java/com/hfkj/common/security/UserCenter.java new file mode 100644 index 0000000..4febfed --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/UserCenter.java @@ -0,0 +1,135 @@ +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 UserCenter { + + private static Logger log = LoggerFactory.getLogger(UserCenter.class); + + @Autowired + private RedisUtil redisUtil; + private final int EXPIRE = 3600 * 24 * 3; // 登录过期时间为3天 + + /** + * 保存登录信息 + * @throws Exception + */ + public void save(SessionObject seObj) { + redisUtil.set(seObj.getToken(), seObj, EXPIRE); + } + + /** + * 是否登录 + * @param request + * @return + */ + public boolean isLogin(HttpServletRequest request){ + String token = request.getHeader("Authorization"); + if(StringUtils.isBlank(token)) { + return false; + } + return redisUtil.hasKey(token); + } + + /** + * 是否登录 + * @param token 账户token + * @return + */ + public boolean isLogin(String token){ + if(StringUtils.isBlank(token)) { + return false; + } + return redisUtil.hasKey(token); + } + + /** + * 退出登录 + * @param request + */ + public void remove(HttpServletRequest request) { + String token = request.getHeader("Authorization"); + if (StringUtils.isNotBlank(token)) { + //通过token方式登录 + redisUtil.del(token); + } + } + + /** + * 退出登录 + * @param token + */ + public void remove(String token) { + if (StringUtils.isNotBlank(token)) { + //通过token方式登录 + redisUtil.del(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(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(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/VerifyCode.java b/service/src/main/java/com/hfkj/common/security/VerifyCode.java new file mode 100644 index 0000000..2ffc3e3 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/VerifyCode.java @@ -0,0 +1,44 @@ +package com.hfkj.common.security; + +import org.apache.commons.lang3.StringUtils; + +public class VerifyCode { + + /** + * 验证码唯一标识 手机号 + */ + private String uniqueCode; + + /** + * 存储验证码 + */ + private String verifyCode; + + public VerifyCode(){ + + } + public VerifyCode(String uniqueCode, String verifyCode){ + this.uniqueCode = uniqueCode; + this.verifyCode = verifyCode; + } + + public String getUniqueCode() throws Exception { + if(StringUtils.isEmpty(uniqueCode)){ + throw new Exception("VerifyCode uniqueCode is null"); + } + return uniqueCode; + } + + public void setUniqueCode(String uniqueCode) { + this.uniqueCode = uniqueCode; + } + + public String getObject() { + return verifyCode; + } + + public void setObject(String verifyCode) { + this.verifyCode = verifyCode; + } + +} diff --git a/service/src/main/java/com/hfkj/common/security/VerifyCodeStorage.java b/service/src/main/java/com/hfkj/common/security/VerifyCodeStorage.java new file mode 100644 index 0000000..eeedf5a --- /dev/null +++ b/service/src/main/java/com/hfkj/common/security/VerifyCodeStorage.java @@ -0,0 +1,29 @@ +package com.hfkj.common.security; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class VerifyCodeStorage { + + private static Logger log = LoggerFactory.getLogger(VerifyCodeStorage.class); + + private static final int EXPIRE = 600;//cookie过期时间为10分钟,600秒 + + + /** + * @param + * @throws Exception + */ + public static void save(VerifyCode verifyCode) throws Exception{ + LoginCache.setData(verifyCode.getUniqueCode(), verifyCode, EXPIRE); + } + + + public static VerifyCode getDate(String uniqueCode) throws Exception{ + return LoginCache.getData(uniqueCode); + } + + public static void remove(String uniqueCode) throws Exception{ + LoginCache.clear(uniqueCode); + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/AliyunService.java b/service/src/main/java/com/hfkj/common/utils/AliyunService.java new file mode 100644 index 0000000..2ced96b --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/AliyunService.java @@ -0,0 +1,56 @@ +package com.hfkj.common.utils; + +import com.alibaba.fastjson.JSONObject; +import org.apache.http.HttpResponse; +import org.apache.http.util.EntityUtils; + +import java.util.HashMap; +import java.util.Map; + +/** + * 阿里云业务服务 + * @className: AliyunService + * @author: HuRui + * @date: 2024/4/3 + **/ +public class AliyunService { + + /** + * 查询ip地址 + * @param ip ip地址 + * @return + */ + public static JSONObject queryAddress(String ip) { + try { + String host = "https://ipaddquery.market.alicloudapi.com"; + String path = "/ip/address-query"; + String method = "POST"; + String appcode = "f9ace4c915054ca697a76fb9a4e1e8c0"; + + Map headers = new HashMap<>(); + headers.put("Authorization", "APPCODE " + appcode); + headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); + + Map bodys = new HashMap<>(); + bodys.put("ip", ip); + + HttpResponse response = HttpUtils.doPost(host, path, method, headers, new HashMap<>(), bodys); + JSONObject resObj = JSONObject.parseObject(EntityUtils.toString(response.getEntity())); + if (resObj.getString("code").equals("200")) { + return resObj.getJSONObject("data"); + } + return null; + + } catch (Exception e) { + return null; + } + } + + public static void main(String[] args) { + try { + System.out.println(queryAddress("123.147.76.209")); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/CoordCommonUtil.java b/service/src/main/java/com/hfkj/common/utils/CoordCommonUtil.java new file mode 100644 index 0000000..b1266d8 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/CoordCommonUtil.java @@ -0,0 +1,38 @@ +package com.hfkj.common.utils; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/4/1 20:32 + */ +public class CoordCommonUtil { + + + private static final double EARTH_RADIUS = 6371000; // 平均半径,单位:m;不是赤道半径。赤道为6378左右 + + /** + * 获得球面(地球)上两个点之间的距离(坐标可以为WGS84、GCJ02等任何一种坐标,但两个点的坐标类型必须相同) + * + * @param lon1 起点的经度 + * @param lat1 起点的纬度 + * @param lon2 终点的经度 + * @param lat2 终点的纬度 + * @return 两点之间的距离,单位是米 + */ + public static double getDistance(Double lat1,Double lng1,Double lat2,Double lng2) { + // 经纬度(角度)转弧度。弧度用作参数,以调用Math.cos和Math.sin + double radiansAX = Math.toRadians(lng1); // A经弧度 + double radiansAY = Math.toRadians(lat1); // A纬弧度 + double radiansBX = Math.toRadians(lng2); // B经弧度 + double radiansBY = Math.toRadians(lat2); // B纬弧度 + + // 公式中“cosβ1cosβ2cos(α1-α2)+sinβ1sinβ2”的部分,得到∠AOB的cos值 + double cos = Math.cos(radiansAY) * Math.cos(radiansBY) * Math.cos(radiansAX - radiansBX) + + Math.sin(radiansAY) * Math.sin(radiansBY); +// System.out.println("cos = " + cos); // 值域[-1,1] + double acos = Math.acos(cos); // 反余弦值 +// System.out.println("acos = " + acos); // 值域[0,π] +// System.out.println("∠AOB = " + Math.toDegrees(acos)); // 球心角 值域[0,180] + return EARTH_RADIUS * acos; // 最终结果附上原文出处链接及本声明。 + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/DateUtil.java b/service/src/main/java/com/hfkj/common/utils/DateUtil.java new file mode 100644 index 0000000..5ad9435 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/DateUtil.java @@ -0,0 +1,785 @@ +package com.hfkj.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.text.SimpleDateFormat; +import java.time.*; +import java.util.Calendar; +import java.util.Date; + +public class DateUtil { + + private static Logger log = LoggerFactory.getLogger(DateUtil.class); + public static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + public static SimpleDateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM"); + public static SimpleDateFormat dateFormatDB = new SimpleDateFormat("yyyyMMdd");// 数据库使用的日期格式 + public static SimpleDateFormat dataTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + public static final String Y_M_D = "yyyy-MM-dd"; + public static final String Y_M_D_HM = "yyyy-MM-dd HH:mm"; + public static final String Y_M_D_HMS = "yyyy-MM-dd HH:mm:ss"; + public static final String YMD = "yyyyMMdd"; + public static final String YMDHM = "yyyyMMddHHmm"; + public static final String YMDHMS = "yyyyMMddHHmmss"; + public static final String YYMMDDH = "yyMMddHH"; + public static final String ymd = "yyyy/MM/dd"; + public static final String ymd_HM = "yyyy/MM/dd HH:mm"; + public static final String ymd_HMS = "yyyy/MM/dd HH:mm:ss"; + public static final String ymd_point = "yyyy.MM.dd"; + public static final String md_point = "MM.dd"; + public static final String Y_M = "yyyy-MM"; + private static final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + + + public static Integer getThisYear(){ + Calendar calendar = Calendar.getInstance(); + return calendar.get(Calendar.YEAR); + } + public static String date2String(Date date,String format) throws Exception{ + String str = null; + SimpleDateFormat sdf = new SimpleDateFormat(format); + if(date != null){ + str = sdf.format(date); + } + return str; + } + + public static Date long2Date(Long time) throws Exception{ + if(time != null){ + return new Date(time); + }else{ + return null; + } + } + /** + * 获取最近几个月的日期,例如今天是2018年6月26日,输入-3,返回最近三个月的日期2018年3月26日 + * @param delta + * @return + * @throws Exception + */ + public static Date getLastMonth(int delta){ + try { + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, delta); + return calendar.getTime(); + } catch (Exception e) { + log.error("getLastMonth error",e); + } + return null; + } + + /** + * 字符串转时间 + * + * @param date + * @param format + * @return + */ + public static Date StringToDate(String date, String format) { + if(StringUtils.isBlank(date)){ + return null; + } + SimpleDateFormat formatter = new SimpleDateFormat(format); + ParsePosition pos = new ParsePosition(0); + Date strtodate = formatter.parse(date, pos); + return strtodate; + } + + /** + * @throws + * @Title: getDateBegin + * @Description: TODO(获取指定日期开始) + * @author: 杜江 + * @param: [date] + * @return: java.util.Date + */ + public static Date getDateBegin(Date date) { + LocalDate nowDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + //设置零点 + LocalDateTime beginTime = LocalDateTime.of(nowDate, LocalTime.MIN); + //将时间进行格式化 + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = beginTime.atZone(zoneId); + return Date.from(zdt.toInstant()); + } + + /** + * date转换成UNIX时间戳,毫秒 + * + * @param date + * @return + * @throws ParseException + */ + public static Long timesTamp(Date date,String formats) { + try { + // 获取系统时间 + SimpleDateFormat simpleDateFormat = new SimpleDateFormat( + formats); + String time = simpleDateFormat.format(date); + Long timeStemp = (simpleDateFormat.parse(time).getTime()); + return timeStemp; + }catch (Exception e){ + return null; + } + + } + + /** + * 获取某月第一天日期 + * @return Date + */ + public static Date getFisrtDayOfMonth(String dateString) throws ParseException { + DateFormat dateFormat = new SimpleDateFormat("yyyyMM"); + Date inputDate = dateFormat.parse(dateString); + + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDate); + + int firstDay = cal.getActualMinimum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, firstDay); + + return cal.getTime(); + } + + /** + * @throws + * @Title: addSeconds + * @Description: TODO(指定日期 , 指定秒后的时间) + * @author: 杜江 + * @param: [date, seconds] + * @return: java.util.Date + */ + public static Date addSeconds(Date date, int seconds) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.SECOND, seconds); + return calendar.getTime(); + } + + /** + * 获取某月最后一天日期 + * @return Date + */ + public static Date getLastDayOfMonth(String dateString) throws ParseException { + DateFormat dateFormat = new SimpleDateFormat("yyyyMM"); + Date inputDate = dateFormat.parse(dateString); + + Calendar cal = Calendar.getInstance(); + cal.setTime(inputDate); + + int lastDay = cal.getActualMaximum(Calendar.DAY_OF_MONTH); + cal.set(Calendar.DAY_OF_MONTH, lastDay); + + return cal.getTime(); + } + + /** + * + * @Title: getDaysOfMonth + * @Description: TODO(获取某月天数) + * @author: 杜江 + * @param: [date] + * @return: int + * @throws + */ + public static int getDaysOfMonth(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + return calendar.getActualMaximum(Calendar.DAY_OF_MONTH); + } + + /** + * @throws + * @Title: getDateBegin + * @Description: TODO(获取指定日期结束) + * @author: 杜江 + * @param: [date] + * @return: java.util.Date + */ + public static Date getDateEnd(Date date) { + LocalDate nowDate = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); + //设置最大时间 + LocalDateTime beginTime = LocalDateTime.of(nowDate, LocalTime.MAX); + //将时间进行格式化 + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = beginTime.atZone(zoneId); + return Date.from(zdt.toInstant()); + } + + /** + * 功能:传入时间字符串按所需格式返回时间 + * + * @param dateStr 时间字符串 + * @param format 跟传入dateStr时间的格式必须一样 yyyy-MM-dd HH:mm:ss | yyyy年MM月dd日 HH时mm分ss秒 + * @return + */ + public static Date format(String dateStr, String format) { + if (dateStr == null || dateStr == "") { + return new Date(); + } + if (dateStr == null || dateStr == "") { + format = "yyyy-MM-dd"; + } + Date date = null; + try { + DateFormat f = new SimpleDateFormat(format); + date = f.parse(dateStr); + } catch (ParseException e) { + e.printStackTrace(); + } + return date; + + } + + /** + * 功能:传入时间按所需格式返回时间字符串 + * + * @param date java.util.Date格式 + * @param format yyyy-MM-dd HH:mm:ss | yyyy年MM月dd日 HH时mm分ss秒 + * @return + */ + public static String format(Date date, String format) { + String result = ""; + try { + if (date == null) { + date = new Date();// 如果时间为空,则默认为当前时间 + } + if (format == null || format == "") {// 默认格式化形式 + format = "yyyy-MM-dd"; + } + DateFormat df = new SimpleDateFormat(format); + result = df.format(date); + } catch (Exception e) { + e.printStackTrace(); + } + return result; + } + + /** + * + * @Title: UtcToDate + * @Description: 转为+8区标准时间 + * @author: + * @param: [date, format] + * @return: java.util.Date + * @throws + */ + public static Date UtcToDate(String date, String format) { + try { + String newDate = date.replace("Z", " UTC"); + SimpleDateFormat formatter = new SimpleDateFormat(format); + Date strtodate = formatter.parse(newDate); + return strtodate; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + /** + * + * @Title: getNewDate + * @Description: 指定日期加上制定月份得到新的日期 + * @author: + * @param: [cur, addNum] + * @return: java.util.Date + * @throws + */ + public static Date getNewDate(Date cur,Integer addNum) { + Calendar c = Calendar.getInstance(); + c.setTime(cur); //设置时间 + c.add(Calendar.MONTH, addNum); //日期分钟加1,Calendar.DATE(天),Calendar.HOUR(小时) + Date date = c.getTime(); //结果 + return date; + } + /** + * + * @Title: getTimeInterval + * @Description: 获取本周的星期数所对应的日期 + * @author: 杜江 + * @param: [dayWeek] + * @return: java.lang.String + * @throws + */ + public static String getTimeInterval(int dayWeek) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar cal = Calendar.getInstance(); + cal.setFirstDayOfWeek(Calendar.MONDAY);// 设置一个星期的第一天,按中国的习惯一个星期的第一天是星期一 + int day = 0; + if(dayWeek==1){ + day=-3; + } + if(dayWeek==2){ + day=-2; + } + if(dayWeek==3){ + day=-1; + } + if (dayWeek==4){ + day=0; + } + if(dayWeek==5){ + day=1; + } + if(dayWeek==6){ + day=2; + } + if(dayWeek==7){ + day=3; + } + cal.add(Calendar.DATE, cal.getFirstDayOfWeek() +day);// 根据日历的规则,给当前日期减去星期几与一个星期第一天的差值 + Date mondayDate = cal.getTime(); + String weekBegin = sdf.format(mondayDate); + return weekBegin; + } + /** + * + * @Title: getDayInWeek + * @Description: 获取今天是本周的第几天 + * @author: 杜江 + * @param: [] + * @return: int + * @throws + */ + public static int getDayInWeek(){ + Date today = new Date(); + Calendar c=Calendar.getInstance(); + c.setTime(today); + int weekday=c.get(Calendar.DAY_OF_WEEK); + if(weekday==1){ + weekday = weekday+6; + return weekday; + }else{ + weekday = weekday-1; + return weekday; + } + } + /** + * + * @Title: getLastWeekInDay + * @Description: 获取下周的星期几的日期 + * @author: 杜江 + * @param: [] + * @return: java.lang.String + * @throws + */ + public static Date getLastWeekInDay(int day){ + Calendar calendar = Calendar.getInstance(); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK) - 1; + int offset1 = day - dayOfWeek; + calendar.add(Calendar.DATE, offset1 + 7); + return calendar.getTime(); + } + /** + * + * @Title: changeDate + * @Description: 指定的日期减去天数后得到的日期 + * @author: 杜江 + * @param: [date, day] + * @return: java.util.Date + * @throws + */ + public static Date reduceDate(Date date,int day) throws ParseException { + long time = date.getTime(); // 得到指定日期的毫秒数 + day = day*24*60*60*1000; // 要减去的天数转换成毫秒数 + time-=day; // 相减得到新的毫秒数 + return new Date(time); // 将毫秒数转换成日期 + } + + /** + * + * @Title: changeDate + * @Description: 指定的日期加上天数后得到的日期 + * @author: 杜江 + * @param: [date, day] + * @return: java.util.Date + * @throws + */ + public static Date addDate(Date date,int day) throws ParseException { + long time = date.getTime(); // 得到指定日期的毫秒数 + long longTime = (long)day; + long addDay = longTime*24*60*60*1000; // 要加上的天数转换成毫秒数 + time+=addDay; // 相减得到新的毫秒数 + return new Date(time); // 将毫秒数转换成日期 + } + + /** + * + * @Title: getChinaWeek + * @Description: 功能:返回星期 1:星期一,2:星期二 ... 6:星期六 7:星期日 + * @author: 杜江 + * @param: [date] + * @return: int + * @throws + */ + public static int getChinaWeek(Date date) { + Calendar c = Calendar.getInstance(); + c.setTime(date); + int week = c.get(Calendar.DAY_OF_WEEK) - 1; + if (week == 0) { + return 7; + } else { + return week; + } + } + + /** + * + * @Title: getNextDay + * @Description: TODO(当前日期加一天) + * @author: 杜江 + * @param: [date] + * @return: java.util.Date + * @throws + */ + public static Date getNextDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_MONTH, +1);//+1今天的时间加一天 + date = calendar.getTime(); + return date; + } + + /** + * + * @Title: getNowBegin + * @Description: TODO(获取今天开始时间) + * @author: 杜江 + * @param: [] + * @return: java.util.Date + * @throws + */ + public static Date getNowBegin() { + //获取当前日期 + LocalDate nowDate = LocalDate.now(); + //设置零点 + LocalDateTime beginTime = LocalDateTime.of(nowDate, LocalTime.MIN); + //将时间进行格式化 + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = beginTime.atZone(zoneId); + return Date.from(zdt.toInstant()); + } + + /** + * + * @Title: numberChange + * @Description: TODO(星期转换) + * @author: + * @param: [number] + * @return: java.lang.String + * @throws + */ + public static String numberChange(Integer number) { + if (number == 1) { + return "一"; + }else if (number == 2) { + return "二"; + } + else if (number == 3) { + return "三"; + } + else if (number == 4) { + return "四"; + } + else if (number == 5) { + return "五"; + } + else if (number == 6) { + return "六"; + } + else if (number == 7) { + return "日"; + }else { + return null; + } + } + + + /** + * + * @Title: getNowEnd + * @Description: TODO(获取今天结束时间) + * @author: 杜江 + * @param: [] + * @return: java.util.Date + * @throws + */ + public static Date getNowEnd() { + //获取当前日期 + LocalDate nowDate = LocalDate.now(); + //设置最大时间 + LocalDateTime endTime = LocalDateTime.of(nowDate,LocalTime.MAX); + //将时间进行格式化 + ZoneId zoneId = ZoneId.systemDefault(); + ZonedDateTime zdt = endTime.atZone(zoneId); + return Date.from(zdt.toInstant()); + } + + /** + * * 获取当月的 天数 + * + */ + public static int getCurrentMonthDay() { + Calendar a = Calendar.getInstance(); + a.set(Calendar.DATE, 1); + a.roll(Calendar.DATE, -1); + int maxDate = a.get(Calendar.DATE); + return maxDate; + } + + /** + * 获取当前月第一天日期 + * @return Date + */ + public static String getCurrentMonthFirstDay() { + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, 0); + c.set(Calendar.DAY_OF_MONTH, 1); + String first = format.format(c.getTime()); + return first; + } + + /** + * 获取当前月最后一天日期 + * @return Date + */ + public static String getCurrentMonthlastDay() { + Calendar ca = Calendar.getInstance(); + ca.set(Calendar.DAY_OF_MONTH, ca.getActualMaximum(Calendar.DAY_OF_MONTH)); + String last = format.format(ca.getTime()); + return last; + } + + /** + * + * @Title: getMinutesDiff + * @Description: 获取newTime-oldTime相差分钟数 + * @author: gongjia + * @param: [oldTime, newTime] + * @return: int + * @throws + */ + public static long getMinutesDiff(Date oldTime, Date newTime) throws Exception{ + long oldTimeStamp = oldTime.getTime(); + long newTimeStamp = newTime.getTime(); + + long diffTimeStamp = newTimeStamp - oldTimeStamp; + + return diffTimeStamp / (1000 * 60); + } + + /** + * + * @Title: addDatetime + * @Description: 1.指定日期加上'年、月、日、时、分、秒' + * 2.'年、月、日、时、分、秒'允许负数 + * 3.下级时间会向上级传递(如增加1天25小时,实际增加2天1小时) + * 4.无需改变的值可指定为0 + * @author: gongjia + * @param: [date, year, month, day, hour, minute, second] + * @return: java.util.Date + * @throws + */ + public static Date addDatetime(Date date, int year, int month, int day, int hour, int minute, int second) throws Exception { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + + calendar.add(Calendar.YEAR, year); + calendar.add(Calendar.MONTH, month); + calendar.add(Calendar.DAY_OF_MONTH, day); + calendar.add(Calendar.HOUR_OF_DAY, hour); + calendar.add(Calendar.MINUTE, minute); + calendar.add(Calendar.SECOND, second); + + return calendar.getTime(); + } + + public static Date getDateArea(Date oldDate) throws Exception { + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + String strOld = format.format(oldDate); + + return format.parse(strOld); + } + + public static Date addMinute(Date time, int minute) { + Calendar c = Calendar.getInstance(); + c.setTime(time); //设置时间 + c.add(Calendar.MINUTE, minute); //日期分钟加1,Calendar.DATE(天),Calendar.HOUR(小时) + Date date = c.getTime(); //结果 + return date; + } + + /** + * 通过时间秒毫秒数判断两个时间的间隔 + * @param date1 + * @param date2 + * @return + */ + public static int differentDaysByMillisecond(Date date1,Date date2) + { + int days = (int)Math.ceil(((date2.getTime() - date1.getTime()) / (1000*3600*24))); + return days; + } + + /** + * date2比date1多的天数 + * @param date1 + * @param date2 + * @return + */ + public static int differentDays(Date date1,Date date2) + { + Calendar cal1 = Calendar.getInstance(); + cal1.setTime(date1); + + Calendar cal2 = Calendar.getInstance(); + cal2.setTime(date2); + int day1= cal1.get(Calendar.DAY_OF_YEAR); + int day2 = cal2.get(Calendar.DAY_OF_YEAR); + + int year1 = cal1.get(Calendar.YEAR); + int year2 = cal2.get(Calendar.YEAR); + if(year1 != year2) //同一年 + { + int timeDistance = 0 ; + for(int i = year1 ; i < year2 ; i ++) + { + if(i%4==0 && i%100!=0 || i%400==0) //闰年 + { + timeDistance += 366; + } + else //不是闰年 + { + timeDistance += 365; + } + } + + return timeDistance + (day2-day1) ; + } + else //不同年 + { + System.out.println("判断day2 - day1 : " + (day2-day1)); + return day2-day1; + } + } + + + /** + * 字符串日期转换成中文格式日期 + * + * @param date 字符串日期 yyyy-MM-dd + * @return yyyy年MM月dd日 + * @throws Exception + */ + public static String dateToCnDate(Date date) { + try { + String dateString = date2String(date, Y_M_D); + String result = ""; + String[] cnDate = new String[]{"〇", "一", "二", "三", "四", "五", "六", "七", "八", "九"}; + String ten = "十"; + String[] dateStr = dateString.split("-"); + for (int i = 0; i < dateStr.length; i++) { + for (int j = 0; j < dateStr[i].length(); j++) { + String charStr = dateStr[i]; + String str = String.valueOf(charStr.charAt(j)); + if (charStr.length() == 2) { + if (charStr.equals("10")) { + result += ten; + break; + } else { + if (j == 0) { + if (charStr.charAt(j) == '1') + result += ten; + else if (charStr.charAt(j) == '0') + result += ""; + else + result += cnDate[Integer.parseInt(str)] + ten; + } + if (j == 1) { + if (charStr.charAt(j) == '0') + result += ""; + else + result += cnDate[Integer.parseInt(str)]; + } + } + } else { + result += cnDate[Integer.parseInt(str)]; + } + } + if (i == 0) { + result += "年"; + continue; + } + if (i == 1) { + result += "月"; + continue; + } + if (i == 2) { + result += "日"; + continue; + } + } + return result; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + + /** + * 判断当前时间是否在[startTime, endTime]区间,注意时间格式要一致 + * + * @param nowTime 当前时间 + * @param startTime 开始时间 + * @param endTime 结束时间 + * @return + * @author jqlin + */ + public static boolean isEffectiveDate(Date nowTime, Date startTime, Date endTime) { + if (nowTime.getTime() == startTime.getTime() + || nowTime.getTime() == endTime.getTime()) { + return true; + } + + Calendar date = Calendar.getInstance(); + date.setTime(nowTime); + + Calendar begin = Calendar.getInstance(); + begin.setTime(startTime); + + Calendar end = Calendar.getInstance(); + end.setTime(endTime); + + if (date.after(begin) && date.before(end)) { + return true; + } else { + return false; + } + } + + public static long getSecondDiff(Date startTime, Date endTime) { + try { + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + long eTime = endTime.getTime(); + long sTime = startTime.getTime(); + long diff = (eTime - sTime) / 1000; + return diff; + } catch (Exception e) { + log.error("getSecondDiff error", e); + } + return 0; + } + + public static void main(String[] args) throws Exception { + String a = "51130319931105651X"; + System.out.println(a.substring(6,10)); + System.out.println(a.substring(10,12)); + System.out.println(a.substring(12,14)); + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/HttpUtils.java b/service/src/main/java/com/hfkj/common/utils/HttpUtils.java new file mode 100644 index 0000000..f9e682d --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/HttpUtils.java @@ -0,0 +1,311 @@ +package com.hfkj.common.utils; + +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.HttpDelete; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpPut; +import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.scheme.SchemeRegistry; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.entity.ByteArrayEntity; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.message.BasicNameValuePair; + +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class HttpUtils { + + /** + * get + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doGet(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpGet request = new HttpGet(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + /** + * post form + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param bodys + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + Map bodys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (bodys != null) { + List nameValuePairList = new ArrayList(); + + for (String key : bodys.keySet()) { + nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); + } + UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); + formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); + request.setEntity(formEntity); + } + + return httpClient.execute(request); + } + + /** + * Post String + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Post stream + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPost(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPost request = new HttpPost(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Put String + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + String body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (StringUtils.isNotBlank(body)) { + request.setEntity(new StringEntity(body, "utf-8")); + } + + return httpClient.execute(request); + } + + /** + * Put stream + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @param body + * @return + * @throws Exception + */ + public static HttpResponse doPut(String host, String path, String method, + Map headers, + Map querys, + byte[] body) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpPut request = new HttpPut(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + if (body != null) { + request.setEntity(new ByteArrayEntity(body)); + } + + return httpClient.execute(request); + } + + /** + * Delete + * + * @param host + * @param path + * @param method + * @param headers + * @param querys + * @return + * @throws Exception + */ + public static HttpResponse doDelete(String host, String path, String method, + Map headers, + Map querys) + throws Exception { + HttpClient httpClient = wrapClient(host); + + HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); + for (Map.Entry e : headers.entrySet()) { + request.addHeader(e.getKey(), e.getValue()); + } + + return httpClient.execute(request); + } + + private static String buildUrl(String host, String path, Map querys) throws UnsupportedEncodingException { + StringBuilder sbUrl = new StringBuilder(); + sbUrl.append(host); + if (!StringUtils.isBlank(path)) { + sbUrl.append(path); + } + if (null != querys) { + StringBuilder sbQuery = new StringBuilder(); + for (Map.Entry query : querys.entrySet()) { + if (0 < sbQuery.length()) { + sbQuery.append("&"); + } + if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { + sbQuery.append(query.getValue()); + } + if (!StringUtils.isBlank(query.getKey())) { + sbQuery.append(query.getKey()); + if (!StringUtils.isBlank(query.getValue())) { + sbQuery.append("="); + sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); + } + } + } + if (0 < sbQuery.length()) { + sbUrl.append("?").append(sbQuery); + } + } + + return sbUrl.toString(); + } + + private static HttpClient wrapClient(String host) { + HttpClient httpClient = new DefaultHttpClient(); + if (host.startsWith("https://")) { + sslClient(httpClient); + } + + return httpClient; + } + + private static void sslClient(HttpClient httpClient) { + try { + SSLContext ctx = SSLContext.getInstance("TLS"); + X509TrustManager tm = new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted(X509Certificate[] xcs, String str) { + + } + public void checkServerTrusted(X509Certificate[] xcs, String str) { + + } + }; + ctx.init(null, new TrustManager[] { tm }, null); + SSLSocketFactory ssf = new SSLSocketFactory(ctx); + ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); + ClientConnectionManager ccm = httpClient.getConnectionManager(); + SchemeRegistry registry = ccm.getSchemeRegistry(); + registry.register(new Scheme("https", 443, ssf)); + } catch (KeyManagementException ex) { + throw new RuntimeException(ex); + } catch (NoSuchAlgorithmException ex) { + throw new RuntimeException(ex); + } + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java b/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java new file mode 100644 index 0000000..41315bf --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/HttpsUtils.java @@ -0,0 +1,836 @@ +package com.hfkj.common.utils; + + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpEntity; +import org.apache.http.HttpResponse; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.conn.ssl.SSLConnectionSocketFactory; +import org.apache.http.conn.ssl.SSLContexts; +import org.apache.http.conn.ssl.TrustStrategy; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.ssl.SSLContextBuilder; +import org.apache.http.util.EntityUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.Charset; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class HttpsUtils { + + private static final Logger log = LoggerFactory.getLogger(HttpsUtils.class); + + private static PoolingHttpClientConnectionManager connMgr; + private static RequestConfig requestConfig; + private static final int MAX_TIMEOUT = 7000; + + static { + // 设置连接池 + connMgr = new PoolingHttpClientConnectionManager(); + // 设置连接池大小 + connMgr.setMaxTotal(100); + connMgr.setDefaultMaxPerRoute(connMgr.getMaxTotal()); + // Validate connections after 1 sec of inactivity + connMgr.setValidateAfterInactivity(1000); + RequestConfig.Builder configBuilder = RequestConfig.custom(); + // 设置连接超时 + configBuilder.setConnectTimeout(MAX_TIMEOUT); + // 设置读取超时 + configBuilder.setSocketTimeout(MAX_TIMEOUT); + // 设置从连接池获取连接实例的超时 + configBuilder.setConnectionRequestTimeout(MAX_TIMEOUT); + + requestConfig = configBuilder.build(); + } + + /** + * 发送 GET 请求(HTTP),不带输入数据 + * + * @param url + * @return + */ + public static JSONObject doGet(String url) { + return doGet(url, new HashMap()); + } + + /** + * 发送 GET 请求(HTTP),K-V形式 + * + * @param url + * @param params + * @return + */ + public static JSONObject doGet(String url, Map params) { + String apiUrl = url; + StringBuffer param = new StringBuffer(); + int i = 0; + for (String key : params.keySet()) { + if (i == 0) + param.append("?"); + else + param.append("&"); + param.append(key).append("=").append(params.get(key)); + i++; + } + apiUrl += param; + String result = null; + HttpClient httpClient = null; + try { + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + + HttpGet httpGet = new HttpGet(apiUrl); + HttpResponse response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + InputStream instream = entity.getContent(); + result = IOUtils.toString(instream, "UTF-8"); + } + return JSON.parseObject(result); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + return null; + } + + public static JSONObject doGet(String url, Map params , String o) { + String apiUrl = url; + StringBuffer param = new StringBuffer(); + int i = 0; + for (String key : params.keySet()) { + if (i == 0) + param.append("?"); + else + param.append("&"); + param.append(key).append("=").append(params.get(key)); + i++; + } + apiUrl += param; + String result = null; + HttpClient httpClient = null; + try { + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + + HttpGet httpGet = new HttpGet(apiUrl); + HttpResponse response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + InputStream instream = entity.getContent(); + result = IOUtils.toString(instream, "UTF-8"); + } + return JSON.parseObject(result); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + return null; + } + + public static JSONObject doGet(String url, Map params , Map headers) { + String apiUrl = url; + StringBuffer param = new StringBuffer(); + int i = 0; + for (String key : params.keySet()) { + if (i == 0) + param.append("?"); + else + param.append("&"); + param.append(key).append("=").append(params.get(key)); + i++; + } + apiUrl += param; + String result = null; + HttpClient httpClient = null; + try { + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + + HttpGet httpGet = new HttpGet(apiUrl); + for (Map.Entry e : headers.entrySet()) { + httpGet.addHeader(e.getKey(), e.getValue()); + } + HttpResponse response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + InputStream instream = entity.getContent(); + result = IOUtils.toString(instream, "UTF-8"); + } + return JSON.parseObject(result); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + return null; + } + + public static JSONObject doWxGet(String url, Map params) { + String apiUrl = url; + StringBuffer param = new StringBuffer(); + int i = 0; + for (String key : params.keySet()) { + if (i == 0) + param.append("?"); + else + param.append("&"); + param.append(key).append("=").append(params.get(key)); + i++; + } + apiUrl += param + "#wechat_redirect"; + String result = null; + HttpClient httpClient = null; + try { + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + + HttpGet httpGet = new HttpGet(apiUrl); + HttpResponse response = httpClient.execute(httpGet); + HttpEntity entity = response.getEntity(); + if (entity != null) { + InputStream instream = entity.getContent(); + result = IOUtils.toString(instream, "UTF-8"); + } + return JSON.parseObject(result); + } catch (Exception e) { + log.error(e.getMessage(),e); + } + return null; + } + + /** + * 发送 POST 请求(HTTP),不带输入数据 + * + * @param apiUrl + * @return + */ + public static JSONObject doPost(String apiUrl) { + return doPost(apiUrl, new HashMap()); + } + + /** + * 发送 POST 请求,K-V形式 + * + * @param apiUrl + * API接口URL + * @param params + * 参数map + * @return + */ + public static JSONObject doPost(String apiUrl, Map params) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + List pairList = new ArrayList<>(params.size()); + for (Map.Entry entry : params.entrySet()) { + NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue().toString()); + pairList.add(pair); + } + httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8"))); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + + /** + * 发送 POST 请求,K-V形式 + * + * @param apiUrl + * API接口URL + * @param params + * 参数map + * @return + */ + public static JSONObject doPostSendSms(String apiUrl, Map params) { + CloseableHttpClient httpClient = null; + + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + List pairList = new ArrayList<>(params.size()); + for (Map.Entry entry : params.entrySet()) { + NameValuePair pair = new BasicNameValuePair(entry.getKey(), entry.getValue().toString()); + pairList.add(pair); + } + httpPost.setEntity(new UrlEncodedFormEntity(pairList, Charset.forName("UTF-8"))); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + /** + * 发送 POST 请求,JSON形式 + * + * @param apiUrl + * @param json + * json对象 + * @return + */ + public static JSONObject doPost(String apiUrl, JSONObject json) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + StringEntity stringEntity = new StringEntity(json.toString(), "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doHuiLianTongPost(String apiUrl) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + StringEntity stringEntity = new StringEntity("", "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doWxPost(String apiUrl, Map body, Map header) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + for (Map.Entry entry : header.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue().toString()); + } + StringEntity stringEntity = new StringEntity(JSON.toJSONString(body), "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doPost(String apiUrl, Map body, Map header) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + for (Map.Entry entry : header.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue().toString()); + } + StringEntity stringEntity = new StringEntity(JSON.toJSONString(body), "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doPostForm(String apiUrl, String body, Map header) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + for (Map.Entry entry : header.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue().toString()); + } + StringEntity stringEntity = new StringEntity(body,"UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doSmsPost(String apiUrl, Map body, Map header) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + for (Map.Entry entry : header.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue().toString()); + } + StringEntity stringEntity = new StringEntity(body.get("from").toString());// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doWxH5PayPost(String apiUrl, Map body, Map header) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + for (Map.Entry entry : header.entrySet()) { + httpPost.setHeader(entry.getKey(), entry.getValue().toString()); + } + StringEntity stringEntity = new StringEntity(body.get("from").toString());// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/x-www-form-urlencoded"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + /** + * 发送 POST 请求,JSON形式 + * + * @param apiUrl + * @return + */ + public static JSONObject doPost(String apiUrl, String str) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static JSONObject doPost(String apiUrl, String str, String token, String sign, Long ts) { + CloseableHttpClient httpClient = null; + if (apiUrl.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(apiUrl); + httpPost.setConfig(requestConfig); + httpPost.setHeader("token", token); + httpPost.setHeader("sign", sign); + httpPost.setHeader("ts", ts.toString()); + StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + stringEntity.setContentType("application/json"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + /** + * @Author Sum1Dream + * @Description // 不带证书请求xml + * @Date 11:42 2021/6/8 + * @Param [url, str] + * @return com.alibaba.fastjson.JSONObject + **/ + public static JSONObject postData(String url, String str) { + CloseableHttpClient httpClient = null; + if (url.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(createSSLConnSocketFactory()) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setConfig(requestConfig); + + StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + httpPost.addHeader("Content-Type", "text/xml"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + /** + * @Author Sum1Dream + * @Description // 带证书请求 xml + * @Date 11:45 2021/6/8 + * @Param [url, mchId, str] + * @return com.alibaba.fastjson.JSONObject + **/ + public static JSONObject postData(String url, String mchId , String str) { + CloseableHttpClient httpClient = null; + if (url.startsWith("https")) { + httpClient = HttpClients.custom().setSSLSocketFactory(readCertificate(mchId)) + .setConnectionManager(connMgr).setDefaultRequestConfig(requestConfig).build(); + } else { + httpClient = HttpClients.createDefault(); + } + String httpStr = null; + CloseableHttpResponse response = null; + + try { + HttpPost httpPost = new HttpPost(url); + httpPost.setConfig(requestConfig); + + StringEntity stringEntity = new StringEntity(str, "UTF-8");// 解决中文乱码问题 + stringEntity.setContentEncoding("UTF-8"); + httpPost.addHeader("Content-Type", "text/xml"); + httpPost.setEntity(stringEntity); + response = httpClient.execute(httpPost); + HttpEntity entity = response.getEntity(); + httpStr = EntityUtils.toString(entity, "UTF-8"); + return JSON.parseObject(httpStr); + } catch (Exception e) { + log.error(e.getMessage(),e); + } finally { + if (response != null) { + try { + EntityUtils.consume(response.getEntity()); + } catch (IOException e) { + log.error(e.getMessage(),e); + } + } + } + return null; + } + + public static SSLConnectionSocketFactory readCertificate(String mchId) { + try { + KeyStore keyStore = KeyStore.getInstance("PKCS12"); + FileInputStream stream = new FileInputStream( "F:/mine/hai-server/hai-service/src/main/java/privatekey/apiclient_cert.p12"); + keyStore.load(stream , mchId.toCharArray()); + stream.close(); + SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, mchId.toCharArray()).build(); + return new SSLConnectionSocketFactory( + sslcontext, + new String[]{"TLSv1"}, + null, + SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); + } catch (Exception e) { + System.out.println("证书双向认证出现异常" + e); + } + return null; + } + + /** + * 创建SSL安全连接 + * + * @return + */ + private static SSLConnectionSocketFactory createSSLConnSocketFactory() { + SSLConnectionSocketFactory sslsf = null; + try { + SSLContext sslContext = new SSLContextBuilder().loadTrustMaterial(null, new TrustStrategy() { + + public boolean isTrusted(X509Certificate[] chain, String authType) throws CertificateException { + return true; + } + }).build(); + sslsf = new SSLConnectionSocketFactory(sslContext, new HostnameVerifier() { + + @Override + public boolean verify(String arg0, SSLSession arg1) { + return true; + } + }); + } catch (GeneralSecurityException e) { + log.error(e.getMessage(),e); + } + return sslsf; + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/IDGenerator.java b/service/src/main/java/com/hfkj/common/utils/IDGenerator.java new file mode 100644 index 0000000..c5b185b --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/IDGenerator.java @@ -0,0 +1,63 @@ +package com.hfkj.common.utils; + +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +public class IDGenerator { + + private static final long ONE_STEP = 10; + private static final Lock LOCK = new ReentrantLock(); + private static long lastTime = System.nanoTime(); + private static short lastCount = 0; + private static int count = 0; + /** + * 可传入指定长度的值 + * @param length + * @return + */ + @SuppressWarnings("finally") + public static String nextId(int... length) + { + LOCK.lock(); + try { + if (lastCount == ONE_STEP) { + boolean done = false; + while (!done) { + long now = System.nanoTime(); + if (now == lastTime) { + try { + Thread.currentThread(); + Thread.sleep(1); + } catch (InterruptedException e) { + } + continue; + } else { + lastTime = now; + lastCount = 0; + done = true; + } + } + } + count = lastCount++; + } + finally + { + LOCK.unlock(); + String idStr = lastTime+""+String.format("%02d",count); + if(length.length > 0 && length[0] > 0){ + idStr = idStr.substring(idStr.length()-length[0]<0?0:idStr.length()-length[0], idStr.length()); + } + return idStr; + } + } + public static void main(String[] args) + { +// for(int i=0;i<100;i++) +// { +// System.out.println(nextId()); +// } +// nextId(20); + System.out.println(System.currentTimeMillis()); + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java b/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java new file mode 100644 index 0000000..f5b128e --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/IdCardUtil.java @@ -0,0 +1,99 @@ +package com.hfkj.common.utils; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @ClassName IdCardUtil + * @Description + * @Author 杜江 + * @Date 2020/8/11 11:38 + * @Version 1.0 + */ +public class IdCardUtil { + public static boolean isIdCard(String card){ + card = replaceBlank(card); + if(card == null || "".equals(card)){ + return false; + } + //定义 叛别用户 身份证号的正则表达式 (15位 或 18位,最后一位可以为字母) + String requal = "(^[1-9]\\d{5}(18|19|20)\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|(10|20|30|31))\\d{3}[0-9Xx]$)|" + +"(^[1-9]\\d{5}\\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\\d{3}$)"; + + // 假设18位 身份证号码: + // ^ 表示开头 + // [1-9] 第一位1-9 中的一个 4 注意!! 前六位代表地址,此处是 拆分 讲解 对正则 的注释 + // \\d{5} 五位数字 10001(前六位省市县地区) + // (18|19|20) 19 (现阶段可能取值范围18xx-20xx年) + // \\d{2} 91 (年份) + // ((0[1-9])|(10|11|12)) 01(月份) + // (([0-2][1-9])|10|20|30|31) 01(日期) 也可写成(([0-2][1-9])|(10|20|30|31)) + // \\d{3} 三位数字 123(第十七位奇数表示男,偶数表示女) + // [0-9Xx] 0123456789Xx 其中的一个 X(第十八位为校验值) + // $结尾 + + // 假设15位身份证号码: 410001910101123 + // ^ 开头 + // [1-9] 第一位1-9中的一个 4 + // \\d{5} 五位数字 10001(前六位省市县地区) + // \\d{2} 91(年份) 表示 91年 + // ((0[1-9])|(10|11|12)) 01(月份) + // (([0-2][1-9])|10|20|30|31) 01(日期) + // \\d{3} 123(第十五位奇数代表男,偶数代表女),15位身份证不含X + // $结尾 + boolean matches = card.matches(requal); + + //判断 第 18位 校验值 ,校验算法涉及两次mod 11的过程 + // 二代身份证中的 号码第十八位的计算方法为: + if(matches){ + if (card.length() == 18){ + try { + char[] charArray = card.toCharArray(); + //1,将前面的身份证号码17位数分别乘以不同的系数,系数为此处的 加权因子 + //前十七位加权因子 + int[] idCardWi = {7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2}; + int sum = 0; + // 2,将这17位数字 和系数相乘 的结果相加 + for (int i = 0;i < idCardWi.length;i++){ + int current = Integer.parseInt(String.valueOf(charArray[i])); + // 相乘对应的 加权因子系数 + int count = current * idCardWi[i]; + // 结果相加 + sum += count; + } + char idCardLast = charArray[17]; + // 3,结果和 除以11,查看余数 + int idCardMod = sum % 11; + // 4,这是除以 11后,可能产生的 11位余数对应的验证码(--对应下标),其中 X 代表罗马数字 10 + String[] idCardY = {"1","0","X","9","8","7","6","5","4","3","2"}; + if (idCardY[idCardMod].toUpperCase().equals(String.valueOf(idCardLast).toUpperCase())){ + return true; + }else { + System.out.println("身份证最后一位:"+String.valueOf(idCardLast).toUpperCase()+ + "错误,正确的应该是:"+idCardY[idCardMod].toUpperCase()); + return false; + } + }catch (Exception e){ + e.printStackTrace(); + System.out.println("异常:"+card); + return false; + } + } + } + return matches; + } + + public static String replaceBlank(String str) { + String dest = ""; + if (str!=null) { + Pattern p = Pattern.compile("\\s*|\t|\r|\n"); + Matcher m = p.matcher(str); + dest = m.replaceAll(""); + } + return dest; + } + + public static void main(String[] args) { + System.out.println(isIdCard("5113221999409035038")); + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/IdentifyUtil.java b/service/src/main/java/com/hfkj/common/utils/IdentifyUtil.java new file mode 100644 index 0000000..8d0af33 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/IdentifyUtil.java @@ -0,0 +1,40 @@ +package com.hfkj.common.utils; + +import java.text.SimpleDateFormat; + +/** + * 生成唯一标识 + * + * @author + * @createDate + */ +public class IdentifyUtil { + public static void main(String[] args) { + //调用生成id方法 + System.out.println(getGuid()); + } + + /** + * 20位的数字id + */ + public static int Guid = 100; + + public static String getGuid() { + IdentifyUtil.Guid += 1; + long now = System.currentTimeMillis(); + //获取4位年份数字 + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy"); + //获取时间戳 + String time = dateFormat.format(now); + String info = now + ""; + //获取三位随机数 + //int ran=(int) ((Math.random()*9+1)*100); + //要是一段时间内的数据连过大会有重复的情况,所以做以下修改 + int ran = 0; + if (IdentifyUtil.Guid > 999) { + IdentifyUtil.Guid = 100; + } + ran = IdentifyUtil.Guid; + return time + info.substring(2, info.length()) + ran; + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/MD5Util.java b/service/src/main/java/com/hfkj/common/utils/MD5Util.java new file mode 100644 index 0000000..2f36b75 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/MD5Util.java @@ -0,0 +1,69 @@ +package com.hfkj.common.utils; + +import javax.xml.bind.annotation.adapters.HexBinaryAdapter; +import java.security.MessageDigest; + +/** + * + * @ClassName: MD5Util + * @Description:TODO(MD5 加密工具) + * @author: 胡锐 + * @date: 2019年5月6日 上午10:13:26 + * + * @Copyright: 2019 www.shinwoten.com Inc. All rights reserved. + */ +public class MD5Util { + + + /** + * + * @Title: encode + * @Description: TODO(MD5 32位加密) + * @author: 胡锐 + * @param: @param data + * @param: @return + * @param: @throws Exception + * @return: String + * @throws + */ + public static String encode(byte[] data) throws Exception { + // 初始化MessageDigest + MessageDigest md = MessageDigest.getInstance("MD5"); + // 执行摘要信息 + byte[] digest = md.digest(data); + // 将摘要信息转换为32位的十六进制字符串 + return new String(new HexBinaryAdapter().marshal(digest)); + } + /* public static String EncoderByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException{ + //确定计算方法 + MessageDigest md5=MessageDigest.getInstance("MD5"); + Encoder base64en = Base64.getEncoder(); + //加密后的字符串 + String newstr=base64en.encodeToString(md5.digest(str.getBytes("utf-8"))); + return newstr; + }*/ + + public static String encodeS(byte[] data) throws Exception { + // 初始化MessageDigest + MessageDigest md = MessageDigest.getInstance("MD5"); + // 执行摘要信息 + byte[] digest = md.digest(data); + // 将摘要信息转换为32位的十六进制字符串 + return new HexBinaryAdapter().marshal(digest); + } + /* public static String EncoderByMd5(String str) throws NoSuchAlgorithmException, UnsupportedEncodingException{ + //确定计算方法 + MessageDigest md5=MessageDigest.getInstance("MD5"); + Encoder base64en = Base64.getEncoder(); + //加密后的字符串 + String newstr=base64en.encodeToString(md5.digest(str.getBytes("utf-8"))); + return newstr; + }*/ + + + public static void main(String[] args) throws Exception { + String str = "123456"; + System.out.println(MD5Util.encode(str.getBytes("UTF-8"))); + //String ee = "29AD0E3FD3DB681FB9F8091C756313F7"; + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/MathUtils.java b/service/src/main/java/com/hfkj/common/utils/MathUtils.java new file mode 100644 index 0000000..fac8059 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/MathUtils.java @@ -0,0 +1,25 @@ +package com.hfkj.common.utils; + +import java.math.BigDecimal; +import java.math.BigInteger; + +public class MathUtils { + + public static BigDecimal objectConvertBigDecimal(Object value) { + BigDecimal ret = null; + if (value != null) { + if (value instanceof BigDecimal) { + ret = (BigDecimal) value; + } else if (value instanceof String) { + ret = new BigDecimal((String) value); + } else if (value instanceof BigInteger) { + ret = new BigDecimal((BigInteger) value); + } else if (value instanceof Number) { + ret = new BigDecimal(((Number) value).doubleValue()); + } else { + throw new ClassCastException("Not possible to coerce [" + value + "] from class " + value.getClass() + " into a BigDecimal."); + } + } + return ret; + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/MemberValidateUtil.java b/service/src/main/java/com/hfkj/common/utils/MemberValidateUtil.java new file mode 100644 index 0000000..09c3303 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/MemberValidateUtil.java @@ -0,0 +1,112 @@ +package com.hfkj.common.utils; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * + * @ClassName: FormatValidateUtil + * @Description:TODO(格式校验) + * @author: 胡锐 + * @date: 2018年8月2日 上午10:12:43 + * + * @Copyright: 2018 www.shinwoten.com Inc. All rights reserved. + */ +public class MemberValidateUtil { + + /** + * + * @Title: validateName + * @Description: TODO(用户名验证) + * @author: 胡锐 + * @param: @param name + * @param: @return + * @return: boolean + * @throws + */ + public static boolean validateName(String name) { + if(name.length() < 2 || name.length() > 20) { + return false; + } + + return true; + } + + /** + * + * @Title: validatePhone + * @Description: TODO(手机号格式校验) + * @author: 胡锐 + * @param: @param phone + * @param: @return + * @return: boolean + * @throws + */ + public static boolean validatePhone(String phone) { + phone = replaceBlank(phone); + String regex = "^[1](([3][0-9])|([4][0,1,4-9])|([5][0-3,5-9])|([6][2,5,6,7])|([7][0-8])|([8][0-9])|([9][0-3,5-9]))[0-9]{8}$"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(phone); + boolean isMatch = m.matches(); + return isMatch; + } + + + /** + * + * @Title: validatePass + * @Description: TODO(密码格式校验) + * @author: 胡锐 + * @param: @param password + * @param: @return + * @return: boolean + * @throws + */ + public static boolean validatePass(String password) { + String regex = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$"; + Pattern p = Pattern.compile(regex); + Matcher m = p.matcher(password); + boolean isMatch = m.matches(); + return isMatch; + + } + + /** + * + * @Title: validatePass + * @Description: TODO(校验身份证) + * @author: 胡锐 + * @param: @param password + * @param: @return + * @return: boolean + * @throws + */ + public static boolean validateIdCard(String idCard) { + String regex = "(^\\\\d{18}$)|(^\\\\d{15}$)"; + return Pattern.matches(regex,idCard); + } + + public static boolean isNumber(String str) { + Pattern pattern = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$"); // 判断小数点后2位的数字的正则表达式 + Matcher match = pattern.matcher(str); + if (match.matches() == false) { + return false; + } else { + return true; + } + } + + public static String replaceBlank(String str) { + String dest = ""; + if (str!=null) { + Pattern p = Pattern.compile("\\s*|\t|\r|\n"); + Matcher m = p.matcher(str); + dest = m.replaceAll(""); + } + return dest; + } + + public static void main(String[] args) throws Exception { + System.out.println(validatePhone("15983795288")); + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/PageUtil.java b/service/src/main/java/com/hfkj/common/utils/PageUtil.java new file mode 100644 index 0000000..248ddc7 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/PageUtil.java @@ -0,0 +1,98 @@ +package com.hfkj.common.utils; + +import com.github.pagehelper.PageInfo; + +import java.util.List; + +/** + * 分页工具 + */ +public class PageUtil { + + /** + * 初始化 + * @param currentPage + * @param total + * @param pageSize + * @param pageInfo + * @param + * @return + */ + public static PageInfo initPageInfoObj(int currentPage, int total, int pageSize, PageInfo pageInfo) { + List list = pageInfo.getList(); + int fromIndex = 0; + int toIndex = 0; + if (total / pageSize == 0 && total % pageSize > 0) { + fromIndex = 0; + toIndex = total; + } else { + if (total / pageSize >= 1 && total % pageSize >= 0) { + fromIndex = pageSize * (currentPage - 1); + if (pageSize * currentPage >= total) { + toIndex = total; + } else { + toIndex = pageSize * currentPage; + } + } + } + + try { + list = list.subList(fromIndex, toIndex); + } catch (IndexOutOfBoundsException e) { + fromIndex = 0; + toIndex= pageSize; + list = list.subList(fromIndex, toIndex); + }catch(IllegalArgumentException e) { + fromIndex = total-pageSize; + toIndex =total; + list = list.subList(fromIndex, toIndex); + } + pageInfo.setList(list); + pageInfo.setNextPage(currentPage < ((total + pageSize - 1) / pageSize) ? currentPage + 1 : currentPage); + pageInfo.setTotal(total); + pageInfo.setPageNum(currentPage); + pageInfo.setPages((total + pageSize - 1) / pageSize); + pageInfo.setNavigateLastPage((total + pageSize - 1) / pageSize); + pageInfo.setPrePage(currentPage > 1 ? currentPage - 1 : currentPage); + pageInfo.setIsFirstPage(currentPage == 1 ? true : false); + pageInfo.setIsLastPage(currentPage == (total + pageSize - 1) / pageSize ? true : false); + pageInfo.setHasPreviousPage(currentPage == 1 ? false : true); + pageInfo.setHasNextPage(currentPage == (total + pageSize - 1) / pageSize ? false : true); + return calcNavigatepageNums(pageInfo); + } + + private static PageInfo calcNavigatepageNums(PageInfo pageInfo) { + // 当总页数小于或等于导航页码数时 + if (pageInfo.getPages() <= pageInfo.getNavigatePages()) { + pageInfo.setNavigatepageNums(new int[pageInfo.getPages()]); + for (int i = 0; i < pageInfo.getPages(); i++) { + pageInfo.getNavigatepageNums()[i] = i + 1; + } + } else { // 当总页数大于导航页码数时 + pageInfo.setNavigatepageNums(new int[pageInfo.getNavigatePages()]); + int startNum = pageInfo.getPageNum() - pageInfo.getNavigatePages() / 2; + int endNum = pageInfo.getPageNum() + pageInfo.getNavigatePages() / 2; + + if (startNum < 1) { + startNum = 1; + // (最前navigatePages页 + for (int i = 0; i < pageInfo.getNavigatePages(); i++) { + pageInfo.getNavigatepageNums()[i] = startNum++; + } + } else if (endNum > pageInfo.getPages()) { + endNum = pageInfo.getPages(); + // 最后navigatePages页 + for (int i = pageInfo.getNavigatePages() - 1; i >= 0; i--) { + pageInfo.getNavigatepageNums()[i] = endNum--; + } + } else { + // 所有中间页 + for (int i = 0; i < pageInfo.getNavigatePages(); i++) { + pageInfo.getNavigatepageNums()[i] = startNum++; + } + } + } + return pageInfo; + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/RedisUtil.java b/service/src/main/java/com/hfkj/common/utils/RedisUtil.java new file mode 100644 index 0000000..cfdc008 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/RedisUtil.java @@ -0,0 +1,533 @@ +package com.hfkj.common.utils; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +@Component +public class RedisUtil { + + @Autowired + private RedisTemplate redisTemplate; + + public RedisUtil(RedisTemplate redisTemplate) { + this.redisTemplate = redisTemplate; + } + + /** + * 指定缓存失效时间 + * @param key 键 + * @param time 时间(秒) + * @return + */ + public boolean expire(String key,long time){ + try { + if(time>0){ + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据key 获取过期时间 + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 + */ + public long getExpire(String key){ + return redisTemplate.getExpire(key,TimeUnit.SECONDS); + } + + /** + * 判断key是否存在 + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key){ + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除缓存 + * @param key 可以传一个值 或多个 + */ + @SuppressWarnings("unchecked") + public void del(String ... key){ + if(key!=null&&key.length>0){ + if(key.length==1){ + redisTemplate.delete(key[0]); + }else{ + redisTemplate.delete(CollectionUtils.arrayToList(key)); + } + } + } + + //============================String============================= + /** + * 普通缓存获取 + * @param key 键 + * @return 值 + */ + public Object get(String key){ + return key==null?null:redisTemplate.opsForValue().get(key); + } + + /** + * 普通缓存放入 + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key,Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 普通缓存放入并设置时间 + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean set(String key,Object value,long time){ + try { + if(time>0){ + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + }else{ + set(key, value); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 递增 + * @param key 键 + * @param delta 要增加几(大于0) + * @return + */ + public long incr(String key, long delta){ + if(delta<0){ + throw new RuntimeException("递增因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, delta); + } + + /** + * 递减 + * @param key 键 + * @param delta 要减少几(小于0) + * @return + */ + public long decr(String key, long delta){ + if(delta<0){ + throw new RuntimeException("递减因子必须大于0"); + } + return redisTemplate.opsForValue().increment(key, -delta); + } + + //================================Map================================= + /** + * HashGet + * @param key 键 不能为null + * @param item 项 不能为null + * @return 值 + */ + public Object hget(String key,String item){ + return redisTemplate.opsForHash().get(key, item); + } + + /** + * 获取hashKey对应的所有键值 + * @param key 键 + * @return 对应的多个键值 + */ + public Map hmget(String key){ + return redisTemplate.opsForHash().entries(key); + } + + /** + * HashSet + * @param key 键 + * @param map 对应多个键值 + * @return true 成功 false 失败 + */ + public boolean hmset(String key, Map map){ + try { + redisTemplate.opsForHash().putAll(key, map); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * HashSet 并设置时间 + * @param key 键 + * @param map 对应多个键值 + * @param time 时间(秒) + * @return true成功 false失败 + */ + public boolean hmset(String key, Map map, long time){ + try { + redisTemplate.opsForHash().putAll(key, map); + if(time>0){ + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * @param key 键 + * @param item 项 + * @param value 值 + * @return true 成功 false失败 + */ + public boolean hset(String key,String item,Object value) { + try { + redisTemplate.opsForHash().put(key, item, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * @param key 键 + * @param item 项 + * @param value 值 + * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 + * @return true 成功 false失败 + */ + public boolean hset(String key,String item,Object value,long time) { + try { + redisTemplate.opsForHash().put(key, item, value); + if(time>0){ + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 删除hash表中的值 + * @param key 键 不能为null + * @param item 项 可以使多个 不能为null + */ + public void hdel(String key, Object... item){ + redisTemplate.opsForHash().delete(key,item); + } + + /** + * 判断hash表中是否有该项的值 + * @param key 键 不能为null + * @param item 项 不能为null + * @return true 存在 false不存在 + */ + public boolean hHasKey(String key, String item){ + return redisTemplate.opsForHash().hasKey(key, item); + } + + /** + * hash递增 如果不存在,就会创建一个 并把新增后的值返回 + * @param key 键 + * @param item 项 + * @param by 要增加几(大于0) + * @return + */ + public double hincr(String key, String item,double by){ + return redisTemplate.opsForHash().increment(key, item, by); + } + + /** + * hash递减 + * @param key 键 + * @param item 项 + * @param by 要减少记(小于0) + * @return + */ + public double hdecr(String key, String item,double by){ + return redisTemplate.opsForHash().increment(key, item,-by); + } + + //============================set============================= + /** + * 根据key获取Set中的所有值 + * @param key 键 + * @return + */ + public Set sGet(String key){ + try { + return redisTemplate.opsForSet().members(key); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 根据value从一个set中查询,是否存在 + * @param key 键 + * @param value 值 + * @return true 存在 false不存在 + */ + public boolean sHasKey(String key,Object value){ + try { + return redisTemplate.opsForSet().isMember(key, value); + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将数据放入set缓存 + * @param key 键 + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSet(String key, Object...values) { + try { + return redisTemplate.opsForSet().add(key, values); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 将set数据放入缓存 + * @param key 键 + * @param time 时间(秒) + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSetAndTime(String key,long time,Object...values) { + try { + Long count = redisTemplate.opsForSet().add(key, values); + if(time>0) { + expire(key, time); + } + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 获取set缓存的长度 + * @param key 键 + * @return + */ + public long sGetSetSize(String key){ + try { + return redisTemplate.opsForSet().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 移除值为value的 + * @param key 键 + * @param values 值 可以是多个 + * @return 移除的个数 + */ + public long setRemove(String key, Object ...values) { + try { + Long count = redisTemplate.opsForSet().remove(key, values); + return count; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + //===============================list================================= + + /** + * 获取list缓存的内容 + * @param key 键 + * @param start 开始 + * @param end 结束 0 到 -1代表所有值 + * @return + */ + public List lGet(String key, long start, long end){ + try { + return redisTemplate.opsForList().range(key, start, end); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 获取list缓存的长度 + * @param key 键 + * @return + */ + public long lGetListSize(String key){ + try { + return redisTemplate.opsForList().size(key); + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } + + /** + * 通过索引 获取list中的值 + * @param key 键 + * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 + * @return + */ + public Object lGetIndex(String key,long index){ + try { + return redisTemplate.opsForList().index(key, index); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, Object value) { + try { + redisTemplate.opsForList().rightPush(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, Object value, long time) { + try { + redisTemplate.opsForList().rightPush(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, List value) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 将list放入缓存 + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, List value, long time) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 根据索引修改list中的某条数据 + * @param key 键 + * @param index 索引 + * @param value 值 + * @return + */ + public boolean lUpdateIndex(String key, long index,Object value) { + try { + redisTemplate.opsForList().set(key, index, value); + return true; + } catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + /** + * 移除N个值为value + * @param key 键 + * @param count 移除多少个 + * @param value 值 + * @return 移除的个数 + */ + public long lRemove(String key,long count,Object value) { + try { + Long remove = redisTemplate.opsForList().remove(key, count, value); + return remove; + } catch (Exception e) { + e.printStackTrace(); + return 0; + } + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/RequestUtils.java b/service/src/main/java/com/hfkj/common/utils/RequestUtils.java new file mode 100644 index 0000000..2454d4e --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/RequestUtils.java @@ -0,0 +1,38 @@ +package com.hfkj.common.utils; +import javax.servlet.http.HttpServletRequest; + +public class RequestUtils { + + public static String getIpAddress(HttpServletRequest request) { + // 获取请求主机IP地址,如果通过代理进来,则透过防火墙获取真实IP地址 + String ip = request.getHeader("X-Forwarded-For"); + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("WL-Proxy-Client-IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_CLIENT_IP"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getHeader("HTTP_X_FORWARDED_FOR"); + } + if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { + ip = request.getRemoteAddr(); + } + } else if (ip.length() > 15) { + String[] ips = ip.split(","); + for (int index = 0; index < ips.length; index++) { + String strIp = ips[index]; + if (!("unknown".equalsIgnoreCase(strIp))) { + ip = strIp; + break; + } + } + } + return ip; + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/ResponseMsgUtil.java b/service/src/main/java/com/hfkj/common/utils/ResponseMsgUtil.java new file mode 100644 index 0000000..6caa712 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/ResponseMsgUtil.java @@ -0,0 +1,70 @@ +package com.hfkj.common.utils; + + + +import com.hfkj.common.exception.BaseException; +import com.hfkj.common.exception.BizException; + +import com.hfkj.model.ResponseData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class ResponseMsgUtil { + + static Logger log = LoggerFactory.getLogger(ResponseMsgUtil.class); + + /** + * + * @Title: success + * @Description: 请求成功后,组装返回给前台的对象 + * @author: 机器猫 + * @param: @param data + * @param: @return + * @return: ResponseData + * @throws + */ + public static ResponseData success(Object data){ + ResponseData res = new ResponseData(); + res.setReturn_code("000000"); + res.setReturn_data(data); + return res; + } + + /** + * 根据消息码等生成接口返回对象 + * + * @param code 结果返回码 + * @param msg 结果返回消息 + * @param data 数据对象 + * @param + * @return + */ + public static ResponseData builderResponse(String code, String msg, Object data) { + ResponseData res = new ResponseData(); + res.setReturn_code(code); + res.setReturn_msg(msg); + res.setReturn_data(data); + return res; + } + + /** + * 请求异常返回结果 + * + * @param + * @return + */ + public static ResponseData exception(Exception e) { + + log.error("---controller error---",e); + + if(e instanceof BizException){//业务异常处理 + return builderResponse(((BizException)e).getErrorCode(), ((BizException)e).getErrorMsg(), null); + } else if(e instanceof BaseException){//系统异常处理 + return builderResponse(((BaseException)e).getErrorCode(),"服务异常",null); + } else{//未知异常 + return builderResponse("999999", "未知异常", null); + } + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/SpringContextUtil.java b/service/src/main/java/com/hfkj/common/utils/SpringContextUtil.java new file mode 100644 index 0000000..693bf31 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/SpringContextUtil.java @@ -0,0 +1,28 @@ +package com.hfkj.common.utils; + + +import org.springframework.context.ApplicationContext; + +public class SpringContextUtil { + private static ApplicationContext applicationContext; + + //获取上下文 + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + //设置上下文 + public static void setApplicationContext(ApplicationContext applicationContext) { + SpringContextUtil.applicationContext = applicationContext; + } + + //通过名字获取上下文中的bean + public static Object getBean(String name){ + return applicationContext.getBean(name); + } + + //通过类型获取上下文中的bean + public static Object getBean(Class requiredType){ + return applicationContext.getBean(requiredType); + } +} diff --git a/service/src/main/java/com/hfkj/common/utils/StreamUtil.java b/service/src/main/java/com/hfkj/common/utils/StreamUtil.java new file mode 100644 index 0000000..457f6a6 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/StreamUtil.java @@ -0,0 +1,34 @@ +package com.hfkj.common.utils; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.function.Predicate; + +/** + * + * @ClassName: StreamUtil + * @Description:TODO(List Steam) + * @author: 胡锐 + * @date: 2019年3月25日 下午4:14:00 + * + + */ +public class StreamUtil { + + /** + * + * @Title: distinctByKey + * @Description: TODO(对象 去重) + * @author: 胡锐 + * @param: @param keyExtractor + * @param: @return + * @return: Predicate + * @throws + */ + public static Predicate distinctByKey(Function keyExtractor) { + Map seen = new ConcurrentHashMap<>(); + return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/UnionUtils.java b/service/src/main/java/com/hfkj/common/utils/UnionUtils.java new file mode 100644 index 0000000..bd648a2 --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/UnionUtils.java @@ -0,0 +1,487 @@ +package com.hfkj.common.utils; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.WebResource.Builder; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.client.urlconnection.HTTPSProperties; +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Cipher; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.*; +import javax.ws.rs.core.MediaType; +import java.security.*; +import java.security.cert.CertificateException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.KeySpec; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.*; + +public class UnionUtils { + private static Client c = null; + private static Client secureClient =null; + private static Gson gson = new GsonBuilder().disableHtmlEscaping().create(); + public static String DATE_FORMAT = "yyyy-MM-dd"; + /** + * 初始化设置 + */ + static{ + initalizationJersyClient(); + initalizationSecureJersyClient(); + } + /** + * 设置调用参数 + */ + private static void initalizationJersyClient(){ + try { + c = Client.create(); + c.setFollowRedirects(true); + c.setConnectTimeout(10000); + c.setReadTimeout(10000); + } catch (Exception e) { + e.printStackTrace(); + } + } + + private static void initalizationSecureJersyClient(){ + try { + SSLContext context = SSLContext.getInstance("SSL"); + context.init(null, new TrustManager[] { new X509TrustManager() { + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return null; + } + public void checkClientTrusted( + java.security.cert.X509Certificate[] chain, String authType) + throws CertificateException {} + public void checkServerTrusted( + java.security.cert.X509Certificate[] chain, + String authType) throws CertificateException {} + } }, new SecureRandom()); + HostnameVerifier hv = new HostnameVerifier(){ + public boolean verify(String urlHostName, SSLSession session){ + return true; + } + }; + + HTTPSProperties prop = new HTTPSProperties(hv, context); + DefaultClientConfig dcc = new DefaultClientConfig(); + dcc.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES, prop); + secureClient = Client.create(dcc); + secureClient.setFollowRedirects(true); + secureClient.setConnectTimeout(10000); + secureClient.setReadTimeout(10000); + } catch (Exception e) { + e.printStackTrace(); + } + } + + /** + * 调用接口 + */ + public static String sendPOSTRequest(String url, Object map, String contentTpye){ + if(null==c){ + initalizationJersyClient(); + } + Client client = null; + if(url.indexOf("https://") == 0){ + if(null==secureClient){ + initalizationJersyClient(); + } + client = secureClient; + }else{ + if(null==c){ + initalizationJersyClient(); + } + client = c; + } + WebResource resource = client.resource(url); + String resultStr = null; + try { + Builder builder = resource.accept("*/*"); + ClientResponse res = builder.type(contentTpye).entity(map).post(ClientResponse.class); + if(res.getStatus() != 200){ + throw new Exception("url:"+url+",response code:" + res.getStatus()); + } + resultStr = res.getEntity(String.class); + return resultStr; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 参数 转为json格式 + * @param url 调用地址 + * @param map 设置的参数 + * @return + */ + public static String sendPostGson(String url, Map map){ + String ps = gson.toJson(map); + + System.out.println("生成加密后的报文:"+ps); + return sendPOSTRequest(url, ps, MediaType.APPLICATION_JSON); + } + + + /** + * 使用公钥加密对称密钥 + * @param publicKey 公钥 + * @param symmetricKeyByte 对称密钥字节 + * @return 加密后的对称密钥字节 + * @throws Exception + */ + public static byte[] encrypt(String publicKey, byte[] symmetricKeyByte) throws Exception { + byte[] encodedKey = Base64.decodeBase64(publicKey); + KeySpec keySpec = new X509EncodedKeySpec(encodedKey); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey pk = keyFactory.generatePublic(keySpec); + Cipher cipher = Cipher.getInstance("RSA/ECB/PKCS1Padding"); + cipher.init(Cipher.ENCRYPT_MODE, pk); + byte[] result = cipher.doFinal(symmetricKeyByte); + return result; + } + + /** + * 签名加密后的数据装载进map + * @param key 对称秘钥 + * @param params 待加密的字符串 + * @param encryptKeys 加密字段 + * @throws Exception + */ + public static void encryptedParamMap(String key, Map params, String ... encryptKeys) throws Exception{ + if(encryptKeys != null && encryptKeys.length > 0){ + for(String encryptKey : encryptKeys){ + params.put(encryptKey, getEncryptedValue(params.get(encryptKey), key)); + } + } + } + + /** + * 3DES加密 + * @param value 待加密的字符串 + * @param key 加密密钥 + * @return 加密后的字符串 + * @throws Exception + */ + public static String getEncryptedValue(String value, String key) throws Exception { + if (null == value || "".equals(value)) { + return ""; + } + byte[] valueByte = value.getBytes(); + byte[] sl = encrypt3DES(valueByte, hexToBytes(key)); + String result = Base64.encodeBase64String(sl); + // String result = BytesUtil.bytesToHex(sl); + return result; + } + + /** + * 解密 + * @param value 待解密的字符串 + * @param key 解密秘钥 + * @return 解密后字符串 + * @throws Exception + */ + public static String getDecryptedValue(String value, String key) throws Exception { + if (null == value || "".equals(value)) { + return ""; + } + byte[] valueByte = Base64.decodeBase64(value); + byte[] sl = decrypt3DES(valueByte, hexStr2Bytes(key)); + String result = new String(sl); + return result; + } + + /** + * 3DES解密 + * @param input + * @param key + * @return + * @throws Exception + */ + public static byte[] decrypt3DES(byte[] input, byte[] key) throws Exception { + Cipher c = Cipher.getInstance("DESede/ECB/PKCS5Padding"); + c.init(Cipher.DECRYPT_MODE, new SecretKeySpec(key, "DESede")); + return c.doFinal(input); + } + + + /** + * bytes字符串转换为Byte值 + * @param src String Byte字符串,每个Byte之间没有分隔符(字符范围:0-9 A-F) + * @return byte[] + */ + public static byte[] hexStr2Bytes(String src){ + /*对输入值进行规范化整理*/ + src = src.trim().replace(" ", "").toUpperCase(Locale.US); + //处理值初始化 + int m=0,n=0; + int iLen=src.length()/2; //计算长度 + byte[] ret = new byte[iLen]; //分配存储空间 + + for (int i = 0; i < iLen; i++){ + m=i*2+1; + n=m+1; + ret[i] = (byte)(Integer.decode("0x"+ src.substring(i*2, m) + src.substring(m,n)) & 0xFF); + } + return ret; + } + + /** + * 3DES加密 + * @param input 待加密的字节 + * @param key 密钥 + * @return 加密后的字节 + * @throws Exception + */ + private static byte[] encrypt3DES(byte[] input, byte[] key) throws Exception { + Cipher c = Cipher.getInstance("DESede/ECB/PKCS5Padding"); + c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "DESede")); + return c.doFinal(input); + } + + /** + * 获取随机字符串 + * @return 随机字符串 + */ + public static String createNonceStr(){ + String sl = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + StringBuilder sb = new StringBuilder(); + for(int i = 0 ; i < 16 ; i ++){ + sb.append(sl.charAt(new Random().nextInt(sl.length()))); + } + return sb.toString(); + } + + /** + * h获取32位随机数字字符串 + * @return + */ + public static String createNonceNumber(){ + String sl = "0123456789"; + StringBuilder sb = new StringBuilder(); + for(int i = 0 ; i < 32 ; i ++){ + sb.append(sl.charAt(new Random().nextInt(sl.length()))); + } + return sb.toString(); + } + /** + * 获取当前日期时间 + * + * @return + */ + public static String getCurrentDateTime(String Dateformat) { + String datestr = null; + SimpleDateFormat df = new SimpleDateFormat(Dateformat); + datestr = df.format(new Date()); + return datestr; + } + + /** + * 在输入日期上增加(+)或减去(-)天数 + * + * @param date 输入日期 + */ + public static Date addDay(Date date, int iday) { + Calendar cd = Calendar.getInstance(); + + cd.setTime(date); + + cd.add(Calendar.DAY_OF_MONTH, iday); + + return cd.getTime(); + } + /** + * 将日期格式日期转换为字符串格式 自定義格式 + * + * @param date + * @param dateformat + * @return + */ + public static String dateToString(Date date, String dateformat) { + String datestr = null; + SimpleDateFormat df = new SimpleDateFormat(dateformat); + datestr = df.format(date); + return datestr; + } + + /** + * 将字符串日期转换为日期格式 + * + * @param datestr + * @return + */ + public static Date stringToDate(String datestr) throws Exception{ + + if (datestr == null || datestr.equals("")) { + return null; + } + Date date = new Date(); + SimpleDateFormat df = new SimpleDateFormat(DATE_FORMAT); + try { + date = df.parse(datestr); + } catch (ParseException e) { + date = stringToDate(datestr, "yyyyMMdd"); + } + return date; + } + + /** + * 将字符串日期转换为日期格式 + * 自定義格式 + * + * @param datestr + * @return + */ + public static Date stringToDate(String datestr, String dateformat) throws Exception{ + Date date = new Date(); + SimpleDateFormat df = new SimpleDateFormat(dateformat); + date = df.parse(datestr); + return date; + } + /** + * 签名 + * @param param 待签名的参数 + * @param signKey 签名密钥 + * @return 签名结果字符串 + * @throws Exception + */ + public static String sign(Map param, String signKey) throws Exception { + String value = sortMap(param); + byte[] keyBytes = Base64.decodeBase64(signKey); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); + KeyFactory keyf = KeyFactory.getInstance("RSA"); + PrivateKey priKey = keyf.generatePrivate(keySpec); + Signature signature = Signature.getInstance("SHA256WithRSA"); + signature.initSign(priKey); + signature.update(value.getBytes()); + byte[] signed = signature.sign(); + String result = Base64.encodeBase64String(signed); + return result; + } + + + + /** + * 排序 + * @param param 待排序的参数 + * @return 排序结果字符串 + */ + public static String sortMap(Map param){ + StringBuilder result = new StringBuilder(); + Collection keySet = param.keySet(); + List list = new ArrayList(keySet); + Collections.sort(list); + for (int i = 0; i < list.size(); ++i) { + String key = list.get(i); + if("symmetricKey".equals(key)){ + continue; + } +// 非空字段需要参与签名 +// if(param.get(key) == null || "".equals(param.get(key).trim())){ +// continue; +// } + result.append(key).append("=").append(param.get(key)).append("&"); + } + return result.substring(0, result.length() - 1); + } + + + public static String sha256(byte[] data) { + try { + MessageDigest md = MessageDigest.getInstance("SHA-256"); + return bytesToHex(md.digest(data)); + + } catch (Exception ex) { + + return null; + } + } + + /** + * 将byte数组转换成16进制字符串 + * + * @param bytes + * @return 16进制字符串 + */ + public static String bytesToHex(byte[] bytes) { + String hexArray = "0123456789abcdef"; + StringBuilder sb = new StringBuilder(bytes.length * 2); + for (byte b : bytes) { + int bi = b & 0xff; + sb.append(hexArray.charAt(bi >> 4)); + sb.append(hexArray.charAt(bi & 0xf)); + } + return sb.toString(); + } + + public static byte[] hexToBytes(String hex) { + return hexToBytes(hex.toCharArray()); + } + + public static byte[] hexToBytes(char[] hex) { + int length = hex.length / 2; + byte[] raw = new byte[length]; + for (int i = 0; i < length; i++) { + int high = Character.digit(hex[i * 2], 16); + int low = Character.digit(hex[i * 2 + 1], 16); + int value = (high << 4) | low; + if (value > 127) { + value -= 256; + } + raw[i] = (byte) value; + } + return raw; + } + + public static String createSign(Map params){ + StringBuilder sb = new StringBuilder(); + // 将参数以参数名的字典升序排序 + Map sortParams = new TreeMap(params); + // 遍历排序的字典,并拼接"key=value"格式 + for (Map.Entry entry : sortParams.entrySet()) { + String key = entry.getKey(); + String value = entry.getValue().trim(); + if (null != value && !"".equals(value)) + sb.append("&").append(key).append("=").append(value); + } + String stringA = sb.toString().replaceFirst("&",""); + String stringSignTemp = stringA ; + String signValue = sha256(stringSignTemp.getBytes()); + return signValue; + } + + + + + /** + * 签名 + * @param param 待签名的参数 + * @param sign 签名结果字符串 + * @return 签名结果 + * @throws NoSuchAlgorithmException + * @throws InvalidKeySpecException + * @throws InvalidKeyException + * @throws SignatureException + */ + public static boolean verify(Map param, String sign,String rescissionPublicKey) throws Exception { + String value = sortMap(param); + byte[] keyBytes = Base64.decodeBase64(rescissionPublicKey); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyf = KeyFactory.getInstance("RSA"); + PublicKey pubkey = keyf.generatePublic(keySpec); + Signature signature = Signature.getInstance("SHA256WithRSA"); + signature.initVerify(pubkey); + signature.update(value.getBytes()); + boolean result = signature.verify(Base64.decodeBase64(sign.getBytes())); + return result; + } + +} diff --git a/service/src/main/java/com/hfkj/common/utils/WxUtils.java b/service/src/main/java/com/hfkj/common/utils/WxUtils.java new file mode 100644 index 0000000..0dbb81d --- /dev/null +++ b/service/src/main/java/com/hfkj/common/utils/WxUtils.java @@ -0,0 +1,373 @@ +package com.hfkj.common.utils; + +import com.google.common.collect.Maps; +import com.hfkj.common.pay.util.sdk.WXPayConstants; +import com.hfkj.common.pay.util.sdk.WXPayXmlUtil; +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.io.naming.NoNameCoder; +import com.thoughtworks.xstream.io.xml.XppDriver; +import net.sf.cglib.beans.BeanMap; +import org.apache.commons.lang3.StringUtils; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import java.io.StringWriter; +import java.security.MessageDigest; +import java.security.SecureRandom; +import java.util.*; + +public class WxUtils { + + private static final Random RANDOM = new SecureRandom(); + + private static final String SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + + + /** + * 生成签名 + * + * @param signMaps + * @return + * @throws Exception + */ + public static String generateSign(SortedMap signMaps, String mchKey) { + StringBuffer sb = new StringBuffer(); + + // 字典序 + for (Map.Entry signMap : signMaps.entrySet()) { + String key = (String) signMap.getKey(); + String value = (String) signMap.getValue(); + + // 为空不参与签名、参数名区分大小写 + if (null != value && !"".equals(value) && !"sign".equals(key) && !"key".equals(key)) { + sb.append(key).append("=").append(value).append("&"); + } + } + + // 拼接key + sb.append("key=").append(mchKey); + // MD5加密 + String sign = MD5Encode(sb.toString(), "UTF-8").toUpperCase(); + return sign; + } + + public static String generateSignSHA256(SortedMap signMaps,String mchKey)throws Exception{ + StringBuffer sb = new StringBuffer(); + + // 字典序 + for (Map.Entry signMap : signMaps.entrySet()) { + String key = (String) signMap.getKey(); + String value = (String) signMap.getValue(); + + // 为空不参与签名、参数名区分大小写 + if (null != value && !"".equals(value) && !"sign".equals(key) && !"key".equals(key)) { + sb.append(key).append("=").append(value).append("&"); + } + } + + // 拼接key + sb.append("key=").append(mchKey); + // HMACSHA256加密 + String sign = HMACSHA256(sb.toString(), mchKey).toUpperCase(); + return sign; + } + + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = new String(origin); + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } catch (Exception exception) { + } + return resultString; + } + + private static final String[] hexDigits = { "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; + + + + private static HashMap sortAsc(Map map) { + HashMap tempMap = new LinkedHashMap(); + List> infoIds = new ArrayList>(map.entrySet()); + //排序 + infoIds.sort(new Comparator>() { + @Override + public int compare(Map.Entry o1, Map.Entry o2) { + return o1.getKey().compareTo(o2.getKey()); + } + }); + + for (int i = 0; i < infoIds.size(); i++) { + Map.Entry item = infoIds.get(i); + tempMap.put(item.getKey(), item.getValue()); + } + return tempMap; + } + + + + /** + * 生成 HMACSHA256 + * @param data 待处理数据 + * @param key 密钥 + * @return 加密结果 + * @throws Exception + */ + public static String HMACSHA256(String data, String key) throws Exception { + Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256"); + sha256_HMAC.init(secret_key); + byte[] array = sha256_HMAC.doFinal(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + for (byte item : array) { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + return sb.toString().toUpperCase(); + } + + /** + * 获取随机字符串 Nonce Str + * + * @return String 随机字符串 + */ + public static String makeNonStr() { + char[] nonceChars = new char[32]; + for (int index = 0; index < nonceChars.length; ++index) { + nonceChars[index] = SYMBOLS.charAt(RANDOM.nextInt(SYMBOLS.length())); + } + return new String(nonceChars); + } + + /** + * 拼接签名数据 + * + */ + public static String makeSign(BeanMap beanMap, String mchKey, String signType)throws Exception { + SortedMap signMaps = Maps.newTreeMap(); + + for (Object key : beanMap.keySet()) { + Object value = beanMap.get(key); + + // 排除空数据 + if (value == null) { + continue; + } + signMaps.put(key + "", String.valueOf(value)); + } + if(signType.equals("MD5")) { + // 生成签名 + return generateSign(signMaps, mchKey); + }else if(signType.equals("SHA256")){ + return generateSignSHA256(signMaps, mchKey); + }else{ + return null; + } + } + + /** + * 数据转换为xml格式 + * + * @param object + * @param obj + * @return + */ + public static String truncateDataToXML(Class object, Object obj) { + XStream xStream = new XStream(new XppDriver(new NoNameCoder())); + xStream.alias("xml", object); + return xStream.toXML(obj); + } + + + /** + * 生成签名. 注意,若含有sign_type字段,必须和signType参数保持一致。 + * + * @param data 待签名数据 + * @param key API密钥 + * @param signType 签名方式 + * @return 签名 + */ + public static String generateSignature(final Map data, String key, WXPayConstants.SignType signType) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k).trim().length() > 0) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k).trim()).append("&"); + } + sb.append("key=").append(key); + if (WXPayConstants.SignType.MD5.equals(signType)) { + return MD5(sb.toString() , true); + } + else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) { + return HMACSHA256(sb.toString(), key); + } + else { + throw new Exception(String.format("Invalid sign_type: %s", signType)); + } + } + + public static String generateSignature(final Map data) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (StringUtils.isBlank(sb.toString())) { + sb.append(k).append("=").append(data.get(k)); + } else { + sb.append("&").append(k).append("=").append(data.get(k)); + } + } + return sb.toString(); + } + + public static String generateSignature2(final Map data, String sign, String key) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k) != null) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k)).append("&"); + } + if (key != null) { + sb.append("app_secret=").append(key); + } + return sb.toString(); + } + + /** + * 生成 MD5 + * + * @param data 待处理数据 + * @return MD5结果 + */ + public static String MD5(String data , Boolean isUpperCase) throws Exception { + java.security.MessageDigest md = MessageDigest.getInstance("MD5"); + byte[] array = md.digest(data.getBytes("UTF-8")); + StringBuilder sb = new StringBuilder(); + for (byte item : array) { + sb.append(Integer.toHexString((item & 0xFF) | 0x100).substring(1, 3)); + } + if (isUpperCase) { + return sb.toString().toUpperCase(); + } else { + return sb.toString(); + } + } + + + + /** + * 将Map转换为XML格式的字符串 + * + * @param data Map类型数据 + * @return XML格式的字符串 + * @throws Exception + */ + public static String mapToXml(Map data) throws Exception { + org.w3c.dom.Document document = WXPayXmlUtil.newDocument(); + org.w3c.dom.Element root = document.createElement("xml"); + document.appendChild(root); + for (String key: data.keySet()) { + String value = data.get(key); + if (value == null) { + value = ""; + } + value = value.trim(); + org.w3c.dom.Element filed = document.createElement(key); + filed.appendChild(document.createTextNode(value)); + root.appendChild(filed); + } + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + DOMSource source = new DOMSource(document); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + transformer.transform(source, result); + String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", ""); + try { + writer.close(); + } + catch (Exception ex) { + } + return output; + } + + + /** + * 千猪生成签名。 + * + * @param data 待签名数据 + * @param secret API密钥 + * @param signType 签名方式 + * @return 签名 + */ + public static String generateSignaturePig(final Map data, String secret, WXPayConstants.SignType signType) throws Exception { + Set keySet = data.keySet(); + String[] keyArray = keySet.toArray(new String[keySet.size()]); + Arrays.sort(keyArray); + StringBuilder sb = new StringBuilder(); + for (String k : keyArray) { + if (k.equals(WXPayConstants.FIELD_SIGN)) { + continue; + } + if (data.get(k).trim().length() > 0) // 参数值为空,则不参与签名 + sb.append(k).append("=").append(data.get(k).trim()).append("&"); + } + String s = sb.substring(0, sb.length() - 1) + secret; + + if (WXPayConstants.SignType.MD5.equals(signType)) { + return MD5(sb.toString() , false); + } + else if (WXPayConstants.SignType.HMACSHA256.equals(signType)) { + return HMACSHA256(s, secret); + } + else { + throw new Exception(String.format("Invalid sign_type: %s", signType)); + } + } + + +} diff --git a/service/src/main/java/com/hfkj/config/CommonSysConfig.java b/service/src/main/java/com/hfkj/config/CommonSysConfig.java new file mode 100644 index 0000000..c0d3469 --- /dev/null +++ b/service/src/main/java/com/hfkj/config/CommonSysConfig.java @@ -0,0 +1,18 @@ +package com.hfkj.config; + +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.PropertySource; +import org.springframework.stereotype.Component; +import lombok.Data; +@Component("commonSysConfig") +@ConfigurationProperties +@PropertySource("classpath:/commonConfig.properties") +@Data +public class CommonSysConfig { + + /** + * 文件存放地址 可访问 + */ + private String filesystem; + +} diff --git a/service/src/main/java/com/hfkj/config/CommonSysConst.java b/service/src/main/java/com/hfkj/config/CommonSysConst.java new file mode 100644 index 0000000..c15122c --- /dev/null +++ b/service/src/main/java/com/hfkj/config/CommonSysConst.java @@ -0,0 +1,19 @@ +package com.hfkj.config; + +public class CommonSysConst { + + private static CommonSysConfig sysConfig; + + public static void setSysConfig(CommonSysConfig arg){ + sysConfig = arg; + } + + public static CommonSysConfig getSysConfig(){ + if (null == sysConfig) { + //防止空指针异常 + sysConfig = new CommonSysConfig(); + return sysConfig; + } + return sysConfig; + } +} diff --git a/service/src/main/java/com/hfkj/config/ConfigListener.java b/service/src/main/java/com/hfkj/config/ConfigListener.java new file mode 100644 index 0000000..7677905 --- /dev/null +++ b/service/src/main/java/com/hfkj/config/ConfigListener.java @@ -0,0 +1,23 @@ +package com.hfkj.config; + +import javax.annotation.Resource; +import javax.servlet.ServletContextEvent; +import javax.servlet.ServletContextListener; +import javax.servlet.annotation.WebListener; + +@WebListener +public class ConfigListener implements ServletContextListener { + + @Resource + private CommonSysConfig commonSysConfig; + + @Override + public void contextInitialized(ServletContextEvent sce) { + CommonSysConst.setSysConfig(commonSysConfig); + } + + @Override + public void contextDestroyed(ServletContextEvent sce) { + } + +} diff --git a/service/src/main/java/com/hfkj/config/SpPrinterConfig.java b/service/src/main/java/com/hfkj/config/SpPrinterConfig.java new file mode 100644 index 0000000..7f0e728 --- /dev/null +++ b/service/src/main/java/com/hfkj/config/SpPrinterConfig.java @@ -0,0 +1,198 @@ +package com.hfkj.config; + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.*; +import org.apache.http.client.utils.URLEncodedUtils; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; + +/** + * 商鹏打印机 + * @author hurui + */ +public class SpPrinterConfig { + + public static final String baseUri = "https://open.spyun.net/v1/"; + + private String appid = "sp6284a57015d78"; + + private String appsecret = "2bdca1587ead21c0569e0ed1f82b19f6"; + +/* public SpPrinterConfig(String appid, String appsecret) { + this.appid = appid; + this.appsecret = appsecret; + }*/ + + // 添加打印机 + public String addPrinter(String sn, String pkey, String name) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + params.add(new BasicNameValuePair("pkey", pkey)); + params.add(new BasicNameValuePair("name", name)); + + return request("POST", "printer/add", params); + } + + // 删除打印机 + public String deletePrinter(String sn) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + + return request("DELETE", "printer/delete", params); + } + + // 修改打印机信息 + public String updatePrinter(String sn, String name) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + params.add(new BasicNameValuePair("name", name)); + + return request("PATCH", "printer/update", params); + } + + // 修改打印机参数 + public String updatePrinterSetting(String sn, int auto_cut, String voice) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + params.add(new BasicNameValuePair("auto_cut", String.valueOf(auto_cut))); + params.add(new BasicNameValuePair("voice", voice)); + + return request("PATCH", "printer/setting", params); + } + + // 获取打印机信息 + public String getPrinter(String sn) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + + return request("GET", "printer/info", params); + } + + // 打印订单 + public String print(String sn, String content, int times) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + params.add(new BasicNameValuePair("content", content)); + params.add(new BasicNameValuePair("times", String.valueOf(times))); + + return request("POST", "printer/print", params); + } + + // 清空待打印订单 + public String deletePrints(String sn) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + + return request("DELETE", "printer/cleansqs", params); + } + + // 查询打印订单状态 + public String getPrintsStatus(String id) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("id", id)); + + return request("GET", "printer/order/status", params); + } + + // 查询打印机历史打印订单数 + public String getPrintsOrders(String sn, String date) throws IOException { + ArrayList params = new ArrayList<>(); + params.add(new BasicNameValuePair("sn", sn)); + params.add(new BasicNameValuePair("date", date)); + + return request("GET", "printer/order/number", params); + } + + // 发送请求 + private String request(String method, String uri, ArrayList params) throws IOException { + RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(4000) //读取超时 + .setConnectTimeout(1000) //连接超时 + .build(); + + CloseableHttpClient httpClient = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); + + // 公共请求参数 + params.add(new BasicNameValuePair("appid", appid)); + params.add(new BasicNameValuePair("timestamp", String.valueOf(System.currentTimeMillis() / 1000))); + params.add(new BasicNameValuePair("sign", makeSign(params))); + + CloseableHttpResponse response = null; + String url = baseUri + uri; + if (method.equals("GET")) { + HttpGet request = new HttpGet(url + "?" + URLEncodedUtils.format(params, "utf-8")); + response = httpClient.execute(request); + } else if (method.equals("DELETE")) { + HttpDelete request = new HttpDelete(url + "?" + URLEncodedUtils.format(params, "utf-8")); + response = httpClient.execute(request); + } else if (method.equals("POST")) { + HttpPost request = new HttpPost(url); + request.setEntity(new UrlEncodedFormEntity(params,"utf-8")); + response = httpClient.execute(request); + } else if (method.equals("PATCH")) { + HttpPatch request = new HttpPatch(url); + request.setEntity(new UrlEncodedFormEntity(params,"utf-8")); + response = httpClient.execute(request); + } else if (method.equals("PUT")) { + HttpPut request = new HttpPut(url); + request.setEntity(new UrlEncodedFormEntity(params,"utf-8")); + response = httpClient.execute(request); + } + + if (response == null) { + throw new ClientProtocolException(); + } + + HttpEntity httpEntity = response.getEntity(); + if (httpEntity == null) { + throw new ClientProtocolException(); + } + +/* if (response.getStatusLine().getStatusCode() != 200) { + throw new ClientProtocolException(EntityUtils.toString(httpEntity)); + }*/ + + return EntityUtils.toString(httpEntity); + } + + // 创建签名 + public String makeSign(ArrayList params) { + int size = params.size(); + String[] keys = new String[params.size()]; + HashMap values = new HashMap<>(); + for (int i = 0; i < size; i++) { + NameValuePair p = params.get(i); + keys[i] = p.getName(); + values.put(p.getName(), p.getValue()); + } + Arrays.sort(keys); + + String sign = ""; + for (int i = 0; i < keys.length; i++) { + String v = values.get(keys[i]); + if (!keys[i].equals("sign") && !keys[i].equals("appsecret") && !v.equals("")) { + if (i > 0) { + sign += "&"; + } + sign += keys[i] + "=" + v; + } + } + sign += "&appsecret=" + appsecret; + + return DigestUtils.md5Hex(sign).toUpperCase(); + } +} diff --git a/service/src/main/java/com/hfkj/config/SpPrinterTemplate.java b/service/src/main/java/com/hfkj/config/SpPrinterTemplate.java new file mode 100644 index 0000000..3cc2b7c --- /dev/null +++ b/service/src/main/java/com/hfkj/config/SpPrinterTemplate.java @@ -0,0 +1,149 @@ +/* +package com.hfkj.config; + +import com.hai.common.utils.DateUtil; +import com.hai.model.GasClassGroupTaskDataCount; +import com.hai.model.GasClassGroupTaskOilCount; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.Map; + +*/ +/** + * 商鹏打印机模板 + * @author hurui + *//* + +public class SpPrinterTemplate { + + */ +/** + * 加油站收银员存根模板 + *//* + + public static String classGroupCountTemp(GasClassGroupTaskDataCount dataCount, boolean makeUp) throws Exception { + String str = "" + dataCount.getClassNum() + "班结流水" + (makeUp?"(补打)":"") + "
" + + "===============================
" + + "开始时间:" + DateUtil.date2String(dataCount.getStartTime(), "yyyy-MM-dd HH:mm:ss") + "
" + + "结束时间:" + DateUtil.date2String(dataCount.getEndTime(), "yyyy-MM-dd HH:mm:ss") + "
" + + "
" + + "加油金额汇总:" + dataCount.getRefuelPrice() + "元
" + + "加油笔数汇总:" + dataCount.getRefuelNum() + "笔
" + + "加油升数汇总:" + dataCount.getRefuelLiters() + "升
" + + "
" + + "退款金额汇总:" + dataCount.getRefundPrice() + "元
" + + "退款笔数汇总:" + dataCount.getRefundNum() + "笔
" + + "退款升数汇总:" + dataCount.getRefundLiters() + "升
" + + "
" + + "--------------收款-------------
" + + "油号 金额(元) 升数 笔数
"; + + String oilCountStr = ""; + for (GasClassGroupTaskOilCount oilCount : dataCount.getGroupTaskOilCountList()) { + oilCountStr += oilCount.getOilNo() + "# " + oilCount.getRefuelPrice() + " " + oilCount.getRefuelLiters() + " " + oilCount.getRefuelNum() + "
"; + } + str += oilCountStr + + "================================
" + + "" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") +"
"; + return str; + } + + */ +/** + * 加油站收银员存根模板 + * @param gasName 油站名称 + * @param orderNo 订单号 + * @param payTime 支付时间 + * @param gunNo 抢号 + * @param oilNo 油号 + * @param oilLiters 升数 + * @param orderPrice 加油金额 + * @param receiptMap 小票配置 + * @param makeUp 重复打印 + * @return + *//* + + public static String oilCashierStubTemp(String gasName, + String orderNo, + String payTime, + String phone, + String gunNo, + String oilNo, + String oilLiters, + String orderPrice, + Map receiptMap, + boolean makeUp) throws Exception { + + String str = "" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "
" + + "" + gasName + (makeUp?"(补打)":"") + "
" + + "(收银员存根)
" + + "------------------------------
" + + "流水:" + orderNo + "
" + + "------------------------------
" + + "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + + "支付时间:" + payTime + "
" + + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + + "油枪:"+ gunNo + "号
" + + "油品:" + oilNo + "#
" + + "升数:" + oilLiters +"升
" + + "实际加油升数以油站加油机为准!
" + + "------------------------------
" + + "加油金额
" + + "¥" + orderPrice + "元
" + + "------------------------------
" + + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + ""; + return str; + } + + */ +/** + * 加油站客户存根模板 + * @param gasName 油站名称 + * @param orderNo 订单号 + * @param payTime 支付时间 + * @param gunNo 抢号 + * @param oilNo 油号 + * @param oilLiters 升数 + * @param orderPrice 加油金额 + * @param receiptMap 小票配置 + * @param makeUp 重复打印 + * @return + *//* + + public static String oilClientStubTemp(String gasName, + String orderNo, + String payTime, + String phone, + String gunNo, + String oilNo, + String oilLiters, + String orderPrice, + Map receiptMap, + boolean makeUp) throws Exception { + String str = "" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptTop"))?MapUtils.getString(receiptMap, "receiptTop"):"嗨森逛") + "
" + + "" + gasName + (makeUp?"(补打)":"") + "
" + + "(客户存根)
" + + "------------------------------
" + + "流水:" + orderNo + "
" + + "------------------------------
" + + "打印时间:" + DateUtil.date2String(new Date(), "yyyy-MM-dd HH:mm:ss") + "
" + + "支付时间:" + payTime + "
" + + "电话:" + (StringUtils.isNotBlank(phone)?phone.substring(0, 3) + "****" + phone.substring(7):"") + "
" + + "来源:" + (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptSource"))?MapUtils.getString(receiptMap, "receiptSource"):"嗨森逛")+ "
" + + "油枪:"+ gunNo + "号
" + + "油品:" + oilNo + "#
" + + "升数:" + oilLiters +"升
" + + "实际加油升数以油站加油机为准!
" + + "------------------------------
" + + "加油金额
" + + "¥" + orderPrice + "元
" + + "------------------------------
" + + ""+ (StringUtils.isNotBlank(MapUtils.getString(receiptMap, "receiptBottom"))?MapUtils.getString(receiptMap, "receiptBottom"):"开心又省钱; 来"嗨森逛"") + ""; + return str; + } + +} +*/ diff --git a/service/src/main/java/com/hfkj/dao/BsAgentMapper.java b/service/src/main/java/com/hfkj/dao/BsAgentMapper.java new file mode 100644 index 0000000..2a2fa20 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsAgentMapper.java @@ -0,0 +1,128 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsAgent; +import com.hfkj.entity.BsAgentExample; +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 BsAgentMapper extends BsAgentMapperExt { + @SelectProvider(type=BsAgentSqlProvider.class, method="countByExample") + long countByExample(BsAgentExample example); + + @DeleteProvider(type=BsAgentSqlProvider.class, method="deleteByExample") + int deleteByExample(BsAgentExample example); + + @Delete({ + "delete from bs_agent", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_agent (company_id, company_name, ", + "agent_no, `name`, contacts_name, ", + "contacts_telephone, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR}, ", + "#{agentNo,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{contactsName,jdbcType=VARCHAR}, ", + "#{contactsTelephone,jdbcType=VARCHAR}, #{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(BsAgent record); + + @InsertProvider(type=BsAgentSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsAgent record); + + @SelectProvider(type=BsAgentSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_no", property="agentNo", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_telephone", property="contactsTelephone", jdbcType=JdbcType.VARCHAR), + @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(BsAgentExample example); + + @Select({ + "select", + "id, company_id, company_name, agent_no, `name`, contacts_name, contacts_telephone, ", + "`status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_agent", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_no", property="agentNo", jdbcType=JdbcType.VARCHAR), + @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_telephone", property="contactsTelephone", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsAgent selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsAgentSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsAgent record, @Param("example") BsAgentExample example); + + @UpdateProvider(type=BsAgentSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsAgent record, @Param("example") BsAgentExample example); + + @UpdateProvider(type=BsAgentSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsAgent record); + + @Update({ + "update bs_agent", + "set company_id = #{companyId,jdbcType=BIGINT},", + "company_name = #{companyName,jdbcType=VARCHAR},", + "agent_no = #{agentNo,jdbcType=VARCHAR},", + "`name` = #{name,jdbcType=VARCHAR},", + "contacts_name = #{contactsName,jdbcType=VARCHAR},", + "contacts_telephone = #{contactsTelephone,jdbcType=VARCHAR},", + "`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(BsAgent record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsAgentMapperExt.java b/service/src/main/java/com/hfkj/dao/BsAgentMapperExt.java new file mode 100644 index 0000000..602ab12 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsAgentMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsAgentMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsAgentSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsAgentSqlProvider.java new file mode 100644 index 0000000..3e7f486 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsAgentSqlProvider.java @@ -0,0 +1,346 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsAgent; +import com.hfkj.entity.BsAgentExample.Criteria; +import com.hfkj.entity.BsAgentExample.Criterion; +import com.hfkj.entity.BsAgentExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsAgentSqlProvider { + + public String countByExample(BsAgentExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_agent"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsAgentExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_agent"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsAgent record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_agent"); + + if (record.getCompanyId() != null) { + sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentNo() != null) { + sql.VALUES("agent_no", "#{agentNo,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.VALUES("`name`", "#{name,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.VALUES("contacts_name", "#{contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTelephone() != null) { + sql.VALUES("contacts_telephone", "#{contactsTelephone,jdbcType=VARCHAR}"); + } + + 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(BsAgentExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("company_id"); + sql.SELECT("company_name"); + sql.SELECT("agent_no"); + sql.SELECT("`name`"); + sql.SELECT("contacts_name"); + sql.SELECT("contacts_telephone"); + 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_agent"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsAgent record = (BsAgent) parameter.get("record"); + BsAgentExample example = (BsAgentExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_agent"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentNo() != null) { + sql.SET("agent_no = #{record.agentNo,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTelephone() != null) { + sql.SET("contacts_telephone = #{record.contactsTelephone,jdbcType=VARCHAR}"); + } + + 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_agent"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + sql.SET("agent_no = #{record.agentNo,jdbcType=VARCHAR}"); + sql.SET("`name` = #{record.name,jdbcType=VARCHAR}"); + sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); + sql.SET("contacts_telephone = #{record.contactsTelephone,jdbcType=VARCHAR}"); + 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}"); + + BsAgentExample example = (BsAgentExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsAgent record) { + SQL sql = new SQL(); + sql.UPDATE("bs_agent"); + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentNo() != null) { + sql.SET("agent_no = #{agentNo,jdbcType=VARCHAR}"); + } + + if (record.getName() != null) { + sql.SET("`name` = #{name,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.SET("contacts_name = #{contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTelephone() != null) { + sql.SET("contacts_telephone = #{contactsTelephone,jdbcType=VARCHAR}"); + } + + 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, BsAgentExample 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/BsDeviceMapper.java b/service/src/main/java/com/hfkj/dao/BsDeviceMapper.java new file mode 100644 index 0000000..4158fe6 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDeviceMapper.java @@ -0,0 +1,172 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDevice; +import com.hfkj.entity.BsDeviceExample; +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 BsDeviceMapper extends BsDeviceMapperExt { + @SelectProvider(type=BsDeviceSqlProvider.class, method="countByExample") + long countByExample(BsDeviceExample example); + + @DeleteProvider(type=BsDeviceSqlProvider.class, method="deleteByExample") + int deleteByExample(BsDeviceExample example); + + @Delete({ + "delete from bs_device", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_device (`type`, company_id, ", + "company_name, agent_id, ", + "agent_name, mer_id, ", + "mer_no, mer_name, ", + "device_name, device_sn, ", + "device_key, device_imei, ", + "device_iccid, receipt_top, ", + "receipt_source, receipt_bottom, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{type,jdbcType=INTEGER}, #{companyId,jdbcType=BIGINT}, ", + "#{companyName,jdbcType=VARCHAR}, #{agentId,jdbcType=BIGINT}, ", + "#{agentName,jdbcType=VARCHAR}, #{merId,jdbcType=BIGINT}, ", + "#{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", + "#{deviceName,jdbcType=VARCHAR}, #{deviceSn,jdbcType=VARCHAR}, ", + "#{deviceKey,jdbcType=VARCHAR}, #{deviceImei,jdbcType=VARCHAR}, ", + "#{deviceIccid,jdbcType=VARCHAR}, #{receiptTop,jdbcType=VARCHAR}, ", + "#{receiptSource,jdbcType=VARCHAR}, #{receiptBottom,jdbcType=VARCHAR}, ", + "#{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(BsDevice record); + + @InsertProvider(type=BsDeviceSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsDevice record); + + @SelectProvider(type=BsDeviceSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), + @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), + @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), + @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR), + @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(BsDeviceExample example); + + @Select({ + "select", + "id, `type`, company_id, company_name, agent_id, agent_name, mer_id, mer_no, ", + "mer_name, device_name, device_sn, device_key, device_imei, device_iccid, receipt_top, ", + "receipt_source, receipt_bottom, `status`, create_time, update_time, ext_1, ext_2, ", + "ext_3", + "from bs_device", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="type", property="type", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="company_name", property="companyName", jdbcType=JdbcType.VARCHAR), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_name", property="agentName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_name", property="deviceName", jdbcType=JdbcType.VARCHAR), + @Result(column="device_sn", property="deviceSn", jdbcType=JdbcType.VARCHAR), + @Result(column="device_key", property="deviceKey", jdbcType=JdbcType.VARCHAR), + @Result(column="device_imei", property="deviceImei", jdbcType=JdbcType.VARCHAR), + @Result(column="device_iccid", property="deviceIccid", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_top", property="receiptTop", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_source", property="receiptSource", jdbcType=JdbcType.VARCHAR), + @Result(column="receipt_bottom", property="receiptBottom", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsDevice selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsDeviceSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsDevice record, @Param("example") BsDeviceExample example); + + @UpdateProvider(type=BsDeviceSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsDevice record, @Param("example") BsDeviceExample example); + + @UpdateProvider(type=BsDeviceSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsDevice record); + + @Update({ + "update bs_device", + "set `type` = #{type,jdbcType=INTEGER},", + "company_id = #{companyId,jdbcType=BIGINT},", + "company_name = #{companyName,jdbcType=VARCHAR},", + "agent_id = #{agentId,jdbcType=BIGINT},", + "agent_name = #{agentName,jdbcType=VARCHAR},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "device_name = #{deviceName,jdbcType=VARCHAR},", + "device_sn = #{deviceSn,jdbcType=VARCHAR},", + "device_key = #{deviceKey,jdbcType=VARCHAR},", + "device_imei = #{deviceImei,jdbcType=VARCHAR},", + "device_iccid = #{deviceIccid,jdbcType=VARCHAR},", + "receipt_top = #{receiptTop,jdbcType=VARCHAR},", + "receipt_source = #{receiptSource,jdbcType=VARCHAR},", + "receipt_bottom = #{receiptBottom,jdbcType=VARCHAR},", + "`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(BsDevice record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDeviceMapperExt.java b/service/src/main/java/com/hfkj/dao/BsDeviceMapperExt.java new file mode 100644 index 0000000..5b80dd8 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDeviceMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsDeviceMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDeviceSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsDeviceSqlProvider.java new file mode 100644 index 0000000..6737cff --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDeviceSqlProvider.java @@ -0,0 +1,486 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDevice; +import com.hfkj.entity.BsDeviceExample.Criteria; +import com.hfkj.entity.BsDeviceExample.Criterion; +import com.hfkj.entity.BsDeviceExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsDeviceSqlProvider { + + public String countByExample(BsDeviceExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_device"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsDeviceExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_device"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsDevice record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_device"); + + if (record.getType() != null) { + sql.VALUES("`type`", "#{type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.VALUES("company_id", "#{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.VALUES("company_name", "#{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.VALUES("agent_id", "#{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.VALUES("agent_name", "#{agentName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.VALUES("device_name", "#{deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.VALUES("device_sn", "#{deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.VALUES("device_key", "#{deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.VALUES("device_imei", "#{deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.VALUES("device_iccid", "#{deviceIccid,jdbcType=VARCHAR}"); + } + + if (record.getReceiptTop() != null) { + sql.VALUES("receipt_top", "#{receiptTop,jdbcType=VARCHAR}"); + } + + if (record.getReceiptSource() != null) { + sql.VALUES("receipt_source", "#{receiptSource,jdbcType=VARCHAR}"); + } + + if (record.getReceiptBottom() != null) { + sql.VALUES("receipt_bottom", "#{receiptBottom,jdbcType=VARCHAR}"); + } + + 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(BsDeviceExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("`type`"); + sql.SELECT("company_id"); + sql.SELECT("company_name"); + sql.SELECT("agent_id"); + sql.SELECT("agent_name"); + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("device_name"); + sql.SELECT("device_sn"); + sql.SELECT("device_key"); + sql.SELECT("device_imei"); + sql.SELECT("device_iccid"); + sql.SELECT("receipt_top"); + sql.SELECT("receipt_source"); + sql.SELECT("receipt_bottom"); + 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_device"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsDevice record = (BsDevice) parameter.get("record"); + BsDeviceExample example = (BsDeviceExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_device"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getType() != null) { + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}"); + } + + if (record.getReceiptTop() != null) { + sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}"); + } + + if (record.getReceiptSource() != null) { + sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}"); + } + + if (record.getReceiptBottom() != null) { + sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}"); + } + + 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_device"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("`type` = #{record.type,jdbcType=INTEGER}"); + sql.SET("company_id = #{record.companyId,jdbcType=BIGINT}"); + sql.SET("company_name = #{record.companyName,jdbcType=VARCHAR}"); + sql.SET("agent_id = #{record.agentId,jdbcType=BIGINT}"); + sql.SET("agent_name = #{record.agentName,jdbcType=VARCHAR}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("device_name = #{record.deviceName,jdbcType=VARCHAR}"); + sql.SET("device_sn = #{record.deviceSn,jdbcType=VARCHAR}"); + sql.SET("device_key = #{record.deviceKey,jdbcType=VARCHAR}"); + sql.SET("device_imei = #{record.deviceImei,jdbcType=VARCHAR}"); + sql.SET("device_iccid = #{record.deviceIccid,jdbcType=VARCHAR}"); + sql.SET("receipt_top = #{record.receiptTop,jdbcType=VARCHAR}"); + sql.SET("receipt_source = #{record.receiptSource,jdbcType=VARCHAR}"); + sql.SET("receipt_bottom = #{record.receiptBottom,jdbcType=VARCHAR}"); + 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}"); + + BsDeviceExample example = (BsDeviceExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsDevice record) { + SQL sql = new SQL(); + sql.UPDATE("bs_device"); + + if (record.getType() != null) { + sql.SET("`type` = #{type,jdbcType=INTEGER}"); + } + + if (record.getCompanyId() != null) { + sql.SET("company_id = #{companyId,jdbcType=BIGINT}"); + } + + if (record.getCompanyName() != null) { + sql.SET("company_name = #{companyName,jdbcType=VARCHAR}"); + } + + if (record.getAgentId() != null) { + sql.SET("agent_id = #{agentId,jdbcType=BIGINT}"); + } + + if (record.getAgentName() != null) { + sql.SET("agent_name = #{agentName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceName() != null) { + sql.SET("device_name = #{deviceName,jdbcType=VARCHAR}"); + } + + if (record.getDeviceSn() != null) { + sql.SET("device_sn = #{deviceSn,jdbcType=VARCHAR}"); + } + + if (record.getDeviceKey() != null) { + sql.SET("device_key = #{deviceKey,jdbcType=VARCHAR}"); + } + + if (record.getDeviceImei() != null) { + sql.SET("device_imei = #{deviceImei,jdbcType=VARCHAR}"); + } + + if (record.getDeviceIccid() != null) { + sql.SET("device_iccid = #{deviceIccid,jdbcType=VARCHAR}"); + } + + if (record.getReceiptTop() != null) { + sql.SET("receipt_top = #{receiptTop,jdbcType=VARCHAR}"); + } + + if (record.getReceiptSource() != null) { + sql.SET("receipt_source = #{receiptSource,jdbcType=VARCHAR}"); + } + + if (record.getReceiptBottom() != null) { + sql.SET("receipt_bottom = #{receiptBottom,jdbcType=VARCHAR}"); + } + + 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, BsDeviceExample 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/BsDiscountMapper.java b/service/src/main/java/com/hfkj/dao/BsDiscountMapper.java new file mode 100644 index 0000000..292021b --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountMapper.java @@ -0,0 +1,158 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsDiscountExample; +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 BsDiscountMapper extends BsDiscountMapperExt { + @SelectProvider(type=BsDiscountSqlProvider.class, method="countByExample") + long countByExample(BsDiscountExample example); + + @DeleteProvider(type=BsDiscountSqlProvider.class, method="deleteByExample") + int deleteByExample(BsDiscountExample example); + + @Delete({ + "delete from bs_discount", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_discount (mer_id, mer_no, ", + "mer_name, discount_no, ", + "discount_name, discount_type, ", + "discount_condition, discount_price, ", + "use_scope, start_time, ", + "end_time, reality_start_time, ", + "reality_end_time, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{merName,jdbcType=VARCHAR}, #{discountNo,jdbcType=VARCHAR}, ", + "#{discountName,jdbcType=VARCHAR}, #{discountType,jdbcType=INTEGER}, ", + "#{discountCondition,jdbcType=DECIMAL}, #{discountPrice,jdbcType=DECIMAL}, ", + "#{useScope,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, ", + "#{endTime,jdbcType=TIMESTAMP}, #{realityStartTime,jdbcType=TIMESTAMP}, ", + "#{realityEndTime,jdbcType=TIMESTAMP}, #{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(BsDiscount record); + + @InsertProvider(type=BsDiscountSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsDiscount record); + + @SelectProvider(type=BsDiscountSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), + @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_start_time", property="realityStartTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), + @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(BsDiscountExample example); + + @Select({ + "select", + "id, mer_id, mer_no, mer_name, discount_no, discount_name, discount_type, discount_condition, ", + "discount_price, use_scope, start_time, end_time, reality_start_time, reality_end_time, ", + "`status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_discount", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_type", property="discountType", jdbcType=JdbcType.INTEGER), + @Result(column="discount_condition", property="discountCondition", jdbcType=JdbcType.DECIMAL), + @Result(column="discount_price", property="discountPrice", jdbcType=JdbcType.DECIMAL), + @Result(column="use_scope", property="useScope", jdbcType=JdbcType.VARCHAR), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_start_time", property="realityStartTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="reality_end_time", property="realityEndTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + BsDiscount selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsDiscountSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsDiscount record, @Param("example") BsDiscountExample example); + + @UpdateProvider(type=BsDiscountSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsDiscount record, @Param("example") BsDiscountExample example); + + @UpdateProvider(type=BsDiscountSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsDiscount record); + + @Update({ + "update bs_discount", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "discount_no = #{discountNo,jdbcType=VARCHAR},", + "discount_name = #{discountName,jdbcType=VARCHAR},", + "discount_type = #{discountType,jdbcType=INTEGER},", + "discount_condition = #{discountCondition,jdbcType=DECIMAL},", + "discount_price = #{discountPrice,jdbcType=DECIMAL},", + "use_scope = #{useScope,jdbcType=VARCHAR},", + "start_time = #{startTime,jdbcType=TIMESTAMP},", + "end_time = #{endTime,jdbcType=TIMESTAMP},", + "reality_start_time = #{realityStartTime,jdbcType=TIMESTAMP},", + "reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP},", + "`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(BsDiscount record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountMapperExt.java b/service/src/main/java/com/hfkj/dao/BsDiscountMapperExt.java new file mode 100644 index 0000000..13f8282 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsDiscountMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsDiscountSqlProvider.java new file mode 100644 index 0000000..ce0ba18 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountSqlProvider.java @@ -0,0 +1,444 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsDiscountExample.Criteria; +import com.hfkj.entity.BsDiscountExample.Criterion; +import com.hfkj.entity.BsDiscountExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsDiscountSqlProvider { + + public String countByExample(BsDiscountExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_discount"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsDiscountExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_discount"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsDiscount record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_discount"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountNo() != null) { + sql.VALUES("discount_no", "#{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountType() != null) { + sql.VALUES("discount_type", "#{discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.VALUES("discount_condition", "#{discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.VALUES("discount_price", "#{discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUseScope() != null) { + sql.VALUES("use_scope", "#{useScope,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.VALUES("end_time", "#{endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityStartTime() != null) { + sql.VALUES("reality_start_time", "#{realityStartTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityEndTime() != null) { + sql.VALUES("reality_end_time", "#{realityEndTime,jdbcType=TIMESTAMP}"); + } + + 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(BsDiscountExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("discount_no"); + sql.SELECT("discount_name"); + sql.SELECT("discount_type"); + sql.SELECT("discount_condition"); + sql.SELECT("discount_price"); + sql.SELECT("use_scope"); + sql.SELECT("start_time"); + sql.SELECT("end_time"); + sql.SELECT("reality_start_time"); + sql.SELECT("reality_end_time"); + 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_discount"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsDiscount record = (BsDiscount) parameter.get("record"); + BsDiscountExample example = (BsDiscountExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_discount"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountType() != null) { + sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUseScope() != null) { + sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityStartTime() != null) { + sql.SET("reality_start_time = #{record.realityStartTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityEndTime() != null) { + sql.SET("reality_end_time = #{record.realityEndTime,jdbcType=TIMESTAMP}"); + } + + 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_discount"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + sql.SET("discount_type = #{record.discountType,jdbcType=INTEGER}"); + sql.SET("discount_condition = #{record.discountCondition,jdbcType=DECIMAL}"); + sql.SET("discount_price = #{record.discountPrice,jdbcType=DECIMAL}"); + sql.SET("use_scope = #{record.useScope,jdbcType=VARCHAR}"); + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + sql.SET("end_time = #{record.endTime,jdbcType=TIMESTAMP}"); + sql.SET("reality_start_time = #{record.realityStartTime,jdbcType=TIMESTAMP}"); + sql.SET("reality_end_time = #{record.realityEndTime,jdbcType=TIMESTAMP}"); + 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}"); + + BsDiscountExample example = (BsDiscountExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsDiscount record) { + SQL sql = new SQL(); + sql.UPDATE("bs_discount"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); + } + + if (record.getDiscountType() != null) { + sql.SET("discount_type = #{discountType,jdbcType=INTEGER}"); + } + + if (record.getDiscountCondition() != null) { + sql.SET("discount_condition = #{discountCondition,jdbcType=DECIMAL}"); + } + + if (record.getDiscountPrice() != null) { + sql.SET("discount_price = #{discountPrice,jdbcType=DECIMAL}"); + } + + if (record.getUseScope() != null) { + sql.SET("use_scope = #{useScope,jdbcType=VARCHAR}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); + } + + if (record.getEndTime() != null) { + sql.SET("end_time = #{endTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityStartTime() != null) { + sql.SET("reality_start_time = #{realityStartTime,jdbcType=TIMESTAMP}"); + } + + if (record.getRealityEndTime() != null) { + sql.SET("reality_end_time = #{realityEndTime,jdbcType=TIMESTAMP}"); + } + + 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, BsDiscountExample 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/BsDiscountStockBatchMapper.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchMapper.java new file mode 100644 index 0000000..ecc0e32 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchMapper.java @@ -0,0 +1,133 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscountStockBatch; +import com.hfkj.entity.BsDiscountStockBatchExample; +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 BsDiscountStockBatchMapper extends BsDiscountStockBatchMapperExt { + @SelectProvider(type=BsDiscountStockBatchSqlProvider.class, method="countByExample") + long countByExample(BsDiscountStockBatchExample example); + + @DeleteProvider(type=BsDiscountStockBatchSqlProvider.class, method="deleteByExample") + int deleteByExample(BsDiscountStockBatchExample example); + + @Delete({ + "delete from bs_discount_stock_batch", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_discount_stock_batch (discount_id, discount_no, ", + "discount_name, batch_no, ", + "batch_stock_num, start_id, ", + "end_id, `status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ", + "#{discountName,jdbcType=VARCHAR}, #{batchNo,jdbcType=VARCHAR}, ", + "#{batchStockNum,jdbcType=INTEGER}, #{startId,jdbcType=VARCHAR}, ", + "#{endId,jdbcType=VARCHAR}, #{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(BsDiscountStockBatch record); + + @InsertProvider(type=BsDiscountStockBatchSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsDiscountStockBatch record); + + @SelectProvider(type=BsDiscountStockBatchSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_stock_num", property="batchStockNum", jdbcType=JdbcType.INTEGER), + @Result(column="start_id", property="startId", jdbcType=JdbcType.VARCHAR), + @Result(column="end_id", property="endId", jdbcType=JdbcType.VARCHAR), + @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(BsDiscountStockBatchExample example); + + @Select({ + "select", + "id, discount_id, discount_no, discount_name, batch_no, batch_stock_num, start_id, ", + "end_id, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_discount_stock_batch", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_no", property="batchNo", jdbcType=JdbcType.VARCHAR), + @Result(column="batch_stock_num", property="batchStockNum", jdbcType=JdbcType.INTEGER), + @Result(column="start_id", property="startId", jdbcType=JdbcType.VARCHAR), + @Result(column="end_id", property="endId", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsDiscountStockBatch selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsDiscountStockBatchSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsDiscountStockBatch record, @Param("example") BsDiscountStockBatchExample example); + + @UpdateProvider(type=BsDiscountStockBatchSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsDiscountStockBatch record, @Param("example") BsDiscountStockBatchExample example); + + @UpdateProvider(type=BsDiscountStockBatchSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsDiscountStockBatch record); + + @Update({ + "update bs_discount_stock_batch", + "set discount_id = #{discountId,jdbcType=BIGINT},", + "discount_no = #{discountNo,jdbcType=VARCHAR},", + "discount_name = #{discountName,jdbcType=VARCHAR},", + "batch_no = #{batchNo,jdbcType=VARCHAR},", + "batch_stock_num = #{batchStockNum,jdbcType=INTEGER},", + "start_id = #{startId,jdbcType=VARCHAR},", + "end_id = #{endId,jdbcType=VARCHAR},", + "`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(BsDiscountStockBatch record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchMapperExt.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchMapperExt.java new file mode 100644 index 0000000..41e440f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsDiscountStockBatchMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchSqlProvider.java new file mode 100644 index 0000000..568bd67 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockBatchSqlProvider.java @@ -0,0 +1,360 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscountStockBatch; +import com.hfkj.entity.BsDiscountStockBatchExample.Criteria; +import com.hfkj.entity.BsDiscountStockBatchExample.Criterion; +import com.hfkj.entity.BsDiscountStockBatchExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsDiscountStockBatchSqlProvider { + + public String countByExample(BsDiscountStockBatchExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_discount_stock_batch"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsDiscountStockBatchExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_discount_stock_batch"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsDiscountStockBatch record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_discount_stock_batch"); + + if (record.getDiscountId() != null) { + sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.VALUES("discount_no", "#{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); + } + + if (record.getBatchNo() != null) { + sql.VALUES("batch_no", "#{batchNo,jdbcType=VARCHAR}"); + } + + if (record.getBatchStockNum() != null) { + sql.VALUES("batch_stock_num", "#{batchStockNum,jdbcType=INTEGER}"); + } + + if (record.getStartId() != null) { + sql.VALUES("start_id", "#{startId,jdbcType=VARCHAR}"); + } + + if (record.getEndId() != null) { + sql.VALUES("end_id", "#{endId,jdbcType=VARCHAR}"); + } + + 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(BsDiscountStockBatchExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("discount_id"); + sql.SELECT("discount_no"); + sql.SELECT("discount_name"); + sql.SELECT("batch_no"); + sql.SELECT("batch_stock_num"); + sql.SELECT("start_id"); + sql.SELECT("end_id"); + 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_discount_stock_batch"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsDiscountStockBatch record = (BsDiscountStockBatch) parameter.get("record"); + BsDiscountStockBatchExample example = (BsDiscountStockBatchExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_discount_stock_batch"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + } + + if (record.getBatchNo() != null) { + sql.SET("batch_no = #{record.batchNo,jdbcType=VARCHAR}"); + } + + if (record.getBatchStockNum() != null) { + sql.SET("batch_stock_num = #{record.batchStockNum,jdbcType=INTEGER}"); + } + + if (record.getStartId() != null) { + sql.SET("start_id = #{record.startId,jdbcType=VARCHAR}"); + } + + if (record.getEndId() != null) { + sql.SET("end_id = #{record.endId,jdbcType=VARCHAR}"); + } + + 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_discount_stock_batch"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + sql.SET("batch_no = #{record.batchNo,jdbcType=VARCHAR}"); + sql.SET("batch_stock_num = #{record.batchStockNum,jdbcType=INTEGER}"); + sql.SET("start_id = #{record.startId,jdbcType=VARCHAR}"); + sql.SET("end_id = #{record.endId,jdbcType=VARCHAR}"); + 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}"); + + BsDiscountStockBatchExample example = (BsDiscountStockBatchExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsDiscountStockBatch record) { + SQL sql = new SQL(); + sql.UPDATE("bs_discount_stock_batch"); + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); + } + + if (record.getBatchNo() != null) { + sql.SET("batch_no = #{batchNo,jdbcType=VARCHAR}"); + } + + if (record.getBatchStockNum() != null) { + sql.SET("batch_stock_num = #{batchStockNum,jdbcType=INTEGER}"); + } + + if (record.getStartId() != null) { + sql.SET("start_id = #{startId,jdbcType=VARCHAR}"); + } + + if (record.getEndId() != null) { + sql.SET("end_id = #{endId,jdbcType=VARCHAR}"); + } + + 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, BsDiscountStockBatchExample 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/BsDiscountStockCodeMapper.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapper.java new file mode 100644 index 0000000..dd33ff3 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapper.java @@ -0,0 +1,147 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscountStockCode; +import com.hfkj.entity.BsDiscountStockCodeExample; +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 BsDiscountStockCodeMapper extends BsDiscountStockCodeMapperExt { + @SelectProvider(type=BsDiscountStockCodeSqlProvider.class, method="countByExample") + long countByExample(BsDiscountStockCodeExample example); + + @DeleteProvider(type=BsDiscountStockCodeSqlProvider.class, method="deleteByExample") + int deleteByExample(BsDiscountStockCodeExample example); + + @Delete({ + "delete from bs_discount_stock_code", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_discount_stock_code (discount_stock_batch_id, discount_stock_batch_no, ", + "discount_id, discount_no, ", + "discount_name, obtain_type, ", + "obtain_time, receive_mer_user_id, ", + "receive_mer_user_phone, use_time, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{discountStockBatchId,jdbcType=BIGINT}, #{discountStockBatchNo,jdbcType=VARCHAR}, ", + "#{discountId,jdbcType=BIGINT}, #{discountNo,jdbcType=VARCHAR}, ", + "#{discountName,jdbcType=VARCHAR}, #{obtainType,jdbcType=INTEGER}, ", + "#{obtainTime,jdbcType=TIMESTAMP}, #{receiveMerUserId,jdbcType=BIGINT}, ", + "#{receiveMerUserPhone,jdbcType=VARCHAR}, #{useTime,jdbcType=TIMESTAMP}, ", + "#{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(BsDiscountStockCode record); + + @InsertProvider(type=BsDiscountStockCodeSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsDiscountStockCode record); + + @SelectProvider(type=BsDiscountStockCodeSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_stock_batch_id", property="discountStockBatchId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_stock_batch_no", property="discountStockBatchNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="obtain_type", property="obtainType", jdbcType=JdbcType.INTEGER), + @Result(column="obtain_time", property="obtainTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="receive_mer_user_id", property="receiveMerUserId", jdbcType=JdbcType.BIGINT), + @Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP), + @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(BsDiscountStockCodeExample example); + + @Select({ + "select", + "id, discount_stock_batch_id, discount_stock_batch_no, discount_id, discount_no, ", + "discount_name, obtain_type, obtain_time, receive_mer_user_id, receive_mer_user_phone, ", + "use_time, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_discount_stock_code", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="discount_stock_batch_id", property="discountStockBatchId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_stock_batch_no", property="discountStockBatchNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_id", property="discountId", jdbcType=JdbcType.BIGINT), + @Result(column="discount_no", property="discountNo", jdbcType=JdbcType.VARCHAR), + @Result(column="discount_name", property="discountName", jdbcType=JdbcType.VARCHAR), + @Result(column="obtain_type", property="obtainType", jdbcType=JdbcType.INTEGER), + @Result(column="obtain_time", property="obtainTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="receive_mer_user_id", property="receiveMerUserId", jdbcType=JdbcType.BIGINT), + @Result(column="receive_mer_user_phone", property="receiveMerUserPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="use_time", property="useTime", jdbcType=JdbcType.TIMESTAMP), + @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) + }) + BsDiscountStockCode selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsDiscountStockCodeSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsDiscountStockCode record, @Param("example") BsDiscountStockCodeExample example); + + @UpdateProvider(type=BsDiscountStockCodeSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsDiscountStockCode record, @Param("example") BsDiscountStockCodeExample example); + + @UpdateProvider(type=BsDiscountStockCodeSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsDiscountStockCode record); + + @Update({ + "update bs_discount_stock_code", + "set discount_stock_batch_id = #{discountStockBatchId,jdbcType=BIGINT},", + "discount_stock_batch_no = #{discountStockBatchNo,jdbcType=VARCHAR},", + "discount_id = #{discountId,jdbcType=BIGINT},", + "discount_no = #{discountNo,jdbcType=VARCHAR},", + "discount_name = #{discountName,jdbcType=VARCHAR},", + "obtain_type = #{obtainType,jdbcType=INTEGER},", + "obtain_time = #{obtainTime,jdbcType=TIMESTAMP},", + "receive_mer_user_id = #{receiveMerUserId,jdbcType=BIGINT},", + "receive_mer_user_phone = #{receiveMerUserPhone,jdbcType=VARCHAR},", + "use_time = #{useTime,jdbcType=TIMESTAMP},", + "`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(BsDiscountStockCode record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapperExt.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapperExt.java new file mode 100644 index 0000000..3f631ff --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeMapperExt.java @@ -0,0 +1,36 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscountStockCode; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.Options; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * mapper扩展类 + */ +public interface BsDiscountStockCodeMapperExt { + + @Insert({""}) + @Options(useGeneratedKeys=true, keyProperty="id") + int insertList(@Param("list") List codeList); + +} diff --git a/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeSqlProvider.java new file mode 100644 index 0000000..02735b0 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsDiscountStockCodeSqlProvider.java @@ -0,0 +1,402 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsDiscountStockCode; +import com.hfkj.entity.BsDiscountStockCodeExample.Criteria; +import com.hfkj.entity.BsDiscountStockCodeExample.Criterion; +import com.hfkj.entity.BsDiscountStockCodeExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsDiscountStockCodeSqlProvider { + + public String countByExample(BsDiscountStockCodeExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_discount_stock_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsDiscountStockCodeExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_discount_stock_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsDiscountStockCode record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_discount_stock_code"); + + if (record.getDiscountStockBatchId() != null) { + sql.VALUES("discount_stock_batch_id", "#{discountStockBatchId,jdbcType=BIGINT}"); + } + + if (record.getDiscountStockBatchNo() != null) { + sql.VALUES("discount_stock_batch_no", "#{discountStockBatchNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountId() != null) { + sql.VALUES("discount_id", "#{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.VALUES("discount_no", "#{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.VALUES("discount_name", "#{discountName,jdbcType=VARCHAR}"); + } + + if (record.getObtainType() != null) { + sql.VALUES("obtain_type", "#{obtainType,jdbcType=INTEGER}"); + } + + if (record.getObtainTime() != null) { + sql.VALUES("obtain_time", "#{obtainTime,jdbcType=TIMESTAMP}"); + } + + if (record.getReceiveMerUserId() != null) { + sql.VALUES("receive_mer_user_id", "#{receiveMerUserId,jdbcType=BIGINT}"); + } + + if (record.getReceiveMerUserPhone() != null) { + sql.VALUES("receive_mer_user_phone", "#{receiveMerUserPhone,jdbcType=VARCHAR}"); + } + + if (record.getUseTime() != null) { + sql.VALUES("use_time", "#{useTime,jdbcType=TIMESTAMP}"); + } + + 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(BsDiscountStockCodeExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("discount_stock_batch_id"); + sql.SELECT("discount_stock_batch_no"); + sql.SELECT("discount_id"); + sql.SELECT("discount_no"); + sql.SELECT("discount_name"); + sql.SELECT("obtain_type"); + sql.SELECT("obtain_time"); + sql.SELECT("receive_mer_user_id"); + sql.SELECT("receive_mer_user_phone"); + sql.SELECT("use_time"); + 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_discount_stock_code"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsDiscountStockCode record = (BsDiscountStockCode) parameter.get("record"); + BsDiscountStockCodeExample example = (BsDiscountStockCodeExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_discount_stock_code"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getDiscountStockBatchId() != null) { + sql.SET("discount_stock_batch_id = #{record.discountStockBatchId,jdbcType=BIGINT}"); + } + + if (record.getDiscountStockBatchNo() != null) { + sql.SET("discount_stock_batch_no = #{record.discountStockBatchNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + } + + if (record.getObtainType() != null) { + sql.SET("obtain_type = #{record.obtainType,jdbcType=INTEGER}"); + } + + if (record.getObtainTime() != null) { + sql.SET("obtain_time = #{record.obtainTime,jdbcType=TIMESTAMP}"); + } + + if (record.getReceiveMerUserId() != null) { + sql.SET("receive_mer_user_id = #{record.receiveMerUserId,jdbcType=BIGINT}"); + } + + if (record.getReceiveMerUserPhone() != null) { + sql.SET("receive_mer_user_phone = #{record.receiveMerUserPhone,jdbcType=VARCHAR}"); + } + + if (record.getUseTime() != null) { + sql.SET("use_time = #{record.useTime,jdbcType=TIMESTAMP}"); + } + + 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_discount_stock_code"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("discount_stock_batch_id = #{record.discountStockBatchId,jdbcType=BIGINT}"); + sql.SET("discount_stock_batch_no = #{record.discountStockBatchNo,jdbcType=VARCHAR}"); + sql.SET("discount_id = #{record.discountId,jdbcType=BIGINT}"); + sql.SET("discount_no = #{record.discountNo,jdbcType=VARCHAR}"); + sql.SET("discount_name = #{record.discountName,jdbcType=VARCHAR}"); + sql.SET("obtain_type = #{record.obtainType,jdbcType=INTEGER}"); + sql.SET("obtain_time = #{record.obtainTime,jdbcType=TIMESTAMP}"); + sql.SET("receive_mer_user_id = #{record.receiveMerUserId,jdbcType=BIGINT}"); + sql.SET("receive_mer_user_phone = #{record.receiveMerUserPhone,jdbcType=VARCHAR}"); + sql.SET("use_time = #{record.useTime,jdbcType=TIMESTAMP}"); + 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}"); + + BsDiscountStockCodeExample example = (BsDiscountStockCodeExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsDiscountStockCode record) { + SQL sql = new SQL(); + sql.UPDATE("bs_discount_stock_code"); + + if (record.getDiscountStockBatchId() != null) { + sql.SET("discount_stock_batch_id = #{discountStockBatchId,jdbcType=BIGINT}"); + } + + if (record.getDiscountStockBatchNo() != null) { + sql.SET("discount_stock_batch_no = #{discountStockBatchNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountId() != null) { + sql.SET("discount_id = #{discountId,jdbcType=BIGINT}"); + } + + if (record.getDiscountNo() != null) { + sql.SET("discount_no = #{discountNo,jdbcType=VARCHAR}"); + } + + if (record.getDiscountName() != null) { + sql.SET("discount_name = #{discountName,jdbcType=VARCHAR}"); + } + + if (record.getObtainType() != null) { + sql.SET("obtain_type = #{obtainType,jdbcType=INTEGER}"); + } + + if (record.getObtainTime() != null) { + sql.SET("obtain_time = #{obtainTime,jdbcType=TIMESTAMP}"); + } + + if (record.getReceiveMerUserId() != null) { + sql.SET("receive_mer_user_id = #{receiveMerUserId,jdbcType=BIGINT}"); + } + + if (record.getReceiveMerUserPhone() != null) { + sql.SET("receive_mer_user_phone = #{receiveMerUserPhone,jdbcType=VARCHAR}"); + } + + if (record.getUseTime() != null) { + sql.SET("use_time = #{useTime,jdbcType=TIMESTAMP}"); + } + + 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, BsDiscountStockCodeExample 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/BsGasOilGunNoMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapper.java new file mode 100644 index 0000000..f8cf57d --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapper.java @@ -0,0 +1,133 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilGunNoExample; +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 BsGasOilGunNoMapper extends BsGasOilGunNoMapperExt { + @SelectProvider(type=BsGasOilGunNoSqlProvider.class, method="countByExample") + long countByExample(BsGasOilGunNoExample example); + + @DeleteProvider(type=BsGasOilGunNoSqlProvider.class, method="deleteByExample") + int deleteByExample(BsGasOilGunNoExample example); + + @Delete({ + "delete from bs_gas_oil_gun_no", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_gas_oil_gun_no (gas_oil_price_id, mer_id, ", + "mer_no, oil_type, ", + "oil_type_name, oil_no, ", + "oil_no_name, gun_no, ", + "`status`, create_time, ", + "ext_1, ext_2, ext_3)", + "values (#{gasOilPriceId,jdbcType=BIGINT}, #{merId,jdbcType=BIGINT}, ", + "#{merNo,jdbcType=VARCHAR}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ", + "#{oilNoName,jdbcType=VARCHAR}, #{gunNo,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsGasOilGunNo record); + + @InsertProvider(type=BsGasOilGunNoSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsGasOilGunNo record); + + @SelectProvider(type=BsGasOilGunNoSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_oil_price_id", property="gasOilPriceId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="gun_no", property="gunNo", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(BsGasOilGunNoExample example); + + @Select({ + "select", + "id, gas_oil_price_id, mer_id, mer_no, oil_type, oil_type_name, oil_no, oil_no_name, ", + "gun_no, `status`, create_time, ext_1, ext_2, ext_3", + "from bs_gas_oil_gun_no", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="gas_oil_price_id", property="gasOilPriceId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="gun_no", property="gunNo", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + BsGasOilGunNo selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsGasOilGunNoSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsGasOilGunNo record, @Param("example") BsGasOilGunNoExample example); + + @UpdateProvider(type=BsGasOilGunNoSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsGasOilGunNo record, @Param("example") BsGasOilGunNoExample example); + + @UpdateProvider(type=BsGasOilGunNoSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsGasOilGunNo record); + + @Update({ + "update bs_gas_oil_gun_no", + "set gas_oil_price_id = #{gasOilPriceId,jdbcType=BIGINT},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "oil_no = #{oilNo,jdbcType=VARCHAR},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "gun_no = #{gunNo,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "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(BsGasOilGunNo record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java new file mode 100644 index 0000000..ec54f96 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsGasOilGunNoMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilGunNoSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoSqlProvider.java new file mode 100644 index 0000000..4145565 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilGunNoSqlProvider.java @@ -0,0 +1,360 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilGunNoExample.Criteria; +import com.hfkj.entity.BsGasOilGunNoExample.Criterion; +import com.hfkj.entity.BsGasOilGunNoExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsGasOilGunNoSqlProvider { + + public String countByExample(BsGasOilGunNoExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_gas_oil_gun_no"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsGasOilGunNoExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_gas_oil_gun_no"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsGasOilGunNo record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_gas_oil_gun_no"); + + if (record.getGasOilPriceId() != null) { + sql.VALUES("gas_oil_price_id", "#{gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.VALUES("gun_no", "#{gunNo,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(BsGasOilGunNoExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("gas_oil_price_id"); + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("gun_no"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_gas_oil_gun_no"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsGasOilGunNo record = (BsGasOilGunNo) parameter.get("record"); + BsGasOilGunNoExample example = (BsGasOilGunNoExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_gun_no"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getGasOilPriceId() != null) { + sql.SET("gas_oil_price_id = #{record.gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.SET("gun_no = #{record.gunNo,jdbcType=VARCHAR}"); + } + + 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.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_gas_oil_gun_no"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("gas_oil_price_id = #{record.gasOilPriceId,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("gun_no = #{record.gunNo,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + 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}"); + + BsGasOilGunNoExample example = (BsGasOilGunNoExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsGasOilGunNo record) { + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_gun_no"); + + if (record.getGasOilPriceId() != null) { + sql.SET("gas_oil_price_id = #{gasOilPriceId,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getGunNo() != null) { + sql.SET("gun_no = #{gunNo,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, BsGasOilGunNoExample 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/BsGasOilPriceMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java new file mode 100644 index 0000000..3c7ee68 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapper.java @@ -0,0 +1,150 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsGasOilPriceExample; +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 BsGasOilPriceMapper extends BsGasOilPriceMapperExt { + @SelectProvider(type=BsGasOilPriceSqlProvider.class, method="countByExample") + long countByExample(BsGasOilPriceExample example); + + @DeleteProvider(type=BsGasOilPriceSqlProvider.class, method="deleteByExample") + int deleteByExample(BsGasOilPriceExample example); + + @Delete({ + "delete from bs_gas_oil_price", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_gas_oil_price (mer_id, mer_no, ", + "oil_type, oil_type_name, ", + "oil_no, oil_no_name, ", + "preferential_margin, gas_station_drop, ", + "price_official, price_gun, ", + "price_vip, create_time, ", + "update_time, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{oilType,jdbcType=INTEGER}, #{oilTypeName,jdbcType=VARCHAR}, ", + "#{oilNo,jdbcType=VARCHAR}, #{oilNoName,jdbcType=VARCHAR}, ", + "#{preferentialMargin,jdbcType=DECIMAL}, #{gasStationDrop,jdbcType=DECIMAL}, ", + "#{priceOfficial,jdbcType=DECIMAL}, #{priceGun,jdbcType=DECIMAL}, ", + "#{priceVip,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsGasOilPrice record); + + @InsertProvider(type=BsGasOilPriceSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsGasOilPrice record); + + @SelectProvider(type=BsGasOilPriceSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(BsGasOilPriceExample example); + + @Select({ + "select", + "id, mer_id, mer_no, oil_type, oil_type_name, oil_no, oil_no_name, preferential_margin, ", + "gas_station_drop, price_official, price_gun, price_vip, create_time, update_time, ", + "`status`, ext_1, ext_2, ext_3", + "from bs_gas_oil_price", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + BsGasOilPrice selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsGasOilPriceSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsGasOilPrice record, @Param("example") BsGasOilPriceExample example); + + @UpdateProvider(type=BsGasOilPriceSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsGasOilPrice record, @Param("example") BsGasOilPriceExample example); + + @UpdateProvider(type=BsGasOilPriceSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsGasOilPrice record); + + @Update({ + "update bs_gas_oil_price", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "oil_no = #{oilNo,jdbcType=VARCHAR},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "preferential_margin = #{preferentialMargin,jdbcType=DECIMAL},", + "gas_station_drop = #{gasStationDrop,jdbcType=DECIMAL},", + "price_official = #{priceOfficial,jdbcType=DECIMAL},", + "price_gun = #{priceGun,jdbcType=DECIMAL},", + "price_vip = #{priceVip,jdbcType=DECIMAL},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsGasOilPrice record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java new file mode 100644 index 0000000..afd1a48 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceMapperExt.java @@ -0,0 +1,41 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPrice; +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.type.JdbcType; + +import java.util.List; +import java.util.Map; + +/** + * mapper扩展类 + */ +public interface BsGasOilPriceMapperExt { + @Select({" select b.* from bs_merchant a, bs_gas_oil_price b " + + " where a.id = b.mer_id " + + " and a.`status` = 1 " + + " and a.province_code = #{regionId} " + + " and b.oil_no = #{oilNo} "}) + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="merchant_store_id", property="merchantStoreId", jdbcType=JdbcType.BIGINT), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.INTEGER), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="preferential_margin", property="preferentialMargin", jdbcType=JdbcType.DECIMAL), + @Result(column="gas_station_drop", property="gasStationDrop", jdbcType=JdbcType.DECIMAL), + @Result(column="price_vip", property="priceVip", jdbcType=JdbcType.DECIMAL), + @Result(column="price_gun", property="priceGun", jdbcType=JdbcType.DECIMAL), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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 selectPriceListByRegionAndOilNo(@Param("regionId") Long regionId, @Param("oilNo") String oilNo); + +} diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java new file mode 100644 index 0000000..2b603b4 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapper.java @@ -0,0 +1,125 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPriceOfficial; +import com.hfkj.entity.BsGasOilPriceOfficialExample; +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 BsGasOilPriceOfficialMapper extends BsGasOilPriceOfficialMapperExt { + @SelectProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="countByExample") + long countByExample(BsGasOilPriceOfficialExample example); + + @DeleteProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="deleteByExample") + int deleteByExample(BsGasOilPriceOfficialExample example); + + @Delete({ + "delete from bs_gas_oil_price_official", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_gas_oil_price_official (region_id, region_name, ", + "oil_no, oil_no_name, ", + "price_official, oil_type, ", + "oil_type_name, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", + "#{oilNo,jdbcType=VARCHAR}, #{oilNoName,jdbcType=VARCHAR}, ", + "#{priceOfficial,jdbcType=DECIMAL}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsGasOilPriceOfficial record); + + @InsertProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsGasOilPriceOfficial record); + + @SelectProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(BsGasOilPriceOfficialExample example); + + @Select({ + "select", + "id, region_id, region_name, oil_no, oil_no_name, price_official, oil_type, oil_type_name, ", + "`status`, ext_1, ext_2, ext_3", + "from bs_gas_oil_price_official", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_official", property="priceOfficial", jdbcType=JdbcType.DECIMAL), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + BsGasOilPriceOfficial selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsGasOilPriceOfficial record, @Param("example") BsGasOilPriceOfficialExample example); + + @UpdateProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsGasOilPriceOfficial record, @Param("example") BsGasOilPriceOfficialExample example); + + @UpdateProvider(type=BsGasOilPriceOfficialSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsGasOilPriceOfficial record); + + @Update({ + "update bs_gas_oil_price_official", + "set region_id = #{regionId,jdbcType=BIGINT},", + "region_name = #{regionName,jdbcType=VARCHAR},", + "oil_no = #{oilNo,jdbcType=VARCHAR},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "price_official = #{priceOfficial,jdbcType=DECIMAL},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsGasOilPriceOfficial record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapperExt.java new file mode 100644 index 0000000..4fe7ddd --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsGasOilPriceOfficialMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java new file mode 100644 index 0000000..c9034bd --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceOfficialSqlProvider.java @@ -0,0 +1,332 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPriceOfficial; +import com.hfkj.entity.BsGasOilPriceOfficialExample.Criteria; +import com.hfkj.entity.BsGasOilPriceOfficialExample.Criterion; +import com.hfkj.entity.BsGasOilPriceOfficialExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsGasOilPriceOfficialSqlProvider { + + public String countByExample(BsGasOilPriceOfficialExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_gas_oil_price_official"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsGasOilPriceOfficialExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_gas_oil_price_official"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsGasOilPriceOfficial record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_gas_oil_price_official"); + + if (record.getRegionId() != null) { + sql.VALUES("region_id", "#{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceOfficial() != null) { + sql.VALUES("price_official", "#{priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getOilType() != null) { + sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(BsGasOilPriceOfficialExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("region_id"); + sql.SELECT("region_name"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("price_official"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_gas_oil_price_official"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsGasOilPriceOfficial record = (BsGasOilPriceOfficial) parameter.get("record"); + BsGasOilPriceOfficialExample example = (BsGasOilPriceOfficialExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price_official"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceOfficial() != null) { + sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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_gas_oil_price_official"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsGasOilPriceOfficialExample example = (BsGasOilPriceOfficialExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsGasOilPriceOfficial record) { + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price_official"); + + if (record.getRegionId() != null) { + sql.SET("region_id = #{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceOfficial() != null) { + sql.SET("price_official = #{priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, BsGasOilPriceOfficialExample 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/BsGasOilPriceSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java new file mode 100644 index 0000000..ad7980a --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceSqlProvider.java @@ -0,0 +1,416 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsGasOilPriceExample.Criteria; +import com.hfkj.entity.BsGasOilPriceExample.Criterion; +import com.hfkj.entity.BsGasOilPriceExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsGasOilPriceSqlProvider { + + public String countByExample(BsGasOilPriceExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_gas_oil_price"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsGasOilPriceExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_gas_oil_price"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsGasOilPrice record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_gas_oil_price"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPreferentialMargin() != null) { + sql.VALUES("preferential_margin", "#{preferentialMargin,jdbcType=DECIMAL}"); + } + + if (record.getGasStationDrop() != null) { + sql.VALUES("gas_station_drop", "#{gasStationDrop,jdbcType=DECIMAL}"); + } + + if (record.getPriceOfficial() != null) { + sql.VALUES("price_official", "#{priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getPriceGun() != null) { + sql.VALUES("price_gun", "#{priceGun,jdbcType=DECIMAL}"); + } + + if (record.getPriceVip() != null) { + sql.VALUES("price_vip", "#{priceVip,jdbcType=DECIMAL}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(BsGasOilPriceExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("preferential_margin"); + sql.SELECT("gas_station_drop"); + sql.SELECT("price_official"); + sql.SELECT("price_gun"); + sql.SELECT("price_vip"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_gas_oil_price"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsGasOilPrice record = (BsGasOilPrice) parameter.get("record"); + BsGasOilPriceExample example = (BsGasOilPriceExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPreferentialMargin() != null) { + sql.SET("preferential_margin = #{record.preferentialMargin,jdbcType=DECIMAL}"); + } + + if (record.getGasStationDrop() != null) { + sql.SET("gas_station_drop = #{record.gasStationDrop,jdbcType=DECIMAL}"); + } + + if (record.getPriceOfficial() != null) { + sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getPriceGun() != null) { + sql.SET("price_gun = #{record.priceGun,jdbcType=DECIMAL}"); + } + + if (record.getPriceVip() != null) { + sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}"); + } + + 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.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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_gas_oil_price"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("preferential_margin = #{record.preferentialMargin,jdbcType=DECIMAL}"); + sql.SET("gas_station_drop = #{record.gasStationDrop,jdbcType=DECIMAL}"); + sql.SET("price_official = #{record.priceOfficial,jdbcType=DECIMAL}"); + sql.SET("price_gun = #{record.priceGun,jdbcType=DECIMAL}"); + sql.SET("price_vip = #{record.priceVip,jdbcType=DECIMAL}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsGasOilPriceExample example = (BsGasOilPriceExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsGasOilPrice record) { + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPreferentialMargin() != null) { + sql.SET("preferential_margin = #{preferentialMargin,jdbcType=DECIMAL}"); + } + + if (record.getGasStationDrop() != null) { + sql.SET("gas_station_drop = #{gasStationDrop,jdbcType=DECIMAL}"); + } + + if (record.getPriceOfficial() != null) { + sql.SET("price_official = #{priceOfficial,jdbcType=DECIMAL}"); + } + + if (record.getPriceGun() != null) { + sql.SET("price_gun = #{priceGun,jdbcType=DECIMAL}"); + } + + if (record.getPriceVip() != null) { + sql.SET("price_vip = #{priceVip,jdbcType=DECIMAL}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, BsGasOilPriceExample 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/BsGasOilPriceTaskMapper.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskMapper.java new file mode 100644 index 0000000..79120f8 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskMapper.java @@ -0,0 +1,178 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPriceTask; +import com.hfkj.entity.BsGasOilPriceTaskExample; +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 BsGasOilPriceTaskMapper extends BsGasOilPriceTaskMapperExt { + @SelectProvider(type=BsGasOilPriceTaskSqlProvider.class, method="countByExample") + long countByExample(BsGasOilPriceTaskExample example); + + @DeleteProvider(type=BsGasOilPriceTaskSqlProvider.class, method="deleteByExample") + int deleteByExample(BsGasOilPriceTaskExample example); + + @Delete({ + "delete from bs_gas_oil_price_task", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_gas_oil_price_task (region_id, region_name, ", + "oil_price_zone_id, oil_price_zone_name, ", + "mer_id, mer_no, mer_name, ", + "mer_address, oil_type, ", + "oil_type_name, oil_no, ", + "oil_no_name, price_type, ", + "price, execution_type, ", + "start_time, `status`, ", + "create_time, update_time, ", + "op_user_id, op_user_name, ", + "ext_1, ext_2, ext_3)", + "values (#{regionId,jdbcType=BIGINT}, #{regionName,jdbcType=VARCHAR}, ", + "#{oilPriceZoneId,jdbcType=INTEGER}, #{oilPriceZoneName,jdbcType=VARCHAR}, ", + "#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", + "#{merAddress,jdbcType=VARCHAR}, #{oilType,jdbcType=INTEGER}, ", + "#{oilTypeName,jdbcType=VARCHAR}, #{oilNo,jdbcType=VARCHAR}, ", + "#{oilNoName,jdbcType=VARCHAR}, #{priceType,jdbcType=INTEGER}, ", + "#{price,jdbcType=DECIMAL}, #{executionType,jdbcType=INTEGER}, ", + "#{startTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, ", + "#{opUserId,jdbcType=BIGINT}, #{opUserName,jdbcType=VARCHAR}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsGasOilPriceTask record); + + @InsertProvider(type=BsGasOilPriceTaskSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsGasOilPriceTask record); + + @SelectProvider(type=BsGasOilPriceTaskSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_address", property="merAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="execution_type", property="executionType", jdbcType=JdbcType.INTEGER), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @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(BsGasOilPriceTaskExample example); + + @Select({ + "select", + "id, region_id, region_name, oil_price_zone_id, oil_price_zone_name, mer_id, ", + "mer_no, mer_name, mer_address, oil_type, oil_type_name, oil_no, oil_no_name, ", + "price_type, price, execution_type, start_time, `status`, create_time, update_time, ", + "op_user_id, op_user_name, ext_1, ext_2, ext_3", + "from bs_gas_oil_price_task", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_address", property="merAddress", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_type", property="oilType", jdbcType=JdbcType.INTEGER), + @Result(column="oil_type_name", property="oilTypeName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no", property="oilNo", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_no_name", property="oilNoName", jdbcType=JdbcType.VARCHAR), + @Result(column="price_type", property="priceType", jdbcType=JdbcType.INTEGER), + @Result(column="price", property="price", jdbcType=JdbcType.DECIMAL), + @Result(column="execution_type", property="executionType", jdbcType=JdbcType.INTEGER), + @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP), + @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="op_user_id", property="opUserId", jdbcType=JdbcType.BIGINT), + @Result(column="op_user_name", property="opUserName", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsGasOilPriceTask selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsGasOilPriceTaskSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsGasOilPriceTask record, @Param("example") BsGasOilPriceTaskExample example); + + @UpdateProvider(type=BsGasOilPriceTaskSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsGasOilPriceTask record, @Param("example") BsGasOilPriceTaskExample example); + + @UpdateProvider(type=BsGasOilPriceTaskSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsGasOilPriceTask record); + + @Update({ + "update bs_gas_oil_price_task", + "set region_id = #{regionId,jdbcType=BIGINT},", + "region_name = #{regionName,jdbcType=VARCHAR},", + "oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER},", + "oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR},", + "mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "mer_address = #{merAddress,jdbcType=VARCHAR},", + "oil_type = #{oilType,jdbcType=INTEGER},", + "oil_type_name = #{oilTypeName,jdbcType=VARCHAR},", + "oil_no = #{oilNo,jdbcType=VARCHAR},", + "oil_no_name = #{oilNoName,jdbcType=VARCHAR},", + "price_type = #{priceType,jdbcType=INTEGER},", + "price = #{price,jdbcType=DECIMAL},", + "execution_type = #{executionType,jdbcType=INTEGER},", + "start_time = #{startTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "op_user_id = #{opUserId,jdbcType=BIGINT},", + "op_user_name = #{opUserName,jdbcType=VARCHAR},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsGasOilPriceTask record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskMapperExt.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskMapperExt.java new file mode 100644 index 0000000..3d93d24 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsGasOilPriceTaskMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskSqlProvider.java new file mode 100644 index 0000000..0e06e03 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsGasOilPriceTaskSqlProvider.java @@ -0,0 +1,514 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsGasOilPriceTask; +import com.hfkj.entity.BsGasOilPriceTaskExample.Criteria; +import com.hfkj.entity.BsGasOilPriceTaskExample.Criterion; +import com.hfkj.entity.BsGasOilPriceTaskExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsGasOilPriceTaskSqlProvider { + + public String countByExample(BsGasOilPriceTaskExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_gas_oil_price_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsGasOilPriceTaskExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_gas_oil_price_task"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsGasOilPriceTask record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_gas_oil_price_task"); + + if (record.getRegionId() != null) { + sql.VALUES("region_id", "#{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.VALUES("oil_price_zone_id", "#{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.VALUES("oil_price_zone_name", "#{oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAddress() != null) { + sql.VALUES("mer_address", "#{merAddress,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.VALUES("oil_type", "#{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.VALUES("oil_type_name", "#{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.VALUES("oil_no", "#{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.VALUES("oil_no_name", "#{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceType() != null) { + sql.VALUES("price_type", "#{priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.VALUES("price", "#{price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.VALUES("execution_type", "#{executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.VALUES("start_time", "#{startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.VALUES("op_user_id", "#{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.VALUES("op_user_name", "#{opUserName,jdbcType=VARCHAR}"); + } + + 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(BsGasOilPriceTaskExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("region_id"); + sql.SELECT("region_name"); + sql.SELECT("oil_price_zone_id"); + sql.SELECT("oil_price_zone_name"); + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("mer_address"); + sql.SELECT("oil_type"); + sql.SELECT("oil_type_name"); + sql.SELECT("oil_no"); + sql.SELECT("oil_no_name"); + sql.SELECT("price_type"); + sql.SELECT("price"); + sql.SELECT("execution_type"); + sql.SELECT("start_time"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("op_user_id"); + sql.SELECT("op_user_name"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_gas_oil_price_task"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsGasOilPriceTask record = (BsGasOilPriceTask) parameter.get("record"); + BsGasOilPriceTaskExample example = (BsGasOilPriceTaskExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price_task"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAddress() != null) { + sql.SET("mer_address = #{record.merAddress,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceType() != null) { + sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.SET("execution_type = #{record.executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.SET("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + } + + 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_gas_oil_price_task"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("mer_address = #{record.merAddress,jdbcType=VARCHAR}"); + sql.SET("oil_type = #{record.oilType,jdbcType=INTEGER}"); + sql.SET("oil_type_name = #{record.oilTypeName,jdbcType=VARCHAR}"); + sql.SET("oil_no = #{record.oilNo,jdbcType=VARCHAR}"); + sql.SET("oil_no_name = #{record.oilNoName,jdbcType=VARCHAR}"); + sql.SET("price_type = #{record.priceType,jdbcType=INTEGER}"); + sql.SET("price = #{record.price,jdbcType=DECIMAL}"); + sql.SET("execution_type = #{record.executionType,jdbcType=INTEGER}"); + sql.SET("start_time = #{record.startTime,jdbcType=TIMESTAMP}"); + 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("op_user_id = #{record.opUserId,jdbcType=BIGINT}"); + sql.SET("op_user_name = #{record.opUserName,jdbcType=VARCHAR}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsGasOilPriceTaskExample example = (BsGasOilPriceTaskExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsGasOilPriceTask record) { + SQL sql = new SQL(); + sql.UPDATE("bs_gas_oil_price_task"); + + if (record.getRegionId() != null) { + sql.SET("region_id = #{regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getMerAddress() != null) { + sql.SET("mer_address = #{merAddress,jdbcType=VARCHAR}"); + } + + if (record.getOilType() != null) { + sql.SET("oil_type = #{oilType,jdbcType=INTEGER}"); + } + + if (record.getOilTypeName() != null) { + sql.SET("oil_type_name = #{oilTypeName,jdbcType=VARCHAR}"); + } + + if (record.getOilNo() != null) { + sql.SET("oil_no = #{oilNo,jdbcType=VARCHAR}"); + } + + if (record.getOilNoName() != null) { + sql.SET("oil_no_name = #{oilNoName,jdbcType=VARCHAR}"); + } + + if (record.getPriceType() != null) { + sql.SET("price_type = #{priceType,jdbcType=INTEGER}"); + } + + if (record.getPrice() != null) { + sql.SET("price = #{price,jdbcType=DECIMAL}"); + } + + if (record.getExecutionType() != null) { + sql.SET("execution_type = #{executionType,jdbcType=INTEGER}"); + } + + if (record.getStartTime() != null) { + sql.SET("start_time = #{startTime,jdbcType=TIMESTAMP}"); + } + + 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.getOpUserId() != null) { + sql.SET("op_user_id = #{opUserId,jdbcType=BIGINT}"); + } + + if (record.getOpUserName() != null) { + sql.SET("op_user_name = #{opUserName,jdbcType=VARCHAR}"); + } + + 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, BsGasOilPriceTaskExample 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/BsMerchantMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantMapper.java new file mode 100644 index 0000000..ceb40d9 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantMapper.java @@ -0,0 +1,183 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantExample; +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 BsMerchantMapper extends BsMerchantMapperExt { + @SelectProvider(type=BsMerchantSqlProvider.class, method="countByExample") + long countByExample(BsMerchantExample example); + + @DeleteProvider(type=BsMerchantSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantExample example); + + @Delete({ + "delete from bs_merchant", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant (source_type, province_code, ", + "province_name, city_code, ", + "city_name, area_code, ", + "area_name, oil_price_zone_id, ", + "oil_price_zone_name, mer_no, ", + "mer_logo, mer_name, ", + "contacts_name, contacts_tel, ", + "customer_service_tel, address, ", + "longitude, latitude, ", + "mer_label, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{sourceType,jdbcType=INTEGER}, #{provinceCode,jdbcType=BIGINT}, ", + "#{provinceName,jdbcType=VARCHAR}, #{cityCode,jdbcType=BIGINT}, ", + "#{cityName,jdbcType=VARCHAR}, #{areaCode,jdbcType=BIGINT}, ", + "#{areaName,jdbcType=VARCHAR}, #{oilPriceZoneId,jdbcType=INTEGER}, ", + "#{oilPriceZoneName,jdbcType=VARCHAR}, #{merNo,jdbcType=VARCHAR}, ", + "#{merLogo,jdbcType=VARCHAR}, #{merName,jdbcType=VARCHAR}, ", + "#{contactsName,jdbcType=VARCHAR}, #{contactsTel,jdbcType=VARCHAR}, ", + "#{customerServiceTel,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, ", + "#{longitude,jdbcType=VARCHAR}, #{latitude,jdbcType=VARCHAR}, ", + "#{merLabel,jdbcType=VARCHAR}, #{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(BsMerchant record); + + @InsertProvider(type=BsMerchantSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchant record); + + @SelectProvider(type=BsMerchantSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="province_code", property="provinceCode", jdbcType=JdbcType.BIGINT), + @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR), + @Result(column="city_code", property="cityCode", jdbcType=JdbcType.BIGINT), + @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR), + @Result(column="area_code", property="areaCode", jdbcType=JdbcType.BIGINT), + @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_logo", property="merLogo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_tel", property="contactsTel", jdbcType=JdbcType.VARCHAR), + @Result(column="customer_service_tel", property="customerServiceTel", jdbcType=JdbcType.VARCHAR), + @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR), + @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR), + @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_label", property="merLabel", jdbcType=JdbcType.VARCHAR), + @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(BsMerchantExample example); + + @Select({ + "select", + "id, source_type, province_code, province_name, city_code, city_name, area_code, ", + "area_name, oil_price_zone_id, oil_price_zone_name, mer_no, mer_logo, mer_name, ", + "contacts_name, contacts_tel, customer_service_tel, address, longitude, latitude, ", + "mer_label, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "from bs_merchant", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="source_type", property="sourceType", jdbcType=JdbcType.INTEGER), + @Result(column="province_code", property="provinceCode", jdbcType=JdbcType.BIGINT), + @Result(column="province_name", property="provinceName", jdbcType=JdbcType.VARCHAR), + @Result(column="city_code", property="cityCode", jdbcType=JdbcType.BIGINT), + @Result(column="city_name", property="cityName", jdbcType=JdbcType.VARCHAR), + @Result(column="area_code", property="areaCode", jdbcType=JdbcType.BIGINT), + @Result(column="area_name", property="areaName", jdbcType=JdbcType.VARCHAR), + @Result(column="oil_price_zone_id", property="oilPriceZoneId", jdbcType=JdbcType.INTEGER), + @Result(column="oil_price_zone_name", property="oilPriceZoneName", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_logo", property="merLogo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_name", property="contactsName", jdbcType=JdbcType.VARCHAR), + @Result(column="contacts_tel", property="contactsTel", jdbcType=JdbcType.VARCHAR), + @Result(column="customer_service_tel", property="customerServiceTel", jdbcType=JdbcType.VARCHAR), + @Result(column="address", property="address", jdbcType=JdbcType.VARCHAR), + @Result(column="longitude", property="longitude", jdbcType=JdbcType.VARCHAR), + @Result(column="latitude", property="latitude", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_label", property="merLabel", jdbcType=JdbcType.VARCHAR), + @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) + }) + BsMerchant selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchant record, @Param("example") BsMerchantExample example); + + @UpdateProvider(type=BsMerchantSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchant record, @Param("example") BsMerchantExample example); + + @UpdateProvider(type=BsMerchantSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchant record); + + @Update({ + "update bs_merchant", + "set source_type = #{sourceType,jdbcType=INTEGER},", + "province_code = #{provinceCode,jdbcType=BIGINT},", + "province_name = #{provinceName,jdbcType=VARCHAR},", + "city_code = #{cityCode,jdbcType=BIGINT},", + "city_name = #{cityName,jdbcType=VARCHAR},", + "area_code = #{areaCode,jdbcType=BIGINT},", + "area_name = #{areaName,jdbcType=VARCHAR},", + "oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER},", + "oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_logo = #{merLogo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "contacts_name = #{contactsName,jdbcType=VARCHAR},", + "contacts_tel = #{contactsTel,jdbcType=VARCHAR},", + "customer_service_tel = #{customerServiceTel,jdbcType=VARCHAR},", + "address = #{address,jdbcType=VARCHAR},", + "longitude = #{longitude,jdbcType=VARCHAR},", + "latitude = #{latitude,jdbcType=VARCHAR},", + "mer_label = #{merLabel,jdbcType=VARCHAR},", + "`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(BsMerchant record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantMapperExt.java new file mode 100644 index 0000000..ea7ad61 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapper.java new file mode 100644 index 0000000..279ff79 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapper.java @@ -0,0 +1,133 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantPayConfig; +import com.hfkj.entity.BsMerchantPayConfigExample; +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 BsMerchantPayConfigMapper extends BsMerchantPayConfigMapperExt { + @SelectProvider(type=BsMerchantPayConfigSqlProvider.class, method="countByExample") + long countByExample(BsMerchantPayConfigExample example); + + @DeleteProvider(type=BsMerchantPayConfigSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantPayConfigExample example); + + @Delete({ + "delete from bs_merchant_pay_config", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant_pay_config (mer_id, mer_no, ", + "mer_name, channel_code, ", + "channel_name, channel_mer_no, ", + "channel_mer_key, create_time, ", + "update_time, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{merName,jdbcType=VARCHAR}, #{channelCode,jdbcType=VARCHAR}, ", + "#{channelName,jdbcType=VARCHAR}, #{channelMerNo,jdbcType=VARCHAR}, ", + "#{channelMerKey,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsMerchantPayConfig record); + + @InsertProvider(type=BsMerchantPayConfigSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchantPayConfig record); + + @SelectProvider(type=BsMerchantPayConfigSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_code", property="channelCode", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(BsMerchantPayConfigExample example); + + @Select({ + "select", + "id, mer_id, mer_no, mer_name, channel_code, channel_name, channel_mer_no, channel_mer_key, ", + "create_time, update_time, `status`, ext_1, ext_2, ext_3", + "from bs_merchant_pay_config", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_code", property="channelCode", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_name", property="channelName", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_mer_no", property="channelMerNo", jdbcType=JdbcType.VARCHAR), + @Result(column="channel_mer_key", property="channelMerKey", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + BsMerchantPayConfig selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantPayConfigSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchantPayConfig record, @Param("example") BsMerchantPayConfigExample example); + + @UpdateProvider(type=BsMerchantPayConfigSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchantPayConfig record, @Param("example") BsMerchantPayConfigExample example); + + @UpdateProvider(type=BsMerchantPayConfigSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchantPayConfig record); + + @Update({ + "update bs_merchant_pay_config", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "channel_code = #{channelCode,jdbcType=VARCHAR},", + "channel_name = #{channelName,jdbcType=VARCHAR},", + "channel_mer_no = #{channelMerNo,jdbcType=VARCHAR},", + "channel_mer_key = #{channelMerKey,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsMerchantPayConfig record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapperExt.java new file mode 100644 index 0000000..738b9e2 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantPayConfigMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigSqlProvider.java new file mode 100644 index 0000000..0658989 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantPayConfigSqlProvider.java @@ -0,0 +1,360 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantPayConfig; +import com.hfkj.entity.BsMerchantPayConfigExample.Criteria; +import com.hfkj.entity.BsMerchantPayConfigExample.Criterion; +import com.hfkj.entity.BsMerchantPayConfigExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantPayConfigSqlProvider { + + public String countByExample(BsMerchantPayConfigExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant_pay_config"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantPayConfigExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant_pay_config"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchantPayConfig record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant_pay_config"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getChannelCode() != null) { + sql.VALUES("channel_code", "#{channelCode,jdbcType=VARCHAR}"); + } + + if (record.getChannelName() != null) { + sql.VALUES("channel_name", "#{channelName,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerNo() != null) { + sql.VALUES("channel_mer_no", "#{channelMerNo,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerKey() != null) { + sql.VALUES("channel_mer_key", "#{channelMerKey,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(BsMerchantPayConfigExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("channel_code"); + sql.SELECT("channel_name"); + sql.SELECT("channel_mer_no"); + sql.SELECT("channel_mer_key"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_merchant_pay_config"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchantPayConfig record = (BsMerchantPayConfig) parameter.get("record"); + BsMerchantPayConfigExample example = (BsMerchantPayConfigExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_pay_config"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getChannelCode() != null) { + sql.SET("channel_code = #{record.channelCode,jdbcType=VARCHAR}"); + } + + if (record.getChannelName() != null) { + sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerNo() != null) { + sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerKey() != null) { + sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}"); + } + + 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.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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_merchant_pay_config"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("channel_code = #{record.channelCode,jdbcType=VARCHAR}"); + sql.SET("channel_name = #{record.channelName,jdbcType=VARCHAR}"); + sql.SET("channel_mer_no = #{record.channelMerNo,jdbcType=VARCHAR}"); + sql.SET("channel_mer_key = #{record.channelMerKey,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsMerchantPayConfigExample example = (BsMerchantPayConfigExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchantPayConfig record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_pay_config"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getChannelCode() != null) { + sql.SET("channel_code = #{channelCode,jdbcType=VARCHAR}"); + } + + if (record.getChannelName() != null) { + sql.SET("channel_name = #{channelName,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerNo() != null) { + sql.SET("channel_mer_no = #{channelMerNo,jdbcType=VARCHAR}"); + } + + if (record.getChannelMerKey() != null) { + sql.SET("channel_mer_key = #{channelMerKey,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, BsMerchantPayConfigExample 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/BsMerchantQrCodeMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeMapper.java new file mode 100644 index 0000000..a09070f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeMapper.java @@ -0,0 +1,125 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantQrCode; +import com.hfkj.entity.BsMerchantQrCodeExample; +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 BsMerchantQrCodeMapper extends BsMerchantQrCodeMapperExt { + @SelectProvider(type=BsMerchantQrCodeSqlProvider.class, method="countByExample") + long countByExample(BsMerchantQrCodeExample example); + + @DeleteProvider(type=BsMerchantQrCodeSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantQrCodeExample example); + + @Delete({ + "delete from bs_merchant_qr_code", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant_qr_code (merchant_id, merchant_no, ", + "code_type, code_content, ", + "code_img, create_time, ", + "update_time, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{merchantId,jdbcType=BIGINT}, #{merchantNo,jdbcType=VARCHAR}, ", + "#{codeType,jdbcType=INTEGER}, #{codeContent,jdbcType=VARCHAR}, ", + "#{codeImg,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(BsMerchantQrCode record); + + @InsertProvider(type=BsMerchantQrCodeSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchantQrCode record); + + @SelectProvider(type=BsMerchantQrCodeSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_no", property="merchantNo", jdbcType=JdbcType.VARCHAR), + @Result(column="code_type", property="codeType", jdbcType=JdbcType.INTEGER), + @Result(column="code_content", property="codeContent", jdbcType=JdbcType.VARCHAR), + @Result(column="code_img", property="codeImg", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(BsMerchantQrCodeExample example); + + @Select({ + "select", + "id, merchant_id, merchant_no, code_type, code_content, code_img, create_time, ", + "update_time, `status`, ext_1, ext_2, ext_3", + "from bs_merchant_qr_code", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="merchant_id", property="merchantId", jdbcType=JdbcType.BIGINT), + @Result(column="merchant_no", property="merchantNo", jdbcType=JdbcType.VARCHAR), + @Result(column="code_type", property="codeType", jdbcType=JdbcType.INTEGER), + @Result(column="code_content", property="codeContent", jdbcType=JdbcType.VARCHAR), + @Result(column="code_img", property="codeImg", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + BsMerchantQrCode selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantQrCodeSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchantQrCode record, @Param("example") BsMerchantQrCodeExample example); + + @UpdateProvider(type=BsMerchantQrCodeSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchantQrCode record, @Param("example") BsMerchantQrCodeExample example); + + @UpdateProvider(type=BsMerchantQrCodeSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchantQrCode record); + + @Update({ + "update bs_merchant_qr_code", + "set merchant_id = #{merchantId,jdbcType=BIGINT},", + "merchant_no = #{merchantNo,jdbcType=VARCHAR},", + "code_type = #{codeType,jdbcType=INTEGER},", + "code_content = #{codeContent,jdbcType=VARCHAR},", + "code_img = #{codeImg,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(BsMerchantQrCode record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeMapperExt.java new file mode 100644 index 0000000..550e81c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantQrCodeMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeSqlProvider.java new file mode 100644 index 0000000..2850437 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantQrCodeSqlProvider.java @@ -0,0 +1,332 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantQrCode; +import com.hfkj.entity.BsMerchantQrCodeExample.Criteria; +import com.hfkj.entity.BsMerchantQrCodeExample.Criterion; +import com.hfkj.entity.BsMerchantQrCodeExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantQrCodeSqlProvider { + + public String countByExample(BsMerchantQrCodeExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant_qr_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantQrCodeExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant_qr_code"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchantQrCode record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant_qr_code"); + + if (record.getMerchantId() != null) { + sql.VALUES("merchant_id", "#{merchantId,jdbcType=BIGINT}"); + } + + if (record.getMerchantNo() != null) { + sql.VALUES("merchant_no", "#{merchantNo,jdbcType=VARCHAR}"); + } + + if (record.getCodeType() != null) { + sql.VALUES("code_type", "#{codeType,jdbcType=INTEGER}"); + } + + if (record.getCodeContent() != null) { + sql.VALUES("code_content", "#{codeContent,jdbcType=VARCHAR}"); + } + + if (record.getCodeImg() != null) { + sql.VALUES("code_img", "#{codeImg,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(BsMerchantQrCodeExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("merchant_id"); + sql.SELECT("merchant_no"); + sql.SELECT("code_type"); + sql.SELECT("code_content"); + sql.SELECT("code_img"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("bs_merchant_qr_code"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchantQrCode record = (BsMerchantQrCode) parameter.get("record"); + BsMerchantQrCodeExample example = (BsMerchantQrCodeExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_qr_code"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerchantId() != null) { + sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); + } + + if (record.getMerchantNo() != null) { + sql.SET("merchant_no = #{record.merchantNo,jdbcType=VARCHAR}"); + } + + if (record.getCodeType() != null) { + sql.SET("code_type = #{record.codeType,jdbcType=INTEGER}"); + } + + if (record.getCodeContent() != null) { + sql.SET("code_content = #{record.codeContent,jdbcType=VARCHAR}"); + } + + if (record.getCodeImg() != null) { + sql.SET("code_img = #{record.codeImg,jdbcType=VARCHAR}"); + } + + 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.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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_merchant_qr_code"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("merchant_id = #{record.merchantId,jdbcType=BIGINT}"); + sql.SET("merchant_no = #{record.merchantNo,jdbcType=VARCHAR}"); + sql.SET("code_type = #{record.codeType,jdbcType=INTEGER}"); + sql.SET("code_content = #{record.codeContent,jdbcType=VARCHAR}"); + sql.SET("code_img = #{record.codeImg,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + BsMerchantQrCodeExample example = (BsMerchantQrCodeExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchantQrCode record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_qr_code"); + + if (record.getMerchantId() != null) { + sql.SET("merchant_id = #{merchantId,jdbcType=BIGINT}"); + } + + if (record.getMerchantNo() != null) { + sql.SET("merchant_no = #{merchantNo,jdbcType=VARCHAR}"); + } + + if (record.getCodeType() != null) { + sql.SET("code_type = #{codeType,jdbcType=INTEGER}"); + } + + if (record.getCodeContent() != null) { + sql.SET("code_content = #{codeContent,jdbcType=VARCHAR}"); + } + + if (record.getCodeImg() != null) { + sql.SET("code_img = #{codeImg,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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, BsMerchantQrCodeExample 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/BsMerchantSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantSqlProvider.java new file mode 100644 index 0000000..e82c194 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantSqlProvider.java @@ -0,0 +1,528 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantExample.Criteria; +import com.hfkj.entity.BsMerchantExample.Criterion; +import com.hfkj.entity.BsMerchantExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantSqlProvider { + + public String countByExample(BsMerchantExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchant record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant"); + + if (record.getSourceType() != null) { + sql.VALUES("source_type", "#{sourceType,jdbcType=INTEGER}"); + } + + if (record.getProvinceCode() != null) { + sql.VALUES("province_code", "#{provinceCode,jdbcType=BIGINT}"); + } + + if (record.getProvinceName() != null) { + sql.VALUES("province_name", "#{provinceName,jdbcType=VARCHAR}"); + } + + if (record.getCityCode() != null) { + sql.VALUES("city_code", "#{cityCode,jdbcType=BIGINT}"); + } + + if (record.getCityName() != null) { + sql.VALUES("city_name", "#{cityName,jdbcType=VARCHAR}"); + } + + if (record.getAreaCode() != null) { + sql.VALUES("area_code", "#{areaCode,jdbcType=BIGINT}"); + } + + if (record.getAreaName() != null) { + sql.VALUES("area_name", "#{areaName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.VALUES("oil_price_zone_id", "#{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.VALUES("oil_price_zone_name", "#{oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.VALUES("mer_logo", "#{merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.VALUES("contacts_name", "#{contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTel() != null) { + sql.VALUES("contacts_tel", "#{contactsTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.VALUES("customer_service_tel", "#{customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.VALUES("address", "#{address,jdbcType=VARCHAR}"); + } + + if (record.getLongitude() != null) { + sql.VALUES("longitude", "#{longitude,jdbcType=VARCHAR}"); + } + + if (record.getLatitude() != null) { + sql.VALUES("latitude", "#{latitude,jdbcType=VARCHAR}"); + } + + if (record.getMerLabel() != null) { + sql.VALUES("mer_label", "#{merLabel,jdbcType=VARCHAR}"); + } + + 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(BsMerchantExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("source_type"); + sql.SELECT("province_code"); + sql.SELECT("province_name"); + sql.SELECT("city_code"); + sql.SELECT("city_name"); + sql.SELECT("area_code"); + sql.SELECT("area_name"); + sql.SELECT("oil_price_zone_id"); + sql.SELECT("oil_price_zone_name"); + sql.SELECT("mer_no"); + sql.SELECT("mer_logo"); + sql.SELECT("mer_name"); + sql.SELECT("contacts_name"); + sql.SELECT("contacts_tel"); + sql.SELECT("customer_service_tel"); + sql.SELECT("address"); + sql.SELECT("longitude"); + sql.SELECT("latitude"); + sql.SELECT("mer_label"); + 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_merchant"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchant record = (BsMerchant) parameter.get("record"); + BsMerchantExample example = (BsMerchantExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getSourceType() != null) { + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + } + + if (record.getProvinceCode() != null) { + sql.SET("province_code = #{record.provinceCode,jdbcType=BIGINT}"); + } + + if (record.getProvinceName() != null) { + sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}"); + } + + if (record.getCityCode() != null) { + sql.SET("city_code = #{record.cityCode,jdbcType=BIGINT}"); + } + + if (record.getCityName() != null) { + sql.SET("city_name = #{record.cityName,jdbcType=VARCHAR}"); + } + + if (record.getAreaCode() != null) { + sql.SET("area_code = #{record.areaCode,jdbcType=BIGINT}"); + } + + if (record.getAreaName() != null) { + sql.SET("area_name = #{record.areaName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.SET("mer_logo = #{record.merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTel() != null) { + sql.SET("contacts_tel = #{record.contactsTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.SET("customer_service_tel = #{record.customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.SET("address = #{record.address,jdbcType=VARCHAR}"); + } + + if (record.getLongitude() != null) { + sql.SET("longitude = #{record.longitude,jdbcType=VARCHAR}"); + } + + if (record.getLatitude() != null) { + sql.SET("latitude = #{record.latitude,jdbcType=VARCHAR}"); + } + + if (record.getMerLabel() != null) { + sql.SET("mer_label = #{record.merLabel,jdbcType=VARCHAR}"); + } + + 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_merchant"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("source_type = #{record.sourceType,jdbcType=INTEGER}"); + sql.SET("province_code = #{record.provinceCode,jdbcType=BIGINT}"); + sql.SET("province_name = #{record.provinceName,jdbcType=VARCHAR}"); + sql.SET("city_code = #{record.cityCode,jdbcType=BIGINT}"); + sql.SET("city_name = #{record.cityName,jdbcType=VARCHAR}"); + sql.SET("area_code = #{record.areaCode,jdbcType=BIGINT}"); + sql.SET("area_name = #{record.areaName,jdbcType=VARCHAR}"); + sql.SET("oil_price_zone_id = #{record.oilPriceZoneId,jdbcType=INTEGER}"); + sql.SET("oil_price_zone_name = #{record.oilPriceZoneName,jdbcType=VARCHAR}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_logo = #{record.merLogo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("contacts_name = #{record.contactsName,jdbcType=VARCHAR}"); + sql.SET("contacts_tel = #{record.contactsTel,jdbcType=VARCHAR}"); + sql.SET("customer_service_tel = #{record.customerServiceTel,jdbcType=VARCHAR}"); + sql.SET("address = #{record.address,jdbcType=VARCHAR}"); + sql.SET("longitude = #{record.longitude,jdbcType=VARCHAR}"); + sql.SET("latitude = #{record.latitude,jdbcType=VARCHAR}"); + sql.SET("mer_label = #{record.merLabel,jdbcType=VARCHAR}"); + 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}"); + + BsMerchantExample example = (BsMerchantExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchant record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant"); + + if (record.getSourceType() != null) { + sql.SET("source_type = #{sourceType,jdbcType=INTEGER}"); + } + + if (record.getProvinceCode() != null) { + sql.SET("province_code = #{provinceCode,jdbcType=BIGINT}"); + } + + if (record.getProvinceName() != null) { + sql.SET("province_name = #{provinceName,jdbcType=VARCHAR}"); + } + + if (record.getCityCode() != null) { + sql.SET("city_code = #{cityCode,jdbcType=BIGINT}"); + } + + if (record.getCityName() != null) { + sql.SET("city_name = #{cityName,jdbcType=VARCHAR}"); + } + + if (record.getAreaCode() != null) { + sql.SET("area_code = #{areaCode,jdbcType=BIGINT}"); + } + + if (record.getAreaName() != null) { + sql.SET("area_name = #{areaName,jdbcType=VARCHAR}"); + } + + if (record.getOilPriceZoneId() != null) { + sql.SET("oil_price_zone_id = #{oilPriceZoneId,jdbcType=INTEGER}"); + } + + if (record.getOilPriceZoneName() != null) { + sql.SET("oil_price_zone_name = #{oilPriceZoneName,jdbcType=VARCHAR}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerLogo() != null) { + sql.SET("mer_logo = #{merLogo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getContactsName() != null) { + sql.SET("contacts_name = #{contactsName,jdbcType=VARCHAR}"); + } + + if (record.getContactsTel() != null) { + sql.SET("contacts_tel = #{contactsTel,jdbcType=VARCHAR}"); + } + + if (record.getCustomerServiceTel() != null) { + sql.SET("customer_service_tel = #{customerServiceTel,jdbcType=VARCHAR}"); + } + + if (record.getAddress() != null) { + sql.SET("address = #{address,jdbcType=VARCHAR}"); + } + + if (record.getLongitude() != null) { + sql.SET("longitude = #{longitude,jdbcType=VARCHAR}"); + } + + if (record.getLatitude() != null) { + sql.SET("latitude = #{latitude,jdbcType=VARCHAR}"); + } + + if (record.getMerLabel() != null) { + sql.SET("mer_label = #{merLabel,jdbcType=VARCHAR}"); + } + + 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, BsMerchantExample 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/BsMerchantUserMapper.java b/service/src/main/java/com/hfkj/dao/BsMerchantUserMapper.java new file mode 100644 index 0000000..9f22633 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantUserMapper.java @@ -0,0 +1,133 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantUser; +import com.hfkj.entity.BsMerchantUserExample; +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 BsMerchantUserMapper extends BsMerchantUserMapperExt { + @SelectProvider(type=BsMerchantUserSqlProvider.class, method="countByExample") + long countByExample(BsMerchantUserExample example); + + @DeleteProvider(type=BsMerchantUserSqlProvider.class, method="deleteByExample") + int deleteByExample(BsMerchantUserExample example); + + @Delete({ + "delete from bs_merchant_user", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into bs_merchant_user (mer_id, mer_no, ", + "mer_name, user_id, ", + "user_phone, integral, ", + "vip_level, `status`, ", + "create_time, update_time, ", + "ext_1, ext_2, ext_3)", + "values (#{merId,jdbcType=BIGINT}, #{merNo,jdbcType=VARCHAR}, ", + "#{merName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, ", + "#{userPhone,jdbcType=VARCHAR}, #{integral,jdbcType=INTEGER}, ", + "#{vipLevel,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(BsMerchantUser record); + + @InsertProvider(type=BsMerchantUserSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(BsMerchantUser record); + + @SelectProvider(type=BsMerchantUserSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER), + @Result(column="vip_level", property="vipLevel", 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(BsMerchantUserExample example); + + @Select({ + "select", + "id, mer_id, mer_no, mer_name, user_id, user_phone, integral, vip_level, `status`, ", + "create_time, update_time, ext_1, ext_2, ext_3", + "from bs_merchant_user", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="mer_id", property="merId", jdbcType=JdbcType.BIGINT), + @Result(column="mer_no", property="merNo", jdbcType=JdbcType.VARCHAR), + @Result(column="mer_name", property="merName", jdbcType=JdbcType.VARCHAR), + @Result(column="user_id", property="userId", jdbcType=JdbcType.BIGINT), + @Result(column="user_phone", property="userPhone", jdbcType=JdbcType.VARCHAR), + @Result(column="integral", property="integral", jdbcType=JdbcType.INTEGER), + @Result(column="vip_level", property="vipLevel", 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) + }) + BsMerchantUser selectByPrimaryKey(Long id); + + @UpdateProvider(type=BsMerchantUserSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") BsMerchantUser record, @Param("example") BsMerchantUserExample example); + + @UpdateProvider(type=BsMerchantUserSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") BsMerchantUser record, @Param("example") BsMerchantUserExample example); + + @UpdateProvider(type=BsMerchantUserSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(BsMerchantUser record); + + @Update({ + "update bs_merchant_user", + "set mer_id = #{merId,jdbcType=BIGINT},", + "mer_no = #{merNo,jdbcType=VARCHAR},", + "mer_name = #{merName,jdbcType=VARCHAR},", + "user_id = #{userId,jdbcType=BIGINT},", + "user_phone = #{userPhone,jdbcType=VARCHAR},", + "integral = #{integral,jdbcType=INTEGER},", + "vip_level = #{vipLevel,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(BsMerchantUser record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantUserMapperExt.java b/service/src/main/java/com/hfkj/dao/BsMerchantUserMapperExt.java new file mode 100644 index 0000000..84c08a5 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantUserMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsMerchantUserMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/BsMerchantUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/BsMerchantUserSqlProvider.java new file mode 100644 index 0000000..6fcab1c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsMerchantUserSqlProvider.java @@ -0,0 +1,360 @@ +package com.hfkj.dao; + +import com.hfkj.entity.BsMerchantUser; +import com.hfkj.entity.BsMerchantUserExample.Criteria; +import com.hfkj.entity.BsMerchantUserExample.Criterion; +import com.hfkj.entity.BsMerchantUserExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class BsMerchantUserSqlProvider { + + public String countByExample(BsMerchantUserExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("bs_merchant_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(BsMerchantUserExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("bs_merchant_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(BsMerchantUser record) { + SQL sql = new SQL(); + sql.INSERT_INTO("bs_merchant_user"); + + if (record.getMerId() != null) { + sql.VALUES("mer_id", "#{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.VALUES("mer_no", "#{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.VALUES("mer_name", "#{merName,jdbcType=VARCHAR}"); + } + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.VALUES("user_phone", "#{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getIntegral() != null) { + sql.VALUES("integral", "#{integral,jdbcType=INTEGER}"); + } + + if (record.getVipLevel() != null) { + sql.VALUES("vip_level", "#{vipLevel,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(BsMerchantUserExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("mer_id"); + sql.SELECT("mer_no"); + sql.SELECT("mer_name"); + sql.SELECT("user_id"); + sql.SELECT("user_phone"); + sql.SELECT("integral"); + sql.SELECT("vip_level"); + 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_merchant_user"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + BsMerchantUser record = (BsMerchantUser) parameter.get("record"); + BsMerchantUserExample example = (BsMerchantUserExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_user"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMerId() != null) { + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + } + + 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.getIntegral() != null) { + sql.SET("integral = #{record.integral,jdbcType=INTEGER}"); + } + + if (record.getVipLevel() != null) { + sql.SET("vip_level = #{record.vipLevel,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_merchant_user"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("mer_id = #{record.merId,jdbcType=BIGINT}"); + sql.SET("mer_no = #{record.merNo,jdbcType=VARCHAR}"); + sql.SET("mer_name = #{record.merName,jdbcType=VARCHAR}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("user_phone = #{record.userPhone,jdbcType=VARCHAR}"); + sql.SET("integral = #{record.integral,jdbcType=INTEGER}"); + sql.SET("vip_level = #{record.vipLevel,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}"); + + BsMerchantUserExample example = (BsMerchantUserExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(BsMerchantUser record) { + SQL sql = new SQL(); + sql.UPDATE("bs_merchant_user"); + + if (record.getMerId() != null) { + sql.SET("mer_id = #{merId,jdbcType=BIGINT}"); + } + + if (record.getMerNo() != null) { + sql.SET("mer_no = #{merNo,jdbcType=VARCHAR}"); + } + + if (record.getMerName() != null) { + sql.SET("mer_name = #{merName,jdbcType=VARCHAR}"); + } + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getUserPhone() != null) { + sql.SET("user_phone = #{userPhone,jdbcType=VARCHAR}"); + } + + if (record.getIntegral() != null) { + sql.SET("integral = #{integral,jdbcType=INTEGER}"); + } + + if (record.getVipLevel() != null) { + sql.SET("vip_level = #{vipLevel,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, BsMerchantUserExample 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/BsResourceMapperExt.java b/service/src/main/java/com/hfkj/dao/BsResourceMapperExt.java new file mode 100644 index 0000000..2a5a950 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/BsResourceMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface BsResourceMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecDictionaryMapper.java b/service/src/main/java/com/hfkj/dao/SecDictionaryMapper.java new file mode 100644 index 0000000..bf349ed --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecDictionaryMapper.java @@ -0,0 +1,105 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecDictionaryExample; +import com.hfkj.entity.SecDictionaryKey; +import org.apache.ibatis.annotations.*; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface SecDictionaryMapper extends SecDictionaryMapperExt { + @SelectProvider(type= SecDictionarySqlProvider.class, method="countByExample") + long countByExample(SecDictionaryExample example); + + @DeleteProvider(type= SecDictionarySqlProvider.class, method="deleteByExample") + int deleteByExample(SecDictionaryExample example); + + @Delete({ + "delete from sec_dictionary", + "where code_type = #{codeType,jdbcType=VARCHAR}", + "and code_value = #{codeValue,jdbcType=VARCHAR}" + }) + int deleteByPrimaryKey(SecDictionaryKey key); + + @Insert({ + "insert into sec_dictionary (code_type, code_value, ", + "code_name, code_desc, ", + "sort_id, `status`, ", + "ext_1, ext_2, ext_3)", + "values (#{codeType,jdbcType=VARCHAR}, #{codeValue,jdbcType=VARCHAR}, ", + "#{codeName,jdbcType=VARCHAR}, #{codeDesc,jdbcType=VARCHAR}, ", + "#{sortId,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, ", + "#{ext1,jdbcType=VARCHAR}, #{ext2,jdbcType=VARCHAR}, #{ext3,jdbcType=VARCHAR})" + }) + int insert(SecDictionary record); + + @InsertProvider(type= SecDictionarySqlProvider.class, method="insertSelective") + int insertSelective(SecDictionary record); + + @SelectProvider(type= SecDictionarySqlProvider.class, method="selectByExample") + @Results({ + @Result(column="code_type", property="codeType", jdbcType=JdbcType.VARCHAR, id=true), + @Result(column="code_value", property="codeValue", jdbcType=JdbcType.VARCHAR, id=true), + @Result(column="code_name", property="codeName", jdbcType=JdbcType.VARCHAR), + @Result(column="code_desc", property="codeDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="sort_id", property="sortId", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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(SecDictionaryExample example); + + @Select({ + "select", + "code_type, code_value, code_name, code_desc, sort_id, `status`, ext_1, ext_2, ", + "ext_3", + "from sec_dictionary", + "where code_type = #{codeType,jdbcType=VARCHAR}", + "and code_value = #{codeValue,jdbcType=VARCHAR}" + }) + @Results({ + @Result(column="code_type", property="codeType", jdbcType=JdbcType.VARCHAR, id=true), + @Result(column="code_value", property="codeValue", jdbcType=JdbcType.VARCHAR, id=true), + @Result(column="code_name", property="codeName", jdbcType=JdbcType.VARCHAR), + @Result(column="code_desc", property="codeDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="sort_id", property="sortId", jdbcType=JdbcType.INTEGER), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @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) + }) + SecDictionary selectByPrimaryKey(SecDictionaryKey key); + + @UpdateProvider(type= SecDictionarySqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecDictionary record, @Param("example") SecDictionaryExample example); + + @UpdateProvider(type= SecDictionarySqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecDictionary record, @Param("example") SecDictionaryExample example); + + @UpdateProvider(type= SecDictionarySqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecDictionary record); + + @Update({ + "update sec_dictionary", + "set code_name = #{codeName,jdbcType=VARCHAR},", + "code_desc = #{codeDesc,jdbcType=VARCHAR},", + "sort_id = #{sortId,jdbcType=INTEGER},", + "`status` = #{status,jdbcType=INTEGER},", + "ext_1 = #{ext1,jdbcType=VARCHAR},", + "ext_2 = #{ext2,jdbcType=VARCHAR},", + "ext_3 = #{ext3,jdbcType=VARCHAR}", + "where code_type = #{codeType,jdbcType=VARCHAR}", + "and code_value = #{codeValue,jdbcType=VARCHAR}" + }) + int updateByPrimaryKey(SecDictionary record); +} diff --git a/service/src/main/java/com/hfkj/dao/SecDictionaryMapperExt.java b/service/src/main/java/com/hfkj/dao/SecDictionaryMapperExt.java new file mode 100644 index 0000000..997fe10 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecDictionaryMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecDictionaryMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecDictionarySqlProvider.java b/service/src/main/java/com/hfkj/dao/SecDictionarySqlProvider.java new file mode 100644 index 0000000..efe822d --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecDictionarySqlProvider.java @@ -0,0 +1,292 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecDictionaryExample; +import com.hfkj.entity.SecDictionaryExample.Criteria; +import com.hfkj.entity.SecDictionaryExample.Criterion; +import org.apache.ibatis.jdbc.SQL; + +import java.util.List; +import java.util.Map; + +public class SecDictionarySqlProvider { + + public String countByExample(SecDictionaryExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_dictionary"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecDictionaryExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_dictionary"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecDictionary record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_dictionary"); + + if (record.getCodeType() != null) { + sql.VALUES("code_type", "#{codeType,jdbcType=VARCHAR}"); + } + + if (record.getCodeValue() != null) { + sql.VALUES("code_value", "#{codeValue,jdbcType=VARCHAR}"); + } + + if (record.getCodeName() != null) { + sql.VALUES("code_name", "#{codeName,jdbcType=VARCHAR}"); + } + + if (record.getCodeDesc() != null) { + sql.VALUES("code_desc", "#{codeDesc,jdbcType=VARCHAR}"); + } + + if (record.getSortId() != null) { + sql.VALUES("sort_id", "#{sortId,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + 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(SecDictionaryExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("code_type"); + } else { + sql.SELECT("code_type"); + } + sql.SELECT("code_value"); + sql.SELECT("code_name"); + sql.SELECT("code_desc"); + sql.SELECT("sort_id"); + sql.SELECT("`status`"); + sql.SELECT("ext_1"); + sql.SELECT("ext_2"); + sql.SELECT("ext_3"); + sql.FROM("sec_dictionary"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecDictionary record = (SecDictionary) parameter.get("record"); + SecDictionaryExample example = (SecDictionaryExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_dictionary"); + + if (record.getCodeType() != null) { + sql.SET("code_type = #{record.codeType,jdbcType=VARCHAR}"); + } + + if (record.getCodeValue() != null) { + sql.SET("code_value = #{record.codeValue,jdbcType=VARCHAR}"); + } + + if (record.getCodeName() != null) { + sql.SET("code_name = #{record.codeName,jdbcType=VARCHAR}"); + } + + if (record.getCodeDesc() != null) { + sql.SET("code_desc = #{record.codeDesc,jdbcType=VARCHAR}"); + } + + if (record.getSortId() != null) { + sql.SET("sort_id = #{record.sortId,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + 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("sec_dictionary"); + + sql.SET("code_type = #{record.codeType,jdbcType=VARCHAR}"); + sql.SET("code_value = #{record.codeValue,jdbcType=VARCHAR}"); + sql.SET("code_name = #{record.codeName,jdbcType=VARCHAR}"); + sql.SET("code_desc = #{record.codeDesc,jdbcType=VARCHAR}"); + sql.SET("sort_id = #{record.sortId,jdbcType=INTEGER}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("ext_1 = #{record.ext1,jdbcType=VARCHAR}"); + sql.SET("ext_2 = #{record.ext2,jdbcType=VARCHAR}"); + sql.SET("ext_3 = #{record.ext3,jdbcType=VARCHAR}"); + + SecDictionaryExample example = (SecDictionaryExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecDictionary record) { + SQL sql = new SQL(); + sql.UPDATE("sec_dictionary"); + + if (record.getCodeName() != null) { + sql.SET("code_name = #{codeName,jdbcType=VARCHAR}"); + } + + if (record.getCodeDesc() != null) { + sql.SET("code_desc = #{codeDesc,jdbcType=VARCHAR}"); + } + + if (record.getSortId() != null) { + sql.SET("sort_id = #{sortId,jdbcType=INTEGER}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + 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("code_type = #{codeType,jdbcType=VARCHAR}"); + sql.WHERE("code_value = #{codeValue,jdbcType=VARCHAR}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecDictionaryExample 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()); + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/SecMenuMapper.java b/service/src/main/java/com/hfkj/dao/SecMenuMapper.java new file mode 100644 index 0000000..54b97e7 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecMenuMapper.java @@ -0,0 +1,119 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecMenu; +import com.hfkj.entity.SecMenuExample; +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 SecMenuMapper extends SecMenuMapperExt { + @SelectProvider(type=SecMenuSqlProvider.class, method="countByExample") + long countByExample(SecMenuExample example); + + @DeleteProvider(type=SecMenuSqlProvider.class, method="deleteByExample") + int deleteByExample(SecMenuExample example); + + @Delete({ + "delete from sec_menu", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_menu (menu_name, menu_type, ", + "menu_url, menu_url_img, ", + "menu_p_sid, menu_sort, ", + "menu_desc, create_time, ", + "update_time)", + "values (#{menuName,jdbcType=VARCHAR}, #{menuType,jdbcType=INTEGER}, ", + "#{menuUrl,jdbcType=VARCHAR}, #{menuUrlImg,jdbcType=VARCHAR}, ", + "#{menuPSid,jdbcType=BIGINT}, #{menuSort,jdbcType=INTEGER}, ", + "#{menuDesc,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecMenu record); + + @InsertProvider(type=SecMenuSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecMenu record); + + @SelectProvider(type=SecMenuSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="menu_name", property="menuName", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_type", property="menuType", jdbcType=JdbcType.INTEGER), + @Result(column="menu_url", property="menuUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_url_img", property="menuUrlImg", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_p_sid", property="menuPSid", jdbcType=JdbcType.BIGINT), + @Result(column="menu_sort", property="menuSort", jdbcType=JdbcType.INTEGER), + @Result(column="menu_desc", property="menuDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP) + }) + List selectByExample(SecMenuExample example); + + @Select({ + "select", + "id, menu_name, menu_type, menu_url, menu_url_img, menu_p_sid, menu_sort, menu_desc, ", + "create_time, update_time", + "from sec_menu", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="menu_name", property="menuName", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_type", property="menuType", jdbcType=JdbcType.INTEGER), + @Result(column="menu_url", property="menuUrl", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_url_img", property="menuUrlImg", jdbcType=JdbcType.VARCHAR), + @Result(column="menu_p_sid", property="menuPSid", jdbcType=JdbcType.BIGINT), + @Result(column="menu_sort", property="menuSort", jdbcType=JdbcType.INTEGER), + @Result(column="menu_desc", property="menuDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP) + }) + SecMenu selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecMenuSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecMenu record, @Param("example") SecMenuExample example); + + @UpdateProvider(type=SecMenuSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecMenu record, @Param("example") SecMenuExample example); + + @UpdateProvider(type=SecMenuSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecMenu record); + + @Update({ + "update sec_menu", + "set menu_name = #{menuName,jdbcType=VARCHAR},", + "menu_type = #{menuType,jdbcType=INTEGER},", + "menu_url = #{menuUrl,jdbcType=VARCHAR},", + "menu_url_img = #{menuUrlImg,jdbcType=VARCHAR},", + "menu_p_sid = #{menuPSid,jdbcType=BIGINT},", + "menu_sort = #{menuSort,jdbcType=INTEGER},", + "menu_desc = #{menuDesc,jdbcType=VARCHAR},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecMenu record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecMenuMapperExt.java b/service/src/main/java/com/hfkj/dao/SecMenuMapperExt.java new file mode 100644 index 0000000..64d04c2 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecMenuMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecMenuMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java new file mode 100644 index 0000000..568144f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecMenuSqlProvider.java @@ -0,0 +1,304 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecMenu; +import com.hfkj.entity.SecMenuExample.Criteria; +import com.hfkj.entity.SecMenuExample.Criterion; +import com.hfkj.entity.SecMenuExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecMenuSqlProvider { + + public String countByExample(SecMenuExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_menu"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecMenuExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_menu"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecMenu record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_menu"); + + if (record.getMenuName() != null) { + sql.VALUES("menu_name", "#{menuName,jdbcType=VARCHAR}"); + } + + if (record.getMenuType() != null) { + sql.VALUES("menu_type", "#{menuType,jdbcType=INTEGER}"); + } + + if (record.getMenuUrl() != null) { + sql.VALUES("menu_url", "#{menuUrl,jdbcType=VARCHAR}"); + } + + if (record.getMenuUrlImg() != null) { + sql.VALUES("menu_url_img", "#{menuUrlImg,jdbcType=VARCHAR}"); + } + + if (record.getMenuPSid() != null) { + sql.VALUES("menu_p_sid", "#{menuPSid,jdbcType=BIGINT}"); + } + + if (record.getMenuSort() != null) { + sql.VALUES("menu_sort", "#{menuSort,jdbcType=INTEGER}"); + } + + if (record.getMenuDesc() != null) { + sql.VALUES("menu_desc", "#{menuDesc,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}"); + } + + return sql.toString(); + } + + public String selectByExample(SecMenuExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("menu_name"); + sql.SELECT("menu_type"); + sql.SELECT("menu_url"); + sql.SELECT("menu_url_img"); + sql.SELECT("menu_p_sid"); + sql.SELECT("menu_sort"); + sql.SELECT("menu_desc"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.FROM("sec_menu"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecMenu record = (SecMenu) parameter.get("record"); + SecMenuExample example = (SecMenuExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_menu"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getMenuName() != null) { + sql.SET("menu_name = #{record.menuName,jdbcType=VARCHAR}"); + } + + if (record.getMenuType() != null) { + sql.SET("menu_type = #{record.menuType,jdbcType=INTEGER}"); + } + + if (record.getMenuUrl() != null) { + sql.SET("menu_url = #{record.menuUrl,jdbcType=VARCHAR}"); + } + + if (record.getMenuUrlImg() != null) { + sql.SET("menu_url_img = #{record.menuUrlImg,jdbcType=VARCHAR}"); + } + + if (record.getMenuPSid() != null) { + sql.SET("menu_p_sid = #{record.menuPSid,jdbcType=BIGINT}"); + } + + if (record.getMenuSort() != null) { + sql.SET("menu_sort = #{record.menuSort,jdbcType=INTEGER}"); + } + + if (record.getMenuDesc() != null) { + sql.SET("menu_desc = #{record.menuDesc,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_menu"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("menu_name = #{record.menuName,jdbcType=VARCHAR}"); + sql.SET("menu_type = #{record.menuType,jdbcType=INTEGER}"); + sql.SET("menu_url = #{record.menuUrl,jdbcType=VARCHAR}"); + sql.SET("menu_url_img = #{record.menuUrlImg,jdbcType=VARCHAR}"); + sql.SET("menu_p_sid = #{record.menuPSid,jdbcType=BIGINT}"); + sql.SET("menu_sort = #{record.menuSort,jdbcType=INTEGER}"); + sql.SET("menu_desc = #{record.menuDesc,jdbcType=VARCHAR}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + + SecMenuExample example = (SecMenuExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecMenu record) { + SQL sql = new SQL(); + sql.UPDATE("sec_menu"); + + if (record.getMenuName() != null) { + sql.SET("menu_name = #{menuName,jdbcType=VARCHAR}"); + } + + if (record.getMenuType() != null) { + sql.SET("menu_type = #{menuType,jdbcType=INTEGER}"); + } + + if (record.getMenuUrl() != null) { + sql.SET("menu_url = #{menuUrl,jdbcType=VARCHAR}"); + } + + if (record.getMenuUrlImg() != null) { + sql.SET("menu_url_img = #{menuUrlImg,jdbcType=VARCHAR}"); + } + + if (record.getMenuPSid() != null) { + sql.SET("menu_p_sid = #{menuPSid,jdbcType=BIGINT}"); + } + + if (record.getMenuSort() != null) { + sql.SET("menu_sort = #{menuSort,jdbcType=INTEGER}"); + } + + if (record.getMenuDesc() != null) { + sql.SET("menu_desc = #{menuDesc,jdbcType=VARCHAR}"); + } + + if (record.getCreateTime() != null) { + sql.SET("create_time = #{createTime,jdbcType=TIMESTAMP}"); + } + + if (record.getUpdateTime() != null) { + sql.SET("update_time = #{updateTime,jdbcType=TIMESTAMP}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecMenuExample 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/SecOperationLogMapper.java b/service/src/main/java/com/hfkj/dao/SecOperationLogMapper.java new file mode 100644 index 0000000..7659670 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecOperationLogMapper.java @@ -0,0 +1,110 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecOperationLog; +import com.hfkj.entity.SecOperationLogExample; +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 SecOperationLogMapper extends SecOperationLogMapperExt { + @SelectProvider(type=SecOperationLogSqlProvider.class, method="countByExample") + long countByExample(SecOperationLogExample example); + + @DeleteProvider(type=SecOperationLogSqlProvider.class, method="deleteByExample") + int deleteByExample(SecOperationLogExample example); + + @Delete({ + "delete from sec_operation_log", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_operation_log (ip, `module`, ", + "description, content, ", + "operation_time, operation_id, ", + "operation_name)", + "values (#{ip,jdbcType=VARCHAR}, #{module,jdbcType=VARCHAR}, ", + "#{description,jdbcType=VARCHAR}, #{content,jdbcType=VARCHAR}, ", + "#{operationTime,jdbcType=TIMESTAMP}, #{operationId,jdbcType=BIGINT}, ", + "#{operationName,jdbcType=VARCHAR})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecOperationLog record); + + @InsertProvider(type=SecOperationLogSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecOperationLog record); + + @SelectProvider(type=SecOperationLogSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), + @Result(column="module", property="module", jdbcType=JdbcType.VARCHAR), + @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR), + @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), + @Result(column="operation_time", property="operationTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="operation_id", property="operationId", jdbcType=JdbcType.BIGINT), + @Result(column="operation_name", property="operationName", jdbcType=JdbcType.VARCHAR) + }) + List selectByExample(SecOperationLogExample example); + + @Select({ + "select", + "id, ip, `module`, description, content, operation_time, operation_id, operation_name", + "from sec_operation_log", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="ip", property="ip", jdbcType=JdbcType.VARCHAR), + @Result(column="module", property="module", jdbcType=JdbcType.VARCHAR), + @Result(column="description", property="description", jdbcType=JdbcType.VARCHAR), + @Result(column="content", property="content", jdbcType=JdbcType.VARCHAR), + @Result(column="operation_time", property="operationTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="operation_id", property="operationId", jdbcType=JdbcType.BIGINT), + @Result(column="operation_name", property="operationName", jdbcType=JdbcType.VARCHAR) + }) + SecOperationLog selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecOperationLogSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecOperationLog record, @Param("example") SecOperationLogExample example); + + @UpdateProvider(type=SecOperationLogSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecOperationLog record, @Param("example") SecOperationLogExample example); + + @UpdateProvider(type=SecOperationLogSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecOperationLog record); + + @Update({ + "update sec_operation_log", + "set ip = #{ip,jdbcType=VARCHAR},", + "`module` = #{module,jdbcType=VARCHAR},", + "description = #{description,jdbcType=VARCHAR},", + "content = #{content,jdbcType=VARCHAR},", + "operation_time = #{operationTime,jdbcType=TIMESTAMP},", + "operation_id = #{operationId,jdbcType=BIGINT},", + "operation_name = #{operationName,jdbcType=VARCHAR}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecOperationLog record); +} diff --git a/service/src/main/java/com/hfkj/dao/SecOperationLogMapperExt.java b/service/src/main/java/com/hfkj/dao/SecOperationLogMapperExt.java new file mode 100644 index 0000000..5fa05e5 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecOperationLogMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecOperationLogMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecOperationLogSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecOperationLogSqlProvider.java new file mode 100644 index 0000000..d820dae --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecOperationLogSqlProvider.java @@ -0,0 +1,276 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecOperationLog; +import com.hfkj.entity.SecOperationLogExample.Criteria; +import com.hfkj.entity.SecOperationLogExample.Criterion; +import com.hfkj.entity.SecOperationLogExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecOperationLogSqlProvider { + + public String countByExample(SecOperationLogExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_operation_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecOperationLogExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_operation_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecOperationLog record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_operation_log"); + + if (record.getIp() != null) { + sql.VALUES("ip", "#{ip,jdbcType=VARCHAR}"); + } + + if (record.getModule() != null) { + sql.VALUES("`module`", "#{module,jdbcType=VARCHAR}"); + } + + if (record.getDescription() != null) { + sql.VALUES("description", "#{description,jdbcType=VARCHAR}"); + } + + if (record.getContent() != null) { + sql.VALUES("content", "#{content,jdbcType=VARCHAR}"); + } + + if (record.getOperationTime() != null) { + sql.VALUES("operation_time", "#{operationTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOperationId() != null) { + sql.VALUES("operation_id", "#{operationId,jdbcType=BIGINT}"); + } + + if (record.getOperationName() != null) { + sql.VALUES("operation_name", "#{operationName,jdbcType=VARCHAR}"); + } + + return sql.toString(); + } + + public String selectByExample(SecOperationLogExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("ip"); + sql.SELECT("`module`"); + sql.SELECT("description"); + sql.SELECT("content"); + sql.SELECT("operation_time"); + sql.SELECT("operation_id"); + sql.SELECT("operation_name"); + sql.FROM("sec_operation_log"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecOperationLog record = (SecOperationLog) parameter.get("record"); + SecOperationLogExample example = (SecOperationLogExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_operation_log"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getIp() != null) { + sql.SET("ip = #{record.ip,jdbcType=VARCHAR}"); + } + + if (record.getModule() != null) { + sql.SET("`module` = #{record.module,jdbcType=VARCHAR}"); + } + + if (record.getDescription() != null) { + sql.SET("description = #{record.description,jdbcType=VARCHAR}"); + } + + if (record.getContent() != null) { + sql.SET("content = #{record.content,jdbcType=VARCHAR}"); + } + + if (record.getOperationTime() != null) { + sql.SET("operation_time = #{record.operationTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOperationId() != null) { + sql.SET("operation_id = #{record.operationId,jdbcType=BIGINT}"); + } + + if (record.getOperationName() != null) { + sql.SET("operation_name = #{record.operationName,jdbcType=VARCHAR}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_operation_log"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("ip = #{record.ip,jdbcType=VARCHAR}"); + sql.SET("`module` = #{record.module,jdbcType=VARCHAR}"); + sql.SET("description = #{record.description,jdbcType=VARCHAR}"); + sql.SET("content = #{record.content,jdbcType=VARCHAR}"); + sql.SET("operation_time = #{record.operationTime,jdbcType=TIMESTAMP}"); + sql.SET("operation_id = #{record.operationId,jdbcType=BIGINT}"); + sql.SET("operation_name = #{record.operationName,jdbcType=VARCHAR}"); + + SecOperationLogExample example = (SecOperationLogExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecOperationLog record) { + SQL sql = new SQL(); + sql.UPDATE("sec_operation_log"); + + if (record.getIp() != null) { + sql.SET("ip = #{ip,jdbcType=VARCHAR}"); + } + + if (record.getModule() != null) { + sql.SET("`module` = #{module,jdbcType=VARCHAR}"); + } + + if (record.getDescription() != null) { + sql.SET("description = #{description,jdbcType=VARCHAR}"); + } + + if (record.getContent() != null) { + sql.SET("content = #{content,jdbcType=VARCHAR}"); + } + + if (record.getOperationTime() != null) { + sql.SET("operation_time = #{operationTime,jdbcType=TIMESTAMP}"); + } + + if (record.getOperationId() != null) { + sql.SET("operation_id = #{operationId,jdbcType=BIGINT}"); + } + + if (record.getOperationName() != null) { + sql.SET("operation_name = #{operationName,jdbcType=VARCHAR}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecOperationLogExample 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()); + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/SecPermissionMapper.java b/service/src/main/java/com/hfkj/dao/SecPermissionMapper.java new file mode 100644 index 0000000..a1cc94b --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecPermissionMapper.java @@ -0,0 +1,92 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecPermission; +import com.hfkj.entity.SecPermissionExample; +import org.apache.ibatis.annotations.*; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface SecPermissionMapper extends SecPermissionMapperExt { + @SelectProvider(type=SecPermissionSqlProvider.class, method="countByExample") + long countByExample(SecPermissionExample example); + + @DeleteProvider(type=SecPermissionSqlProvider.class, method="deleteByExample") + int deleteByExample(SecPermissionExample example); + + @Delete({ + "delete from sec_permission", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_permission (permission_name, permission_code, ", + "permission_desc, sort, ", + "menu_id)", + "values (#{permissionName,jdbcType=VARCHAR}, #{permissionCode,jdbcType=VARCHAR}, ", + "#{permissionDesc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, ", + "#{menuId,jdbcType=BIGINT})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecPermission record); + + @InsertProvider(type=SecPermissionSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecPermission record); + + @SelectProvider(type=SecPermissionSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="permission_name", property="permissionName", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_code", property="permissionCode", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_desc", property="permissionDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT) + }) + List selectByExample(SecPermissionExample example); + + @Select({ + "select", + "id, permission_name, permission_code, permission_desc, sort, menu_id", + "from sec_permission", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="permission_name", property="permissionName", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_code", property="permissionCode", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_desc", property="permissionDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT) + }) + SecPermission selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecPermissionSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecPermission record, @Param("example") SecPermissionExample example); + + @UpdateProvider(type=SecPermissionSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecPermission record, @Param("example") SecPermissionExample example); + + @UpdateProvider(type=SecPermissionSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecPermission record); + + @Update({ + "update sec_permission", + "set permission_name = #{permissionName,jdbcType=VARCHAR},", + "permission_code = #{permissionCode,jdbcType=VARCHAR},", + "permission_desc = #{permissionDesc,jdbcType=VARCHAR},", + "sort = #{sort,jdbcType=INTEGER},", + "menu_id = #{menuId,jdbcType=BIGINT}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecPermission record); +} diff --git a/service/src/main/java/com/hfkj/dao/SecPermissionMapperExt.java b/service/src/main/java/com/hfkj/dao/SecPermissionMapperExt.java new file mode 100644 index 0000000..44918dd --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecPermissionMapperExt.java @@ -0,0 +1,39 @@ +package com.hfkj.dao; + +import org.apache.ibatis.annotations.Delete; +import org.apache.ibatis.annotations.Param; + +import java.util.Map; + +/** + * mapper扩展类 + */ +public interface SecPermissionMapperExt { + @Delete({""}) + void deleteTemplatePermission(@Param("map") Map map); +} diff --git a/service/src/main/java/com/hfkj/dao/SecPermissionSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecPermissionSqlProvider.java new file mode 100644 index 0000000..7ad5ecd --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecPermissionSqlProvider.java @@ -0,0 +1,249 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecPermission; +import com.hfkj.entity.SecPermissionExample; +import com.hfkj.entity.SecPermissionExample.Criteria; +import com.hfkj.entity.SecPermissionExample.Criterion; +import org.apache.ibatis.jdbc.SQL; + +import java.util.List; +import java.util.Map; + +public class SecPermissionSqlProvider { + + public String countByExample(SecPermissionExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_permission"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecPermissionExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_permission"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecPermission record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_permission"); + + if (record.getPermissionName() != null) { + sql.VALUES("permission_name", "#{permissionName,jdbcType=VARCHAR}"); + } + + if (record.getPermissionCode() != null) { + sql.VALUES("permission_code", "#{permissionCode,jdbcType=VARCHAR}"); + } + + if (record.getPermissionDesc() != null) { + sql.VALUES("permission_desc", "#{permissionDesc,jdbcType=VARCHAR}"); + } + + if (record.getSort() != null) { + sql.VALUES("sort", "#{sort,jdbcType=INTEGER}"); + } + + if (record.getMenuId() != null) { + sql.VALUES("menu_id", "#{menuId,jdbcType=BIGINT}"); + } + + return sql.toString(); + } + + public String selectByExample(SecPermissionExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("permission_name"); + sql.SELECT("permission_code"); + sql.SELECT("permission_desc"); + sql.SELECT("sort"); + sql.SELECT("menu_id"); + sql.FROM("sec_permission"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecPermission record = (SecPermission) parameter.get("record"); + SecPermissionExample example = (SecPermissionExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_permission"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getPermissionName() != null) { + sql.SET("permission_name = #{record.permissionName,jdbcType=VARCHAR}"); + } + + if (record.getPermissionCode() != null) { + sql.SET("permission_code = #{record.permissionCode,jdbcType=VARCHAR}"); + } + + if (record.getPermissionDesc() != null) { + sql.SET("permission_desc = #{record.permissionDesc,jdbcType=VARCHAR}"); + } + + if (record.getSort() != null) { + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + } + + if (record.getMenuId() != null) { + sql.SET("menu_id = #{record.menuId,jdbcType=BIGINT}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_permission"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("permission_name = #{record.permissionName,jdbcType=VARCHAR}"); + sql.SET("permission_code = #{record.permissionCode,jdbcType=VARCHAR}"); + sql.SET("permission_desc = #{record.permissionDesc,jdbcType=VARCHAR}"); + sql.SET("sort = #{record.sort,jdbcType=INTEGER}"); + sql.SET("menu_id = #{record.menuId,jdbcType=BIGINT}"); + + SecPermissionExample example = (SecPermissionExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecPermission record) { + SQL sql = new SQL(); + sql.UPDATE("sec_permission"); + + if (record.getPermissionName() != null) { + sql.SET("permission_name = #{permissionName,jdbcType=VARCHAR}"); + } + + if (record.getPermissionCode() != null) { + sql.SET("permission_code = #{permissionCode,jdbcType=VARCHAR}"); + } + + if (record.getPermissionDesc() != null) { + sql.SET("permission_desc = #{permissionDesc,jdbcType=VARCHAR}"); + } + + if (record.getSort() != null) { + sql.SET("sort = #{sort,jdbcType=INTEGER}"); + } + + if (record.getMenuId() != null) { + sql.SET("menu_id = #{menuId,jdbcType=BIGINT}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecPermissionExample 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()); + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/SecRegionMapper.java b/service/src/main/java/com/hfkj/dao/SecRegionMapper.java new file mode 100644 index 0000000..712f299 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRegionMapper.java @@ -0,0 +1,84 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRegion; +import com.hfkj.entity.SecRegionExample; +import org.apache.ibatis.annotations.*; +import org.apache.ibatis.type.JdbcType; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * + * 代码由工具生成,请勿修改!!! + * 如果需要扩展请在其父类进行扩展 + * + **/ +@Repository +public interface SecRegionMapper extends SecRegionMapperExt { + @SelectProvider(type= SecRegionSqlProvider.class, method="countByExample") + long countByExample(SecRegionExample example); + + @DeleteProvider(type= SecRegionSqlProvider.class, method="deleteByExample") + int deleteByExample(SecRegionExample example); + + @Delete({ + "delete from sec_region", + "where region_id = #{regionId,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long regionId); + + @Insert({ + "insert into sec_region (region_name, parent_id, ", + "`status`)", + "values (#{regionName,jdbcType=VARCHAR}, #{parentId,jdbcType=BIGINT}, ", + "#{status,jdbcType=INTEGER})" + }) + @Options(useGeneratedKeys=true,keyProperty="regionId") + int insert(SecRegion record); + + @InsertProvider(type= SecRegionSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="regionId") + int insertSelective(SecRegion record); + + @SelectProvider(type= SecRegionSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER) + }) + List selectByExample(SecRegionExample example); + + @Select({ + "select", + "region_id, region_name, parent_id, `status`", + "from sec_region", + "where region_id = #{regionId,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="region_id", property="regionId", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="region_name", property="regionName", jdbcType=JdbcType.VARCHAR), + @Result(column="parent_id", property="parentId", jdbcType=JdbcType.BIGINT), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER) + }) + SecRegion selectByPrimaryKey(Long regionId); + + @UpdateProvider(type= SecRegionSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecRegion record, @Param("example") SecRegionExample example); + + @UpdateProvider(type= SecRegionSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecRegion record, @Param("example") SecRegionExample example); + + @UpdateProvider(type= SecRegionSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecRegion record); + + @Update({ + "update sec_region", + "set region_name = #{regionName,jdbcType=VARCHAR},", + "parent_id = #{parentId,jdbcType=BIGINT},", + "`status` = #{status,jdbcType=INTEGER}", + "where region_id = #{regionId,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecRegion record); +} diff --git a/service/src/main/java/com/hfkj/dao/SecRegionMapperExt.java b/service/src/main/java/com/hfkj/dao/SecRegionMapperExt.java new file mode 100644 index 0000000..6d5a8eb --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRegionMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecRegionMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecRegionSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecRegionSqlProvider.java new file mode 100644 index 0000000..2f246e6 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRegionSqlProvider.java @@ -0,0 +1,221 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRegion; +import com.hfkj.entity.SecRegionExample; +import com.hfkj.entity.SecRegionExample.Criteria; +import com.hfkj.entity.SecRegionExample.Criterion; +import org.apache.ibatis.jdbc.SQL; + +import java.util.List; +import java.util.Map; + +public class SecRegionSqlProvider { + + public String countByExample(SecRegionExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_region"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecRegionExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_region"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecRegion record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_region"); + + if (record.getRegionName() != null) { + sql.VALUES("region_name", "#{regionName,jdbcType=VARCHAR}"); + } + + if (record.getParentId() != null) { + sql.VALUES("parent_id", "#{parentId,jdbcType=BIGINT}"); + } + + if (record.getStatus() != null) { + sql.VALUES("`status`", "#{status,jdbcType=INTEGER}"); + } + + return sql.toString(); + } + + public String selectByExample(SecRegionExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("region_id"); + } else { + sql.SELECT("region_id"); + } + sql.SELECT("region_name"); + sql.SELECT("parent_id"); + sql.SELECT("`status`"); + sql.FROM("sec_region"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecRegion record = (SecRegion) parameter.get("record"); + SecRegionExample example = (SecRegionExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_region"); + + if (record.getRegionId() != null) { + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + } + + if (record.getRegionName() != null) { + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + } + + if (record.getParentId() != null) { + sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_region"); + + sql.SET("region_id = #{record.regionId,jdbcType=BIGINT}"); + sql.SET("region_name = #{record.regionName,jdbcType=VARCHAR}"); + sql.SET("parent_id = #{record.parentId,jdbcType=BIGINT}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + + SecRegionExample example = (SecRegionExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecRegion record) { + SQL sql = new SQL(); + sql.UPDATE("sec_region"); + + if (record.getRegionName() != null) { + sql.SET("region_name = #{regionName,jdbcType=VARCHAR}"); + } + + if (record.getParentId() != null) { + sql.SET("parent_id = #{parentId,jdbcType=BIGINT}"); + } + + if (record.getStatus() != null) { + sql.SET("`status` = #{status,jdbcType=INTEGER}"); + } + + sql.WHERE("region_id = #{regionId,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecRegionExample 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()); + } + } +} diff --git a/service/src/main/java/com/hfkj/dao/SecRoleMapper.java b/service/src/main/java/com/hfkj/dao/SecRoleMapper.java new file mode 100644 index 0000000..d78aed1 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleMapper.java @@ -0,0 +1,102 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecRoleExample; +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 SecRoleMapper extends SecRoleMapperExt { + @SelectProvider(type=SecRoleSqlProvider.class, method="countByExample") + long countByExample(SecRoleExample example); + + @DeleteProvider(type=SecRoleSqlProvider.class, method="deleteByExample") + int deleteByExample(SecRoleExample example); + + @Delete({ + "delete from sec_role", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_role (role_name, role_desc, ", + "`status`, create_time, ", + "update_time)", + "values (#{roleName,jdbcType=VARCHAR}, #{roleDesc,jdbcType=VARCHAR}, ", + "#{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, ", + "#{updateTime,jdbcType=TIMESTAMP})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecRole record); + + @InsertProvider(type=SecRoleSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecRole record); + + @SelectProvider(type=SecRoleSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="role_name", property="roleName", jdbcType=JdbcType.VARCHAR), + @Result(column="role_desc", property="roleDesc", jdbcType=JdbcType.VARCHAR), + @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) + }) + List selectByExample(SecRoleExample example); + + @Select({ + "select", + "id, role_name, role_desc, `status`, create_time, update_time", + "from sec_role", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="role_name", property="roleName", jdbcType=JdbcType.VARCHAR), + @Result(column="role_desc", property="roleDesc", jdbcType=JdbcType.VARCHAR), + @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) + }) + SecRole selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecRoleSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecRole record, @Param("example") SecRoleExample example); + + @UpdateProvider(type=SecRoleSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecRole record, @Param("example") SecRoleExample example); + + @UpdateProvider(type=SecRoleSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecRole record); + + @Update({ + "update sec_role", + "set role_name = #{roleName,jdbcType=VARCHAR},", + "role_desc = #{roleDesc,jdbcType=VARCHAR},", + "`status` = #{status,jdbcType=INTEGER},", + "create_time = #{createTime,jdbcType=TIMESTAMP},", + "update_time = #{updateTime,jdbcType=TIMESTAMP}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecRole record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecRoleMapperExt.java b/service/src/main/java/com/hfkj/dao/SecRoleMapperExt.java new file mode 100644 index 0000000..effa965 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecRoleMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapper.java b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapper.java new file mode 100644 index 0000000..2de7218 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapper.java @@ -0,0 +1,89 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRoleMenuRel; +import com.hfkj.entity.SecRoleMenuRelExample; +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 SecRoleMenuRelMapper extends SecRoleMenuRelMapperExt { + @SelectProvider(type=SecRoleMenuRelSqlProvider.class, method="countByExample") + long countByExample(SecRoleMenuRelExample example); + + @DeleteProvider(type=SecRoleMenuRelSqlProvider.class, method="deleteByExample") + int deleteByExample(SecRoleMenuRelExample example); + + @Delete({ + "delete from sec_role_menu_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_role_menu_rel (role_id, menu_id)", + "values (#{roleId,jdbcType=BIGINT}, #{menuId,jdbcType=BIGINT})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecRoleMenuRel record); + + @InsertProvider(type=SecRoleMenuRelSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecRoleMenuRel record); + + @SelectProvider(type=SecRoleMenuRelSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), + @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT) + }) + List selectByExample(SecRoleMenuRelExample example); + + @Select({ + "select", + "id, role_id, menu_id", + "from sec_role_menu_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), + @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT) + }) + SecRoleMenuRel selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecRoleMenuRelSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecRoleMenuRel record, @Param("example") SecRoleMenuRelExample example); + + @UpdateProvider(type=SecRoleMenuRelSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecRoleMenuRel record, @Param("example") SecRoleMenuRelExample example); + + @UpdateProvider(type=SecRoleMenuRelSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecRoleMenuRel record); + + @Update({ + "update sec_role_menu_rel", + "set role_id = #{roleId,jdbcType=BIGINT},", + "menu_id = #{menuId,jdbcType=BIGINT}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecRoleMenuRel record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapperExt.java b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapperExt.java new file mode 100644 index 0000000..3011544 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelMapperExt.java @@ -0,0 +1,23 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRoleMenuRel; +import org.apache.ibatis.annotations.Insert; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * mapper扩展类 + */ +public interface SecRoleMenuRelMapperExt { + + @Insert({""}) + void batchAdd(@Param("list") List list); + +} diff --git a/service/src/main/java/com/hfkj/dao/SecRoleMenuRelSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelSqlProvider.java new file mode 100644 index 0000000..cba0a33 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleMenuRelSqlProvider.java @@ -0,0 +1,206 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRoleMenuRel; +import com.hfkj.entity.SecRoleMenuRelExample.Criteria; +import com.hfkj.entity.SecRoleMenuRelExample.Criterion; +import com.hfkj.entity.SecRoleMenuRelExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecRoleMenuRelSqlProvider { + + public String countByExample(SecRoleMenuRelExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_role_menu_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecRoleMenuRelExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_role_menu_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecRoleMenuRel record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_role_menu_rel"); + + if (record.getRoleId() != null) { + sql.VALUES("role_id", "#{roleId,jdbcType=BIGINT}"); + } + + if (record.getMenuId() != null) { + sql.VALUES("menu_id", "#{menuId,jdbcType=BIGINT}"); + } + + return sql.toString(); + } + + public String selectByExample(SecRoleMenuRelExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("role_id"); + sql.SELECT("menu_id"); + sql.FROM("sec_role_menu_rel"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecRoleMenuRel record = (SecRoleMenuRel) parameter.get("record"); + SecRoleMenuRelExample example = (SecRoleMenuRelExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_role_menu_rel"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + } + + if (record.getMenuId() != null) { + sql.SET("menu_id = #{record.menuId,jdbcType=BIGINT}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_role_menu_rel"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + sql.SET("menu_id = #{record.menuId,jdbcType=BIGINT}"); + + SecRoleMenuRelExample example = (SecRoleMenuRelExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecRoleMenuRel record) { + SQL sql = new SQL(); + sql.UPDATE("sec_role_menu_rel"); + + if (record.getRoleId() != null) { + sql.SET("role_id = #{roleId,jdbcType=BIGINT}"); + } + + if (record.getMenuId() != null) { + sql.SET("menu_id = #{menuId,jdbcType=BIGINT}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecRoleMenuRelExample 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/SecRolePermissionRelMapper.java b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelMapper.java new file mode 100644 index 0000000..38f7040 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelMapper.java @@ -0,0 +1,89 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRolePermissionRel; +import com.hfkj.entity.SecRolePermissionRelExample; +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 SecRolePermissionRelMapper extends SecRolePermissionRelMapperExt { + @SelectProvider(type=SecRolePermissionRelSqlProvider.class, method="countByExample") + long countByExample(SecRolePermissionRelExample example); + + @DeleteProvider(type=SecRolePermissionRelSqlProvider.class, method="deleteByExample") + int deleteByExample(SecRolePermissionRelExample example); + + @Delete({ + "delete from sec_role_permission_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_role_permission_rel (permission_id, role_id)", + "values (#{permissionId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecRolePermissionRel record); + + @InsertProvider(type=SecRolePermissionRelSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecRolePermissionRel record); + + @SelectProvider(type=SecRolePermissionRelSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="permission_id", property="permissionId", jdbcType=JdbcType.BIGINT), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT) + }) + List selectByExample(SecRolePermissionRelExample example); + + @Select({ + "select", + "id, permission_id, role_id", + "from sec_role_permission_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="permission_id", property="permissionId", jdbcType=JdbcType.BIGINT), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT) + }) + SecRolePermissionRel selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecRolePermissionRelSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecRolePermissionRel record, @Param("example") SecRolePermissionRelExample example); + + @UpdateProvider(type=SecRolePermissionRelSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecRolePermissionRel record, @Param("example") SecRolePermissionRelExample example); + + @UpdateProvider(type=SecRolePermissionRelSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecRolePermissionRel record); + + @Update({ + "update sec_role_permission_rel", + "set permission_id = #{permissionId,jdbcType=BIGINT},", + "role_id = #{roleId,jdbcType=BIGINT}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecRolePermissionRel record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecRolePermissionRelMapperExt.java b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelMapperExt.java new file mode 100644 index 0000000..32c2d5f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelMapperExt.java @@ -0,0 +1,33 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecPermission; +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.type.JdbcType; + +import java.util.List; + +/** + * mapper扩展类 + */ +public interface SecRolePermissionRelMapperExt { + + + @Select({""}) + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="permission_name", property="permissionName", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_code", property="permissionCode", jdbcType=JdbcType.VARCHAR), + @Result(column="permission_desc", property="permissionDesc", jdbcType=JdbcType.VARCHAR), + @Result(column="sort", property="sort", jdbcType=JdbcType.INTEGER), + @Result(column="menu_id", property="menuId", jdbcType=JdbcType.BIGINT) + }) + List getPermissionListByUserId(@Param("userId") Long userId); +} diff --git a/service/src/main/java/com/hfkj/dao/SecRolePermissionRelSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelSqlProvider.java new file mode 100644 index 0000000..5222e04 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRolePermissionRelSqlProvider.java @@ -0,0 +1,206 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRolePermissionRel; +import com.hfkj.entity.SecRolePermissionRelExample.Criteria; +import com.hfkj.entity.SecRolePermissionRelExample.Criterion; +import com.hfkj.entity.SecRolePermissionRelExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecRolePermissionRelSqlProvider { + + public String countByExample(SecRolePermissionRelExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_role_permission_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecRolePermissionRelExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_role_permission_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecRolePermissionRel record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_role_permission_rel"); + + if (record.getPermissionId() != null) { + sql.VALUES("permission_id", "#{permissionId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.VALUES("role_id", "#{roleId,jdbcType=BIGINT}"); + } + + return sql.toString(); + } + + public String selectByExample(SecRolePermissionRelExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("permission_id"); + sql.SELECT("role_id"); + sql.FROM("sec_role_permission_rel"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecRolePermissionRel record = (SecRolePermissionRel) parameter.get("record"); + SecRolePermissionRelExample example = (SecRolePermissionRelExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_role_permission_rel"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getPermissionId() != null) { + sql.SET("permission_id = #{record.permissionId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_role_permission_rel"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("permission_id = #{record.permissionId,jdbcType=BIGINT}"); + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + + SecRolePermissionRelExample example = (SecRolePermissionRelExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecRolePermissionRel record) { + SQL sql = new SQL(); + sql.UPDATE("sec_role_permission_rel"); + + if (record.getPermissionId() != null) { + sql.SET("permission_id = #{permissionId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{roleId,jdbcType=BIGINT}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecRolePermissionRelExample 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/SecRoleSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecRoleSqlProvider.java new file mode 100644 index 0000000..26bf9c6 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecRoleSqlProvider.java @@ -0,0 +1,248 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecRoleExample.Criteria; +import com.hfkj.entity.SecRoleExample.Criterion; +import com.hfkj.entity.SecRoleExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecRoleSqlProvider { + + public String countByExample(SecRoleExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_role"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecRoleExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_role"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecRole record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_role"); + + if (record.getRoleName() != null) { + sql.VALUES("role_name", "#{roleName,jdbcType=VARCHAR}"); + } + + if (record.getRoleDesc() != null) { + sql.VALUES("role_desc", "#{roleDesc,jdbcType=VARCHAR}"); + } + + 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}"); + } + + return sql.toString(); + } + + public String selectByExample(SecRoleExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("role_name"); + sql.SELECT("role_desc"); + sql.SELECT("`status`"); + sql.SELECT("create_time"); + sql.SELECT("update_time"); + sql.FROM("sec_role"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecRole record = (SecRole) parameter.get("record"); + SecRoleExample example = (SecRoleExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_role"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getRoleName() != null) { + sql.SET("role_name = #{record.roleName,jdbcType=VARCHAR}"); + } + + if (record.getRoleDesc() != null) { + sql.SET("role_desc = #{record.roleDesc,jdbcType=VARCHAR}"); + } + + 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}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_role"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("role_name = #{record.roleName,jdbcType=VARCHAR}"); + sql.SET("role_desc = #{record.roleDesc,jdbcType=VARCHAR}"); + sql.SET("`status` = #{record.status,jdbcType=INTEGER}"); + sql.SET("create_time = #{record.createTime,jdbcType=TIMESTAMP}"); + sql.SET("update_time = #{record.updateTime,jdbcType=TIMESTAMP}"); + + SecRoleExample example = (SecRoleExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecRole record) { + SQL sql = new SQL(); + sql.UPDATE("sec_role"); + + if (record.getRoleName() != null) { + sql.SET("role_name = #{roleName,jdbcType=VARCHAR}"); + } + + if (record.getRoleDesc() != null) { + sql.SET("role_desc = #{roleDesc,jdbcType=VARCHAR}"); + } + + 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}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecRoleExample 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/SecUserLoginLogMapper.java b/service/src/main/java/com/hfkj/dao/SecUserLoginLogMapper.java new file mode 100644 index 0000000..df64147 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserLoginLogMapper.java @@ -0,0 +1,139 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUserLoginLog; +import com.hfkj.entity.SecUserLoginLogExample; +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 SecUserLoginLogMapper extends SecUserLoginLogMapperExt { + @SelectProvider(type=SecUserLoginLogSqlProvider.class, method="countByExample") + long countByExample(SecUserLoginLogExample example); + + @DeleteProvider(type=SecUserLoginLogSqlProvider.class, method="deleteByExample") + int deleteByExample(SecUserLoginLogExample example); + + @Delete({ + "delete from sec_user_login_log", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_user_login_log (user_id, user_login_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}, #{userLoginName,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(SecUserLoginLog record); + + @InsertProvider(type=SecUserLoginLogSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecUserLoginLog record); + + @SelectProvider(type=SecUserLoginLogSqlProvider.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_login_name", property="userLoginName", 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(SecUserLoginLogExample example); + + @Select({ + "select", + "id, user_id, user_login_name, ip, country, region_id, region_name, city_id, ", + "city_name, isp, `status`, remark, create_time, ext_1, ext_2, ext_3", + "from sec_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_login_name", property="userLoginName", 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) + }) + SecUserLoginLog selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecUserLoginLogSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecUserLoginLog record, @Param("example") SecUserLoginLogExample example); + + @UpdateProvider(type=SecUserLoginLogSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecUserLoginLog record, @Param("example") SecUserLoginLogExample example); + + @UpdateProvider(type=SecUserLoginLogSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecUserLoginLog record); + + @Update({ + "update sec_user_login_log", + "set user_id = #{userId,jdbcType=BIGINT},", + "user_login_name = #{userLoginName,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(SecUserLoginLog record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecUserLoginLogMapperExt.java b/service/src/main/java/com/hfkj/dao/SecUserLoginLogMapperExt.java new file mode 100644 index 0000000..48f457c --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserLoginLogMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecUserLoginLogMapperExt { +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecUserLoginLogSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecUserLoginLogSqlProvider.java new file mode 100644 index 0000000..28ee0c6 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserLoginLogSqlProvider.java @@ -0,0 +1,388 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUserLoginLog; +import com.hfkj.entity.SecUserLoginLogExample.Criteria; +import com.hfkj.entity.SecUserLoginLogExample.Criterion; +import com.hfkj.entity.SecUserLoginLogExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecUserLoginLogSqlProvider { + + public String countByExample(SecUserLoginLogExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_user_login_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecUserLoginLogExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_user_login_log"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecUserLoginLog record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_user_login_log"); + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getUserLoginName() != null) { + sql.VALUES("user_login_name", "#{userLoginName,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(SecUserLoginLogExample 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_login_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("sec_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) { + SecUserLoginLog record = (SecUserLoginLog) parameter.get("record"); + SecUserLoginLogExample example = (SecUserLoginLogExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_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.getUserLoginName() != null) { + sql.SET("user_login_name = #{record.userLoginName,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("sec_user_login_log"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("user_login_name = #{record.userLoginName,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}"); + + SecUserLoginLogExample example = (SecUserLoginLogExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecUserLoginLog record) { + SQL sql = new SQL(); + sql.UPDATE("sec_user_login_log"); + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getUserLoginName() != null) { + sql.SET("user_login_name = #{userLoginName,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, SecUserLoginLogExample 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/SecUserMapper.java b/service/src/main/java/com/hfkj/dao/SecUserMapper.java new file mode 100644 index 0000000..0d7529f --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserMapper.java @@ -0,0 +1,138 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUser; +import com.hfkj.entity.SecUserExample; +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 SecUserMapper extends SecUserMapperExt { + @SelectProvider(type=SecUserSqlProvider.class, method="countByExample") + long countByExample(SecUserExample example); + + @DeleteProvider(type=SecUserSqlProvider.class, method="deleteByExample") + int deleteByExample(SecUserExample example); + + @Delete({ + "delete from sec_user", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_user (avatar, user_name, ", + "login_name, `password`, ", + "telephone, object_type, ", + "object_id, role_id, ", + "`status`, create_time, ", + "update_time, ext_1, ", + "ext_2, ext_3)", + "values (#{avatar,jdbcType=VARCHAR}, #{userName,jdbcType=VARCHAR}, ", + "#{loginName,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, ", + "#{telephone,jdbcType=VARCHAR}, #{objectType,jdbcType=INTEGER}, ", + "#{objectId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}, ", + "#{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(SecUser record); + + @InsertProvider(type=SecUserSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecUser record); + + @SelectProvider(type=SecUserSqlProvider.class, method="selectByExample") + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR), + @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), + @Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR), + @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), + @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), + @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), + @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(SecUserExample example); + + @Select({ + "select", + "id, avatar, user_name, login_name, `password`, telephone, object_type, object_id, ", + "role_id, `status`, create_time, update_time, ext_1, ext_2, ext_3", + "from sec_user", + "where id = #{id,jdbcType=BIGINT}" + }) + @Results({ + @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true), + @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR), + @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), + @Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR), + @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), + @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), + @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @Result(column="role_id", property="roleId", jdbcType=JdbcType.BIGINT), + @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) + }) + SecUser selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecUserSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecUser record, @Param("example") SecUserExample example); + + @UpdateProvider(type=SecUserSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecUser record, @Param("example") SecUserExample example); + + @UpdateProvider(type=SecUserSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecUser record); + + @Update({ + "update sec_user", + "set avatar = #{avatar,jdbcType=VARCHAR},", + "user_name = #{userName,jdbcType=VARCHAR},", + "login_name = #{loginName,jdbcType=VARCHAR},", + "`password` = #{password,jdbcType=VARCHAR},", + "telephone = #{telephone,jdbcType=VARCHAR},", + "object_type = #{objectType,jdbcType=INTEGER},", + "object_id = #{objectId,jdbcType=BIGINT},", + "role_id = #{roleId,jdbcType=BIGINT},", + "`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(SecUser record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecUserMapperExt.java b/service/src/main/java/com/hfkj/dao/SecUserMapperExt.java new file mode 100644 index 0000000..1166899 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserMapperExt.java @@ -0,0 +1,91 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUser; +import com.hfkj.model.SecUserModel; +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.type.JdbcType; + +import java.util.List; + +/** + * mapper扩展类 + */ +public interface SecUserMapperExt { + + + @Select({ + "" + }) + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR), + @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), + @Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR), + @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), + @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), + @Result(column="admin_flag", property="adminFlag", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="organization_id", property="organizationId", jdbcType=JdbcType.BIGINT), + @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @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="organization_name", property="organizationName", jdbcType=JdbcType.VARCHAR), + @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 findPage(@Param("companyId") Long companyId, @Param("organizationId") Long organizationId, @Param("userName") String userName, @Param("phone") String phone); + + @Select({ + "" + }) + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="avatar", property="avatar", jdbcType=JdbcType.VARCHAR), + @Result(column="user_name", property="userName", jdbcType=JdbcType.VARCHAR), + @Result(column="login_name", property="loginName", jdbcType=JdbcType.VARCHAR), + @Result(column="password", property="password", jdbcType=JdbcType.VARCHAR), + @Result(column="telephone", property="telephone", jdbcType=JdbcType.VARCHAR), + @Result(column="admin_flag", property="adminFlag", jdbcType=JdbcType.INTEGER), + @Result(column="company_id", property="companyId", jdbcType=JdbcType.BIGINT), + @Result(column="organization_id", property="organizationId", jdbcType=JdbcType.BIGINT), + @Result(column="object_type", property="objectType", jdbcType=JdbcType.INTEGER), + @Result(column="object_id", property="objectId", jdbcType=JdbcType.BIGINT), + @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="organization_name", property="organizationName", jdbcType=JdbcType.VARCHAR), + @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) + }) + SecUser login(@Param("loginName") String loginName,@Param("password") String password); +} diff --git a/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapper.java b/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapper.java new file mode 100644 index 0000000..f12e28a --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapper.java @@ -0,0 +1,89 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUserRoleRel; +import com.hfkj.entity.SecUserRoleRelExample; +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 SecUserRoleRelMapper extends SecUserRoleRelMapperExt { + @SelectProvider(type=SecUserRoleRelSqlProvider.class, method="countByExample") + long countByExample(SecUserRoleRelExample example); + + @DeleteProvider(type=SecUserRoleRelSqlProvider.class, method="deleteByExample") + int deleteByExample(SecUserRoleRelExample example); + + @Delete({ + "delete from sec_user_role_rel", + "where id = #{id,jdbcType=BIGINT}" + }) + int deleteByPrimaryKey(Long id); + + @Insert({ + "insert into sec_user_role_rel (user_id, role_id)", + "values (#{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT})" + }) + @Options(useGeneratedKeys=true,keyProperty="id") + int insert(SecUserRoleRel record); + + @InsertProvider(type=SecUserRoleRelSqlProvider.class, method="insertSelective") + @Options(useGeneratedKeys=true,keyProperty="id") + int insertSelective(SecUserRoleRel record); + + @SelectProvider(type=SecUserRoleRelSqlProvider.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="role_id", property="roleId", jdbcType=JdbcType.BIGINT) + }) + List selectByExample(SecUserRoleRelExample example); + + @Select({ + "select", + "id, user_id, role_id", + "from sec_user_role_rel", + "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="role_id", property="roleId", jdbcType=JdbcType.BIGINT) + }) + SecUserRoleRel selectByPrimaryKey(Long id); + + @UpdateProvider(type=SecUserRoleRelSqlProvider.class, method="updateByExampleSelective") + int updateByExampleSelective(@Param("record") SecUserRoleRel record, @Param("example") SecUserRoleRelExample example); + + @UpdateProvider(type=SecUserRoleRelSqlProvider.class, method="updateByExample") + int updateByExample(@Param("record") SecUserRoleRel record, @Param("example") SecUserRoleRelExample example); + + @UpdateProvider(type=SecUserRoleRelSqlProvider.class, method="updateByPrimaryKeySelective") + int updateByPrimaryKeySelective(SecUserRoleRel record); + + @Update({ + "update sec_user_role_rel", + "set user_id = #{userId,jdbcType=BIGINT},", + "role_id = #{roleId,jdbcType=BIGINT}", + "where id = #{id,jdbcType=BIGINT}" + }) + int updateByPrimaryKey(SecUserRoleRel record); +} \ No newline at end of file diff --git a/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapperExt.java b/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapperExt.java new file mode 100644 index 0000000..fc91a62 --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserRoleRelMapperExt.java @@ -0,0 +1,7 @@ +package com.hfkj.dao; + +/** + * mapper扩展类 + */ +public interface SecUserRoleRelMapperExt { +} diff --git a/service/src/main/java/com/hfkj/dao/SecUserRoleRelSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecUserRoleRelSqlProvider.java new file mode 100644 index 0000000..4318b5b --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserRoleRelSqlProvider.java @@ -0,0 +1,206 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUserRoleRel; +import com.hfkj.entity.SecUserRoleRelExample.Criteria; +import com.hfkj.entity.SecUserRoleRelExample.Criterion; +import com.hfkj.entity.SecUserRoleRelExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecUserRoleRelSqlProvider { + + public String countByExample(SecUserRoleRelExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_user_role_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecUserRoleRelExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_user_role_rel"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecUserRoleRel record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_user_role_rel"); + + if (record.getUserId() != null) { + sql.VALUES("user_id", "#{userId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.VALUES("role_id", "#{roleId,jdbcType=BIGINT}"); + } + + return sql.toString(); + } + + public String selectByExample(SecUserRoleRelExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("user_id"); + sql.SELECT("role_id"); + sql.FROM("sec_user_role_rel"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecUserRoleRel record = (SecUserRoleRel) parameter.get("record"); + SecUserRoleRelExample example = (SecUserRoleRelExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_user_role_rel"); + + 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.getRoleId() != null) { + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + } + + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByExample(Map parameter) { + SQL sql = new SQL(); + sql.UPDATE("sec_user_role_rel"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("user_id = #{record.userId,jdbcType=BIGINT}"); + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + + SecUserRoleRelExample example = (SecUserRoleRelExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecUserRoleRel record) { + SQL sql = new SQL(); + sql.UPDATE("sec_user_role_rel"); + + if (record.getUserId() != null) { + sql.SET("user_id = #{userId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{roleId,jdbcType=BIGINT}"); + } + + sql.WHERE("id = #{id,jdbcType=BIGINT}"); + + return sql.toString(); + } + + protected void applyWhere(SQL sql, SecUserRoleRelExample 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/SecUserSqlProvider.java b/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java new file mode 100644 index 0000000..0ed635d --- /dev/null +++ b/service/src/main/java/com/hfkj/dao/SecUserSqlProvider.java @@ -0,0 +1,374 @@ +package com.hfkj.dao; + +import com.hfkj.entity.SecUser; +import com.hfkj.entity.SecUserExample.Criteria; +import com.hfkj.entity.SecUserExample.Criterion; +import com.hfkj.entity.SecUserExample; +import java.util.List; +import java.util.Map; +import org.apache.ibatis.jdbc.SQL; + +public class SecUserSqlProvider { + + public String countByExample(SecUserExample example) { + SQL sql = new SQL(); + sql.SELECT("count(*)").FROM("sec_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String deleteByExample(SecUserExample example) { + SQL sql = new SQL(); + sql.DELETE_FROM("sec_user"); + applyWhere(sql, example, false); + return sql.toString(); + } + + public String insertSelective(SecUser record) { + SQL sql = new SQL(); + sql.INSERT_INTO("sec_user"); + + if (record.getAvatar() != null) { + sql.VALUES("avatar", "#{avatar,jdbcType=VARCHAR}"); + } + + if (record.getUserName() != null) { + sql.VALUES("user_name", "#{userName,jdbcType=VARCHAR}"); + } + + if (record.getLoginName() != null) { + sql.VALUES("login_name", "#{loginName,jdbcType=VARCHAR}"); + } + + if (record.getPassword() != null) { + sql.VALUES("`password`", "#{password,jdbcType=VARCHAR}"); + } + + if (record.getTelephone() != null) { + sql.VALUES("telephone", "#{telephone,jdbcType=VARCHAR}"); + } + + if (record.getObjectType() != null) { + sql.VALUES("object_type", "#{objectType,jdbcType=INTEGER}"); + } + + if (record.getObjectId() != null) { + sql.VALUES("object_id", "#{objectId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.VALUES("role_id", "#{roleId,jdbcType=BIGINT}"); + } + + 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(SecUserExample example) { + SQL sql = new SQL(); + if (example != null && example.isDistinct()) { + sql.SELECT_DISTINCT("id"); + } else { + sql.SELECT("id"); + } + sql.SELECT("avatar"); + sql.SELECT("user_name"); + sql.SELECT("login_name"); + sql.SELECT("`password`"); + sql.SELECT("telephone"); + sql.SELECT("object_type"); + sql.SELECT("object_id"); + sql.SELECT("role_id"); + 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("sec_user"); + applyWhere(sql, example, false); + + if (example != null && example.getOrderByClause() != null) { + sql.ORDER_BY(example.getOrderByClause()); + } + + return sql.toString(); + } + + public String updateByExampleSelective(Map parameter) { + SecUser record = (SecUser) parameter.get("record"); + SecUserExample example = (SecUserExample) parameter.get("example"); + + SQL sql = new SQL(); + sql.UPDATE("sec_user"); + + if (record.getId() != null) { + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + } + + if (record.getAvatar() != null) { + sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}"); + } + + if (record.getUserName() != null) { + sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); + } + + if (record.getLoginName() != null) { + sql.SET("login_name = #{record.loginName,jdbcType=VARCHAR}"); + } + + if (record.getPassword() != null) { + sql.SET("`password` = #{record.password,jdbcType=VARCHAR}"); + } + + if (record.getTelephone() != null) { + sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}"); + } + + if (record.getObjectType() != null) { + sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); + } + + if (record.getObjectId() != null) { + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + } + + 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("sec_user"); + + sql.SET("id = #{record.id,jdbcType=BIGINT}"); + sql.SET("avatar = #{record.avatar,jdbcType=VARCHAR}"); + sql.SET("user_name = #{record.userName,jdbcType=VARCHAR}"); + sql.SET("login_name = #{record.loginName,jdbcType=VARCHAR}"); + sql.SET("`password` = #{record.password,jdbcType=VARCHAR}"); + sql.SET("telephone = #{record.telephone,jdbcType=VARCHAR}"); + sql.SET("object_type = #{record.objectType,jdbcType=INTEGER}"); + sql.SET("object_id = #{record.objectId,jdbcType=BIGINT}"); + sql.SET("role_id = #{record.roleId,jdbcType=BIGINT}"); + 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}"); + + SecUserExample example = (SecUserExample) parameter.get("example"); + applyWhere(sql, example, true); + return sql.toString(); + } + + public String updateByPrimaryKeySelective(SecUser record) { + SQL sql = new SQL(); + sql.UPDATE("sec_user"); + + if (record.getAvatar() != null) { + sql.SET("avatar = #{avatar,jdbcType=VARCHAR}"); + } + + if (record.getUserName() != null) { + sql.SET("user_name = #{userName,jdbcType=VARCHAR}"); + } + + if (record.getLoginName() != null) { + sql.SET("login_name = #{loginName,jdbcType=VARCHAR}"); + } + + if (record.getPassword() != null) { + sql.SET("`password` = #{password,jdbcType=VARCHAR}"); + } + + if (record.getTelephone() != null) { + sql.SET("telephone = #{telephone,jdbcType=VARCHAR}"); + } + + if (record.getObjectType() != null) { + sql.SET("object_type = #{objectType,jdbcType=INTEGER}"); + } + + if (record.getObjectId() != null) { + sql.SET("object_id = #{objectId,jdbcType=BIGINT}"); + } + + if (record.getRoleId() != null) { + sql.SET("role_id = #{roleId,jdbcType=BIGINT}"); + } + + 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, SecUserExample 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/BsAgent.java b/service/src/main/java/com/hfkj/entity/BsAgent.java new file mode 100644 index 0000000..557a357 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsAgent.java @@ -0,0 +1,248 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_agent + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsAgent implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 公司id + */ + private Long companyId; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 代理商编号 + */ + private String agentNo; + + /** + * 代理名称 + */ + private String name; + + /** + * 代理联系人 + */ + private String contactsName; + + /** + * 代理联系方式 + */ + private String contactsTelephone; + + /** + * 状态 0:删除 1: 可用 + */ + 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 Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getAgentNo() { + return agentNo; + } + + public void setAgentNo(String agentNo) { + this.agentNo = agentNo; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getContactsName() { + return contactsName; + } + + public void setContactsName(String contactsName) { + this.contactsName = contactsName; + } + + public String getContactsTelephone() { + return contactsTelephone; + } + + public void setContactsTelephone(String contactsTelephone) { + this.contactsTelephone = contactsTelephone; + } + + 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; + } + BsAgent other = (BsAgent) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) + && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) + && (this.getAgentNo() == null ? other.getAgentNo() == null : this.getAgentNo().equals(other.getAgentNo())) + && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName())) + && (this.getContactsName() == null ? other.getContactsName() == null : this.getContactsName().equals(other.getContactsName())) + && (this.getContactsTelephone() == null ? other.getContactsTelephone() == null : this.getContactsTelephone().equals(other.getContactsTelephone())) + && (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 + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); + result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); + result = prime * result + ((getAgentNo() == null) ? 0 : getAgentNo().hashCode()); + result = prime * result + ((getName() == null) ? 0 : getName().hashCode()); + result = prime * result + ((getContactsName() == null) ? 0 : getContactsName().hashCode()); + result = prime * result + ((getContactsTelephone() == null) ? 0 : getContactsTelephone().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(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", agentNo=").append(agentNo); + sb.append(", name=").append(name); + sb.append(", contactsName=").append(contactsName); + sb.append(", contactsTelephone=").append(contactsTelephone); + 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/BsAgentExample.java b/service/src/main/java/com/hfkj/entity/BsAgentExample.java new file mode 100644 index 0000000..8d41a13 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsAgentExample.java @@ -0,0 +1,1083 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsAgentExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsAgentExample() { + 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 andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andAgentNoIsNull() { + addCriterion("agent_no is null"); + return (Criteria) this; + } + + public Criteria andAgentNoIsNotNull() { + addCriterion("agent_no is not null"); + return (Criteria) this; + } + + public Criteria andAgentNoEqualTo(String value) { + addCriterion("agent_no =", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoNotEqualTo(String value) { + addCriterion("agent_no <>", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoGreaterThan(String value) { + addCriterion("agent_no >", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoGreaterThanOrEqualTo(String value) { + addCriterion("agent_no >=", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoLessThan(String value) { + addCriterion("agent_no <", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoLessThanOrEqualTo(String value) { + addCriterion("agent_no <=", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoLike(String value) { + addCriterion("agent_no like", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoNotLike(String value) { + addCriterion("agent_no not like", value, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoIn(List values) { + addCriterion("agent_no in", values, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoNotIn(List values) { + addCriterion("agent_no not in", values, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoBetween(String value1, String value2) { + addCriterion("agent_no between", value1, value2, "agentNo"); + return (Criteria) this; + } + + public Criteria andAgentNoNotBetween(String value1, String value2) { + addCriterion("agent_no not between", value1, value2, "agentNo"); + 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 andContactsNameIsNull() { + addCriterion("contacts_name is null"); + return (Criteria) this; + } + + public Criteria andContactsNameIsNotNull() { + addCriterion("contacts_name is not null"); + return (Criteria) this; + } + + public Criteria andContactsNameEqualTo(String value) { + addCriterion("contacts_name =", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotEqualTo(String value) { + addCriterion("contacts_name <>", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameGreaterThan(String value) { + addCriterion("contacts_name >", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameGreaterThanOrEqualTo(String value) { + addCriterion("contacts_name >=", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLessThan(String value) { + addCriterion("contacts_name <", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLessThanOrEqualTo(String value) { + addCriterion("contacts_name <=", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLike(String value) { + addCriterion("contacts_name like", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotLike(String value) { + addCriterion("contacts_name not like", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameIn(List values) { + addCriterion("contacts_name in", values, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotIn(List values) { + addCriterion("contacts_name not in", values, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameBetween(String value1, String value2) { + addCriterion("contacts_name between", value1, value2, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotBetween(String value1, String value2) { + addCriterion("contacts_name not between", value1, value2, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneIsNull() { + addCriterion("contacts_telephone is null"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneIsNotNull() { + addCriterion("contacts_telephone is not null"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneEqualTo(String value) { + addCriterion("contacts_telephone =", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneNotEqualTo(String value) { + addCriterion("contacts_telephone <>", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneGreaterThan(String value) { + addCriterion("contacts_telephone >", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneGreaterThanOrEqualTo(String value) { + addCriterion("contacts_telephone >=", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneLessThan(String value) { + addCriterion("contacts_telephone <", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneLessThanOrEqualTo(String value) { + addCriterion("contacts_telephone <=", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneLike(String value) { + addCriterion("contacts_telephone like", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneNotLike(String value) { + addCriterion("contacts_telephone not like", value, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneIn(List values) { + addCriterion("contacts_telephone in", values, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneNotIn(List values) { + addCriterion("contacts_telephone not in", values, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneBetween(String value1, String value2) { + addCriterion("contacts_telephone between", value1, value2, "contactsTelephone"); + return (Criteria) this; + } + + public Criteria andContactsTelephoneNotBetween(String value1, String value2) { + addCriterion("contacts_telephone not between", value1, value2, "contactsTelephone"); + 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/BsDevice.java b/service/src/main/java/com/hfkj/entity/BsDevice.java new file mode 100644 index 0000000..f657931 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDevice.java @@ -0,0 +1,408 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_device + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsDevice implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 设备类型 1. 商鹏4G 2. 4G打印机 + */ + private Integer type; + + /** + * 公司id + */ + private Long companyId; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 代理商id + */ + private Long agentId; + + /** + * 代理商名称 + */ + private String agentName; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 设备SN编号 + */ + private String deviceSn; + + /** + * 设备KEY编号 + */ + private String deviceKey; + + /** + * 设备IMEI + */ + private String deviceImei; + + /** + * 设备ICCID + */ + private String deviceIccid; + + /** + * 小票顶部显示 + */ + private String receiptTop; + + /** + * 小票来源显示 + */ + private String receiptSource; + + /** + * 小票底部显示 + */ + private String receiptBottom; + + /** + * 状态:0:删除,1:正常 + */ + 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 Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public Long getCompanyId() { + return companyId; + } + + public void setCompanyId(Long companyId) { + this.companyId = companyId; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public Long getAgentId() { + return agentId; + } + + public void setAgentId(Long agentId) { + this.agentId = agentId; + } + + public String getAgentName() { + return agentName; + } + + public void setAgentName(String agentName) { + this.agentName = agentName; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(String deviceName) { + this.deviceName = deviceName; + } + + public String getDeviceSn() { + return deviceSn; + } + + public void setDeviceSn(String deviceSn) { + this.deviceSn = deviceSn; + } + + public String getDeviceKey() { + return deviceKey; + } + + public void setDeviceKey(String deviceKey) { + this.deviceKey = deviceKey; + } + + public String getDeviceImei() { + return deviceImei; + } + + public void setDeviceImei(String deviceImei) { + this.deviceImei = deviceImei; + } + + public String getDeviceIccid() { + return deviceIccid; + } + + public void setDeviceIccid(String deviceIccid) { + this.deviceIccid = deviceIccid; + } + + public String getReceiptTop() { + return receiptTop; + } + + public void setReceiptTop(String receiptTop) { + this.receiptTop = receiptTop; + } + + public String getReceiptSource() { + return receiptSource; + } + + public void setReceiptSource(String receiptSource) { + this.receiptSource = receiptSource; + } + + public String getReceiptBottom() { + return receiptBottom; + } + + public void setReceiptBottom(String receiptBottom) { + this.receiptBottom = receiptBottom; + } + + 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; + } + BsDevice other = (BsDevice) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType())) + && (this.getCompanyId() == null ? other.getCompanyId() == null : this.getCompanyId().equals(other.getCompanyId())) + && (this.getCompanyName() == null ? other.getCompanyName() == null : this.getCompanyName().equals(other.getCompanyName())) + && (this.getAgentId() == null ? other.getAgentId() == null : this.getAgentId().equals(other.getAgentId())) + && (this.getAgentName() == null ? other.getAgentName() == null : this.getAgentName().equals(other.getAgentName())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName())) + && (this.getDeviceSn() == null ? other.getDeviceSn() == null : this.getDeviceSn().equals(other.getDeviceSn())) + && (this.getDeviceKey() == null ? other.getDeviceKey() == null : this.getDeviceKey().equals(other.getDeviceKey())) + && (this.getDeviceImei() == null ? other.getDeviceImei() == null : this.getDeviceImei().equals(other.getDeviceImei())) + && (this.getDeviceIccid() == null ? other.getDeviceIccid() == null : this.getDeviceIccid().equals(other.getDeviceIccid())) + && (this.getReceiptTop() == null ? other.getReceiptTop() == null : this.getReceiptTop().equals(other.getReceiptTop())) + && (this.getReceiptSource() == null ? other.getReceiptSource() == null : this.getReceiptSource().equals(other.getReceiptSource())) + && (this.getReceiptBottom() == null ? other.getReceiptBottom() == null : this.getReceiptBottom().equals(other.getReceiptBottom())) + && (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 + ((getType() == null) ? 0 : getType().hashCode()); + result = prime * result + ((getCompanyId() == null) ? 0 : getCompanyId().hashCode()); + result = prime * result + ((getCompanyName() == null) ? 0 : getCompanyName().hashCode()); + result = prime * result + ((getAgentId() == null) ? 0 : getAgentId().hashCode()); + result = prime * result + ((getAgentName() == null) ? 0 : getAgentName().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); + result = prime * result + ((getDeviceSn() == null) ? 0 : getDeviceSn().hashCode()); + result = prime * result + ((getDeviceKey() == null) ? 0 : getDeviceKey().hashCode()); + result = prime * result + ((getDeviceImei() == null) ? 0 : getDeviceImei().hashCode()); + result = prime * result + ((getDeviceIccid() == null) ? 0 : getDeviceIccid().hashCode()); + result = prime * result + ((getReceiptTop() == null) ? 0 : getReceiptTop().hashCode()); + result = prime * result + ((getReceiptSource() == null) ? 0 : getReceiptSource().hashCode()); + result = prime * result + ((getReceiptBottom() == null) ? 0 : getReceiptBottom().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(", type=").append(type); + sb.append(", companyId=").append(companyId); + sb.append(", companyName=").append(companyName); + sb.append(", agentId=").append(agentId); + sb.append(", agentName=").append(agentName); + sb.append(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", deviceName=").append(deviceName); + sb.append(", deviceSn=").append(deviceSn); + sb.append(", deviceKey=").append(deviceKey); + sb.append(", deviceImei=").append(deviceImei); + sb.append(", deviceIccid=").append(deviceIccid); + sb.append(", receiptTop=").append(receiptTop); + sb.append(", receiptSource=").append(receiptSource); + sb.append(", receiptBottom=").append(receiptBottom); + 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/BsDeviceExample.java b/service/src/main/java/com/hfkj/entity/BsDeviceExample.java new file mode 100644 index 0000000..c81dbeb --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDeviceExample.java @@ -0,0 +1,1753 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsDeviceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsDeviceExample() { + 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 andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNull() { + addCriterion("company_id is null"); + return (Criteria) this; + } + + public Criteria andCompanyIdIsNotNull() { + addCriterion("company_id is not null"); + return (Criteria) this; + } + + public Criteria andCompanyIdEqualTo(Long value) { + addCriterion("company_id =", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotEqualTo(Long value) { + addCriterion("company_id <>", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThan(Long value) { + addCriterion("company_id >", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) { + addCriterion("company_id >=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThan(Long value) { + addCriterion("company_id <", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdLessThanOrEqualTo(Long value) { + addCriterion("company_id <=", value, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdIn(List values) { + addCriterion("company_id in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotIn(List values) { + addCriterion("company_id not in", values, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdBetween(Long value1, Long value2) { + addCriterion("company_id between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyIdNotBetween(Long value1, Long value2) { + addCriterion("company_id not between", value1, value2, "companyId"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNull() { + addCriterion("company_name is null"); + return (Criteria) this; + } + + public Criteria andCompanyNameIsNotNull() { + addCriterion("company_name is not null"); + return (Criteria) this; + } + + public Criteria andCompanyNameEqualTo(String value) { + addCriterion("company_name =", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotEqualTo(String value) { + addCriterion("company_name <>", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThan(String value) { + addCriterion("company_name >", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameGreaterThanOrEqualTo(String value) { + addCriterion("company_name >=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThan(String value) { + addCriterion("company_name <", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLessThanOrEqualTo(String value) { + addCriterion("company_name <=", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameLike(String value) { + addCriterion("company_name like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotLike(String value) { + addCriterion("company_name not like", value, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameIn(List values) { + addCriterion("company_name in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotIn(List values) { + addCriterion("company_name not in", values, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameBetween(String value1, String value2) { + addCriterion("company_name between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andCompanyNameNotBetween(String value1, String value2) { + addCriterion("company_name not between", value1, value2, "companyName"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNull() { + addCriterion("agent_id is null"); + return (Criteria) this; + } + + public Criteria andAgentIdIsNotNull() { + addCriterion("agent_id is not null"); + return (Criteria) this; + } + + public Criteria andAgentIdEqualTo(Long value) { + addCriterion("agent_id =", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotEqualTo(Long value) { + addCriterion("agent_id <>", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThan(Long value) { + addCriterion("agent_id >", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdGreaterThanOrEqualTo(Long value) { + addCriterion("agent_id >=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThan(Long value) { + addCriterion("agent_id <", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdLessThanOrEqualTo(Long value) { + addCriterion("agent_id <=", value, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdIn(List values) { + addCriterion("agent_id in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotIn(List values) { + addCriterion("agent_id not in", values, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdBetween(Long value1, Long value2) { + addCriterion("agent_id between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentIdNotBetween(Long value1, Long value2) { + addCriterion("agent_id not between", value1, value2, "agentId"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNull() { + addCriterion("agent_name is null"); + return (Criteria) this; + } + + public Criteria andAgentNameIsNotNull() { + addCriterion("agent_name is not null"); + return (Criteria) this; + } + + public Criteria andAgentNameEqualTo(String value) { + addCriterion("agent_name =", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotEqualTo(String value) { + addCriterion("agent_name <>", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThan(String value) { + addCriterion("agent_name >", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameGreaterThanOrEqualTo(String value) { + addCriterion("agent_name >=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThan(String value) { + addCriterion("agent_name <", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLessThanOrEqualTo(String value) { + addCriterion("agent_name <=", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameLike(String value) { + addCriterion("agent_name like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotLike(String value) { + addCriterion("agent_name not like", value, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameIn(List values) { + addCriterion("agent_name in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotIn(List values) { + addCriterion("agent_name not in", values, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameBetween(String value1, String value2) { + addCriterion("agent_name between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andAgentNameNotBetween(String value1, String value2) { + addCriterion("agent_name not between", value1, value2, "agentName"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNull() { + addCriterion("device_name is null"); + return (Criteria) this; + } + + public Criteria andDeviceNameIsNotNull() { + addCriterion("device_name is not null"); + return (Criteria) this; + } + + public Criteria andDeviceNameEqualTo(String value) { + addCriterion("device_name =", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotEqualTo(String value) { + addCriterion("device_name <>", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThan(String value) { + addCriterion("device_name >", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameGreaterThanOrEqualTo(String value) { + addCriterion("device_name >=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThan(String value) { + addCriterion("device_name <", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLessThanOrEqualTo(String value) { + addCriterion("device_name <=", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameLike(String value) { + addCriterion("device_name like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotLike(String value) { + addCriterion("device_name not like", value, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameIn(List values) { + addCriterion("device_name in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotIn(List values) { + addCriterion("device_name not in", values, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameBetween(String value1, String value2) { + addCriterion("device_name between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceNameNotBetween(String value1, String value2) { + addCriterion("device_name not between", value1, value2, "deviceName"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNull() { + addCriterion("device_sn is null"); + return (Criteria) this; + } + + public Criteria andDeviceSnIsNotNull() { + addCriterion("device_sn is not null"); + return (Criteria) this; + } + + public Criteria andDeviceSnEqualTo(String value) { + addCriterion("device_sn =", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotEqualTo(String value) { + addCriterion("device_sn <>", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThan(String value) { + addCriterion("device_sn >", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnGreaterThanOrEqualTo(String value) { + addCriterion("device_sn >=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThan(String value) { + addCriterion("device_sn <", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLessThanOrEqualTo(String value) { + addCriterion("device_sn <=", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnLike(String value) { + addCriterion("device_sn like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotLike(String value) { + addCriterion("device_sn not like", value, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnIn(List values) { + addCriterion("device_sn in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotIn(List values) { + addCriterion("device_sn not in", values, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnBetween(String value1, String value2) { + addCriterion("device_sn between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceSnNotBetween(String value1, String value2) { + addCriterion("device_sn not between", value1, value2, "deviceSn"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIsNull() { + addCriterion("device_key is null"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIsNotNull() { + addCriterion("device_key is not null"); + return (Criteria) this; + } + + public Criteria andDeviceKeyEqualTo(String value) { + addCriterion("device_key =", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotEqualTo(String value) { + addCriterion("device_key <>", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyGreaterThan(String value) { + addCriterion("device_key >", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyGreaterThanOrEqualTo(String value) { + addCriterion("device_key >=", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLessThan(String value) { + addCriterion("device_key <", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLessThanOrEqualTo(String value) { + addCriterion("device_key <=", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyLike(String value) { + addCriterion("device_key like", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotLike(String value) { + addCriterion("device_key not like", value, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyIn(List values) { + addCriterion("device_key in", values, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotIn(List values) { + addCriterion("device_key not in", values, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyBetween(String value1, String value2) { + addCriterion("device_key between", value1, value2, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceKeyNotBetween(String value1, String value2) { + addCriterion("device_key not between", value1, value2, "deviceKey"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIsNull() { + addCriterion("device_imei is null"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIsNotNull() { + addCriterion("device_imei is not null"); + return (Criteria) this; + } + + public Criteria andDeviceImeiEqualTo(String value) { + addCriterion("device_imei =", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotEqualTo(String value) { + addCriterion("device_imei <>", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiGreaterThan(String value) { + addCriterion("device_imei >", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiGreaterThanOrEqualTo(String value) { + addCriterion("device_imei >=", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLessThan(String value) { + addCriterion("device_imei <", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLessThanOrEqualTo(String value) { + addCriterion("device_imei <=", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiLike(String value) { + addCriterion("device_imei like", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotLike(String value) { + addCriterion("device_imei not like", value, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiIn(List values) { + addCriterion("device_imei in", values, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotIn(List values) { + addCriterion("device_imei not in", values, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiBetween(String value1, String value2) { + addCriterion("device_imei between", value1, value2, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceImeiNotBetween(String value1, String value2) { + addCriterion("device_imei not between", value1, value2, "deviceImei"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIsNull() { + addCriterion("device_iccid is null"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIsNotNull() { + addCriterion("device_iccid is not null"); + return (Criteria) this; + } + + public Criteria andDeviceIccidEqualTo(String value) { + addCriterion("device_iccid =", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotEqualTo(String value) { + addCriterion("device_iccid <>", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidGreaterThan(String value) { + addCriterion("device_iccid >", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidGreaterThanOrEqualTo(String value) { + addCriterion("device_iccid >=", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLessThan(String value) { + addCriterion("device_iccid <", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLessThanOrEqualTo(String value) { + addCriterion("device_iccid <=", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidLike(String value) { + addCriterion("device_iccid like", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotLike(String value) { + addCriterion("device_iccid not like", value, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidIn(List values) { + addCriterion("device_iccid in", values, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotIn(List values) { + addCriterion("device_iccid not in", values, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidBetween(String value1, String value2) { + addCriterion("device_iccid between", value1, value2, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andDeviceIccidNotBetween(String value1, String value2) { + addCriterion("device_iccid not between", value1, value2, "deviceIccid"); + return (Criteria) this; + } + + public Criteria andReceiptTopIsNull() { + addCriterion("receipt_top is null"); + return (Criteria) this; + } + + public Criteria andReceiptTopIsNotNull() { + addCriterion("receipt_top is not null"); + return (Criteria) this; + } + + public Criteria andReceiptTopEqualTo(String value) { + addCriterion("receipt_top =", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopNotEqualTo(String value) { + addCriterion("receipt_top <>", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopGreaterThan(String value) { + addCriterion("receipt_top >", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopGreaterThanOrEqualTo(String value) { + addCriterion("receipt_top >=", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopLessThan(String value) { + addCriterion("receipt_top <", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopLessThanOrEqualTo(String value) { + addCriterion("receipt_top <=", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopLike(String value) { + addCriterion("receipt_top like", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopNotLike(String value) { + addCriterion("receipt_top not like", value, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopIn(List values) { + addCriterion("receipt_top in", values, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopNotIn(List values) { + addCriterion("receipt_top not in", values, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopBetween(String value1, String value2) { + addCriterion("receipt_top between", value1, value2, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptTopNotBetween(String value1, String value2) { + addCriterion("receipt_top not between", value1, value2, "receiptTop"); + return (Criteria) this; + } + + public Criteria andReceiptSourceIsNull() { + addCriterion("receipt_source is null"); + return (Criteria) this; + } + + public Criteria andReceiptSourceIsNotNull() { + addCriterion("receipt_source is not null"); + return (Criteria) this; + } + + public Criteria andReceiptSourceEqualTo(String value) { + addCriterion("receipt_source =", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceNotEqualTo(String value) { + addCriterion("receipt_source <>", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceGreaterThan(String value) { + addCriterion("receipt_source >", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceGreaterThanOrEqualTo(String value) { + addCriterion("receipt_source >=", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceLessThan(String value) { + addCriterion("receipt_source <", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceLessThanOrEqualTo(String value) { + addCriterion("receipt_source <=", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceLike(String value) { + addCriterion("receipt_source like", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceNotLike(String value) { + addCriterion("receipt_source not like", value, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceIn(List values) { + addCriterion("receipt_source in", values, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceNotIn(List values) { + addCriterion("receipt_source not in", values, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceBetween(String value1, String value2) { + addCriterion("receipt_source between", value1, value2, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptSourceNotBetween(String value1, String value2) { + addCriterion("receipt_source not between", value1, value2, "receiptSource"); + return (Criteria) this; + } + + public Criteria andReceiptBottomIsNull() { + addCriterion("receipt_bottom is null"); + return (Criteria) this; + } + + public Criteria andReceiptBottomIsNotNull() { + addCriterion("receipt_bottom is not null"); + return (Criteria) this; + } + + public Criteria andReceiptBottomEqualTo(String value) { + addCriterion("receipt_bottom =", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomNotEqualTo(String value) { + addCriterion("receipt_bottom <>", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomGreaterThan(String value) { + addCriterion("receipt_bottom >", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomGreaterThanOrEqualTo(String value) { + addCriterion("receipt_bottom >=", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomLessThan(String value) { + addCriterion("receipt_bottom <", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomLessThanOrEqualTo(String value) { + addCriterion("receipt_bottom <=", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomLike(String value) { + addCriterion("receipt_bottom like", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomNotLike(String value) { + addCriterion("receipt_bottom not like", value, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomIn(List values) { + addCriterion("receipt_bottom in", values, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomNotIn(List values) { + addCriterion("receipt_bottom not in", values, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomBetween(String value1, String value2) { + addCriterion("receipt_bottom between", value1, value2, "receiptBottom"); + return (Criteria) this; + } + + public Criteria andReceiptBottomNotBetween(String value1, String value2) { + addCriterion("receipt_bottom not between", value1, value2, "receiptBottom"); + 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/BsDiscount.java b/service/src/main/java/com/hfkj/entity/BsDiscount.java new file mode 100644 index 0000000..d15d1a6 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscount.java @@ -0,0 +1,361 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_discount + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsDiscount implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 优惠编号 + */ + private String discountNo; + + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 优惠类型 1:满减 2:抵扣 3:折扣 + */ + private Integer discountType; + + /** + * 优惠券条件(满减价格) + */ + private BigDecimal discountCondition; + + /** + * 优惠券价格 + */ + private BigDecimal discountPrice; + + /** + * 使用范围(支持多选) 1:加油 2:商城 + */ + private String useScope; + + /** + * 上线时间 + */ + private Date startTime; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 实际上线时间 + */ + private Date realityStartTime; + + /** + * 实际结束时间 + */ + private Date realityEndTime; + + /** + * 状态 0:删除 1:编辑中 2:已上线 3:已结束 + */ + 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 Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getDiscountNo() { + return discountNo; + } + + public void setDiscountNo(String discountNo) { + this.discountNo = discountNo; + } + + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public Integer getDiscountType() { + return discountType; + } + + public void setDiscountType(Integer discountType) { + this.discountType = discountType; + } + + public BigDecimal getDiscountCondition() { + return discountCondition; + } + + public void setDiscountCondition(BigDecimal discountCondition) { + this.discountCondition = discountCondition; + } + + public BigDecimal getDiscountPrice() { + return discountPrice; + } + + public void setDiscountPrice(BigDecimal discountPrice) { + this.discountPrice = discountPrice; + } + + public String getUseScope() { + return useScope; + } + + public void setUseScope(String useScope) { + this.useScope = useScope; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public Date getRealityStartTime() { + return realityStartTime; + } + + public void setRealityStartTime(Date realityStartTime) { + this.realityStartTime = realityStartTime; + } + + public Date getRealityEndTime() { + return realityEndTime; + } + + public void setRealityEndTime(Date realityEndTime) { + this.realityEndTime = realityEndTime; + } + + 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; + } + BsDiscount other = (BsDiscount) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo())) + && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) + && (this.getDiscountType() == null ? other.getDiscountType() == null : this.getDiscountType().equals(other.getDiscountType())) + && (this.getDiscountCondition() == null ? other.getDiscountCondition() == null : this.getDiscountCondition().equals(other.getDiscountCondition())) + && (this.getDiscountPrice() == null ? other.getDiscountPrice() == null : this.getDiscountPrice().equals(other.getDiscountPrice())) + && (this.getUseScope() == null ? other.getUseScope() == null : this.getUseScope().equals(other.getUseScope())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (this.getRealityStartTime() == null ? other.getRealityStartTime() == null : this.getRealityStartTime().equals(other.getRealityStartTime())) + && (this.getRealityEndTime() == null ? other.getRealityEndTime() == null : this.getRealityEndTime().equals(other.getRealityEndTime())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode()); + result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); + result = prime * result + ((getDiscountType() == null) ? 0 : getDiscountType().hashCode()); + result = prime * result + ((getDiscountCondition() == null) ? 0 : getDiscountCondition().hashCode()); + result = prime * result + ((getDiscountPrice() == null) ? 0 : getDiscountPrice().hashCode()); + result = prime * result + ((getUseScope() == null) ? 0 : getUseScope().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); + result = prime * result + ((getRealityStartTime() == null) ? 0 : getRealityStartTime().hashCode()); + result = prime * result + ((getRealityEndTime() == null) ? 0 : getRealityEndTime().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", discountNo=").append(discountNo); + sb.append(", discountName=").append(discountName); + sb.append(", discountType=").append(discountType); + sb.append(", discountCondition=").append(discountCondition); + sb.append(", discountPrice=").append(discountPrice); + sb.append(", useScope=").append(useScope); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + sb.append(", realityStartTime=").append(realityStartTime); + sb.append(", realityEndTime=").append(realityEndTime); + 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/BsDiscountExample.java b/service/src/main/java/com/hfkj/entity/BsDiscountExample.java new file mode 100644 index 0000000..a30302d --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscountExample.java @@ -0,0 +1,1504 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsDiscountExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsDiscountExample() { + 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 andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNull() { + addCriterion("discount_no is null"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNotNull() { + addCriterion("discount_no is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNoEqualTo(String value) { + addCriterion("discount_no =", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotEqualTo(String value) { + addCriterion("discount_no <>", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThan(String value) { + addCriterion("discount_no >", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThanOrEqualTo(String value) { + addCriterion("discount_no >=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThan(String value) { + addCriterion("discount_no <", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThanOrEqualTo(String value) { + addCriterion("discount_no <=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLike(String value) { + addCriterion("discount_no like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotLike(String value) { + addCriterion("discount_no not like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoIn(List values) { + addCriterion("discount_no in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotIn(List values) { + addCriterion("discount_no not in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoBetween(String value1, String value2) { + addCriterion("discount_no between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotBetween(String value1, String value2) { + addCriterion("discount_no not between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNull() { + addCriterion("discount_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNotNull() { + addCriterion("discount_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNameEqualTo(String value) { + addCriterion("discount_name =", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotEqualTo(String value) { + addCriterion("discount_name <>", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThan(String value) { + addCriterion("discount_name >", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_name >=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThan(String value) { + addCriterion("discount_name <", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThanOrEqualTo(String value) { + addCriterion("discount_name <=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLike(String value) { + addCriterion("discount_name like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotLike(String value) { + addCriterion("discount_name not like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameIn(List values) { + addCriterion("discount_name in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotIn(List values) { + addCriterion("discount_name not in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameBetween(String value1, String value2) { + addCriterion("discount_name between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotBetween(String value1, String value2) { + addCriterion("discount_name not between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIsNull() { + addCriterion("discount_type is null"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIsNotNull() { + addCriterion("discount_type is not null"); + return (Criteria) this; + } + + public Criteria andDiscountTypeEqualTo(Integer value) { + addCriterion("discount_type =", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotEqualTo(Integer value) { + addCriterion("discount_type <>", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeGreaterThan(Integer value) { + addCriterion("discount_type >", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("discount_type >=", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeLessThan(Integer value) { + addCriterion("discount_type <", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeLessThanOrEqualTo(Integer value) { + addCriterion("discount_type <=", value, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeIn(List values) { + addCriterion("discount_type in", values, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotIn(List values) { + addCriterion("discount_type not in", values, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeBetween(Integer value1, Integer value2) { + addCriterion("discount_type between", value1, value2, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountTypeNotBetween(Integer value1, Integer value2) { + addCriterion("discount_type not between", value1, value2, "discountType"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIsNull() { + addCriterion("discount_condition is null"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIsNotNull() { + addCriterion("discount_condition is not null"); + return (Criteria) this; + } + + public Criteria andDiscountConditionEqualTo(BigDecimal value) { + addCriterion("discount_condition =", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotEqualTo(BigDecimal value) { + addCriterion("discount_condition <>", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionGreaterThan(BigDecimal value) { + addCriterion("discount_condition >", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_condition >=", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionLessThan(BigDecimal value) { + addCriterion("discount_condition <", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_condition <=", value, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionIn(List values) { + addCriterion("discount_condition in", values, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotIn(List values) { + addCriterion("discount_condition not in", values, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_condition between", value1, value2, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountConditionNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_condition not between", value1, value2, "discountCondition"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNull() { + addCriterion("discount_price is null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIsNotNull() { + addCriterion("discount_price is not null"); + return (Criteria) this; + } + + public Criteria andDiscountPriceEqualTo(BigDecimal value) { + addCriterion("discount_price =", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotEqualTo(BigDecimal value) { + addCriterion("discount_price <>", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThan(BigDecimal value) { + addCriterion("discount_price >", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price >=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThan(BigDecimal value) { + addCriterion("discount_price <", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("discount_price <=", value, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceIn(List values) { + addCriterion("discount_price in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotIn(List values) { + addCriterion("discount_price not in", values, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andDiscountPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("discount_price not between", value1, value2, "discountPrice"); + return (Criteria) this; + } + + public Criteria andUseScopeIsNull() { + addCriterion("use_scope is null"); + return (Criteria) this; + } + + public Criteria andUseScopeIsNotNull() { + addCriterion("use_scope is not null"); + return (Criteria) this; + } + + public Criteria andUseScopeEqualTo(String value) { + addCriterion("use_scope =", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotEqualTo(String value) { + addCriterion("use_scope <>", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeGreaterThan(String value) { + addCriterion("use_scope >", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeGreaterThanOrEqualTo(String value) { + addCriterion("use_scope >=", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeLessThan(String value) { + addCriterion("use_scope <", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeLessThanOrEqualTo(String value) { + addCriterion("use_scope <=", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeLike(String value) { + addCriterion("use_scope like", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotLike(String value) { + addCriterion("use_scope not like", value, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeIn(List values) { + addCriterion("use_scope in", values, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotIn(List values) { + addCriterion("use_scope not in", values, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeBetween(String value1, String value2) { + addCriterion("use_scope between", value1, value2, "useScope"); + return (Criteria) this; + } + + public Criteria andUseScopeNotBetween(String value1, String value2) { + addCriterion("use_scope not between", value1, value2, "useScope"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Date value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Date value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Date value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Date value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Date value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Date value1, Date value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Date value1, Date value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Date value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Date value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Date value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Date value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Date value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Date value1, Date value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Date value1, Date value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeIsNull() { + addCriterion("reality_start_time is null"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeIsNotNull() { + addCriterion("reality_start_time is not null"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeEqualTo(Date value) { + addCriterion("reality_start_time =", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeNotEqualTo(Date value) { + addCriterion("reality_start_time <>", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeGreaterThan(Date value) { + addCriterion("reality_start_time >", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("reality_start_time >=", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeLessThan(Date value) { + addCriterion("reality_start_time <", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeLessThanOrEqualTo(Date value) { + addCriterion("reality_start_time <=", value, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeIn(List values) { + addCriterion("reality_start_time in", values, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeNotIn(List values) { + addCriterion("reality_start_time not in", values, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeBetween(Date value1, Date value2) { + addCriterion("reality_start_time between", value1, value2, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityStartTimeNotBetween(Date value1, Date value2) { + addCriterion("reality_start_time not between", value1, value2, "realityStartTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeIsNull() { + addCriterion("reality_end_time is null"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeIsNotNull() { + addCriterion("reality_end_time is not null"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeEqualTo(Date value) { + addCriterion("reality_end_time =", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeNotEqualTo(Date value) { + addCriterion("reality_end_time <>", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeGreaterThan(Date value) { + addCriterion("reality_end_time >", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeGreaterThanOrEqualTo(Date value) { + addCriterion("reality_end_time >=", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeLessThan(Date value) { + addCriterion("reality_end_time <", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeLessThanOrEqualTo(Date value) { + addCriterion("reality_end_time <=", value, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeIn(List values) { + addCriterion("reality_end_time in", values, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeNotIn(List values) { + addCriterion("reality_end_time not in", values, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeBetween(Date value1, Date value2) { + addCriterion("reality_end_time between", value1, value2, "realityEndTime"); + return (Criteria) this; + } + + public Criteria andRealityEndTimeNotBetween(Date value1, Date value2) { + addCriterion("reality_end_time not between", value1, value2, "realityEndTime"); + 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/BsDiscountStockBatch.java b/service/src/main/java/com/hfkj/entity/BsDiscountStockBatch.java new file mode 100644 index 0000000..7d2d457 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscountStockBatch.java @@ -0,0 +1,264 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_discount_stock_batch + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsDiscountStockBatch implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 优惠券id + */ + private Long discountId; + + /** + * 优惠编号 + */ + private String discountNo; + + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 批次编号 + */ + private String batchNo; + + /** + * 批次库存数量 + */ + private Integer batchStockNum; + + /** + * 开始id + */ + private String startId; + + /** + * 结束id + */ + private String endId; + + /** + * 状态 0:删除 1:正常 + */ + 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 Long getDiscountId() { + return discountId; + } + + public void setDiscountId(Long discountId) { + this.discountId = discountId; + } + + public String getDiscountNo() { + return discountNo; + } + + public void setDiscountNo(String discountNo) { + this.discountNo = discountNo; + } + + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public String getBatchNo() { + return batchNo; + } + + public void setBatchNo(String batchNo) { + this.batchNo = batchNo; + } + + public Integer getBatchStockNum() { + return batchStockNum; + } + + public void setBatchStockNum(Integer batchStockNum) { + this.batchStockNum = batchStockNum; + } + + public String getStartId() { + return startId; + } + + public void setStartId(String startId) { + this.startId = startId; + } + + public String getEndId() { + return endId; + } + + public void setEndId(String endId) { + this.endId = endId; + } + + 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; + } + BsDiscountStockBatch other = (BsDiscountStockBatch) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) + && (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo())) + && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) + && (this.getBatchNo() == null ? other.getBatchNo() == null : this.getBatchNo().equals(other.getBatchNo())) + && (this.getBatchStockNum() == null ? other.getBatchStockNum() == null : this.getBatchStockNum().equals(other.getBatchStockNum())) + && (this.getStartId() == null ? other.getStartId() == null : this.getStartId().equals(other.getStartId())) + && (this.getEndId() == null ? other.getEndId() == null : this.getEndId().equals(other.getEndId())) + && (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 + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); + result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode()); + result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); + result = prime * result + ((getBatchNo() == null) ? 0 : getBatchNo().hashCode()); + result = prime * result + ((getBatchStockNum() == null) ? 0 : getBatchStockNum().hashCode()); + result = prime * result + ((getStartId() == null) ? 0 : getStartId().hashCode()); + result = prime * result + ((getEndId() == null) ? 0 : getEndId().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(", discountId=").append(discountId); + sb.append(", discountNo=").append(discountNo); + sb.append(", discountName=").append(discountName); + sb.append(", batchNo=").append(batchNo); + sb.append(", batchStockNum=").append(batchStockNum); + sb.append(", startId=").append(startId); + sb.append(", endId=").append(endId); + 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/BsDiscountStockBatchExample.java b/service/src/main/java/com/hfkj/entity/BsDiscountStockBatchExample.java new file mode 100644 index 0000000..11ffb3e --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscountStockBatchExample.java @@ -0,0 +1,1143 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsDiscountStockBatchExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsDiscountStockBatchExample() { + 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 andDiscountIdIsNull() { + addCriterion("discount_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountIdIsNotNull() { + addCriterion("discount_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountIdEqualTo(Long value) { + addCriterion("discount_id =", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotEqualTo(Long value) { + addCriterion("discount_id <>", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThan(Long value) { + addCriterion("discount_id >", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_id >=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThan(Long value) { + addCriterion("discount_id <", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThanOrEqualTo(Long value) { + addCriterion("discount_id <=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdIn(List values) { + addCriterion("discount_id in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotIn(List values) { + addCriterion("discount_id not in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdBetween(Long value1, Long value2) { + addCriterion("discount_id between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotBetween(Long value1, Long value2) { + addCriterion("discount_id not between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNull() { + addCriterion("discount_no is null"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNotNull() { + addCriterion("discount_no is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNoEqualTo(String value) { + addCriterion("discount_no =", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotEqualTo(String value) { + addCriterion("discount_no <>", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThan(String value) { + addCriterion("discount_no >", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThanOrEqualTo(String value) { + addCriterion("discount_no >=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThan(String value) { + addCriterion("discount_no <", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThanOrEqualTo(String value) { + addCriterion("discount_no <=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLike(String value) { + addCriterion("discount_no like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotLike(String value) { + addCriterion("discount_no not like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoIn(List values) { + addCriterion("discount_no in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotIn(List values) { + addCriterion("discount_no not in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoBetween(String value1, String value2) { + addCriterion("discount_no between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotBetween(String value1, String value2) { + addCriterion("discount_no not between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNull() { + addCriterion("discount_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNotNull() { + addCriterion("discount_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNameEqualTo(String value) { + addCriterion("discount_name =", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotEqualTo(String value) { + addCriterion("discount_name <>", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThan(String value) { + addCriterion("discount_name >", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_name >=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThan(String value) { + addCriterion("discount_name <", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThanOrEqualTo(String value) { + addCriterion("discount_name <=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLike(String value) { + addCriterion("discount_name like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotLike(String value) { + addCriterion("discount_name not like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameIn(List values) { + addCriterion("discount_name in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotIn(List values) { + addCriterion("discount_name not in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameBetween(String value1, String value2) { + addCriterion("discount_name between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotBetween(String value1, String value2) { + addCriterion("discount_name not between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andBatchNoIsNull() { + addCriterion("batch_no is null"); + return (Criteria) this; + } + + public Criteria andBatchNoIsNotNull() { + addCriterion("batch_no is not null"); + return (Criteria) this; + } + + public Criteria andBatchNoEqualTo(String value) { + addCriterion("batch_no =", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoNotEqualTo(String value) { + addCriterion("batch_no <>", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoGreaterThan(String value) { + addCriterion("batch_no >", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoGreaterThanOrEqualTo(String value) { + addCriterion("batch_no >=", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoLessThan(String value) { + addCriterion("batch_no <", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoLessThanOrEqualTo(String value) { + addCriterion("batch_no <=", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoLike(String value) { + addCriterion("batch_no like", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoNotLike(String value) { + addCriterion("batch_no not like", value, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoIn(List values) { + addCriterion("batch_no in", values, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoNotIn(List values) { + addCriterion("batch_no not in", values, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoBetween(String value1, String value2) { + addCriterion("batch_no between", value1, value2, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchNoNotBetween(String value1, String value2) { + addCriterion("batch_no not between", value1, value2, "batchNo"); + return (Criteria) this; + } + + public Criteria andBatchStockNumIsNull() { + addCriterion("batch_stock_num is null"); + return (Criteria) this; + } + + public Criteria andBatchStockNumIsNotNull() { + addCriterion("batch_stock_num is not null"); + return (Criteria) this; + } + + public Criteria andBatchStockNumEqualTo(Integer value) { + addCriterion("batch_stock_num =", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumNotEqualTo(Integer value) { + addCriterion("batch_stock_num <>", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumGreaterThan(Integer value) { + addCriterion("batch_stock_num >", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumGreaterThanOrEqualTo(Integer value) { + addCriterion("batch_stock_num >=", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumLessThan(Integer value) { + addCriterion("batch_stock_num <", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumLessThanOrEqualTo(Integer value) { + addCriterion("batch_stock_num <=", value, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumIn(List values) { + addCriterion("batch_stock_num in", values, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumNotIn(List values) { + addCriterion("batch_stock_num not in", values, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumBetween(Integer value1, Integer value2) { + addCriterion("batch_stock_num between", value1, value2, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andBatchStockNumNotBetween(Integer value1, Integer value2) { + addCriterion("batch_stock_num not between", value1, value2, "batchStockNum"); + return (Criteria) this; + } + + public Criteria andStartIdIsNull() { + addCriterion("start_id is null"); + return (Criteria) this; + } + + public Criteria andStartIdIsNotNull() { + addCriterion("start_id is not null"); + return (Criteria) this; + } + + public Criteria andStartIdEqualTo(String value) { + addCriterion("start_id =", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdNotEqualTo(String value) { + addCriterion("start_id <>", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdGreaterThan(String value) { + addCriterion("start_id >", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdGreaterThanOrEqualTo(String value) { + addCriterion("start_id >=", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdLessThan(String value) { + addCriterion("start_id <", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdLessThanOrEqualTo(String value) { + addCriterion("start_id <=", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdLike(String value) { + addCriterion("start_id like", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdNotLike(String value) { + addCriterion("start_id not like", value, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdIn(List values) { + addCriterion("start_id in", values, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdNotIn(List values) { + addCriterion("start_id not in", values, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdBetween(String value1, String value2) { + addCriterion("start_id between", value1, value2, "startId"); + return (Criteria) this; + } + + public Criteria andStartIdNotBetween(String value1, String value2) { + addCriterion("start_id not between", value1, value2, "startId"); + return (Criteria) this; + } + + public Criteria andEndIdIsNull() { + addCriterion("end_id is null"); + return (Criteria) this; + } + + public Criteria andEndIdIsNotNull() { + addCriterion("end_id is not null"); + return (Criteria) this; + } + + public Criteria andEndIdEqualTo(String value) { + addCriterion("end_id =", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdNotEqualTo(String value) { + addCriterion("end_id <>", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdGreaterThan(String value) { + addCriterion("end_id >", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdGreaterThanOrEqualTo(String value) { + addCriterion("end_id >=", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdLessThan(String value) { + addCriterion("end_id <", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdLessThanOrEqualTo(String value) { + addCriterion("end_id <=", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdLike(String value) { + addCriterion("end_id like", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdNotLike(String value) { + addCriterion("end_id not like", value, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdIn(List values) { + addCriterion("end_id in", values, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdNotIn(List values) { + addCriterion("end_id not in", values, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdBetween(String value1, String value2) { + addCriterion("end_id between", value1, value2, "endId"); + return (Criteria) this; + } + + public Criteria andEndIdNotBetween(String value1, String value2) { + addCriterion("end_id not between", value1, value2, "endId"); + 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/BsDiscountStockCode.java b/service/src/main/java/com/hfkj/entity/BsDiscountStockCode.java new file mode 100644 index 0000000..cbe8d05 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscountStockCode.java @@ -0,0 +1,312 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_discount_stock_code + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsDiscountStockCode implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 优惠券库存批次id + */ + private Long discountStockBatchId; + + /** + * 优惠券库存批次编号 + */ + private String discountStockBatchNo; + + /** + * 优惠券id + */ + private Long discountId; + + /** + * 优惠编号 + */ + private String discountNo; + + /** + * 优惠券名称 + */ + private String discountName; + + /** + * 获得方式 1:加油 2:商城 + */ + private Integer obtainType; + + /** + * 获得时间 + */ + private Date obtainTime; + + /** + * 领取用户id + */ + private Long receiveMerUserId; + + /** + * 领取用户手机号 + */ + private String receiveMerUserPhone; + + /** + * 使用时间 + */ + private Date useTime; + + /** + * 状态 1:未领取 2:未使用 3:已使用 + */ + 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 Long getDiscountStockBatchId() { + return discountStockBatchId; + } + + public void setDiscountStockBatchId(Long discountStockBatchId) { + this.discountStockBatchId = discountStockBatchId; + } + + public String getDiscountStockBatchNo() { + return discountStockBatchNo; + } + + public void setDiscountStockBatchNo(String discountStockBatchNo) { + this.discountStockBatchNo = discountStockBatchNo; + } + + public Long getDiscountId() { + return discountId; + } + + public void setDiscountId(Long discountId) { + this.discountId = discountId; + } + + public String getDiscountNo() { + return discountNo; + } + + public void setDiscountNo(String discountNo) { + this.discountNo = discountNo; + } + + public String getDiscountName() { + return discountName; + } + + public void setDiscountName(String discountName) { + this.discountName = discountName; + } + + public Integer getObtainType() { + return obtainType; + } + + public void setObtainType(Integer obtainType) { + this.obtainType = obtainType; + } + + public Date getObtainTime() { + return obtainTime; + } + + public void setObtainTime(Date obtainTime) { + this.obtainTime = obtainTime; + } + + public Long getReceiveMerUserId() { + return receiveMerUserId; + } + + public void setReceiveMerUserId(Long receiveMerUserId) { + this.receiveMerUserId = receiveMerUserId; + } + + public String getReceiveMerUserPhone() { + return receiveMerUserPhone; + } + + public void setReceiveMerUserPhone(String receiveMerUserPhone) { + this.receiveMerUserPhone = receiveMerUserPhone; + } + + public Date getUseTime() { + return useTime; + } + + public void setUseTime(Date useTime) { + this.useTime = useTime; + } + + 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; + } + BsDiscountStockCode other = (BsDiscountStockCode) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getDiscountStockBatchId() == null ? other.getDiscountStockBatchId() == null : this.getDiscountStockBatchId().equals(other.getDiscountStockBatchId())) + && (this.getDiscountStockBatchNo() == null ? other.getDiscountStockBatchNo() == null : this.getDiscountStockBatchNo().equals(other.getDiscountStockBatchNo())) + && (this.getDiscountId() == null ? other.getDiscountId() == null : this.getDiscountId().equals(other.getDiscountId())) + && (this.getDiscountNo() == null ? other.getDiscountNo() == null : this.getDiscountNo().equals(other.getDiscountNo())) + && (this.getDiscountName() == null ? other.getDiscountName() == null : this.getDiscountName().equals(other.getDiscountName())) + && (this.getObtainType() == null ? other.getObtainType() == null : this.getObtainType().equals(other.getObtainType())) + && (this.getObtainTime() == null ? other.getObtainTime() == null : this.getObtainTime().equals(other.getObtainTime())) + && (this.getReceiveMerUserId() == null ? other.getReceiveMerUserId() == null : this.getReceiveMerUserId().equals(other.getReceiveMerUserId())) + && (this.getReceiveMerUserPhone() == null ? other.getReceiveMerUserPhone() == null : this.getReceiveMerUserPhone().equals(other.getReceiveMerUserPhone())) + && (this.getUseTime() == null ? other.getUseTime() == null : this.getUseTime().equals(other.getUseTime())) + && (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 + ((getDiscountStockBatchId() == null) ? 0 : getDiscountStockBatchId().hashCode()); + result = prime * result + ((getDiscountStockBatchNo() == null) ? 0 : getDiscountStockBatchNo().hashCode()); + result = prime * result + ((getDiscountId() == null) ? 0 : getDiscountId().hashCode()); + result = prime * result + ((getDiscountNo() == null) ? 0 : getDiscountNo().hashCode()); + result = prime * result + ((getDiscountName() == null) ? 0 : getDiscountName().hashCode()); + result = prime * result + ((getObtainType() == null) ? 0 : getObtainType().hashCode()); + result = prime * result + ((getObtainTime() == null) ? 0 : getObtainTime().hashCode()); + result = prime * result + ((getReceiveMerUserId() == null) ? 0 : getReceiveMerUserId().hashCode()); + result = prime * result + ((getReceiveMerUserPhone() == null) ? 0 : getReceiveMerUserPhone().hashCode()); + result = prime * result + ((getUseTime() == null) ? 0 : getUseTime().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(", discountStockBatchId=").append(discountStockBatchId); + sb.append(", discountStockBatchNo=").append(discountStockBatchNo); + sb.append(", discountId=").append(discountId); + sb.append(", discountNo=").append(discountNo); + sb.append(", discountName=").append(discountName); + sb.append(", obtainType=").append(obtainType); + sb.append(", obtainTime=").append(obtainTime); + sb.append(", receiveMerUserId=").append(receiveMerUserId); + sb.append(", receiveMerUserPhone=").append(receiveMerUserPhone); + sb.append(", useTime=").append(useTime); + 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/BsDiscountStockCodeExample.java b/service/src/main/java/com/hfkj/entity/BsDiscountStockCodeExample.java new file mode 100644 index 0000000..9401aa9 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsDiscountStockCodeExample.java @@ -0,0 +1,1313 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsDiscountStockCodeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsDiscountStockCodeExample() { + 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 andDiscountStockBatchIdIsNull() { + addCriterion("discount_stock_batch_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdIsNotNull() { + addCriterion("discount_stock_batch_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdEqualTo(Long value) { + addCriterion("discount_stock_batch_id =", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdNotEqualTo(Long value) { + addCriterion("discount_stock_batch_id <>", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdGreaterThan(Long value) { + addCriterion("discount_stock_batch_id >", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_stock_batch_id >=", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdLessThan(Long value) { + addCriterion("discount_stock_batch_id <", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdLessThanOrEqualTo(Long value) { + addCriterion("discount_stock_batch_id <=", value, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdIn(List values) { + addCriterion("discount_stock_batch_id in", values, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdNotIn(List values) { + addCriterion("discount_stock_batch_id not in", values, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdBetween(Long value1, Long value2) { + addCriterion("discount_stock_batch_id between", value1, value2, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchIdNotBetween(Long value1, Long value2) { + addCriterion("discount_stock_batch_id not between", value1, value2, "discountStockBatchId"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoIsNull() { + addCriterion("discount_stock_batch_no is null"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoIsNotNull() { + addCriterion("discount_stock_batch_no is not null"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoEqualTo(String value) { + addCriterion("discount_stock_batch_no =", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoNotEqualTo(String value) { + addCriterion("discount_stock_batch_no <>", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoGreaterThan(String value) { + addCriterion("discount_stock_batch_no >", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoGreaterThanOrEqualTo(String value) { + addCriterion("discount_stock_batch_no >=", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoLessThan(String value) { + addCriterion("discount_stock_batch_no <", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoLessThanOrEqualTo(String value) { + addCriterion("discount_stock_batch_no <=", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoLike(String value) { + addCriterion("discount_stock_batch_no like", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoNotLike(String value) { + addCriterion("discount_stock_batch_no not like", value, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoIn(List values) { + addCriterion("discount_stock_batch_no in", values, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoNotIn(List values) { + addCriterion("discount_stock_batch_no not in", values, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoBetween(String value1, String value2) { + addCriterion("discount_stock_batch_no between", value1, value2, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountStockBatchNoNotBetween(String value1, String value2) { + addCriterion("discount_stock_batch_no not between", value1, value2, "discountStockBatchNo"); + return (Criteria) this; + } + + public Criteria andDiscountIdIsNull() { + addCriterion("discount_id is null"); + return (Criteria) this; + } + + public Criteria andDiscountIdIsNotNull() { + addCriterion("discount_id is not null"); + return (Criteria) this; + } + + public Criteria andDiscountIdEqualTo(Long value) { + addCriterion("discount_id =", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotEqualTo(Long value) { + addCriterion("discount_id <>", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThan(Long value) { + addCriterion("discount_id >", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdGreaterThanOrEqualTo(Long value) { + addCriterion("discount_id >=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThan(Long value) { + addCriterion("discount_id <", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdLessThanOrEqualTo(Long value) { + addCriterion("discount_id <=", value, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdIn(List values) { + addCriterion("discount_id in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotIn(List values) { + addCriterion("discount_id not in", values, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdBetween(Long value1, Long value2) { + addCriterion("discount_id between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountIdNotBetween(Long value1, Long value2) { + addCriterion("discount_id not between", value1, value2, "discountId"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNull() { + addCriterion("discount_no is null"); + return (Criteria) this; + } + + public Criteria andDiscountNoIsNotNull() { + addCriterion("discount_no is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNoEqualTo(String value) { + addCriterion("discount_no =", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotEqualTo(String value) { + addCriterion("discount_no <>", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThan(String value) { + addCriterion("discount_no >", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoGreaterThanOrEqualTo(String value) { + addCriterion("discount_no >=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThan(String value) { + addCriterion("discount_no <", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLessThanOrEqualTo(String value) { + addCriterion("discount_no <=", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoLike(String value) { + addCriterion("discount_no like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotLike(String value) { + addCriterion("discount_no not like", value, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoIn(List values) { + addCriterion("discount_no in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotIn(List values) { + addCriterion("discount_no not in", values, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoBetween(String value1, String value2) { + addCriterion("discount_no between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNoNotBetween(String value1, String value2) { + addCriterion("discount_no not between", value1, value2, "discountNo"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNull() { + addCriterion("discount_name is null"); + return (Criteria) this; + } + + public Criteria andDiscountNameIsNotNull() { + addCriterion("discount_name is not null"); + return (Criteria) this; + } + + public Criteria andDiscountNameEqualTo(String value) { + addCriterion("discount_name =", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotEqualTo(String value) { + addCriterion("discount_name <>", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThan(String value) { + addCriterion("discount_name >", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameGreaterThanOrEqualTo(String value) { + addCriterion("discount_name >=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThan(String value) { + addCriterion("discount_name <", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLessThanOrEqualTo(String value) { + addCriterion("discount_name <=", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameLike(String value) { + addCriterion("discount_name like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotLike(String value) { + addCriterion("discount_name not like", value, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameIn(List values) { + addCriterion("discount_name in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotIn(List values) { + addCriterion("discount_name not in", values, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameBetween(String value1, String value2) { + addCriterion("discount_name between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andDiscountNameNotBetween(String value1, String value2) { + addCriterion("discount_name not between", value1, value2, "discountName"); + return (Criteria) this; + } + + public Criteria andObtainTypeIsNull() { + addCriterion("obtain_type is null"); + return (Criteria) this; + } + + public Criteria andObtainTypeIsNotNull() { + addCriterion("obtain_type is not null"); + return (Criteria) this; + } + + public Criteria andObtainTypeEqualTo(Integer value) { + addCriterion("obtain_type =", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeNotEqualTo(Integer value) { + addCriterion("obtain_type <>", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeGreaterThan(Integer value) { + addCriterion("obtain_type >", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("obtain_type >=", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeLessThan(Integer value) { + addCriterion("obtain_type <", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeLessThanOrEqualTo(Integer value) { + addCriterion("obtain_type <=", value, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeIn(List values) { + addCriterion("obtain_type in", values, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeNotIn(List values) { + addCriterion("obtain_type not in", values, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeBetween(Integer value1, Integer value2) { + addCriterion("obtain_type between", value1, value2, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTypeNotBetween(Integer value1, Integer value2) { + addCriterion("obtain_type not between", value1, value2, "obtainType"); + return (Criteria) this; + } + + public Criteria andObtainTimeIsNull() { + addCriterion("obtain_time is null"); + return (Criteria) this; + } + + public Criteria andObtainTimeIsNotNull() { + addCriterion("obtain_time is not null"); + return (Criteria) this; + } + + public Criteria andObtainTimeEqualTo(Date value) { + addCriterion("obtain_time =", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeNotEqualTo(Date value) { + addCriterion("obtain_time <>", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeGreaterThan(Date value) { + addCriterion("obtain_time >", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeGreaterThanOrEqualTo(Date value) { + addCriterion("obtain_time >=", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeLessThan(Date value) { + addCriterion("obtain_time <", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeLessThanOrEqualTo(Date value) { + addCriterion("obtain_time <=", value, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeIn(List values) { + addCriterion("obtain_time in", values, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeNotIn(List values) { + addCriterion("obtain_time not in", values, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeBetween(Date value1, Date value2) { + addCriterion("obtain_time between", value1, value2, "obtainTime"); + return (Criteria) this; + } + + public Criteria andObtainTimeNotBetween(Date value1, Date value2) { + addCriterion("obtain_time not between", value1, value2, "obtainTime"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdIsNull() { + addCriterion("receive_mer_user_id is null"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdIsNotNull() { + addCriterion("receive_mer_user_id is not null"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdEqualTo(Long value) { + addCriterion("receive_mer_user_id =", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdNotEqualTo(Long value) { + addCriterion("receive_mer_user_id <>", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdGreaterThan(Long value) { + addCriterion("receive_mer_user_id >", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("receive_mer_user_id >=", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdLessThan(Long value) { + addCriterion("receive_mer_user_id <", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdLessThanOrEqualTo(Long value) { + addCriterion("receive_mer_user_id <=", value, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdIn(List values) { + addCriterion("receive_mer_user_id in", values, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdNotIn(List values) { + addCriterion("receive_mer_user_id not in", values, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdBetween(Long value1, Long value2) { + addCriterion("receive_mer_user_id between", value1, value2, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserIdNotBetween(Long value1, Long value2) { + addCriterion("receive_mer_user_id not between", value1, value2, "receiveMerUserId"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneIsNull() { + addCriterion("receive_mer_user_phone is null"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneIsNotNull() { + addCriterion("receive_mer_user_phone is not null"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneEqualTo(String value) { + addCriterion("receive_mer_user_phone =", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneNotEqualTo(String value) { + addCriterion("receive_mer_user_phone <>", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneGreaterThan(String value) { + addCriterion("receive_mer_user_phone >", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneGreaterThanOrEqualTo(String value) { + addCriterion("receive_mer_user_phone >=", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneLessThan(String value) { + addCriterion("receive_mer_user_phone <", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneLessThanOrEqualTo(String value) { + addCriterion("receive_mer_user_phone <=", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneLike(String value) { + addCriterion("receive_mer_user_phone like", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneNotLike(String value) { + addCriterion("receive_mer_user_phone not like", value, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneIn(List values) { + addCriterion("receive_mer_user_phone in", values, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneNotIn(List values) { + addCriterion("receive_mer_user_phone not in", values, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneBetween(String value1, String value2) { + addCriterion("receive_mer_user_phone between", value1, value2, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andReceiveMerUserPhoneNotBetween(String value1, String value2) { + addCriterion("receive_mer_user_phone not between", value1, value2, "receiveMerUserPhone"); + return (Criteria) this; + } + + public Criteria andUseTimeIsNull() { + addCriterion("use_time is null"); + return (Criteria) this; + } + + public Criteria andUseTimeIsNotNull() { + addCriterion("use_time is not null"); + return (Criteria) this; + } + + public Criteria andUseTimeEqualTo(Date value) { + addCriterion("use_time =", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeNotEqualTo(Date value) { + addCriterion("use_time <>", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeGreaterThan(Date value) { + addCriterion("use_time >", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeGreaterThanOrEqualTo(Date value) { + addCriterion("use_time >=", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeLessThan(Date value) { + addCriterion("use_time <", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeLessThanOrEqualTo(Date value) { + addCriterion("use_time <=", value, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeIn(List values) { + addCriterion("use_time in", values, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeNotIn(List values) { + addCriterion("use_time not in", values, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeBetween(Date value1, Date value2) { + addCriterion("use_time between", value1, value2, "useTime"); + return (Criteria) this; + } + + public Criteria andUseTimeNotBetween(Date value1, Date value2) { + addCriterion("use_time not between", value1, value2, "useTime"); + 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/BsGasOilGunNo.java b/service/src/main/java/com/hfkj/entity/BsGasOilGunNo.java new file mode 100644 index 0000000..689853a --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilGunNo.java @@ -0,0 +1,264 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_gas_oil_gun_no + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsGasOilGunNo implements Serializable { + /** + * 主键r + */ + private Long id; + + /** + * 油品价格id + */ + private Long gasOilPriceId; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户号 + */ + private String merNo; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 燃油类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 油号 + */ + private String oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 枪号 + */ + private String gunNo; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + 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 getGasOilPriceId() { + return gasOilPriceId; + } + + public void setGasOilPriceId(Long gasOilPriceId) { + this.gasOilPriceId = gasOilPriceId; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public Integer getOilType() { + return oilType; + } + + public void setOilType(Integer oilType) { + this.oilType = oilType; + } + + public String getOilTypeName() { + return oilTypeName; + } + + public void setOilTypeName(String oilTypeName) { + this.oilTypeName = oilTypeName; + } + + public String getOilNo() { + return oilNo; + } + + public void setOilNo(String oilNo) { + this.oilNo = oilNo; + } + + public String getOilNoName() { + return oilNoName; + } + + public void setOilNoName(String oilNoName) { + this.oilNoName = oilNoName; + } + + public String getGunNo() { + return gunNo; + } + + public void setGunNo(String gunNo) { + this.gunNo = gunNo; + } + + 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 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; + } + BsGasOilGunNo other = (BsGasOilGunNo) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getGasOilPriceId() == null ? other.getGasOilPriceId() == null : this.getGasOilPriceId().equals(other.getGasOilPriceId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getGunNo() == null ? other.getGunNo() == null : this.getGunNo().equals(other.getGunNo())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getGasOilPriceId() == null) ? 0 : getGasOilPriceId().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getGunNo() == null) ? 0 : getGunNo().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", gasOilPriceId=").append(gasOilPriceId); + sb.append(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", gunNo=").append(gunNo); + sb.append(", status=").append(status); + 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/BsGasOilGunNoExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilGunNoExample.java new file mode 100644 index 0000000..3dbb65d --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilGunNoExample.java @@ -0,0 +1,1143 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsGasOilGunNoExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsGasOilGunNoExample() { + 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 andGasOilPriceIdIsNull() { + addCriterion("gas_oil_price_id is null"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdIsNotNull() { + addCriterion("gas_oil_price_id is not null"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdEqualTo(Long value) { + addCriterion("gas_oil_price_id =", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotEqualTo(Long value) { + addCriterion("gas_oil_price_id <>", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdGreaterThan(Long value) { + addCriterion("gas_oil_price_id >", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdGreaterThanOrEqualTo(Long value) { + addCriterion("gas_oil_price_id >=", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdLessThan(Long value) { + addCriterion("gas_oil_price_id <", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdLessThanOrEqualTo(Long value) { + addCriterion("gas_oil_price_id <=", value, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdIn(List values) { + addCriterion("gas_oil_price_id in", values, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotIn(List values) { + addCriterion("gas_oil_price_id not in", values, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdBetween(Long value1, Long value2) { + addCriterion("gas_oil_price_id between", value1, value2, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andGasOilPriceIdNotBetween(Long value1, Long value2) { + addCriterion("gas_oil_price_id not between", value1, value2, "gasOilPriceId"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNull() { + addCriterion("oil_type is null"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNotNull() { + addCriterion("oil_type is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeEqualTo(Integer value) { + addCriterion("oil_type =", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotEqualTo(Integer value) { + addCriterion("oil_type <>", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThan(Integer value) { + addCriterion("oil_type >", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_type >=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThan(Integer value) { + addCriterion("oil_type <", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("oil_type <=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeIn(List values) { + addCriterion("oil_type in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotIn(List values) { + addCriterion("oil_type not in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeBetween(Integer value1, Integer value2) { + addCriterion("oil_type between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("oil_type not between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNull() { + addCriterion("oil_type_name is null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNotNull() { + addCriterion("oil_type_name is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameEqualTo(String value) { + addCriterion("oil_type_name =", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotEqualTo(String value) { + addCriterion("oil_type_name <>", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThan(String value) { + addCriterion("oil_type_name >", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_type_name >=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThan(String value) { + addCriterion("oil_type_name <", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThanOrEqualTo(String value) { + addCriterion("oil_type_name <=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLike(String value) { + addCriterion("oil_type_name like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotLike(String value) { + addCriterion("oil_type_name not like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIn(List values) { + addCriterion("oil_type_name in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotIn(List values) { + addCriterion("oil_type_name not in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameBetween(String value1, String value2) { + addCriterion("oil_type_name between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotBetween(String value1, String value2) { + addCriterion("oil_type_name not between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilNoIsNull() { + addCriterion("oil_no is null"); + return (Criteria) this; + } + + public Criteria andOilNoIsNotNull() { + addCriterion("oil_no is not null"); + return (Criteria) this; + } + + public Criteria andOilNoEqualTo(String value) { + addCriterion("oil_no =", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotEqualTo(String value) { + addCriterion("oil_no <>", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThan(String value) { + addCriterion("oil_no >", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThanOrEqualTo(String value) { + addCriterion("oil_no >=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThan(String value) { + addCriterion("oil_no <", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThanOrEqualTo(String value) { + addCriterion("oil_no <=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLike(String value) { + addCriterion("oil_no like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotLike(String value) { + addCriterion("oil_no not like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoIn(List values) { + addCriterion("oil_no in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotIn(List values) { + addCriterion("oil_no not in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoBetween(String value1, String value2) { + addCriterion("oil_no between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotBetween(String value1, String value2) { + addCriterion("oil_no not between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNull() { + addCriterion("oil_no_name is null"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNotNull() { + addCriterion("oil_no_name is not null"); + return (Criteria) this; + } + + public Criteria andOilNoNameEqualTo(String value) { + addCriterion("oil_no_name =", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotEqualTo(String value) { + addCriterion("oil_no_name <>", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThan(String value) { + addCriterion("oil_no_name >", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_name >=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThan(String value) { + addCriterion("oil_no_name <", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThanOrEqualTo(String value) { + addCriterion("oil_no_name <=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLike(String value) { + addCriterion("oil_no_name like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotLike(String value) { + addCriterion("oil_no_name not like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameIn(List values) { + addCriterion("oil_no_name in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotIn(List values) { + addCriterion("oil_no_name not in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameBetween(String value1, String value2) { + addCriterion("oil_no_name between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotBetween(String value1, String value2) { + addCriterion("oil_no_name not between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andGunNoIsNull() { + addCriterion("gun_no is null"); + return (Criteria) this; + } + + public Criteria andGunNoIsNotNull() { + addCriterion("gun_no is not null"); + return (Criteria) this; + } + + public Criteria andGunNoEqualTo(String value) { + addCriterion("gun_no =", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotEqualTo(String value) { + addCriterion("gun_no <>", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoGreaterThan(String value) { + addCriterion("gun_no >", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoGreaterThanOrEqualTo(String value) { + addCriterion("gun_no >=", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoLessThan(String value) { + addCriterion("gun_no <", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoLessThanOrEqualTo(String value) { + addCriterion("gun_no <=", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoLike(String value) { + addCriterion("gun_no like", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotLike(String value) { + addCriterion("gun_no not like", value, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoIn(List values) { + addCriterion("gun_no in", values, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotIn(List values) { + addCriterion("gun_no not in", values, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoBetween(String value1, String value2) { + addCriterion("gun_no between", value1, value2, "gunNo"); + return (Criteria) this; + } + + public Criteria andGunNoNotBetween(String value1, String value2) { + addCriterion("gun_no not between", value1, value2, "gunNo"); + 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 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/BsGasOilPrice.java b/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java new file mode 100644 index 0000000..e30fa4f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPrice.java @@ -0,0 +1,329 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_gas_oil_price + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsGasOilPrice implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户号 + */ + private String merNo; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 燃油类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 油号 + */ + private String oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 平台优惠 + */ + private BigDecimal preferentialMargin; + + /** + * 油站直降 + */ + private BigDecimal gasStationDrop; + + /** + * 官方指导价 + */ + private BigDecimal priceOfficial; + + /** + * 枪价 + */ + private BigDecimal priceGun; + + /** + * 优惠价 + */ + private BigDecimal priceVip; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 0:删除 1:正常 2:禁用 + */ + private Integer status; + + 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 getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public Integer getOilType() { + return oilType; + } + + public void setOilType(Integer oilType) { + this.oilType = oilType; + } + + public String getOilTypeName() { + return oilTypeName; + } + + public void setOilTypeName(String oilTypeName) { + this.oilTypeName = oilTypeName; + } + + public String getOilNo() { + return oilNo; + } + + public void setOilNo(String oilNo) { + this.oilNo = oilNo; + } + + public String getOilNoName() { + return oilNoName; + } + + public void setOilNoName(String oilNoName) { + this.oilNoName = oilNoName; + } + + public BigDecimal getPreferentialMargin() { + return preferentialMargin; + } + + public void setPreferentialMargin(BigDecimal preferentialMargin) { + this.preferentialMargin = preferentialMargin; + } + + public BigDecimal getGasStationDrop() { + return gasStationDrop; + } + + public void setGasStationDrop(BigDecimal gasStationDrop) { + this.gasStationDrop = gasStationDrop; + } + + public BigDecimal getPriceOfficial() { + return priceOfficial; + } + + public void setPriceOfficial(BigDecimal priceOfficial) { + this.priceOfficial = priceOfficial; + } + + public BigDecimal getPriceGun() { + return priceGun; + } + + public void setPriceGun(BigDecimal priceGun) { + this.priceGun = priceGun; + } + + public BigDecimal getPriceVip() { + return priceVip; + } + + public void setPriceVip(BigDecimal priceVip) { + this.priceVip = priceVip; + } + + 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 Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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; + } + BsGasOilPrice other = (BsGasOilPrice) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getPreferentialMargin() == null ? other.getPreferentialMargin() == null : this.getPreferentialMargin().equals(other.getPreferentialMargin())) + && (this.getGasStationDrop() == null ? other.getGasStationDrop() == null : this.getGasStationDrop().equals(other.getGasStationDrop())) + && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) + && (this.getPriceGun() == null ? other.getPriceGun() == null : this.getPriceGun().equals(other.getPriceGun())) + && (this.getPriceVip() == null ? other.getPriceVip() == null : this.getPriceVip().equals(other.getPriceVip())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getPreferentialMargin() == null) ? 0 : getPreferentialMargin().hashCode()); + result = prime * result + ((getGasStationDrop() == null) ? 0 : getGasStationDrop().hashCode()); + result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode()); + result = prime * result + ((getPriceGun() == null) ? 0 : getPriceGun().hashCode()); + result = prime * result + ((getPriceVip() == null) ? 0 : getPriceVip().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", preferentialMargin=").append(preferentialMargin); + sb.append(", gasStationDrop=").append(gasStationDrop); + sb.append(", priceOfficial=").append(priceOfficial); + sb.append(", priceGun=").append(priceGun); + sb.append(", priceVip=").append(priceVip); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + 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/BsGasOilPriceExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java new file mode 100644 index 0000000..babb67b --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceExample.java @@ -0,0 +1,1374 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsGasOilPriceExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsGasOilPriceExample() { + 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 andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNull() { + addCriterion("oil_type is null"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNotNull() { + addCriterion("oil_type is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeEqualTo(Integer value) { + addCriterion("oil_type =", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotEqualTo(Integer value) { + addCriterion("oil_type <>", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThan(Integer value) { + addCriterion("oil_type >", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_type >=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThan(Integer value) { + addCriterion("oil_type <", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("oil_type <=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeIn(List values) { + addCriterion("oil_type in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotIn(List values) { + addCriterion("oil_type not in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeBetween(Integer value1, Integer value2) { + addCriterion("oil_type between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("oil_type not between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNull() { + addCriterion("oil_type_name is null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNotNull() { + addCriterion("oil_type_name is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameEqualTo(String value) { + addCriterion("oil_type_name =", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotEqualTo(String value) { + addCriterion("oil_type_name <>", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThan(String value) { + addCriterion("oil_type_name >", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_type_name >=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThan(String value) { + addCriterion("oil_type_name <", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThanOrEqualTo(String value) { + addCriterion("oil_type_name <=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLike(String value) { + addCriterion("oil_type_name like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotLike(String value) { + addCriterion("oil_type_name not like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIn(List values) { + addCriterion("oil_type_name in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotIn(List values) { + addCriterion("oil_type_name not in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameBetween(String value1, String value2) { + addCriterion("oil_type_name between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotBetween(String value1, String value2) { + addCriterion("oil_type_name not between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilNoIsNull() { + addCriterion("oil_no is null"); + return (Criteria) this; + } + + public Criteria andOilNoIsNotNull() { + addCriterion("oil_no is not null"); + return (Criteria) this; + } + + public Criteria andOilNoEqualTo(String value) { + addCriterion("oil_no =", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotEqualTo(String value) { + addCriterion("oil_no <>", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThan(String value) { + addCriterion("oil_no >", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThanOrEqualTo(String value) { + addCriterion("oil_no >=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThan(String value) { + addCriterion("oil_no <", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThanOrEqualTo(String value) { + addCriterion("oil_no <=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLike(String value) { + addCriterion("oil_no like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotLike(String value) { + addCriterion("oil_no not like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoIn(List values) { + addCriterion("oil_no in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotIn(List values) { + addCriterion("oil_no not in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoBetween(String value1, String value2) { + addCriterion("oil_no between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotBetween(String value1, String value2) { + addCriterion("oil_no not between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNull() { + addCriterion("oil_no_name is null"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNotNull() { + addCriterion("oil_no_name is not null"); + return (Criteria) this; + } + + public Criteria andOilNoNameEqualTo(String value) { + addCriterion("oil_no_name =", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotEqualTo(String value) { + addCriterion("oil_no_name <>", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThan(String value) { + addCriterion("oil_no_name >", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_name >=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThan(String value) { + addCriterion("oil_no_name <", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThanOrEqualTo(String value) { + addCriterion("oil_no_name <=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLike(String value) { + addCriterion("oil_no_name like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotLike(String value) { + addCriterion("oil_no_name not like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameIn(List values) { + addCriterion("oil_no_name in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotIn(List values) { + addCriterion("oil_no_name not in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameBetween(String value1, String value2) { + addCriterion("oil_no_name between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotBetween(String value1, String value2) { + addCriterion("oil_no_name not between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginIsNull() { + addCriterion("preferential_margin is null"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginIsNotNull() { + addCriterion("preferential_margin is not null"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginEqualTo(BigDecimal value) { + addCriterion("preferential_margin =", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginNotEqualTo(BigDecimal value) { + addCriterion("preferential_margin <>", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginGreaterThan(BigDecimal value) { + addCriterion("preferential_margin >", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("preferential_margin >=", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginLessThan(BigDecimal value) { + addCriterion("preferential_margin <", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginLessThanOrEqualTo(BigDecimal value) { + addCriterion("preferential_margin <=", value, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginIn(List values) { + addCriterion("preferential_margin in", values, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginNotIn(List values) { + addCriterion("preferential_margin not in", values, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("preferential_margin between", value1, value2, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andPreferentialMarginNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("preferential_margin not between", value1, value2, "preferentialMargin"); + return (Criteria) this; + } + + public Criteria andGasStationDropIsNull() { + addCriterion("gas_station_drop is null"); + return (Criteria) this; + } + + public Criteria andGasStationDropIsNotNull() { + addCriterion("gas_station_drop is not null"); + return (Criteria) this; + } + + public Criteria andGasStationDropEqualTo(BigDecimal value) { + addCriterion("gas_station_drop =", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropNotEqualTo(BigDecimal value) { + addCriterion("gas_station_drop <>", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropGreaterThan(BigDecimal value) { + addCriterion("gas_station_drop >", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("gas_station_drop >=", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropLessThan(BigDecimal value) { + addCriterion("gas_station_drop <", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropLessThanOrEqualTo(BigDecimal value) { + addCriterion("gas_station_drop <=", value, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropIn(List values) { + addCriterion("gas_station_drop in", values, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropNotIn(List values) { + addCriterion("gas_station_drop not in", values, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_station_drop between", value1, value2, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andGasStationDropNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("gas_station_drop not between", value1, value2, "gasStationDrop"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIsNull() { + addCriterion("price_official is null"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIsNotNull() { + addCriterion("price_official is not null"); + return (Criteria) this; + } + + public Criteria andPriceOfficialEqualTo(BigDecimal value) { + addCriterion("price_official =", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotEqualTo(BigDecimal value) { + addCriterion("price_official <>", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialGreaterThan(BigDecimal value) { + addCriterion("price_official >", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price_official >=", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialLessThan(BigDecimal value) { + addCriterion("price_official <", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialLessThanOrEqualTo(BigDecimal value) { + addCriterion("price_official <=", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIn(List values) { + addCriterion("price_official in", values, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotIn(List values) { + addCriterion("price_official not in", values, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_official between", value1, value2, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_official not between", value1, value2, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceGunIsNull() { + addCriterion("price_gun is null"); + return (Criteria) this; + } + + public Criteria andPriceGunIsNotNull() { + addCriterion("price_gun is not null"); + return (Criteria) this; + } + + public Criteria andPriceGunEqualTo(BigDecimal value) { + addCriterion("price_gun =", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunNotEqualTo(BigDecimal value) { + addCriterion("price_gun <>", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunGreaterThan(BigDecimal value) { + addCriterion("price_gun >", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price_gun >=", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunLessThan(BigDecimal value) { + addCriterion("price_gun <", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunLessThanOrEqualTo(BigDecimal value) { + addCriterion("price_gun <=", value, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunIn(List values) { + addCriterion("price_gun in", values, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunNotIn(List values) { + addCriterion("price_gun not in", values, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_gun between", value1, value2, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceGunNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_gun not between", value1, value2, "priceGun"); + return (Criteria) this; + } + + public Criteria andPriceVipIsNull() { + addCriterion("price_vip is null"); + return (Criteria) this; + } + + public Criteria andPriceVipIsNotNull() { + addCriterion("price_vip is not null"); + return (Criteria) this; + } + + public Criteria andPriceVipEqualTo(BigDecimal value) { + addCriterion("price_vip =", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipNotEqualTo(BigDecimal value) { + addCriterion("price_vip <>", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipGreaterThan(BigDecimal value) { + addCriterion("price_vip >", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price_vip >=", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipLessThan(BigDecimal value) { + addCriterion("price_vip <", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipLessThanOrEqualTo(BigDecimal value) { + addCriterion("price_vip <=", value, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipIn(List values) { + addCriterion("price_vip in", values, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipNotIn(List values) { + addCriterion("price_vip not in", values, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_vip between", value1, value2, "priceVip"); + return (Criteria) this; + } + + public Criteria andPriceVipNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_vip not between", value1, value2, "priceVip"); + 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 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 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/BsGasOilPriceOfficial.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java new file mode 100644 index 0000000..27a4e6b --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficial.java @@ -0,0 +1,232 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * bs_gas_oil_price_official + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsGasOilPriceOfficial implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 区域id + */ + private Long regionId; + + /** + * 区域名称 + */ + private String regionName; + + /** + * 油号 + */ + private String oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 官方指导价【国标价】 + */ + private BigDecimal priceOfficial; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 燃油类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 状态 0:删除 1:正常 + */ + private Integer status; + + 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 getRegionId() { + return regionId; + } + + public void setRegionId(Long regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + public String getOilNo() { + return oilNo; + } + + public void setOilNo(String oilNo) { + this.oilNo = oilNo; + } + + public String getOilNoName() { + return oilNoName; + } + + public void setOilNoName(String oilNoName) { + this.oilNoName = oilNoName; + } + + public BigDecimal getPriceOfficial() { + return priceOfficial; + } + + public void setPriceOfficial(BigDecimal priceOfficial) { + this.priceOfficial = priceOfficial; + } + + public Integer getOilType() { + return oilType; + } + + public void setOilType(Integer oilType) { + this.oilType = oilType; + } + + public String getOilTypeName() { + return oilTypeName; + } + + public void setOilTypeName(String oilTypeName) { + this.oilTypeName = oilTypeName; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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; + } + BsGasOilPriceOfficial other = (BsGasOilPriceOfficial) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getPriceOfficial() == null ? other.getPriceOfficial() == null : this.getPriceOfficial().equals(other.getPriceOfficial())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getPriceOfficial() == null) ? 0 : getPriceOfficial().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", priceOfficial=").append(priceOfficial); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", status=").append(status); + 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/BsGasOilPriceOfficialExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java new file mode 100644 index 0000000..23452a7 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceOfficialExample.java @@ -0,0 +1,1013 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +public class BsGasOilPriceOfficialExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsGasOilPriceOfficialExample() { + 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 andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(Long value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(Long value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(Long value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(Long value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(Long value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(Long value) { + addCriterion("region_id <=", 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(Long value1, Long value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(Long value1, Long 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 andOilNoIsNull() { + addCriterion("oil_no is null"); + return (Criteria) this; + } + + public Criteria andOilNoIsNotNull() { + addCriterion("oil_no is not null"); + return (Criteria) this; + } + + public Criteria andOilNoEqualTo(String value) { + addCriterion("oil_no =", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotEqualTo(String value) { + addCriterion("oil_no <>", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThan(String value) { + addCriterion("oil_no >", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThanOrEqualTo(String value) { + addCriterion("oil_no >=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThan(String value) { + addCriterion("oil_no <", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThanOrEqualTo(String value) { + addCriterion("oil_no <=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLike(String value) { + addCriterion("oil_no like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotLike(String value) { + addCriterion("oil_no not like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoIn(List values) { + addCriterion("oil_no in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotIn(List values) { + addCriterion("oil_no not in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoBetween(String value1, String value2) { + addCriterion("oil_no between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotBetween(String value1, String value2) { + addCriterion("oil_no not between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNull() { + addCriterion("oil_no_name is null"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNotNull() { + addCriterion("oil_no_name is not null"); + return (Criteria) this; + } + + public Criteria andOilNoNameEqualTo(String value) { + addCriterion("oil_no_name =", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotEqualTo(String value) { + addCriterion("oil_no_name <>", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThan(String value) { + addCriterion("oil_no_name >", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_name >=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThan(String value) { + addCriterion("oil_no_name <", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThanOrEqualTo(String value) { + addCriterion("oil_no_name <=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLike(String value) { + addCriterion("oil_no_name like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotLike(String value) { + addCriterion("oil_no_name not like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameIn(List values) { + addCriterion("oil_no_name in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotIn(List values) { + addCriterion("oil_no_name not in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameBetween(String value1, String value2) { + addCriterion("oil_no_name between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotBetween(String value1, String value2) { + addCriterion("oil_no_name not between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIsNull() { + addCriterion("price_official is null"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIsNotNull() { + addCriterion("price_official is not null"); + return (Criteria) this; + } + + public Criteria andPriceOfficialEqualTo(BigDecimal value) { + addCriterion("price_official =", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotEqualTo(BigDecimal value) { + addCriterion("price_official <>", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialGreaterThan(BigDecimal value) { + addCriterion("price_official >", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price_official >=", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialLessThan(BigDecimal value) { + addCriterion("price_official <", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialLessThanOrEqualTo(BigDecimal value) { + addCriterion("price_official <=", value, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialIn(List values) { + addCriterion("price_official in", values, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotIn(List values) { + addCriterion("price_official not in", values, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_official between", value1, value2, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andPriceOfficialNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price_official not between", value1, value2, "priceOfficial"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNull() { + addCriterion("oil_type is null"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNotNull() { + addCriterion("oil_type is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeEqualTo(Integer value) { + addCriterion("oil_type =", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotEqualTo(Integer value) { + addCriterion("oil_type <>", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThan(Integer value) { + addCriterion("oil_type >", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_type >=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThan(Integer value) { + addCriterion("oil_type <", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("oil_type <=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeIn(List values) { + addCriterion("oil_type in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotIn(List values) { + addCriterion("oil_type not in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeBetween(Integer value1, Integer value2) { + addCriterion("oil_type between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("oil_type not between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNull() { + addCriterion("oil_type_name is null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNotNull() { + addCriterion("oil_type_name is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameEqualTo(String value) { + addCriterion("oil_type_name =", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotEqualTo(String value) { + addCriterion("oil_type_name <>", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThan(String value) { + addCriterion("oil_type_name >", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_type_name >=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThan(String value) { + addCriterion("oil_type_name <", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThanOrEqualTo(String value) { + addCriterion("oil_type_name <=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLike(String value) { + addCriterion("oil_type_name like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotLike(String value) { + addCriterion("oil_type_name not like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIn(List values) { + addCriterion("oil_type_name in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotIn(List values) { + addCriterion("oil_type_name not in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameBetween(String value1, String value2) { + addCriterion("oil_type_name between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotBetween(String value1, String value2) { + addCriterion("oil_type_name not between", value1, value2, "oilTypeName"); + 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 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/BsGasOilPriceTask.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceTask.java new file mode 100644 index 0000000..08343d3 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceTask.java @@ -0,0 +1,441 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * bs_gas_oil_price_task + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsGasOilPriceTask implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 区域id + */ + private Long regionId; + + /** + * 区域名称 + */ + private String regionName; + + /** + * 油价价区id + */ + private Integer oilPriceZoneId; + + /** + * 油价价区名称 + */ + private String oilPriceZoneName; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 商户地址 + */ + private String merAddress; + + /** + * 油品类型 1:汽油:2:柴油;3:天然气 + */ + private Integer oilType; + + /** + * 油品类型名 1:汽油:2:柴油;3:天然气 + */ + private String oilTypeName; + + /** + * 油号 + */ + private String oilNo; + + /** + * 油品名称 + */ + private String oilNoName; + + /** + * 价格类型 1. 国标价 2. 油站价 3. 优惠幅度 + */ + private Integer priceType; + + /** + * 价格 + */ + private BigDecimal price; + + /** + * 执行方式 1. 立刻执行 2. 定时执行 + */ + private Integer executionType; + + /** + * 执行时间 + */ + private Date startTime; + + /** + * 状态 0:删除 1:等待中 2:已执行 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 操作人id + */ + private Long opUserId; + + /** + * 操作人名称 + */ + private String opUserName; + + 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 getRegionId() { + return regionId; + } + + public void setRegionId(Long regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + public Integer getOilPriceZoneId() { + return oilPriceZoneId; + } + + public void setOilPriceZoneId(Integer oilPriceZoneId) { + this.oilPriceZoneId = oilPriceZoneId; + } + + public String getOilPriceZoneName() { + return oilPriceZoneName; + } + + public void setOilPriceZoneName(String oilPriceZoneName) { + this.oilPriceZoneName = oilPriceZoneName; + } + + public Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getMerAddress() { + return merAddress; + } + + public void setMerAddress(String merAddress) { + this.merAddress = merAddress; + } + + public Integer getOilType() { + return oilType; + } + + public void setOilType(Integer oilType) { + this.oilType = oilType; + } + + public String getOilTypeName() { + return oilTypeName; + } + + public void setOilTypeName(String oilTypeName) { + this.oilTypeName = oilTypeName; + } + + public String getOilNo() { + return oilNo; + } + + public void setOilNo(String oilNo) { + this.oilNo = oilNo; + } + + public String getOilNoName() { + return oilNoName; + } + + public void setOilNoName(String oilNoName) { + this.oilNoName = oilNoName; + } + + public Integer getPriceType() { + return priceType; + } + + public void setPriceType(Integer priceType) { + this.priceType = priceType; + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public Integer getExecutionType() { + return executionType; + } + + public void setExecutionType(Integer executionType) { + this.executionType = executionType; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + 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 Long getOpUserId() { + return opUserId; + } + + public void setOpUserId(Long opUserId) { + this.opUserId = opUserId; + } + + public String getOpUserName() { + return opUserName; + } + + public void setOpUserName(String opUserName) { + this.opUserName = opUserName; + } + + 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; + } + BsGasOilPriceTask other = (BsGasOilPriceTask) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getOilPriceZoneId() == null ? other.getOilPriceZoneId() == null : this.getOilPriceZoneId().equals(other.getOilPriceZoneId())) + && (this.getOilPriceZoneName() == null ? other.getOilPriceZoneName() == null : this.getOilPriceZoneName().equals(other.getOilPriceZoneName())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getMerAddress() == null ? other.getMerAddress() == null : this.getMerAddress().equals(other.getMerAddress())) + && (this.getOilType() == null ? other.getOilType() == null : this.getOilType().equals(other.getOilType())) + && (this.getOilTypeName() == null ? other.getOilTypeName() == null : this.getOilTypeName().equals(other.getOilTypeName())) + && (this.getOilNo() == null ? other.getOilNo() == null : this.getOilNo().equals(other.getOilNo())) + && (this.getOilNoName() == null ? other.getOilNoName() == null : this.getOilNoName().equals(other.getOilNoName())) + && (this.getPriceType() == null ? other.getPriceType() == null : this.getPriceType().equals(other.getPriceType())) + && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice())) + && (this.getExecutionType() == null ? other.getExecutionType() == null : this.getExecutionType().equals(other.getExecutionType())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (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.getOpUserId() == null ? other.getOpUserId() == null : this.getOpUserId().equals(other.getOpUserId())) + && (this.getOpUserName() == null ? other.getOpUserName() == null : this.getOpUserName().equals(other.getOpUserName())) + && (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 + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getOilPriceZoneId() == null) ? 0 : getOilPriceZoneId().hashCode()); + result = prime * result + ((getOilPriceZoneName() == null) ? 0 : getOilPriceZoneName().hashCode()); + result = prime * result + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getMerAddress() == null) ? 0 : getMerAddress().hashCode()); + result = prime * result + ((getOilType() == null) ? 0 : getOilType().hashCode()); + result = prime * result + ((getOilTypeName() == null) ? 0 : getOilTypeName().hashCode()); + result = prime * result + ((getOilNo() == null) ? 0 : getOilNo().hashCode()); + result = prime * result + ((getOilNoName() == null) ? 0 : getOilNoName().hashCode()); + result = prime * result + ((getPriceType() == null) ? 0 : getPriceType().hashCode()); + result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode()); + result = prime * result + ((getExecutionType() == null) ? 0 : getExecutionType().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().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 + ((getOpUserId() == null) ? 0 : getOpUserId().hashCode()); + result = prime * result + ((getOpUserName() == null) ? 0 : getOpUserName().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(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); + sb.append(", oilPriceZoneId=").append(oilPriceZoneId); + sb.append(", oilPriceZoneName=").append(oilPriceZoneName); + sb.append(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", merAddress=").append(merAddress); + sb.append(", oilType=").append(oilType); + sb.append(", oilTypeName=").append(oilTypeName); + sb.append(", oilNo=").append(oilNo); + sb.append(", oilNoName=").append(oilNoName); + sb.append(", priceType=").append(priceType); + sb.append(", price=").append(price); + sb.append(", executionType=").append(executionType); + sb.append(", startTime=").append(startTime); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", opUserId=").append(opUserId); + sb.append(", opUserName=").append(opUserName); + 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/BsGasOilPriceTaskExample.java b/service/src/main/java/com/hfkj/entity/BsGasOilPriceTaskExample.java new file mode 100644 index 0000000..61767fa --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsGasOilPriceTaskExample.java @@ -0,0 +1,1844 @@ +package com.hfkj.entity; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsGasOilPriceTaskExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsGasOilPriceTaskExample() { + 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 andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(Long value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(Long value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(Long value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(Long value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(Long value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(Long value) { + addCriterion("region_id <=", 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(Long value1, Long value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(Long value1, Long 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 andOilPriceZoneIdIsNull() { + addCriterion("oil_price_zone_id is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIsNotNull() { + addCriterion("oil_price_zone_id is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdEqualTo(Integer value) { + addCriterion("oil_price_zone_id =", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotEqualTo(Integer value) { + addCriterion("oil_price_zone_id <>", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThan(Integer value) { + addCriterion("oil_price_zone_id >", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id >=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThan(Integer value) { + addCriterion("oil_price_zone_id <", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id <=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIn(List values) { + addCriterion("oil_price_zone_id in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotIn(List values) { + addCriterion("oil_price_zone_id not in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id not between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNull() { + addCriterion("oil_price_zone_name is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNotNull() { + addCriterion("oil_price_zone_name is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameEqualTo(String value) { + addCriterion("oil_price_zone_name =", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotEqualTo(String value) { + addCriterion("oil_price_zone_name <>", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThan(String value) { + addCriterion("oil_price_zone_name >", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name >=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThan(String value) { + addCriterion("oil_price_zone_name <", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name <=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLike(String value) { + addCriterion("oil_price_zone_name like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotLike(String value) { + addCriterion("oil_price_zone_name not like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIn(List values) { + addCriterion("oil_price_zone_name in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotIn(List values) { + addCriterion("oil_price_zone_name not in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameBetween(String value1, String value2) { + addCriterion("oil_price_zone_name between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotBetween(String value1, String value2) { + addCriterion("oil_price_zone_name not between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerAddressIsNull() { + addCriterion("mer_address is null"); + return (Criteria) this; + } + + public Criteria andMerAddressIsNotNull() { + addCriterion("mer_address is not null"); + return (Criteria) this; + } + + public Criteria andMerAddressEqualTo(String value) { + addCriterion("mer_address =", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressNotEqualTo(String value) { + addCriterion("mer_address <>", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressGreaterThan(String value) { + addCriterion("mer_address >", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressGreaterThanOrEqualTo(String value) { + addCriterion("mer_address >=", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressLessThan(String value) { + addCriterion("mer_address <", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressLessThanOrEqualTo(String value) { + addCriterion("mer_address <=", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressLike(String value) { + addCriterion("mer_address like", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressNotLike(String value) { + addCriterion("mer_address not like", value, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressIn(List values) { + addCriterion("mer_address in", values, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressNotIn(List values) { + addCriterion("mer_address not in", values, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressBetween(String value1, String value2) { + addCriterion("mer_address between", value1, value2, "merAddress"); + return (Criteria) this; + } + + public Criteria andMerAddressNotBetween(String value1, String value2) { + addCriterion("mer_address not between", value1, value2, "merAddress"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNull() { + addCriterion("oil_type is null"); + return (Criteria) this; + } + + public Criteria andOilTypeIsNotNull() { + addCriterion("oil_type is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeEqualTo(Integer value) { + addCriterion("oil_type =", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotEqualTo(Integer value) { + addCriterion("oil_type <>", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThan(Integer value) { + addCriterion("oil_type >", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_type >=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThan(Integer value) { + addCriterion("oil_type <", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeLessThanOrEqualTo(Integer value) { + addCriterion("oil_type <=", value, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeIn(List values) { + addCriterion("oil_type in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotIn(List values) { + addCriterion("oil_type not in", values, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeBetween(Integer value1, Integer value2) { + addCriterion("oil_type between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNotBetween(Integer value1, Integer value2) { + addCriterion("oil_type not between", value1, value2, "oilType"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNull() { + addCriterion("oil_type_name is null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIsNotNull() { + addCriterion("oil_type_name is not null"); + return (Criteria) this; + } + + public Criteria andOilTypeNameEqualTo(String value) { + addCriterion("oil_type_name =", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotEqualTo(String value) { + addCriterion("oil_type_name <>", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThan(String value) { + addCriterion("oil_type_name >", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_type_name >=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThan(String value) { + addCriterion("oil_type_name <", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLessThanOrEqualTo(String value) { + addCriterion("oil_type_name <=", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameLike(String value) { + addCriterion("oil_type_name like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotLike(String value) { + addCriterion("oil_type_name not like", value, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameIn(List values) { + addCriterion("oil_type_name in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotIn(List values) { + addCriterion("oil_type_name not in", values, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameBetween(String value1, String value2) { + addCriterion("oil_type_name between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilTypeNameNotBetween(String value1, String value2) { + addCriterion("oil_type_name not between", value1, value2, "oilTypeName"); + return (Criteria) this; + } + + public Criteria andOilNoIsNull() { + addCriterion("oil_no is null"); + return (Criteria) this; + } + + public Criteria andOilNoIsNotNull() { + addCriterion("oil_no is not null"); + return (Criteria) this; + } + + public Criteria andOilNoEqualTo(String value) { + addCriterion("oil_no =", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotEqualTo(String value) { + addCriterion("oil_no <>", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThan(String value) { + addCriterion("oil_no >", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoGreaterThanOrEqualTo(String value) { + addCriterion("oil_no >=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThan(String value) { + addCriterion("oil_no <", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLessThanOrEqualTo(String value) { + addCriterion("oil_no <=", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoLike(String value) { + addCriterion("oil_no like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotLike(String value) { + addCriterion("oil_no not like", value, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoIn(List values) { + addCriterion("oil_no in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotIn(List values) { + addCriterion("oil_no not in", values, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoBetween(String value1, String value2) { + addCriterion("oil_no between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNotBetween(String value1, String value2) { + addCriterion("oil_no not between", value1, value2, "oilNo"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNull() { + addCriterion("oil_no_name is null"); + return (Criteria) this; + } + + public Criteria andOilNoNameIsNotNull() { + addCriterion("oil_no_name is not null"); + return (Criteria) this; + } + + public Criteria andOilNoNameEqualTo(String value) { + addCriterion("oil_no_name =", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotEqualTo(String value) { + addCriterion("oil_no_name <>", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThan(String value) { + addCriterion("oil_no_name >", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_no_name >=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThan(String value) { + addCriterion("oil_no_name <", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLessThanOrEqualTo(String value) { + addCriterion("oil_no_name <=", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameLike(String value) { + addCriterion("oil_no_name like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotLike(String value) { + addCriterion("oil_no_name not like", value, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameIn(List values) { + addCriterion("oil_no_name in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotIn(List values) { + addCriterion("oil_no_name not in", values, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameBetween(String value1, String value2) { + addCriterion("oil_no_name between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andOilNoNameNotBetween(String value1, String value2) { + addCriterion("oil_no_name not between", value1, value2, "oilNoName"); + return (Criteria) this; + } + + public Criteria andPriceTypeIsNull() { + addCriterion("price_type is null"); + return (Criteria) this; + } + + public Criteria andPriceTypeIsNotNull() { + addCriterion("price_type is not null"); + return (Criteria) this; + } + + public Criteria andPriceTypeEqualTo(Integer value) { + addCriterion("price_type =", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotEqualTo(Integer value) { + addCriterion("price_type <>", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeGreaterThan(Integer value) { + addCriterion("price_type >", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("price_type >=", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeLessThan(Integer value) { + addCriterion("price_type <", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeLessThanOrEqualTo(Integer value) { + addCriterion("price_type <=", value, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeIn(List values) { + addCriterion("price_type in", values, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotIn(List values) { + addCriterion("price_type not in", values, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeBetween(Integer value1, Integer value2) { + addCriterion("price_type between", value1, value2, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("price_type not between", value1, value2, "priceType"); + return (Criteria) this; + } + + public Criteria andPriceIsNull() { + addCriterion("price is null"); + return (Criteria) this; + } + + public Criteria andPriceIsNotNull() { + addCriterion("price is not null"); + return (Criteria) this; + } + + public Criteria andPriceEqualTo(BigDecimal value) { + addCriterion("price =", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotEqualTo(BigDecimal value) { + addCriterion("price <>", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThan(BigDecimal value) { + addCriterion("price >", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceGreaterThanOrEqualTo(BigDecimal value) { + addCriterion("price >=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThan(BigDecimal value) { + addCriterion("price <", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceLessThanOrEqualTo(BigDecimal value) { + addCriterion("price <=", value, "price"); + return (Criteria) this; + } + + public Criteria andPriceIn(List values) { + addCriterion("price in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotIn(List values) { + addCriterion("price not in", values, "price"); + return (Criteria) this; + } + + public Criteria andPriceBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andPriceNotBetween(BigDecimal value1, BigDecimal value2) { + addCriterion("price not between", value1, value2, "price"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIsNull() { + addCriterion("execution_type is null"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIsNotNull() { + addCriterion("execution_type is not null"); + return (Criteria) this; + } + + public Criteria andExecutionTypeEqualTo(Integer value) { + addCriterion("execution_type =", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotEqualTo(Integer value) { + addCriterion("execution_type <>", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeGreaterThan(Integer value) { + addCriterion("execution_type >", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("execution_type >=", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeLessThan(Integer value) { + addCriterion("execution_type <", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeLessThanOrEqualTo(Integer value) { + addCriterion("execution_type <=", value, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeIn(List values) { + addCriterion("execution_type in", values, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotIn(List values) { + addCriterion("execution_type not in", values, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeBetween(Integer value1, Integer value2) { + addCriterion("execution_type between", value1, value2, "executionType"); + return (Criteria) this; + } + + public Criteria andExecutionTypeNotBetween(Integer value1, Integer value2) { + addCriterion("execution_type not between", value1, value2, "executionType"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Date value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Date value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Date value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Date value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Date value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Date value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Date value1, Date value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Date value1, Date value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + 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 andOpUserIdIsNull() { + addCriterion("op_user_id is null"); + return (Criteria) this; + } + + public Criteria andOpUserIdIsNotNull() { + addCriterion("op_user_id is not null"); + return (Criteria) this; + } + + public Criteria andOpUserIdEqualTo(Long value) { + addCriterion("op_user_id =", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotEqualTo(Long value) { + addCriterion("op_user_id <>", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThan(Long value) { + addCriterion("op_user_id >", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdGreaterThanOrEqualTo(Long value) { + addCriterion("op_user_id >=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThan(Long value) { + addCriterion("op_user_id <", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdLessThanOrEqualTo(Long value) { + addCriterion("op_user_id <=", value, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdIn(List values) { + addCriterion("op_user_id in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotIn(List values) { + addCriterion("op_user_id not in", values, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdBetween(Long value1, Long value2) { + addCriterion("op_user_id between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserIdNotBetween(Long value1, Long value2) { + addCriterion("op_user_id not between", value1, value2, "opUserId"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNull() { + addCriterion("op_user_name is null"); + return (Criteria) this; + } + + public Criteria andOpUserNameIsNotNull() { + addCriterion("op_user_name is not null"); + return (Criteria) this; + } + + public Criteria andOpUserNameEqualTo(String value) { + addCriterion("op_user_name =", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotEqualTo(String value) { + addCriterion("op_user_name <>", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThan(String value) { + addCriterion("op_user_name >", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameGreaterThanOrEqualTo(String value) { + addCriterion("op_user_name >=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThan(String value) { + addCriterion("op_user_name <", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLessThanOrEqualTo(String value) { + addCriterion("op_user_name <=", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameLike(String value) { + addCriterion("op_user_name like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotLike(String value) { + addCriterion("op_user_name not like", value, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameIn(List values) { + addCriterion("op_user_name in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotIn(List values) { + addCriterion("op_user_name not in", values, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameBetween(String value1, String value2) { + addCriterion("op_user_name between", value1, value2, "opUserName"); + return (Criteria) this; + } + + public Criteria andOpUserNameNotBetween(String value1, String value2) { + addCriterion("op_user_name not between", value1, value2, "opUserName"); + 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/BsMerchant.java b/service/src/main/java/com/hfkj/entity/BsMerchant.java new file mode 100644 index 0000000..dce37db --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchant.java @@ -0,0 +1,456 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_merchant + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchant implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 来源类型 + */ + private Integer sourceType; + + /** + * 省地区代码 + */ + private Long provinceCode; + + /** + * 省地区名称 + */ + private String provinceName; + + /** + * 市地区代码 + */ + private Long cityCode; + + /** + * 市地区名称 + */ + private String cityName; + + /** + * 区/县地区代码 + */ + private Long areaCode; + + /** + * 区/县地区名称 + */ + private String areaName; + + /** + * 油价价区id + */ + private Integer oilPriceZoneId; + + /** + * 油价价区名称 + */ + private String oilPriceZoneName; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 商户logo + */ + private String merLogo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 联系人 + */ + private String contactsName; + + /** + * 联系方式 + */ + private String contactsTel; + + /** + * 客服电话 + */ + private String customerServiceTel; + + /** + * 商户地址 + */ + private String address; + + /** + * 商户地址经度 + */ + private String longitude; + + /** + * 商户地址纬度 + */ + private String latitude; + + /** + * 商户标签 + */ + private String merLabel; + + /** + * 状态 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 Integer getSourceType() { + return sourceType; + } + + public void setSourceType(Integer sourceType) { + this.sourceType = sourceType; + } + + public Long getProvinceCode() { + return provinceCode; + } + + public void setProvinceCode(Long provinceCode) { + this.provinceCode = provinceCode; + } + + public String getProvinceName() { + return provinceName; + } + + public void setProvinceName(String provinceName) { + this.provinceName = provinceName; + } + + public Long getCityCode() { + return cityCode; + } + + public void setCityCode(Long cityCode) { + this.cityCode = cityCode; + } + + public String getCityName() { + return cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public Long getAreaCode() { + return areaCode; + } + + public void setAreaCode(Long areaCode) { + this.areaCode = areaCode; + } + + public String getAreaName() { + return areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public Integer getOilPriceZoneId() { + return oilPriceZoneId; + } + + public void setOilPriceZoneId(Integer oilPriceZoneId) { + this.oilPriceZoneId = oilPriceZoneId; + } + + public String getOilPriceZoneName() { + return oilPriceZoneName; + } + + public void setOilPriceZoneName(String oilPriceZoneName) { + this.oilPriceZoneName = oilPriceZoneName; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerLogo() { + return merLogo; + } + + public void setMerLogo(String merLogo) { + this.merLogo = merLogo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getContactsName() { + return contactsName; + } + + public void setContactsName(String contactsName) { + this.contactsName = contactsName; + } + + public String getContactsTel() { + return contactsTel; + } + + public void setContactsTel(String contactsTel) { + this.contactsTel = contactsTel; + } + + public String getCustomerServiceTel() { + return customerServiceTel; + } + + public void setCustomerServiceTel(String customerServiceTel) { + this.customerServiceTel = customerServiceTel; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getMerLabel() { + return merLabel; + } + + public void setMerLabel(String merLabel) { + this.merLabel = merLabel; + } + + 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; + } + BsMerchant other = (BsMerchant) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getSourceType() == null ? other.getSourceType() == null : this.getSourceType().equals(other.getSourceType())) + && (this.getProvinceCode() == null ? other.getProvinceCode() == null : this.getProvinceCode().equals(other.getProvinceCode())) + && (this.getProvinceName() == null ? other.getProvinceName() == null : this.getProvinceName().equals(other.getProvinceName())) + && (this.getCityCode() == null ? other.getCityCode() == null : this.getCityCode().equals(other.getCityCode())) + && (this.getCityName() == null ? other.getCityName() == null : this.getCityName().equals(other.getCityName())) + && (this.getAreaCode() == null ? other.getAreaCode() == null : this.getAreaCode().equals(other.getAreaCode())) + && (this.getAreaName() == null ? other.getAreaName() == null : this.getAreaName().equals(other.getAreaName())) + && (this.getOilPriceZoneId() == null ? other.getOilPriceZoneId() == null : this.getOilPriceZoneId().equals(other.getOilPriceZoneId())) + && (this.getOilPriceZoneName() == null ? other.getOilPriceZoneName() == null : this.getOilPriceZoneName().equals(other.getOilPriceZoneName())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerLogo() == null ? other.getMerLogo() == null : this.getMerLogo().equals(other.getMerLogo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getContactsName() == null ? other.getContactsName() == null : this.getContactsName().equals(other.getContactsName())) + && (this.getContactsTel() == null ? other.getContactsTel() == null : this.getContactsTel().equals(other.getContactsTel())) + && (this.getCustomerServiceTel() == null ? other.getCustomerServiceTel() == null : this.getCustomerServiceTel().equals(other.getCustomerServiceTel())) + && (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress())) + && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude())) + && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude())) + && (this.getMerLabel() == null ? other.getMerLabel() == null : this.getMerLabel().equals(other.getMerLabel())) + && (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 + ((getSourceType() == null) ? 0 : getSourceType().hashCode()); + result = prime * result + ((getProvinceCode() == null) ? 0 : getProvinceCode().hashCode()); + result = prime * result + ((getProvinceName() == null) ? 0 : getProvinceName().hashCode()); + result = prime * result + ((getCityCode() == null) ? 0 : getCityCode().hashCode()); + result = prime * result + ((getCityName() == null) ? 0 : getCityName().hashCode()); + result = prime * result + ((getAreaCode() == null) ? 0 : getAreaCode().hashCode()); + result = prime * result + ((getAreaName() == null) ? 0 : getAreaName().hashCode()); + result = prime * result + ((getOilPriceZoneId() == null) ? 0 : getOilPriceZoneId().hashCode()); + result = prime * result + ((getOilPriceZoneName() == null) ? 0 : getOilPriceZoneName().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerLogo() == null) ? 0 : getMerLogo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getContactsName() == null) ? 0 : getContactsName().hashCode()); + result = prime * result + ((getContactsTel() == null) ? 0 : getContactsTel().hashCode()); + result = prime * result + ((getCustomerServiceTel() == null) ? 0 : getCustomerServiceTel().hashCode()); + result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode()); + result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode()); + result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode()); + result = prime * result + ((getMerLabel() == null) ? 0 : getMerLabel().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(", sourceType=").append(sourceType); + sb.append(", provinceCode=").append(provinceCode); + sb.append(", provinceName=").append(provinceName); + sb.append(", cityCode=").append(cityCode); + sb.append(", cityName=").append(cityName); + sb.append(", areaCode=").append(areaCode); + sb.append(", areaName=").append(areaName); + sb.append(", oilPriceZoneId=").append(oilPriceZoneId); + sb.append(", oilPriceZoneName=").append(oilPriceZoneName); + sb.append(", merNo=").append(merNo); + sb.append(", merLogo=").append(merLogo); + sb.append(", merName=").append(merName); + sb.append(", contactsName=").append(contactsName); + sb.append(", contactsTel=").append(contactsTel); + sb.append(", customerServiceTel=").append(customerServiceTel); + sb.append(", address=").append(address); + sb.append(", longitude=").append(longitude); + sb.append(", latitude=").append(latitude); + sb.append(", merLabel=").append(merLabel); + 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/BsMerchantExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantExample.java new file mode 100644 index 0000000..9822709 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantExample.java @@ -0,0 +1,1953 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantExample() { + 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 andSourceTypeIsNull() { + addCriterion("source_type is null"); + return (Criteria) this; + } + + public Criteria andSourceTypeIsNotNull() { + addCriterion("source_type is not null"); + return (Criteria) this; + } + + public Criteria andSourceTypeEqualTo(Integer value) { + addCriterion("source_type =", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotEqualTo(Integer value) { + addCriterion("source_type <>", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThan(Integer value) { + addCriterion("source_type >", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("source_type >=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThan(Integer value) { + addCriterion("source_type <", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeLessThanOrEqualTo(Integer value) { + addCriterion("source_type <=", value, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeIn(List values) { + addCriterion("source_type in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotIn(List values) { + addCriterion("source_type not in", values, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeBetween(Integer value1, Integer value2) { + addCriterion("source_type between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) { + addCriterion("source_type not between", value1, value2, "sourceType"); + return (Criteria) this; + } + + public Criteria andProvinceCodeIsNull() { + addCriterion("province_code is null"); + return (Criteria) this; + } + + public Criteria andProvinceCodeIsNotNull() { + addCriterion("province_code is not null"); + return (Criteria) this; + } + + public Criteria andProvinceCodeEqualTo(Long value) { + addCriterion("province_code =", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeNotEqualTo(Long value) { + addCriterion("province_code <>", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeGreaterThan(Long value) { + addCriterion("province_code >", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeGreaterThanOrEqualTo(Long value) { + addCriterion("province_code >=", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeLessThan(Long value) { + addCriterion("province_code <", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeLessThanOrEqualTo(Long value) { + addCriterion("province_code <=", value, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeIn(List values) { + addCriterion("province_code in", values, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeNotIn(List values) { + addCriterion("province_code not in", values, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeBetween(Long value1, Long value2) { + addCriterion("province_code between", value1, value2, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceCodeNotBetween(Long value1, Long value2) { + addCriterion("province_code not between", value1, value2, "provinceCode"); + return (Criteria) this; + } + + public Criteria andProvinceNameIsNull() { + addCriterion("province_name is null"); + return (Criteria) this; + } + + public Criteria andProvinceNameIsNotNull() { + addCriterion("province_name is not null"); + return (Criteria) this; + } + + public Criteria andProvinceNameEqualTo(String value) { + addCriterion("province_name =", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameNotEqualTo(String value) { + addCriterion("province_name <>", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameGreaterThan(String value) { + addCriterion("province_name >", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameGreaterThanOrEqualTo(String value) { + addCriterion("province_name >=", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameLessThan(String value) { + addCriterion("province_name <", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameLessThanOrEqualTo(String value) { + addCriterion("province_name <=", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameLike(String value) { + addCriterion("province_name like", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameNotLike(String value) { + addCriterion("province_name not like", value, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameIn(List values) { + addCriterion("province_name in", values, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameNotIn(List values) { + addCriterion("province_name not in", values, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameBetween(String value1, String value2) { + addCriterion("province_name between", value1, value2, "provinceName"); + return (Criteria) this; + } + + public Criteria andProvinceNameNotBetween(String value1, String value2) { + addCriterion("province_name not between", value1, value2, "provinceName"); + return (Criteria) this; + } + + public Criteria andCityCodeIsNull() { + addCriterion("city_code is null"); + return (Criteria) this; + } + + public Criteria andCityCodeIsNotNull() { + addCriterion("city_code is not null"); + return (Criteria) this; + } + + public Criteria andCityCodeEqualTo(Long value) { + addCriterion("city_code =", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeNotEqualTo(Long value) { + addCriterion("city_code <>", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeGreaterThan(Long value) { + addCriterion("city_code >", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeGreaterThanOrEqualTo(Long value) { + addCriterion("city_code >=", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeLessThan(Long value) { + addCriterion("city_code <", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeLessThanOrEqualTo(Long value) { + addCriterion("city_code <=", value, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeIn(List values) { + addCriterion("city_code in", values, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeNotIn(List values) { + addCriterion("city_code not in", values, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeBetween(Long value1, Long value2) { + addCriterion("city_code between", value1, value2, "cityCode"); + return (Criteria) this; + } + + public Criteria andCityCodeNotBetween(Long value1, Long value2) { + addCriterion("city_code not between", value1, value2, "cityCode"); + 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 andAreaCodeIsNull() { + addCriterion("area_code is null"); + return (Criteria) this; + } + + public Criteria andAreaCodeIsNotNull() { + addCriterion("area_code is not null"); + return (Criteria) this; + } + + public Criteria andAreaCodeEqualTo(Long value) { + addCriterion("area_code =", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeNotEqualTo(Long value) { + addCriterion("area_code <>", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeGreaterThan(Long value) { + addCriterion("area_code >", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeGreaterThanOrEqualTo(Long value) { + addCriterion("area_code >=", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeLessThan(Long value) { + addCriterion("area_code <", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeLessThanOrEqualTo(Long value) { + addCriterion("area_code <=", value, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeIn(List values) { + addCriterion("area_code in", values, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeNotIn(List values) { + addCriterion("area_code not in", values, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeBetween(Long value1, Long value2) { + addCriterion("area_code between", value1, value2, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaCodeNotBetween(Long value1, Long value2) { + addCriterion("area_code not between", value1, value2, "areaCode"); + return (Criteria) this; + } + + public Criteria andAreaNameIsNull() { + addCriterion("area_name is null"); + return (Criteria) this; + } + + public Criteria andAreaNameIsNotNull() { + addCriterion("area_name is not null"); + return (Criteria) this; + } + + public Criteria andAreaNameEqualTo(String value) { + addCriterion("area_name =", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameNotEqualTo(String value) { + addCriterion("area_name <>", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameGreaterThan(String value) { + addCriterion("area_name >", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameGreaterThanOrEqualTo(String value) { + addCriterion("area_name >=", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameLessThan(String value) { + addCriterion("area_name <", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameLessThanOrEqualTo(String value) { + addCriterion("area_name <=", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameLike(String value) { + addCriterion("area_name like", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameNotLike(String value) { + addCriterion("area_name not like", value, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameIn(List values) { + addCriterion("area_name in", values, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameNotIn(List values) { + addCriterion("area_name not in", values, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameBetween(String value1, String value2) { + addCriterion("area_name between", value1, value2, "areaName"); + return (Criteria) this; + } + + public Criteria andAreaNameNotBetween(String value1, String value2) { + addCriterion("area_name not between", value1, value2, "areaName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIsNull() { + addCriterion("oil_price_zone_id is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIsNotNull() { + addCriterion("oil_price_zone_id is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdEqualTo(Integer value) { + addCriterion("oil_price_zone_id =", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotEqualTo(Integer value) { + addCriterion("oil_price_zone_id <>", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThan(Integer value) { + addCriterion("oil_price_zone_id >", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdGreaterThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id >=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThan(Integer value) { + addCriterion("oil_price_zone_id <", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdLessThanOrEqualTo(Integer value) { + addCriterion("oil_price_zone_id <=", value, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdIn(List values) { + addCriterion("oil_price_zone_id in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotIn(List values) { + addCriterion("oil_price_zone_id not in", values, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneIdNotBetween(Integer value1, Integer value2) { + addCriterion("oil_price_zone_id not between", value1, value2, "oilPriceZoneId"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNull() { + addCriterion("oil_price_zone_name is null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIsNotNull() { + addCriterion("oil_price_zone_name is not null"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameEqualTo(String value) { + addCriterion("oil_price_zone_name =", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotEqualTo(String value) { + addCriterion("oil_price_zone_name <>", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThan(String value) { + addCriterion("oil_price_zone_name >", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameGreaterThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name >=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThan(String value) { + addCriterion("oil_price_zone_name <", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLessThanOrEqualTo(String value) { + addCriterion("oil_price_zone_name <=", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameLike(String value) { + addCriterion("oil_price_zone_name like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotLike(String value) { + addCriterion("oil_price_zone_name not like", value, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameIn(List values) { + addCriterion("oil_price_zone_name in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotIn(List values) { + addCriterion("oil_price_zone_name not in", values, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameBetween(String value1, String value2) { + addCriterion("oil_price_zone_name between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andOilPriceZoneNameNotBetween(String value1, String value2) { + addCriterion("oil_price_zone_name not between", value1, value2, "oilPriceZoneName"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerLogoIsNull() { + addCriterion("mer_logo is null"); + return (Criteria) this; + } + + public Criteria andMerLogoIsNotNull() { + addCriterion("mer_logo is not null"); + return (Criteria) this; + } + + public Criteria andMerLogoEqualTo(String value) { + addCriterion("mer_logo =", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotEqualTo(String value) { + addCriterion("mer_logo <>", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoGreaterThan(String value) { + addCriterion("mer_logo >", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoGreaterThanOrEqualTo(String value) { + addCriterion("mer_logo >=", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLessThan(String value) { + addCriterion("mer_logo <", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLessThanOrEqualTo(String value) { + addCriterion("mer_logo <=", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoLike(String value) { + addCriterion("mer_logo like", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotLike(String value) { + addCriterion("mer_logo not like", value, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoIn(List values) { + addCriterion("mer_logo in", values, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotIn(List values) { + addCriterion("mer_logo not in", values, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoBetween(String value1, String value2) { + addCriterion("mer_logo between", value1, value2, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerLogoNotBetween(String value1, String value2) { + addCriterion("mer_logo not between", value1, value2, "merLogo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andContactsNameIsNull() { + addCriterion("contacts_name is null"); + return (Criteria) this; + } + + public Criteria andContactsNameIsNotNull() { + addCriterion("contacts_name is not null"); + return (Criteria) this; + } + + public Criteria andContactsNameEqualTo(String value) { + addCriterion("contacts_name =", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotEqualTo(String value) { + addCriterion("contacts_name <>", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameGreaterThan(String value) { + addCriterion("contacts_name >", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameGreaterThanOrEqualTo(String value) { + addCriterion("contacts_name >=", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLessThan(String value) { + addCriterion("contacts_name <", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLessThanOrEqualTo(String value) { + addCriterion("contacts_name <=", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameLike(String value) { + addCriterion("contacts_name like", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotLike(String value) { + addCriterion("contacts_name not like", value, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameIn(List values) { + addCriterion("contacts_name in", values, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotIn(List values) { + addCriterion("contacts_name not in", values, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameBetween(String value1, String value2) { + addCriterion("contacts_name between", value1, value2, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsNameNotBetween(String value1, String value2) { + addCriterion("contacts_name not between", value1, value2, "contactsName"); + return (Criteria) this; + } + + public Criteria andContactsTelIsNull() { + addCriterion("contacts_tel is null"); + return (Criteria) this; + } + + public Criteria andContactsTelIsNotNull() { + addCriterion("contacts_tel is not null"); + return (Criteria) this; + } + + public Criteria andContactsTelEqualTo(String value) { + addCriterion("contacts_tel =", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelNotEqualTo(String value) { + addCriterion("contacts_tel <>", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelGreaterThan(String value) { + addCriterion("contacts_tel >", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelGreaterThanOrEqualTo(String value) { + addCriterion("contacts_tel >=", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelLessThan(String value) { + addCriterion("contacts_tel <", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelLessThanOrEqualTo(String value) { + addCriterion("contacts_tel <=", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelLike(String value) { + addCriterion("contacts_tel like", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelNotLike(String value) { + addCriterion("contacts_tel not like", value, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelIn(List values) { + addCriterion("contacts_tel in", values, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelNotIn(List values) { + addCriterion("contacts_tel not in", values, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelBetween(String value1, String value2) { + addCriterion("contacts_tel between", value1, value2, "contactsTel"); + return (Criteria) this; + } + + public Criteria andContactsTelNotBetween(String value1, String value2) { + addCriterion("contacts_tel not between", value1, value2, "contactsTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIsNull() { + addCriterion("customer_service_tel is null"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIsNotNull() { + addCriterion("customer_service_tel is not null"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelEqualTo(String value) { + addCriterion("customer_service_tel =", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotEqualTo(String value) { + addCriterion("customer_service_tel <>", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelGreaterThan(String value) { + addCriterion("customer_service_tel >", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelGreaterThanOrEqualTo(String value) { + addCriterion("customer_service_tel >=", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLessThan(String value) { + addCriterion("customer_service_tel <", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLessThanOrEqualTo(String value) { + addCriterion("customer_service_tel <=", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelLike(String value) { + addCriterion("customer_service_tel like", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotLike(String value) { + addCriterion("customer_service_tel not like", value, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelIn(List values) { + addCriterion("customer_service_tel in", values, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotIn(List values) { + addCriterion("customer_service_tel not in", values, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelBetween(String value1, String value2) { + addCriterion("customer_service_tel between", value1, value2, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andCustomerServiceTelNotBetween(String value1, String value2) { + addCriterion("customer_service_tel not between", value1, value2, "customerServiceTel"); + return (Criteria) this; + } + + public Criteria andAddressIsNull() { + addCriterion("address is null"); + return (Criteria) this; + } + + public Criteria andAddressIsNotNull() { + addCriterion("address is not null"); + return (Criteria) this; + } + + public Criteria andAddressEqualTo(String value) { + addCriterion("address =", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotEqualTo(String value) { + addCriterion("address <>", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThan(String value) { + addCriterion("address >", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressGreaterThanOrEqualTo(String value) { + addCriterion("address >=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThan(String value) { + addCriterion("address <", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLessThanOrEqualTo(String value) { + addCriterion("address <=", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressLike(String value) { + addCriterion("address like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotLike(String value) { + addCriterion("address not like", value, "address"); + return (Criteria) this; + } + + public Criteria andAddressIn(List values) { + addCriterion("address in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotIn(List values) { + addCriterion("address not in", values, "address"); + return (Criteria) this; + } + + public Criteria andAddressBetween(String value1, String value2) { + addCriterion("address between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andAddressNotBetween(String value1, String value2) { + addCriterion("address not between", value1, value2, "address"); + return (Criteria) this; + } + + public Criteria andLongitudeIsNull() { + addCriterion("longitude is null"); + return (Criteria) this; + } + + public Criteria andLongitudeIsNotNull() { + addCriterion("longitude is not null"); + return (Criteria) this; + } + + public Criteria andLongitudeEqualTo(String value) { + addCriterion("longitude =", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotEqualTo(String value) { + addCriterion("longitude <>", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeGreaterThan(String value) { + addCriterion("longitude >", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeGreaterThanOrEqualTo(String value) { + addCriterion("longitude >=", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLessThan(String value) { + addCriterion("longitude <", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLessThanOrEqualTo(String value) { + addCriterion("longitude <=", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeLike(String value) { + addCriterion("longitude like", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotLike(String value) { + addCriterion("longitude not like", value, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeIn(List values) { + addCriterion("longitude in", values, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotIn(List values) { + addCriterion("longitude not in", values, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeBetween(String value1, String value2) { + addCriterion("longitude between", value1, value2, "longitude"); + return (Criteria) this; + } + + public Criteria andLongitudeNotBetween(String value1, String value2) { + addCriterion("longitude not between", value1, value2, "longitude"); + return (Criteria) this; + } + + public Criteria andLatitudeIsNull() { + addCriterion("latitude is null"); + return (Criteria) this; + } + + public Criteria andLatitudeIsNotNull() { + addCriterion("latitude is not null"); + return (Criteria) this; + } + + public Criteria andLatitudeEqualTo(String value) { + addCriterion("latitude =", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotEqualTo(String value) { + addCriterion("latitude <>", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeGreaterThan(String value) { + addCriterion("latitude >", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeGreaterThanOrEqualTo(String value) { + addCriterion("latitude >=", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLessThan(String value) { + addCriterion("latitude <", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLessThanOrEqualTo(String value) { + addCriterion("latitude <=", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeLike(String value) { + addCriterion("latitude like", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotLike(String value) { + addCriterion("latitude not like", value, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeIn(List values) { + addCriterion("latitude in", values, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotIn(List values) { + addCriterion("latitude not in", values, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeBetween(String value1, String value2) { + addCriterion("latitude between", value1, value2, "latitude"); + return (Criteria) this; + } + + public Criteria andLatitudeNotBetween(String value1, String value2) { + addCriterion("latitude not between", value1, value2, "latitude"); + return (Criteria) this; + } + + public Criteria andMerLabelIsNull() { + addCriterion("mer_label is null"); + return (Criteria) this; + } + + public Criteria andMerLabelIsNotNull() { + addCriterion("mer_label is not null"); + return (Criteria) this; + } + + public Criteria andMerLabelEqualTo(String value) { + addCriterion("mer_label =", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelNotEqualTo(String value) { + addCriterion("mer_label <>", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelGreaterThan(String value) { + addCriterion("mer_label >", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelGreaterThanOrEqualTo(String value) { + addCriterion("mer_label >=", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelLessThan(String value) { + addCriterion("mer_label <", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelLessThanOrEqualTo(String value) { + addCriterion("mer_label <=", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelLike(String value) { + addCriterion("mer_label like", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelNotLike(String value) { + addCriterion("mer_label not like", value, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelIn(List values) { + addCriterion("mer_label in", values, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelNotIn(List values) { + addCriterion("mer_label not in", values, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelBetween(String value1, String value2) { + addCriterion("mer_label between", value1, value2, "merLabel"); + return (Criteria) this; + } + + public Criteria andMerLabelNotBetween(String value1, String value2) { + addCriterion("mer_label not between", value1, value2, "merLabel"); + 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/BsMerchantPayConfig.java b/service/src/main/java/com/hfkj/entity/BsMerchantPayConfig.java new file mode 100644 index 0000000..c9a7f53 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantPayConfig.java @@ -0,0 +1,261 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_merchant_pay_config + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchantPayConfig implements Serializable { + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 支付渠道代码 + */ + private String channelCode; + + /** + * 支付渠道名称 + */ + private String channelName; + + /** + * 支付渠道商户号 + */ + private String channelMerNo; + + /** + * 支付渠道商户秘钥 + */ + private String channelMerKey; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + /** + * 状态 1:正常 2:停用 + */ + private Integer status; + + 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 getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + public String getChannelCode() { + return channelCode; + } + + public void setChannelCode(String channelCode) { + this.channelCode = channelCode; + } + + public String getChannelName() { + return channelName; + } + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + public String getChannelMerNo() { + return channelMerNo; + } + + public void setChannelMerNo(String channelMerNo) { + this.channelMerNo = channelMerNo; + } + + public String getChannelMerKey() { + return channelMerKey; + } + + public void setChannelMerKey(String channelMerKey) { + this.channelMerKey = channelMerKey; + } + + 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 Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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; + } + BsMerchantPayConfig other = (BsMerchantPayConfig) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getChannelCode() == null ? other.getChannelCode() == null : this.getChannelCode().equals(other.getChannelCode())) + && (this.getChannelName() == null ? other.getChannelName() == null : this.getChannelName().equals(other.getChannelName())) + && (this.getChannelMerNo() == null ? other.getChannelMerNo() == null : this.getChannelMerNo().equals(other.getChannelMerNo())) + && (this.getChannelMerKey() == null ? other.getChannelMerKey() == null : this.getChannelMerKey().equals(other.getChannelMerKey())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getChannelCode() == null) ? 0 : getChannelCode().hashCode()); + result = prime * result + ((getChannelName() == null) ? 0 : getChannelName().hashCode()); + result = prime * result + ((getChannelMerNo() == null) ? 0 : getChannelMerNo().hashCode()); + result = prime * result + ((getChannelMerKey() == null) ? 0 : getChannelMerKey().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", channelCode=").append(channelCode); + sb.append(", channelName=").append(channelName); + sb.append(", channelMerNo=").append(channelMerNo); + sb.append(", channelMerKey=").append(channelMerKey); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + 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/BsMerchantPayConfigExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantPayConfigExample.java new file mode 100644 index 0000000..a08a339 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantPayConfigExample.java @@ -0,0 +1,1153 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantPayConfigExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantPayConfigExample() { + 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 andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andChannelCodeIsNull() { + addCriterion("channel_code is null"); + return (Criteria) this; + } + + public Criteria andChannelCodeIsNotNull() { + addCriterion("channel_code is not null"); + return (Criteria) this; + } + + public Criteria andChannelCodeEqualTo(String value) { + addCriterion("channel_code =", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeNotEqualTo(String value) { + addCriterion("channel_code <>", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeGreaterThan(String value) { + addCriterion("channel_code >", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeGreaterThanOrEqualTo(String value) { + addCriterion("channel_code >=", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeLessThan(String value) { + addCriterion("channel_code <", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeLessThanOrEqualTo(String value) { + addCriterion("channel_code <=", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeLike(String value) { + addCriterion("channel_code like", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeNotLike(String value) { + addCriterion("channel_code not like", value, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeIn(List values) { + addCriterion("channel_code in", values, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeNotIn(List values) { + addCriterion("channel_code not in", values, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeBetween(String value1, String value2) { + addCriterion("channel_code between", value1, value2, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelCodeNotBetween(String value1, String value2) { + addCriterion("channel_code not between", value1, value2, "channelCode"); + return (Criteria) this; + } + + public Criteria andChannelNameIsNull() { + addCriterion("channel_name is null"); + return (Criteria) this; + } + + public Criteria andChannelNameIsNotNull() { + addCriterion("channel_name is not null"); + return (Criteria) this; + } + + public Criteria andChannelNameEqualTo(String value) { + addCriterion("channel_name =", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotEqualTo(String value) { + addCriterion("channel_name <>", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameGreaterThan(String value) { + addCriterion("channel_name >", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameGreaterThanOrEqualTo(String value) { + addCriterion("channel_name >=", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLessThan(String value) { + addCriterion("channel_name <", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLessThanOrEqualTo(String value) { + addCriterion("channel_name <=", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameLike(String value) { + addCriterion("channel_name like", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotLike(String value) { + addCriterion("channel_name not like", value, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameIn(List values) { + addCriterion("channel_name in", values, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotIn(List values) { + addCriterion("channel_name not in", values, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameBetween(String value1, String value2) { + addCriterion("channel_name between", value1, value2, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelNameNotBetween(String value1, String value2) { + addCriterion("channel_name not between", value1, value2, "channelName"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIsNull() { + addCriterion("channel_mer_no is null"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIsNotNull() { + addCriterion("channel_mer_no is not null"); + return (Criteria) this; + } + + public Criteria andChannelMerNoEqualTo(String value) { + addCriterion("channel_mer_no =", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotEqualTo(String value) { + addCriterion("channel_mer_no <>", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoGreaterThan(String value) { + addCriterion("channel_mer_no >", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoGreaterThanOrEqualTo(String value) { + addCriterion("channel_mer_no >=", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLessThan(String value) { + addCriterion("channel_mer_no <", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLessThanOrEqualTo(String value) { + addCriterion("channel_mer_no <=", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoLike(String value) { + addCriterion("channel_mer_no like", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotLike(String value) { + addCriterion("channel_mer_no not like", value, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoIn(List values) { + addCriterion("channel_mer_no in", values, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotIn(List values) { + addCriterion("channel_mer_no not in", values, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoBetween(String value1, String value2) { + addCriterion("channel_mer_no between", value1, value2, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerNoNotBetween(String value1, String value2) { + addCriterion("channel_mer_no not between", value1, value2, "channelMerNo"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIsNull() { + addCriterion("channel_mer_key is null"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIsNotNull() { + addCriterion("channel_mer_key is not null"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyEqualTo(String value) { + addCriterion("channel_mer_key =", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotEqualTo(String value) { + addCriterion("channel_mer_key <>", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyGreaterThan(String value) { + addCriterion("channel_mer_key >", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyGreaterThanOrEqualTo(String value) { + addCriterion("channel_mer_key >=", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLessThan(String value) { + addCriterion("channel_mer_key <", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLessThanOrEqualTo(String value) { + addCriterion("channel_mer_key <=", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyLike(String value) { + addCriterion("channel_mer_key like", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotLike(String value) { + addCriterion("channel_mer_key not like", value, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyIn(List values) { + addCriterion("channel_mer_key in", values, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotIn(List values) { + addCriterion("channel_mer_key not in", values, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyBetween(String value1, String value2) { + addCriterion("channel_mer_key between", value1, value2, "channelMerKey"); + return (Criteria) this; + } + + public Criteria andChannelMerKeyNotBetween(String value1, String value2) { + addCriterion("channel_mer_key not between", value1, value2, "channelMerKey"); + 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 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 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/BsMerchantQrCode.java b/service/src/main/java/com/hfkj/entity/BsMerchantQrCode.java new file mode 100644 index 0000000..1eec3c4 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantQrCode.java @@ -0,0 +1,232 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_merchant_qr_code + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchantQrCode implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 商户id + */ + private Long merchantId; + + /** + * 商户号 + */ + private String merchantNo; + + /** + * 类型 1:综合二维码 2:加油二维码 3:商城二维码 + */ + private Integer codeType; + + /** + * 内容 + */ + private String codeContent; + + /** + * 图片地址 + */ + private String codeImg; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 状态 0:删除 1:正常 2:禁用 + */ + private Integer status; + + 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 getMerchantId() { + return merchantId; + } + + public void setMerchantId(Long merchantId) { + this.merchantId = merchantId; + } + + public String getMerchantNo() { + return merchantNo; + } + + public void setMerchantNo(String merchantNo) { + this.merchantNo = merchantNo; + } + + public Integer getCodeType() { + return codeType; + } + + public void setCodeType(Integer codeType) { + this.codeType = codeType; + } + + public String getCodeContent() { + return codeContent; + } + + public void setCodeContent(String codeContent) { + this.codeContent = codeContent; + } + + public String getCodeImg() { + return codeImg; + } + + public void setCodeImg(String codeImg) { + this.codeImg = codeImg; + } + + 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 Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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; + } + BsMerchantQrCode other = (BsMerchantQrCode) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerchantId() == null ? other.getMerchantId() == null : this.getMerchantId().equals(other.getMerchantId())) + && (this.getMerchantNo() == null ? other.getMerchantNo() == null : this.getMerchantNo().equals(other.getMerchantNo())) + && (this.getCodeType() == null ? other.getCodeType() == null : this.getCodeType().equals(other.getCodeType())) + && (this.getCodeContent() == null ? other.getCodeContent() == null : this.getCodeContent().equals(other.getCodeContent())) + && (this.getCodeImg() == null ? other.getCodeImg() == null : this.getCodeImg().equals(other.getCodeImg())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getMerchantId() == null) ? 0 : getMerchantId().hashCode()); + result = prime * result + ((getMerchantNo() == null) ? 0 : getMerchantNo().hashCode()); + result = prime * result + ((getCodeType() == null) ? 0 : getCodeType().hashCode()); + result = prime * result + ((getCodeContent() == null) ? 0 : getCodeContent().hashCode()); + result = prime * result + ((getCodeImg() == null) ? 0 : getCodeImg().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", merchantId=").append(merchantId); + sb.append(", merchantNo=").append(merchantNo); + sb.append(", codeType=").append(codeType); + sb.append(", codeContent=").append(codeContent); + sb.append(", codeImg=").append(codeImg); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + sb.append(", status=").append(status); + 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/BsMerchantQrCodeExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantQrCodeExample.java new file mode 100644 index 0000000..2e20023 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantQrCodeExample.java @@ -0,0 +1,1003 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantQrCodeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantQrCodeExample() { + 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 andMerchantIdIsNull() { + addCriterion("merchant_id is null"); + return (Criteria) this; + } + + public Criteria andMerchantIdIsNotNull() { + addCriterion("merchant_id is not null"); + return (Criteria) this; + } + + public Criteria andMerchantIdEqualTo(Long value) { + addCriterion("merchant_id =", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotEqualTo(Long value) { + addCriterion("merchant_id <>", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdGreaterThan(Long value) { + addCriterion("merchant_id >", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdGreaterThanOrEqualTo(Long value) { + addCriterion("merchant_id >=", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdLessThan(Long value) { + addCriterion("merchant_id <", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdLessThanOrEqualTo(Long value) { + addCriterion("merchant_id <=", value, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdIn(List values) { + addCriterion("merchant_id in", values, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotIn(List values) { + addCriterion("merchant_id not in", values, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdBetween(Long value1, Long value2) { + addCriterion("merchant_id between", value1, value2, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantIdNotBetween(Long value1, Long value2) { + addCriterion("merchant_id not between", value1, value2, "merchantId"); + return (Criteria) this; + } + + public Criteria andMerchantNoIsNull() { + addCriterion("merchant_no is null"); + return (Criteria) this; + } + + public Criteria andMerchantNoIsNotNull() { + addCriterion("merchant_no is not null"); + return (Criteria) this; + } + + public Criteria andMerchantNoEqualTo(String value) { + addCriterion("merchant_no =", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoNotEqualTo(String value) { + addCriterion("merchant_no <>", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoGreaterThan(String value) { + addCriterion("merchant_no >", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoGreaterThanOrEqualTo(String value) { + addCriterion("merchant_no >=", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoLessThan(String value) { + addCriterion("merchant_no <", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoLessThanOrEqualTo(String value) { + addCriterion("merchant_no <=", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoLike(String value) { + addCriterion("merchant_no like", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoNotLike(String value) { + addCriterion("merchant_no not like", value, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoIn(List values) { + addCriterion("merchant_no in", values, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoNotIn(List values) { + addCriterion("merchant_no not in", values, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoBetween(String value1, String value2) { + addCriterion("merchant_no between", value1, value2, "merchantNo"); + return (Criteria) this; + } + + public Criteria andMerchantNoNotBetween(String value1, String value2) { + addCriterion("merchant_no not between", value1, value2, "merchantNo"); + return (Criteria) this; + } + + public Criteria andCodeTypeIsNull() { + addCriterion("code_type is null"); + return (Criteria) this; + } + + public Criteria andCodeTypeIsNotNull() { + addCriterion("code_type is not null"); + return (Criteria) this; + } + + public Criteria andCodeTypeEqualTo(Integer value) { + addCriterion("code_type =", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotEqualTo(Integer value) { + addCriterion("code_type <>", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeGreaterThan(Integer value) { + addCriterion("code_type >", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("code_type >=", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeLessThan(Integer value) { + addCriterion("code_type <", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeLessThanOrEqualTo(Integer value) { + addCriterion("code_type <=", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeIn(List values) { + addCriterion("code_type in", values, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotIn(List values) { + addCriterion("code_type not in", values, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeBetween(Integer value1, Integer value2) { + addCriterion("code_type between", value1, value2, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotBetween(Integer value1, Integer value2) { + addCriterion("code_type not between", value1, value2, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeContentIsNull() { + addCriterion("code_content is null"); + return (Criteria) this; + } + + public Criteria andCodeContentIsNotNull() { + addCriterion("code_content is not null"); + return (Criteria) this; + } + + public Criteria andCodeContentEqualTo(String value) { + addCriterion("code_content =", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentNotEqualTo(String value) { + addCriterion("code_content <>", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentGreaterThan(String value) { + addCriterion("code_content >", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentGreaterThanOrEqualTo(String value) { + addCriterion("code_content >=", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentLessThan(String value) { + addCriterion("code_content <", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentLessThanOrEqualTo(String value) { + addCriterion("code_content <=", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentLike(String value) { + addCriterion("code_content like", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentNotLike(String value) { + addCriterion("code_content not like", value, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentIn(List values) { + addCriterion("code_content in", values, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentNotIn(List values) { + addCriterion("code_content not in", values, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentBetween(String value1, String value2) { + addCriterion("code_content between", value1, value2, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeContentNotBetween(String value1, String value2) { + addCriterion("code_content not between", value1, value2, "codeContent"); + return (Criteria) this; + } + + public Criteria andCodeImgIsNull() { + addCriterion("code_img is null"); + return (Criteria) this; + } + + public Criteria andCodeImgIsNotNull() { + addCriterion("code_img is not null"); + return (Criteria) this; + } + + public Criteria andCodeImgEqualTo(String value) { + addCriterion("code_img =", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgNotEqualTo(String value) { + addCriterion("code_img <>", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgGreaterThan(String value) { + addCriterion("code_img >", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgGreaterThanOrEqualTo(String value) { + addCriterion("code_img >=", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgLessThan(String value) { + addCriterion("code_img <", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgLessThanOrEqualTo(String value) { + addCriterion("code_img <=", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgLike(String value) { + addCriterion("code_img like", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgNotLike(String value) { + addCriterion("code_img not like", value, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgIn(List values) { + addCriterion("code_img in", values, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgNotIn(List values) { + addCriterion("code_img not in", values, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgBetween(String value1, String value2) { + addCriterion("code_img between", value1, value2, "codeImg"); + return (Criteria) this; + } + + public Criteria andCodeImgNotBetween(String value1, String value2) { + addCriterion("code_img not between", value1, value2, "codeImg"); + 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 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 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/BsMerchantUser.java b/service/src/main/java/com/hfkj/entity/BsMerchantUser.java new file mode 100644 index 0000000..a0e0d13 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantUser.java @@ -0,0 +1,264 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * bs_merchant_user + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class BsMerchantUser implements Serializable { + /** + * 主键ID + */ + private Long id; + + /** + * 商户id + */ + private Long merId; + + /** + * 商户编号 + */ + private String merNo; + + /** + * 商户名称 + */ + private String merName; + + /** + * 用户id + */ + private Long userId; + + /** + * 用户手机号 + */ + private String userPhone; + + /** + * 积分数量 + */ + private Integer integral; + + /** + * VIP等级 0:普通会员 + */ + private Integer vipLevel; + + /** + * 状态:0:不可用 1:正常 + */ + 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 Long getMerId() { + return merId; + } + + public void setMerId(Long merId) { + this.merId = merId; + } + + public String getMerNo() { + return merNo; + } + + public void setMerNo(String merNo) { + this.merNo = merNo; + } + + public String getMerName() { + return merName; + } + + public void setMerName(String merName) { + this.merName = merName; + } + + 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 Integer getIntegral() { + return integral; + } + + public void setIntegral(Integer integral) { + this.integral = integral; + } + + public Integer getVipLevel() { + return vipLevel; + } + + public void setVipLevel(Integer vipLevel) { + this.vipLevel = vipLevel; + } + + 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; + } + BsMerchantUser other = (BsMerchantUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMerId() == null ? other.getMerId() == null : this.getMerId().equals(other.getMerId())) + && (this.getMerNo() == null ? other.getMerNo() == null : this.getMerNo().equals(other.getMerNo())) + && (this.getMerName() == null ? other.getMerName() == null : this.getMerName().equals(other.getMerName())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getUserPhone() == null ? other.getUserPhone() == null : this.getUserPhone().equals(other.getUserPhone())) + && (this.getIntegral() == null ? other.getIntegral() == null : this.getIntegral().equals(other.getIntegral())) + && (this.getVipLevel() == null ? other.getVipLevel() == null : this.getVipLevel().equals(other.getVipLevel())) + && (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 + ((getMerId() == null) ? 0 : getMerId().hashCode()); + result = prime * result + ((getMerNo() == null) ? 0 : getMerNo().hashCode()); + result = prime * result + ((getMerName() == null) ? 0 : getMerName().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getUserPhone() == null) ? 0 : getUserPhone().hashCode()); + result = prime * result + ((getIntegral() == null) ? 0 : getIntegral().hashCode()); + result = prime * result + ((getVipLevel() == null) ? 0 : getVipLevel().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(", merId=").append(merId); + sb.append(", merNo=").append(merNo); + sb.append(", merName=").append(merName); + sb.append(", userId=").append(userId); + sb.append(", userPhone=").append(userPhone); + sb.append(", integral=").append(integral); + sb.append(", vipLevel=").append(vipLevel); + 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/BsMerchantUserExample.java b/service/src/main/java/com/hfkj/entity/BsMerchantUserExample.java new file mode 100644 index 0000000..4039d80 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/BsMerchantUserExample.java @@ -0,0 +1,1123 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class BsMerchantUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public BsMerchantUserExample() { + 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 andMerIdIsNull() { + addCriterion("mer_id is null"); + return (Criteria) this; + } + + public Criteria andMerIdIsNotNull() { + addCriterion("mer_id is not null"); + return (Criteria) this; + } + + public Criteria andMerIdEqualTo(Long value) { + addCriterion("mer_id =", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotEqualTo(Long value) { + addCriterion("mer_id <>", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThan(Long value) { + addCriterion("mer_id >", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdGreaterThanOrEqualTo(Long value) { + addCriterion("mer_id >=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThan(Long value) { + addCriterion("mer_id <", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdLessThanOrEqualTo(Long value) { + addCriterion("mer_id <=", value, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdIn(List values) { + addCriterion("mer_id in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotIn(List values) { + addCriterion("mer_id not in", values, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdBetween(Long value1, Long value2) { + addCriterion("mer_id between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerIdNotBetween(Long value1, Long value2) { + addCriterion("mer_id not between", value1, value2, "merId"); + return (Criteria) this; + } + + public Criteria andMerNoIsNull() { + addCriterion("mer_no is null"); + return (Criteria) this; + } + + public Criteria andMerNoIsNotNull() { + addCriterion("mer_no is not null"); + return (Criteria) this; + } + + public Criteria andMerNoEqualTo(String value) { + addCriterion("mer_no =", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotEqualTo(String value) { + addCriterion("mer_no <>", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThan(String value) { + addCriterion("mer_no >", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoGreaterThanOrEqualTo(String value) { + addCriterion("mer_no >=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThan(String value) { + addCriterion("mer_no <", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLessThanOrEqualTo(String value) { + addCriterion("mer_no <=", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoLike(String value) { + addCriterion("mer_no like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotLike(String value) { + addCriterion("mer_no not like", value, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoIn(List values) { + addCriterion("mer_no in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotIn(List values) { + addCriterion("mer_no not in", values, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoBetween(String value1, String value2) { + addCriterion("mer_no between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNoNotBetween(String value1, String value2) { + addCriterion("mer_no not between", value1, value2, "merNo"); + return (Criteria) this; + } + + public Criteria andMerNameIsNull() { + addCriterion("mer_name is null"); + return (Criteria) this; + } + + public Criteria andMerNameIsNotNull() { + addCriterion("mer_name is not null"); + return (Criteria) this; + } + + public Criteria andMerNameEqualTo(String value) { + addCriterion("mer_name =", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotEqualTo(String value) { + addCriterion("mer_name <>", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThan(String value) { + addCriterion("mer_name >", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameGreaterThanOrEqualTo(String value) { + addCriterion("mer_name >=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThan(String value) { + addCriterion("mer_name <", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLessThanOrEqualTo(String value) { + addCriterion("mer_name <=", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameLike(String value) { + addCriterion("mer_name like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotLike(String value) { + addCriterion("mer_name not like", value, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameIn(List values) { + addCriterion("mer_name in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotIn(List values) { + addCriterion("mer_name not in", values, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameBetween(String value1, String value2) { + addCriterion("mer_name between", value1, value2, "merName"); + return (Criteria) this; + } + + public Criteria andMerNameNotBetween(String value1, String value2) { + addCriterion("mer_name not between", value1, value2, "merName"); + 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 andIntegralIsNull() { + addCriterion("integral is null"); + return (Criteria) this; + } + + public Criteria andIntegralIsNotNull() { + addCriterion("integral is not null"); + return (Criteria) this; + } + + public Criteria andIntegralEqualTo(Integer value) { + addCriterion("integral =", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralNotEqualTo(Integer value) { + addCriterion("integral <>", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralGreaterThan(Integer value) { + addCriterion("integral >", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralGreaterThanOrEqualTo(Integer value) { + addCriterion("integral >=", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralLessThan(Integer value) { + addCriterion("integral <", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralLessThanOrEqualTo(Integer value) { + addCriterion("integral <=", value, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralIn(List values) { + addCriterion("integral in", values, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralNotIn(List values) { + addCriterion("integral not in", values, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralBetween(Integer value1, Integer value2) { + addCriterion("integral between", value1, value2, "integral"); + return (Criteria) this; + } + + public Criteria andIntegralNotBetween(Integer value1, Integer value2) { + addCriterion("integral not between", value1, value2, "integral"); + return (Criteria) this; + } + + public Criteria andVipLevelIsNull() { + addCriterion("vip_level is null"); + return (Criteria) this; + } + + public Criteria andVipLevelIsNotNull() { + addCriterion("vip_level is not null"); + return (Criteria) this; + } + + public Criteria andVipLevelEqualTo(Integer value) { + addCriterion("vip_level =", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelNotEqualTo(Integer value) { + addCriterion("vip_level <>", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelGreaterThan(Integer value) { + addCriterion("vip_level >", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelGreaterThanOrEqualTo(Integer value) { + addCriterion("vip_level >=", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelLessThan(Integer value) { + addCriterion("vip_level <", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelLessThanOrEqualTo(Integer value) { + addCriterion("vip_level <=", value, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelIn(List values) { + addCriterion("vip_level in", values, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelNotIn(List values) { + addCriterion("vip_level not in", values, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelBetween(Integer value1, Integer value2) { + addCriterion("vip_level between", value1, value2, "vipLevel"); + return (Criteria) this; + } + + public Criteria andVipLevelNotBetween(Integer value1, Integer value2) { + addCriterion("vip_level not between", value1, value2, "vipLevel"); + 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/SecDictionary.java b/service/src/main/java/com/hfkj/entity/SecDictionary.java new file mode 100644 index 0000000..f2361a3 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecDictionary.java @@ -0,0 +1,156 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_dictionary + * @author + */ + +/** + * + * 代码由工具生成 + * + **/ +public class SecDictionary extends SecDictionaryKey implements Serializable { + /** + * 码值名称 + */ + private String codeName; + + /** + * 描述 + */ + private String codeDesc; + + /** + * 排序 + */ + private Integer sortId; + + /** + * 状态:0:不可用,1:可用 + */ + private Integer status; + + private String ext1; + + private String ext2; + + private String ext3; + + private static final long serialVersionUID = 1L; + + public String getCodeName() { + return codeName; + } + + public void setCodeName(String codeName) { + this.codeName = codeName; + } + + public String getCodeDesc() { + return codeDesc; + } + + public void setCodeDesc(String codeDesc) { + this.codeDesc = codeDesc; + } + + public Integer getSortId() { + return sortId; + } + + public void setSortId(Integer sortId) { + this.sortId = sortId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + 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; + } + SecDictionary other = (SecDictionary) that; + return (this.getCodeType() == null ? other.getCodeType() == null : this.getCodeType().equals(other.getCodeType())) + && (this.getCodeValue() == null ? other.getCodeValue() == null : this.getCodeValue().equals(other.getCodeValue())) + && (this.getCodeName() == null ? other.getCodeName() == null : this.getCodeName().equals(other.getCodeName())) + && (this.getCodeDesc() == null ? other.getCodeDesc() == null : this.getCodeDesc().equals(other.getCodeDesc())) + && (this.getSortId() == null ? other.getSortId() == null : this.getSortId().equals(other.getSortId())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (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 + ((getCodeType() == null) ? 0 : getCodeType().hashCode()); + result = prime * result + ((getCodeValue() == null) ? 0 : getCodeValue().hashCode()); + result = prime * result + ((getCodeName() == null) ? 0 : getCodeName().hashCode()); + result = prime * result + ((getCodeDesc() == null) ? 0 : getCodeDesc().hashCode()); + result = prime * result + ((getSortId() == null) ? 0 : getSortId().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().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(", codeName=").append(codeName); + sb.append(", codeDesc=").append(codeDesc); + sb.append(", sortId=").append(sortId); + sb.append(", status=").append(status); + 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(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecDictionaryExample.java b/service/src/main/java/com/hfkj/entity/SecDictionaryExample.java new file mode 100644 index 0000000..f025edf --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecDictionaryExample.java @@ -0,0 +1,832 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecDictionaryExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecDictionaryExample() { + 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 andCodeTypeIsNull() { + addCriterion("code_type is null"); + return (Criteria) this; + } + + public Criteria andCodeTypeIsNotNull() { + addCriterion("code_type is not null"); + return (Criteria) this; + } + + public Criteria andCodeTypeEqualTo(String value) { + addCriterion("code_type =", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotEqualTo(String value) { + addCriterion("code_type <>", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeGreaterThan(String value) { + addCriterion("code_type >", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeGreaterThanOrEqualTo(String value) { + addCriterion("code_type >=", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeLessThan(String value) { + addCriterion("code_type <", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeLessThanOrEqualTo(String value) { + addCriterion("code_type <=", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeLike(String value) { + addCriterion("code_type like", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotLike(String value) { + addCriterion("code_type not like", value, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeIn(List values) { + addCriterion("code_type in", values, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotIn(List values) { + addCriterion("code_type not in", values, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeBetween(String value1, String value2) { + addCriterion("code_type between", value1, value2, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeTypeNotBetween(String value1, String value2) { + addCriterion("code_type not between", value1, value2, "codeType"); + return (Criteria) this; + } + + public Criteria andCodeValueIsNull() { + addCriterion("code_value is null"); + return (Criteria) this; + } + + public Criteria andCodeValueIsNotNull() { + addCriterion("code_value is not null"); + return (Criteria) this; + } + + public Criteria andCodeValueEqualTo(String value) { + addCriterion("code_value =", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueNotEqualTo(String value) { + addCriterion("code_value <>", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueGreaterThan(String value) { + addCriterion("code_value >", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueGreaterThanOrEqualTo(String value) { + addCriterion("code_value >=", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueLessThan(String value) { + addCriterion("code_value <", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueLessThanOrEqualTo(String value) { + addCriterion("code_value <=", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueLike(String value) { + addCriterion("code_value like", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueNotLike(String value) { + addCriterion("code_value not like", value, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueIn(List values) { + addCriterion("code_value in", values, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueNotIn(List values) { + addCriterion("code_value not in", values, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueBetween(String value1, String value2) { + addCriterion("code_value between", value1, value2, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeValueNotBetween(String value1, String value2) { + addCriterion("code_value not between", value1, value2, "codeValue"); + return (Criteria) this; + } + + public Criteria andCodeNameIsNull() { + addCriterion("code_name is null"); + return (Criteria) this; + } + + public Criteria andCodeNameIsNotNull() { + addCriterion("code_name is not null"); + return (Criteria) this; + } + + public Criteria andCodeNameEqualTo(String value) { + addCriterion("code_name =", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameNotEqualTo(String value) { + addCriterion("code_name <>", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameGreaterThan(String value) { + addCriterion("code_name >", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameGreaterThanOrEqualTo(String value) { + addCriterion("code_name >=", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameLessThan(String value) { + addCriterion("code_name <", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameLessThanOrEqualTo(String value) { + addCriterion("code_name <=", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameLike(String value) { + addCriterion("code_name like", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameNotLike(String value) { + addCriterion("code_name not like", value, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameIn(List values) { + addCriterion("code_name in", values, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameNotIn(List values) { + addCriterion("code_name not in", values, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameBetween(String value1, String value2) { + addCriterion("code_name between", value1, value2, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeNameNotBetween(String value1, String value2) { + addCriterion("code_name not between", value1, value2, "codeName"); + return (Criteria) this; + } + + public Criteria andCodeDescIsNull() { + addCriterion("code_desc is null"); + return (Criteria) this; + } + + public Criteria andCodeDescIsNotNull() { + addCriterion("code_desc is not null"); + return (Criteria) this; + } + + public Criteria andCodeDescEqualTo(String value) { + addCriterion("code_desc =", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescNotEqualTo(String value) { + addCriterion("code_desc <>", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescGreaterThan(String value) { + addCriterion("code_desc >", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescGreaterThanOrEqualTo(String value) { + addCriterion("code_desc >=", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescLessThan(String value) { + addCriterion("code_desc <", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescLessThanOrEqualTo(String value) { + addCriterion("code_desc <=", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescLike(String value) { + addCriterion("code_desc like", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescNotLike(String value) { + addCriterion("code_desc not like", value, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescIn(List values) { + addCriterion("code_desc in", values, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescNotIn(List values) { + addCriterion("code_desc not in", values, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescBetween(String value1, String value2) { + addCriterion("code_desc between", value1, value2, "codeDesc"); + return (Criteria) this; + } + + public Criteria andCodeDescNotBetween(String value1, String value2) { + addCriterion("code_desc not between", value1, value2, "codeDesc"); + return (Criteria) this; + } + + public Criteria andSortIdIsNull() { + addCriterion("sort_id is null"); + return (Criteria) this; + } + + public Criteria andSortIdIsNotNull() { + addCriterion("sort_id is not null"); + return (Criteria) this; + } + + public Criteria andSortIdEqualTo(Integer value) { + addCriterion("sort_id =", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdNotEqualTo(Integer value) { + addCriterion("sort_id <>", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdGreaterThan(Integer value) { + addCriterion("sort_id >", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdGreaterThanOrEqualTo(Integer value) { + addCriterion("sort_id >=", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdLessThan(Integer value) { + addCriterion("sort_id <", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdLessThanOrEqualTo(Integer value) { + addCriterion("sort_id <=", value, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdIn(List values) { + addCriterion("sort_id in", values, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdNotIn(List values) { + addCriterion("sort_id not in", values, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdBetween(Integer value1, Integer value2) { + addCriterion("sort_id between", value1, value2, "sortId"); + return (Criteria) this; + } + + public Criteria andSortIdNotBetween(Integer value1, Integer value2) { + addCriterion("sort_id not between", value1, value2, "sortId"); + 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 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecDictionaryKey.java b/service/src/main/java/com/hfkj/entity/SecDictionaryKey.java new file mode 100644 index 0000000..5ad3f02 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecDictionaryKey.java @@ -0,0 +1,75 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_dictionary + * @author + */ +public class SecDictionaryKey implements Serializable { + /** + * 码值类型 + */ + private String codeType; + + /** + * 码值 + */ + private String codeValue; + + private static final long serialVersionUID = 1L; + + public String getCodeType() { + return codeType; + } + + public void setCodeType(String codeType) { + this.codeType = codeType; + } + + public String getCodeValue() { + return codeValue; + } + + public void setCodeValue(String codeValue) { + this.codeValue = codeValue; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecDictionaryKey other = (SecDictionaryKey) that; + return (this.getCodeType() == null ? other.getCodeType() == null : this.getCodeType().equals(other.getCodeType())) + && (this.getCodeValue() == null ? other.getCodeValue() == null : this.getCodeValue().equals(other.getCodeValue())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getCodeType() == null) ? 0 : getCodeType().hashCode()); + result = prime * result + ((getCodeValue() == null) ? 0 : getCodeValue().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", codeType=").append(codeType); + sb.append(", codeValue=").append(codeValue); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecMenu.java b/service/src/main/java/com/hfkj/entity/SecMenu.java new file mode 100644 index 0000000..5cc61c7 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecMenu.java @@ -0,0 +1,209 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * sec_menu + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecMenu implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 菜单名称 + */ + private String menuName; + + /** + * 菜单类型 1:菜单 2:按钮 + */ + private Integer menuType; + + /** + * 菜单URL + */ + private String menuUrl; + + /** + * 图标URL + */ + private String menuUrlImg; + + /** + * 父级菜单主键 + */ + private Long menuPSid; + + /** + * 菜单顺序 + */ + private Integer menuSort; + + /** + * 菜单描述 + */ + private String menuDesc; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getMenuName() { + return menuName; + } + + public void setMenuName(String menuName) { + this.menuName = menuName; + } + + public Integer getMenuType() { + return menuType; + } + + public void setMenuType(Integer menuType) { + this.menuType = menuType; + } + + public String getMenuUrl() { + return menuUrl; + } + + public void setMenuUrl(String menuUrl) { + this.menuUrl = menuUrl; + } + + public String getMenuUrlImg() { + return menuUrlImg; + } + + public void setMenuUrlImg(String menuUrlImg) { + this.menuUrlImg = menuUrlImg; + } + + public Long getMenuPSid() { + return menuPSid; + } + + public void setMenuPSid(Long menuPSid) { + this.menuPSid = menuPSid; + } + + public Integer getMenuSort() { + return menuSort; + } + + public void setMenuSort(Integer menuSort) { + this.menuSort = menuSort; + } + + public String getMenuDesc() { + return menuDesc; + } + + public void setMenuDesc(String menuDesc) { + this.menuDesc = menuDesc; + } + + 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; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecMenu other = (SecMenu) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getMenuName() == null ? other.getMenuName() == null : this.getMenuName().equals(other.getMenuName())) + && (this.getMenuType() == null ? other.getMenuType() == null : this.getMenuType().equals(other.getMenuType())) + && (this.getMenuUrl() == null ? other.getMenuUrl() == null : this.getMenuUrl().equals(other.getMenuUrl())) + && (this.getMenuUrlImg() == null ? other.getMenuUrlImg() == null : this.getMenuUrlImg().equals(other.getMenuUrlImg())) + && (this.getMenuPSid() == null ? other.getMenuPSid() == null : this.getMenuPSid().equals(other.getMenuPSid())) + && (this.getMenuSort() == null ? other.getMenuSort() == null : this.getMenuSort().equals(other.getMenuSort())) + && (this.getMenuDesc() == null ? other.getMenuDesc() == null : this.getMenuDesc().equals(other.getMenuDesc())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getMenuName() == null) ? 0 : getMenuName().hashCode()); + result = prime * result + ((getMenuType() == null) ? 0 : getMenuType().hashCode()); + result = prime * result + ((getMenuUrl() == null) ? 0 : getMenuUrl().hashCode()); + result = prime * result + ((getMenuUrlImg() == null) ? 0 : getMenuUrlImg().hashCode()); + result = prime * result + ((getMenuPSid() == null) ? 0 : getMenuPSid().hashCode()); + result = prime * result + ((getMenuSort() == null) ? 0 : getMenuSort().hashCode()); + result = prime * result + ((getMenuDesc() == null) ? 0 : getMenuDesc().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().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(", menuName=").append(menuName); + sb.append(", menuType=").append(menuType); + sb.append(", menuUrl=").append(menuUrl); + sb.append(", menuUrlImg=").append(menuUrlImg); + sb.append(", menuPSid=").append(menuPSid); + sb.append(", menuSort=").append(menuSort); + sb.append(", menuDesc=").append(menuDesc); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + 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/SecMenuExample.java b/service/src/main/java/com/hfkj/entity/SecMenuExample.java new file mode 100644 index 0000000..af6da6b --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecMenuExample.java @@ -0,0 +1,863 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SecMenuExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecMenuExample() { + 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 andMenuNameIsNull() { + addCriterion("menu_name is null"); + return (Criteria) this; + } + + public Criteria andMenuNameIsNotNull() { + addCriterion("menu_name is not null"); + return (Criteria) this; + } + + public Criteria andMenuNameEqualTo(String value) { + addCriterion("menu_name =", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotEqualTo(String value) { + addCriterion("menu_name <>", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameGreaterThan(String value) { + addCriterion("menu_name >", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameGreaterThanOrEqualTo(String value) { + addCriterion("menu_name >=", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLessThan(String value) { + addCriterion("menu_name <", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLessThanOrEqualTo(String value) { + addCriterion("menu_name <=", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameLike(String value) { + addCriterion("menu_name like", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotLike(String value) { + addCriterion("menu_name not like", value, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameIn(List values) { + addCriterion("menu_name in", values, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotIn(List values) { + addCriterion("menu_name not in", values, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameBetween(String value1, String value2) { + addCriterion("menu_name between", value1, value2, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuNameNotBetween(String value1, String value2) { + addCriterion("menu_name not between", value1, value2, "menuName"); + return (Criteria) this; + } + + public Criteria andMenuTypeIsNull() { + addCriterion("menu_type is null"); + return (Criteria) this; + } + + public Criteria andMenuTypeIsNotNull() { + addCriterion("menu_type is not null"); + return (Criteria) this; + } + + public Criteria andMenuTypeEqualTo(Integer value) { + addCriterion("menu_type =", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeNotEqualTo(Integer value) { + addCriterion("menu_type <>", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeGreaterThan(Integer value) { + addCriterion("menu_type >", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("menu_type >=", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeLessThan(Integer value) { + addCriterion("menu_type <", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeLessThanOrEqualTo(Integer value) { + addCriterion("menu_type <=", value, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeIn(List values) { + addCriterion("menu_type in", values, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeNotIn(List values) { + addCriterion("menu_type not in", values, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeBetween(Integer value1, Integer value2) { + addCriterion("menu_type between", value1, value2, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuTypeNotBetween(Integer value1, Integer value2) { + addCriterion("menu_type not between", value1, value2, "menuType"); + return (Criteria) this; + } + + public Criteria andMenuUrlIsNull() { + addCriterion("menu_url is null"); + return (Criteria) this; + } + + public Criteria andMenuUrlIsNotNull() { + addCriterion("menu_url is not null"); + return (Criteria) this; + } + + public Criteria andMenuUrlEqualTo(String value) { + addCriterion("menu_url =", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlNotEqualTo(String value) { + addCriterion("menu_url <>", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlGreaterThan(String value) { + addCriterion("menu_url >", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlGreaterThanOrEqualTo(String value) { + addCriterion("menu_url >=", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlLessThan(String value) { + addCriterion("menu_url <", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlLessThanOrEqualTo(String value) { + addCriterion("menu_url <=", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlLike(String value) { + addCriterion("menu_url like", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlNotLike(String value) { + addCriterion("menu_url not like", value, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlIn(List values) { + addCriterion("menu_url in", values, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlNotIn(List values) { + addCriterion("menu_url not in", values, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlBetween(String value1, String value2) { + addCriterion("menu_url between", value1, value2, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlNotBetween(String value1, String value2) { + addCriterion("menu_url not between", value1, value2, "menuUrl"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgIsNull() { + addCriterion("menu_url_img is null"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgIsNotNull() { + addCriterion("menu_url_img is not null"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgEqualTo(String value) { + addCriterion("menu_url_img =", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgNotEqualTo(String value) { + addCriterion("menu_url_img <>", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgGreaterThan(String value) { + addCriterion("menu_url_img >", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgGreaterThanOrEqualTo(String value) { + addCriterion("menu_url_img >=", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgLessThan(String value) { + addCriterion("menu_url_img <", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgLessThanOrEqualTo(String value) { + addCriterion("menu_url_img <=", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgLike(String value) { + addCriterion("menu_url_img like", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgNotLike(String value) { + addCriterion("menu_url_img not like", value, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgIn(List values) { + addCriterion("menu_url_img in", values, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgNotIn(List values) { + addCriterion("menu_url_img not in", values, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgBetween(String value1, String value2) { + addCriterion("menu_url_img between", value1, value2, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuUrlImgNotBetween(String value1, String value2) { + addCriterion("menu_url_img not between", value1, value2, "menuUrlImg"); + return (Criteria) this; + } + + public Criteria andMenuPSidIsNull() { + addCriterion("menu_p_sid is null"); + return (Criteria) this; + } + + public Criteria andMenuPSidIsNotNull() { + addCriterion("menu_p_sid is not null"); + return (Criteria) this; + } + + public Criteria andMenuPSidEqualTo(Long value) { + addCriterion("menu_p_sid =", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidNotEqualTo(Long value) { + addCriterion("menu_p_sid <>", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidGreaterThan(Long value) { + addCriterion("menu_p_sid >", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidGreaterThanOrEqualTo(Long value) { + addCriterion("menu_p_sid >=", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidLessThan(Long value) { + addCriterion("menu_p_sid <", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidLessThanOrEqualTo(Long value) { + addCriterion("menu_p_sid <=", value, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidIn(List values) { + addCriterion("menu_p_sid in", values, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidNotIn(List values) { + addCriterion("menu_p_sid not in", values, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidBetween(Long value1, Long value2) { + addCriterion("menu_p_sid between", value1, value2, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuPSidNotBetween(Long value1, Long value2) { + addCriterion("menu_p_sid not between", value1, value2, "menuPSid"); + return (Criteria) this; + } + + public Criteria andMenuSortIsNull() { + addCriterion("menu_sort is null"); + return (Criteria) this; + } + + public Criteria andMenuSortIsNotNull() { + addCriterion("menu_sort is not null"); + return (Criteria) this; + } + + public Criteria andMenuSortEqualTo(Integer value) { + addCriterion("menu_sort =", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotEqualTo(Integer value) { + addCriterion("menu_sort <>", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortGreaterThan(Integer value) { + addCriterion("menu_sort >", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortGreaterThanOrEqualTo(Integer value) { + addCriterion("menu_sort >=", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortLessThan(Integer value) { + addCriterion("menu_sort <", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortLessThanOrEqualTo(Integer value) { + addCriterion("menu_sort <=", value, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortIn(List values) { + addCriterion("menu_sort in", values, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotIn(List values) { + addCriterion("menu_sort not in", values, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortBetween(Integer value1, Integer value2) { + addCriterion("menu_sort between", value1, value2, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuSortNotBetween(Integer value1, Integer value2) { + addCriterion("menu_sort not between", value1, value2, "menuSort"); + return (Criteria) this; + } + + public Criteria andMenuDescIsNull() { + addCriterion("menu_desc is null"); + return (Criteria) this; + } + + public Criteria andMenuDescIsNotNull() { + addCriterion("menu_desc is not null"); + return (Criteria) this; + } + + public Criteria andMenuDescEqualTo(String value) { + addCriterion("menu_desc =", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescNotEqualTo(String value) { + addCriterion("menu_desc <>", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescGreaterThan(String value) { + addCriterion("menu_desc >", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescGreaterThanOrEqualTo(String value) { + addCriterion("menu_desc >=", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescLessThan(String value) { + addCriterion("menu_desc <", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescLessThanOrEqualTo(String value) { + addCriterion("menu_desc <=", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescLike(String value) { + addCriterion("menu_desc like", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescNotLike(String value) { + addCriterion("menu_desc not like", value, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescIn(List values) { + addCriterion("menu_desc in", values, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescNotIn(List values) { + addCriterion("menu_desc not in", values, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescBetween(String value1, String value2) { + addCriterion("menu_desc between", value1, value2, "menuDesc"); + return (Criteria) this; + } + + public Criteria andMenuDescNotBetween(String value1, String value2) { + addCriterion("menu_desc not between", value1, value2, "menuDesc"); + 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 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/SecOperationLog.java b/service/src/main/java/com/hfkj/entity/SecOperationLog.java new file mode 100644 index 0000000..747eeb9 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecOperationLog.java @@ -0,0 +1,177 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * sec_operation_log + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecOperationLog implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * ip地址 + */ + private String ip; + + /** + * 模块 + */ + private String module; + + /** + * 操作 + */ + private String description; + + /** + * 详细内容 + */ + private String content; + + /** + * 操作时间 + */ + private Date operationTime; + + /** + * 操作id + */ + private Long operationId; + + /** + * 操作用户名称 + */ + private String operationName; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getModule() { + return module; + } + + public void setModule(String module) { + this.module = module; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Date getOperationTime() { + return operationTime; + } + + public void setOperationTime(Date operationTime) { + this.operationTime = operationTime; + } + + public Long getOperationId() { + return operationId; + } + + public void setOperationId(Long operationId) { + this.operationId = operationId; + } + + public String getOperationName() { + return operationName; + } + + public void setOperationName(String operationName) { + this.operationName = operationName; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecOperationLog other = (SecOperationLog) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getIp() == null ? other.getIp() == null : this.getIp().equals(other.getIp())) + && (this.getModule() == null ? other.getModule() == null : this.getModule().equals(other.getModule())) + && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription())) + && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent())) + && (this.getOperationTime() == null ? other.getOperationTime() == null : this.getOperationTime().equals(other.getOperationTime())) + && (this.getOperationId() == null ? other.getOperationId() == null : this.getOperationId().equals(other.getOperationId())) + && (this.getOperationName() == null ? other.getOperationName() == null : this.getOperationName().equals(other.getOperationName())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); + result = prime * result + ((getModule() == null) ? 0 : getModule().hashCode()); + result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode()); + result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode()); + result = prime * result + ((getOperationTime() == null) ? 0 : getOperationTime().hashCode()); + result = prime * result + ((getOperationId() == null) ? 0 : getOperationId().hashCode()); + result = prime * result + ((getOperationName() == null) ? 0 : getOperationName().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(", ip=").append(ip); + sb.append(", module=").append(module); + sb.append(", description=").append(description); + sb.append(", content=").append(content); + sb.append(", operationTime=").append(operationTime); + sb.append(", operationId=").append(operationId); + sb.append(", operationName=").append(operationName); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecOperationLogExample.java b/service/src/main/java/com/hfkj/entity/SecOperationLogExample.java new file mode 100644 index 0000000..1b2bab8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecOperationLogExample.java @@ -0,0 +1,753 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SecOperationLogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecOperationLogExample() { + 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 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 andModuleIsNull() { + addCriterion("`module` is null"); + return (Criteria) this; + } + + public Criteria andModuleIsNotNull() { + addCriterion("`module` is not null"); + return (Criteria) this; + } + + public Criteria andModuleEqualTo(String value) { + addCriterion("`module` =", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotEqualTo(String value) { + addCriterion("`module` <>", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleGreaterThan(String value) { + addCriterion("`module` >", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleGreaterThanOrEqualTo(String value) { + addCriterion("`module` >=", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLessThan(String value) { + addCriterion("`module` <", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLessThanOrEqualTo(String value) { + addCriterion("`module` <=", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleLike(String value) { + addCriterion("`module` like", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotLike(String value) { + addCriterion("`module` not like", value, "module"); + return (Criteria) this; + } + + public Criteria andModuleIn(List values) { + addCriterion("`module` in", values, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotIn(List values) { + addCriterion("`module` not in", values, "module"); + return (Criteria) this; + } + + public Criteria andModuleBetween(String value1, String value2) { + addCriterion("`module` between", value1, value2, "module"); + return (Criteria) this; + } + + public Criteria andModuleNotBetween(String value1, String value2) { + addCriterion("`module` not between", value1, value2, "module"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNull() { + addCriterion("description is null"); + return (Criteria) this; + } + + public Criteria andDescriptionIsNotNull() { + addCriterion("description is not null"); + return (Criteria) this; + } + + public Criteria andDescriptionEqualTo(String value) { + addCriterion("description =", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotEqualTo(String value) { + addCriterion("description <>", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThan(String value) { + addCriterion("description >", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionGreaterThanOrEqualTo(String value) { + addCriterion("description >=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThan(String value) { + addCriterion("description <", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLessThanOrEqualTo(String value) { + addCriterion("description <=", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionLike(String value) { + addCriterion("description like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotLike(String value) { + addCriterion("description not like", value, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionIn(List values) { + addCriterion("description in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotIn(List values) { + addCriterion("description not in", values, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionBetween(String value1, String value2) { + addCriterion("description between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andDescriptionNotBetween(String value1, String value2) { + addCriterion("description not between", value1, value2, "description"); + return (Criteria) this; + } + + public Criteria andContentIsNull() { + addCriterion("content is null"); + return (Criteria) this; + } + + public Criteria andContentIsNotNull() { + addCriterion("content is not null"); + return (Criteria) this; + } + + public Criteria andContentEqualTo(String value) { + addCriterion("content =", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotEqualTo(String value) { + addCriterion("content <>", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThan(String value) { + addCriterion("content >", value, "content"); + return (Criteria) this; + } + + public Criteria andContentGreaterThanOrEqualTo(String value) { + addCriterion("content >=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThan(String value) { + addCriterion("content <", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLessThanOrEqualTo(String value) { + addCriterion("content <=", value, "content"); + return (Criteria) this; + } + + public Criteria andContentLike(String value) { + addCriterion("content like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentNotLike(String value) { + addCriterion("content not like", value, "content"); + return (Criteria) this; + } + + public Criteria andContentIn(List values) { + addCriterion("content in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentNotIn(List values) { + addCriterion("content not in", values, "content"); + return (Criteria) this; + } + + public Criteria andContentBetween(String value1, String value2) { + addCriterion("content between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andContentNotBetween(String value1, String value2) { + addCriterion("content not between", value1, value2, "content"); + return (Criteria) this; + } + + public Criteria andOperationTimeIsNull() { + addCriterion("operation_time is null"); + return (Criteria) this; + } + + public Criteria andOperationTimeIsNotNull() { + addCriterion("operation_time is not null"); + return (Criteria) this; + } + + public Criteria andOperationTimeEqualTo(Date value) { + addCriterion("operation_time =", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotEqualTo(Date value) { + addCriterion("operation_time <>", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeGreaterThan(Date value) { + addCriterion("operation_time >", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeGreaterThanOrEqualTo(Date value) { + addCriterion("operation_time >=", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeLessThan(Date value) { + addCriterion("operation_time <", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeLessThanOrEqualTo(Date value) { + addCriterion("operation_time <=", value, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeIn(List values) { + addCriterion("operation_time in", values, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotIn(List values) { + addCriterion("operation_time not in", values, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeBetween(Date value1, Date value2) { + addCriterion("operation_time between", value1, value2, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationTimeNotBetween(Date value1, Date value2) { + addCriterion("operation_time not between", value1, value2, "operationTime"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNull() { + addCriterion("operation_id is null"); + return (Criteria) this; + } + + public Criteria andOperationIdIsNotNull() { + addCriterion("operation_id is not null"); + return (Criteria) this; + } + + public Criteria andOperationIdEqualTo(Long value) { + addCriterion("operation_id =", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotEqualTo(Long value) { + addCriterion("operation_id <>", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThan(Long value) { + addCriterion("operation_id >", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdGreaterThanOrEqualTo(Long value) { + addCriterion("operation_id >=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThan(Long value) { + addCriterion("operation_id <", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdLessThanOrEqualTo(Long value) { + addCriterion("operation_id <=", value, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdIn(List values) { + addCriterion("operation_id in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotIn(List values) { + addCriterion("operation_id not in", values, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdBetween(Long value1, Long value2) { + addCriterion("operation_id between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationIdNotBetween(Long value1, Long value2) { + addCriterion("operation_id not between", value1, value2, "operationId"); + return (Criteria) this; + } + + public Criteria andOperationNameIsNull() { + addCriterion("operation_name is null"); + return (Criteria) this; + } + + public Criteria andOperationNameIsNotNull() { + addCriterion("operation_name is not null"); + return (Criteria) this; + } + + public Criteria andOperationNameEqualTo(String value) { + addCriterion("operation_name =", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameNotEqualTo(String value) { + addCriterion("operation_name <>", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameGreaterThan(String value) { + addCriterion("operation_name >", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameGreaterThanOrEqualTo(String value) { + addCriterion("operation_name >=", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameLessThan(String value) { + addCriterion("operation_name <", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameLessThanOrEqualTo(String value) { + addCriterion("operation_name <=", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameLike(String value) { + addCriterion("operation_name like", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameNotLike(String value) { + addCriterion("operation_name not like", value, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameIn(List values) { + addCriterion("operation_name in", values, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameNotIn(List values) { + addCriterion("operation_name not in", values, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameBetween(String value1, String value2) { + addCriterion("operation_name between", value1, value2, "operationName"); + return (Criteria) this; + } + + public Criteria andOperationNameNotBetween(String value1, String value2) { + addCriterion("operation_name not between", value1, value2, "operationName"); + 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecPermission.java b/service/src/main/java/com/hfkj/entity/SecPermission.java new file mode 100644 index 0000000..a2445c8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecPermission.java @@ -0,0 +1,145 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_permission + * @author + */ + +/** + * + * 代码由工具生成 + * + **/ +public class SecPermission implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 权限名称 + */ + private String permissionName; + + /** + * 权限编码 + */ + private String permissionCode; + + /** + * 权限描述 + */ + private String permissionDesc; + + /** + * 权限排序 + */ + private Integer sort; + + /** + * 菜单ID + */ + private Long menuId; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPermissionName() { + return permissionName; + } + + public void setPermissionName(String permissionName) { + this.permissionName = permissionName; + } + + public String getPermissionCode() { + return permissionCode; + } + + public void setPermissionCode(String permissionCode) { + this.permissionCode = permissionCode; + } + + public String getPermissionDesc() { + return permissionDesc; + } + + public void setPermissionDesc(String permissionDesc) { + this.permissionDesc = permissionDesc; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecPermission other = (SecPermission) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPermissionName() == null ? other.getPermissionName() == null : this.getPermissionName().equals(other.getPermissionName())) + && (this.getPermissionCode() == null ? other.getPermissionCode() == null : this.getPermissionCode().equals(other.getPermissionCode())) + && (this.getPermissionDesc() == null ? other.getPermissionDesc() == null : this.getPermissionDesc().equals(other.getPermissionDesc())) + && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort())) + && (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getPermissionName() == null) ? 0 : getPermissionName().hashCode()); + result = prime * result + ((getPermissionCode() == null) ? 0 : getPermissionCode().hashCode()); + result = prime * result + ((getPermissionDesc() == null) ? 0 : getPermissionDesc().hashCode()); + result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode()); + result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().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(", permissionName=").append(permissionName); + sb.append(", permissionCode=").append(permissionCode); + sb.append(", permissionDesc=").append(permissionDesc); + sb.append(", sort=").append(sort); + sb.append(", menuId=").append(menuId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecPermissionExample.java b/service/src/main/java/com/hfkj/entity/SecPermissionExample.java new file mode 100644 index 0000000..6afcc33 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecPermissionExample.java @@ -0,0 +1,612 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecPermissionExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecPermissionExample() { + 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 andPermissionNameIsNull() { + addCriterion("permission_name is null"); + return (Criteria) this; + } + + public Criteria andPermissionNameIsNotNull() { + addCriterion("permission_name is not null"); + return (Criteria) this; + } + + public Criteria andPermissionNameEqualTo(String value) { + addCriterion("permission_name =", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameNotEqualTo(String value) { + addCriterion("permission_name <>", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameGreaterThan(String value) { + addCriterion("permission_name >", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameGreaterThanOrEqualTo(String value) { + addCriterion("permission_name >=", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameLessThan(String value) { + addCriterion("permission_name <", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameLessThanOrEqualTo(String value) { + addCriterion("permission_name <=", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameLike(String value) { + addCriterion("permission_name like", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameNotLike(String value) { + addCriterion("permission_name not like", value, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameIn(List values) { + addCriterion("permission_name in", values, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameNotIn(List values) { + addCriterion("permission_name not in", values, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameBetween(String value1, String value2) { + addCriterion("permission_name between", value1, value2, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionNameNotBetween(String value1, String value2) { + addCriterion("permission_name not between", value1, value2, "permissionName"); + return (Criteria) this; + } + + public Criteria andPermissionCodeIsNull() { + addCriterion("permission_code is null"); + return (Criteria) this; + } + + public Criteria andPermissionCodeIsNotNull() { + addCriterion("permission_code is not null"); + return (Criteria) this; + } + + public Criteria andPermissionCodeEqualTo(String value) { + addCriterion("permission_code =", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeNotEqualTo(String value) { + addCriterion("permission_code <>", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeGreaterThan(String value) { + addCriterion("permission_code >", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeGreaterThanOrEqualTo(String value) { + addCriterion("permission_code >=", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeLessThan(String value) { + addCriterion("permission_code <", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeLessThanOrEqualTo(String value) { + addCriterion("permission_code <=", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeLike(String value) { + addCriterion("permission_code like", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeNotLike(String value) { + addCriterion("permission_code not like", value, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeIn(List values) { + addCriterion("permission_code in", values, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeNotIn(List values) { + addCriterion("permission_code not in", values, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeBetween(String value1, String value2) { + addCriterion("permission_code between", value1, value2, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionCodeNotBetween(String value1, String value2) { + addCriterion("permission_code not between", value1, value2, "permissionCode"); + return (Criteria) this; + } + + public Criteria andPermissionDescIsNull() { + addCriterion("permission_desc is null"); + return (Criteria) this; + } + + public Criteria andPermissionDescIsNotNull() { + addCriterion("permission_desc is not null"); + return (Criteria) this; + } + + public Criteria andPermissionDescEqualTo(String value) { + addCriterion("permission_desc =", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescNotEqualTo(String value) { + addCriterion("permission_desc <>", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescGreaterThan(String value) { + addCriterion("permission_desc >", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescGreaterThanOrEqualTo(String value) { + addCriterion("permission_desc >=", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescLessThan(String value) { + addCriterion("permission_desc <", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescLessThanOrEqualTo(String value) { + addCriterion("permission_desc <=", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescLike(String value) { + addCriterion("permission_desc like", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescNotLike(String value) { + addCriterion("permission_desc not like", value, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescIn(List values) { + addCriterion("permission_desc in", values, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescNotIn(List values) { + addCriterion("permission_desc not in", values, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescBetween(String value1, String value2) { + addCriterion("permission_desc between", value1, value2, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andPermissionDescNotBetween(String value1, String value2) { + addCriterion("permission_desc not between", value1, value2, "permissionDesc"); + return (Criteria) this; + } + + public Criteria andSortIsNull() { + addCriterion("sort is null"); + return (Criteria) this; + } + + public Criteria andSortIsNotNull() { + addCriterion("sort is not null"); + return (Criteria) this; + } + + public Criteria andSortEqualTo(Integer value) { + addCriterion("sort =", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotEqualTo(Integer value) { + addCriterion("sort <>", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThan(Integer value) { + addCriterion("sort >", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortGreaterThanOrEqualTo(Integer value) { + addCriterion("sort >=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThan(Integer value) { + addCriterion("sort <", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortLessThanOrEqualTo(Integer value) { + addCriterion("sort <=", value, "sort"); + return (Criteria) this; + } + + public Criteria andSortIn(List values) { + addCriterion("sort in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotIn(List values) { + addCriterion("sort not in", values, "sort"); + return (Criteria) this; + } + + public Criteria andSortBetween(Integer value1, Integer value2) { + addCriterion("sort between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andSortNotBetween(Integer value1, Integer value2) { + addCriterion("sort not between", value1, value2, "sort"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNull() { + addCriterion("menu_id is null"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNotNull() { + addCriterion("menu_id is not null"); + return (Criteria) this; + } + + public Criteria andMenuIdEqualTo(Long value) { + addCriterion("menu_id =", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotEqualTo(Long value) { + addCriterion("menu_id <>", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThan(Long value) { + addCriterion("menu_id >", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThanOrEqualTo(Long value) { + addCriterion("menu_id >=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThan(Long value) { + addCriterion("menu_id <", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThanOrEqualTo(Long value) { + addCriterion("menu_id <=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdIn(List values) { + addCriterion("menu_id in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotIn(List values) { + addCriterion("menu_id not in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdBetween(Long value1, Long value2) { + addCriterion("menu_id between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotBetween(Long value1, Long value2) { + addCriterion("menu_id not between", value1, value2, "menuId"); + 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecRegion.java b/service/src/main/java/com/hfkj/entity/SecRegion.java new file mode 100644 index 0000000..667374f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRegion.java @@ -0,0 +1,113 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_region + * @author + */ + +/** + * + * 代码由工具生成 + * + **/ +public class SecRegion implements Serializable { + /** + * 主键 + */ + private Long regionId; + + /** + * 省市区 + */ + private String regionName; + + /** + * 父类id + */ + private Long parentId; + + /** + * 状态,是否可用 + */ + private Integer status; + + private static final long serialVersionUID = 1L; + + public Long getRegionId() { + return regionId; + } + + public void setRegionId(Long regionId) { + this.regionId = regionId; + } + + public String getRegionName() { + return regionName; + } + + public void setRegionName(String regionName) { + this.regionName = regionName; + } + + public Long getParentId() { + return parentId; + } + + public void setParentId(Long parentId) { + this.parentId = parentId; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecRegion other = (SecRegion) that; + return (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId())) + && (this.getRegionName() == null ? other.getRegionName() == null : this.getRegionName().equals(other.getRegionName())) + && (this.getParentId() == null ? other.getParentId() == null : this.getParentId().equals(other.getParentId())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode()); + result = prime * result + ((getRegionName() == null) ? 0 : getRegionName().hashCode()); + result = prime * result + ((getParentId() == null) ? 0 : getParentId().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", regionId=").append(regionId); + sb.append(", regionName=").append(regionName); + sb.append(", parentId=").append(parentId); + sb.append(", status=").append(status); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecRegionExample.java b/service/src/main/java/com/hfkj/entity/SecRegionExample.java new file mode 100644 index 0000000..28a81ce --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRegionExample.java @@ -0,0 +1,472 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecRegionExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecRegionExample() { + 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 andRegionIdIsNull() { + addCriterion("region_id is null"); + return (Criteria) this; + } + + public Criteria andRegionIdIsNotNull() { + addCriterion("region_id is not null"); + return (Criteria) this; + } + + public Criteria andRegionIdEqualTo(Long value) { + addCriterion("region_id =", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotEqualTo(Long value) { + addCriterion("region_id <>", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThan(Long value) { + addCriterion("region_id >", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdGreaterThanOrEqualTo(Long value) { + addCriterion("region_id >=", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThan(Long value) { + addCriterion("region_id <", value, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdLessThanOrEqualTo(Long value) { + addCriterion("region_id <=", 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(Long value1, Long value2) { + addCriterion("region_id between", value1, value2, "regionId"); + return (Criteria) this; + } + + public Criteria andRegionIdNotBetween(Long value1, Long 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 andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(Long value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(Long value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(Long value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(Long value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(Long value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(Long value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(Long value1, Long value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(Long value1, Long value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + 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 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecRole.java b/service/src/main/java/com/hfkj/entity/SecRole.java new file mode 100644 index 0000000..c7514b8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRole.java @@ -0,0 +1,145 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * sec_role + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecRole implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色描述 + */ + private String roleDesc; + + /** + * 启用状态 0:删除 1:正常 + */ + private Integer status; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 修改时间 + */ + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRoleName() { + return roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getRoleDesc() { + return roleDesc; + } + + public void setRoleDesc(String roleDesc) { + this.roleDesc = roleDesc; + } + + 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; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecRole other = (SecRole) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRoleName() == null ? other.getRoleName() == null : this.getRoleName().equals(other.getRoleName())) + && (this.getRoleDesc() == null ? other.getRoleDesc() == null : this.getRoleDesc().equals(other.getRoleDesc())) + && (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())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); + result = prime * result + ((getRoleDesc() == null) ? 0 : getRoleDesc().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()); + 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(", roleName=").append(roleName); + sb.append(", roleDesc=").append(roleDesc); + sb.append(", status=").append(status); + sb.append(", createTime=").append(createTime); + sb.append(", updateTime=").append(updateTime); + 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/SecRoleExample.java b/service/src/main/java/com/hfkj/entity/SecRoleExample.java new file mode 100644 index 0000000..0402657 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRoleExample.java @@ -0,0 +1,603 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SecRoleExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecRoleExample() { + 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 andRoleNameIsNull() { + addCriterion("role_name is null"); + return (Criteria) this; + } + + public Criteria andRoleNameIsNotNull() { + addCriterion("role_name is not null"); + return (Criteria) this; + } + + public Criteria andRoleNameEqualTo(String value) { + addCriterion("role_name =", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotEqualTo(String value) { + addCriterion("role_name <>", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameGreaterThan(String value) { + addCriterion("role_name >", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameGreaterThanOrEqualTo(String value) { + addCriterion("role_name >=", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLessThan(String value) { + addCriterion("role_name <", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLessThanOrEqualTo(String value) { + addCriterion("role_name <=", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameLike(String value) { + addCriterion("role_name like", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotLike(String value) { + addCriterion("role_name not like", value, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameIn(List values) { + addCriterion("role_name in", values, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotIn(List values) { + addCriterion("role_name not in", values, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameBetween(String value1, String value2) { + addCriterion("role_name between", value1, value2, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleNameNotBetween(String value1, String value2) { + addCriterion("role_name not between", value1, value2, "roleName"); + return (Criteria) this; + } + + public Criteria andRoleDescIsNull() { + addCriterion("role_desc is null"); + return (Criteria) this; + } + + public Criteria andRoleDescIsNotNull() { + addCriterion("role_desc is not null"); + return (Criteria) this; + } + + public Criteria andRoleDescEqualTo(String value) { + addCriterion("role_desc =", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescNotEqualTo(String value) { + addCriterion("role_desc <>", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescGreaterThan(String value) { + addCriterion("role_desc >", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescGreaterThanOrEqualTo(String value) { + addCriterion("role_desc >=", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescLessThan(String value) { + addCriterion("role_desc <", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescLessThanOrEqualTo(String value) { + addCriterion("role_desc <=", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescLike(String value) { + addCriterion("role_desc like", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescNotLike(String value) { + addCriterion("role_desc not like", value, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescIn(List values) { + addCriterion("role_desc in", values, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescNotIn(List values) { + addCriterion("role_desc not in", values, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescBetween(String value1, String value2) { + addCriterion("role_desc between", value1, value2, "roleDesc"); + return (Criteria) this; + } + + public Criteria andRoleDescNotBetween(String value1, String value2) { + addCriterion("role_desc not between", value1, value2, "roleDesc"); + 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 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/SecRoleMenuRel.java b/service/src/main/java/com/hfkj/entity/SecRoleMenuRel.java new file mode 100644 index 0000000..5ced4e0 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRoleMenuRel.java @@ -0,0 +1,93 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_role_menu_rel + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecRoleMenuRel implements Serializable { + private Long id; + + /** + * 角色id + */ + private Long roleId; + + /** + * 菜单id + */ + private Long menuId; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecRoleMenuRel other = (SecRoleMenuRel) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) + && (this.getMenuId() == null ? other.getMenuId() == null : this.getMenuId().equals(other.getMenuId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().hashCode()); + result = prime * result + ((getMenuId() == null) ? 0 : getMenuId().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(", roleId=").append(roleId); + sb.append(", menuId=").append(menuId); + 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/SecRoleMenuRelExample.java b/service/src/main/java/com/hfkj/entity/SecRoleMenuRelExample.java new file mode 100644 index 0000000..2d063e8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRoleMenuRelExample.java @@ -0,0 +1,402 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecRoleMenuRelExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecRoleMenuRelExample() { + 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 andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNull() { + addCriterion("menu_id is null"); + return (Criteria) this; + } + + public Criteria andMenuIdIsNotNull() { + addCriterion("menu_id is not null"); + return (Criteria) this; + } + + public Criteria andMenuIdEqualTo(Long value) { + addCriterion("menu_id =", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotEqualTo(Long value) { + addCriterion("menu_id <>", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThan(Long value) { + addCriterion("menu_id >", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdGreaterThanOrEqualTo(Long value) { + addCriterion("menu_id >=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThan(Long value) { + addCriterion("menu_id <", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdLessThanOrEqualTo(Long value) { + addCriterion("menu_id <=", value, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdIn(List values) { + addCriterion("menu_id in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotIn(List values) { + addCriterion("menu_id not in", values, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdBetween(Long value1, Long value2) { + addCriterion("menu_id between", value1, value2, "menuId"); + return (Criteria) this; + } + + public Criteria andMenuIdNotBetween(Long value1, Long value2) { + addCriterion("menu_id not between", value1, value2, "menuId"); + 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/SecRolePermissionRel.java b/service/src/main/java/com/hfkj/entity/SecRolePermissionRel.java new file mode 100644 index 0000000..db3d887 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRolePermissionRel.java @@ -0,0 +1,97 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_role_permission_rel + * @author + */ + +/** + * + * 代码由工具生成 + * + **/ +public class SecRolePermissionRel implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 权限ID + */ + private Long permissionId; + + /** + * 角色ID + */ + private Long roleId; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getPermissionId() { + return permissionId; + } + + public void setPermissionId(Long permissionId) { + this.permissionId = permissionId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecRolePermissionRel other = (SecRolePermissionRel) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getPermissionId() == null ? other.getPermissionId() == null : this.getPermissionId().equals(other.getPermissionId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getPermissionId() == null) ? 0 : getPermissionId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().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(", permissionId=").append(permissionId); + sb.append(", roleId=").append(roleId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecRolePermissionRelExample.java b/service/src/main/java/com/hfkj/entity/SecRolePermissionRelExample.java new file mode 100644 index 0000000..54688f9 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecRolePermissionRelExample.java @@ -0,0 +1,402 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecRolePermissionRelExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecRolePermissionRelExample() { + 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 andPermissionIdIsNull() { + addCriterion("permission_id is null"); + return (Criteria) this; + } + + public Criteria andPermissionIdIsNotNull() { + addCriterion("permission_id is not null"); + return (Criteria) this; + } + + public Criteria andPermissionIdEqualTo(Long value) { + addCriterion("permission_id =", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotEqualTo(Long value) { + addCriterion("permission_id <>", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThan(Long value) { + addCriterion("permission_id >", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdGreaterThanOrEqualTo(Long value) { + addCriterion("permission_id >=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThan(Long value) { + addCriterion("permission_id <", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdLessThanOrEqualTo(Long value) { + addCriterion("permission_id <=", value, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdIn(List values) { + addCriterion("permission_id in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotIn(List values) { + addCriterion("permission_id not in", values, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdBetween(Long value1, Long value2) { + addCriterion("permission_id between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andPermissionIdNotBetween(Long value1, Long value2) { + addCriterion("permission_id not between", value1, value2, "permissionId"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecUser.java b/service/src/main/java/com/hfkj/entity/SecUser.java new file mode 100644 index 0000000..3d359f8 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUser.java @@ -0,0 +1,280 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * sec_user + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecUser implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 头像 + */ + private String avatar; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 登录账户 + */ + private String loginName; + + /** + * 登录密码 + */ + private String password; + + /** + * 联系方式 + */ + private String telephone; + + /** + * 对象类型 + */ + private Integer objectType; + + /** + * 对象id + */ + private Long objectId; + + /** + * 角色id + */ + private Long roleId; + + /** + * 状态 0:删除 1:可用 + */ + 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 getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getLoginName() { + return loginName; + } + + public void setLoginName(String loginName) { + this.loginName = loginName; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public Integer getObjectType() { + return objectType; + } + + public void setObjectType(Integer objectType) { + this.objectType = objectType; + } + + public Long getObjectId() { + return objectId; + } + + public void setObjectId(Long objectId) { + this.objectId = objectId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + 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; + } + SecUser other = (SecUser) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getAvatar() == null ? other.getAvatar() == null : this.getAvatar().equals(other.getAvatar())) + && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName())) + && (this.getLoginName() == null ? other.getLoginName() == null : this.getLoginName().equals(other.getLoginName())) + && (this.getPassword() == null ? other.getPassword() == null : this.getPassword().equals(other.getPassword())) + && (this.getTelephone() == null ? other.getTelephone() == null : this.getTelephone().equals(other.getTelephone())) + && (this.getObjectType() == null ? other.getObjectType() == null : this.getObjectType().equals(other.getObjectType())) + && (this.getObjectId() == null ? other.getObjectId() == null : this.getObjectId().equals(other.getObjectId())) + && (this.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())) + && (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 + ((getAvatar() == null) ? 0 : getAvatar().hashCode()); + result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode()); + result = prime * result + ((getLoginName() == null) ? 0 : getLoginName().hashCode()); + result = prime * result + ((getPassword() == null) ? 0 : getPassword().hashCode()); + result = prime * result + ((getTelephone() == null) ? 0 : getTelephone().hashCode()); + result = prime * result + ((getObjectType() == null) ? 0 : getObjectType().hashCode()); + result = prime * result + ((getObjectId() == null) ? 0 : getObjectId().hashCode()); + result = prime * result + ((getRoleId() == null) ? 0 : getRoleId().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(", avatar=").append(avatar); + sb.append(", userName=").append(userName); + sb.append(", loginName=").append(loginName); + sb.append(", password=").append(password); + sb.append(", telephone=").append(telephone); + sb.append(", objectType=").append(objectType); + sb.append(", objectId=").append(objectId); + sb.append(", roleId=").append(roleId); + 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/SecUserExample.java b/service/src/main/java/com/hfkj/entity/SecUserExample.java new file mode 100644 index 0000000..8314f2f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUserExample.java @@ -0,0 +1,1203 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SecUserExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecUserExample() { + 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 andAvatarIsNull() { + addCriterion("avatar is null"); + return (Criteria) this; + } + + public Criteria andAvatarIsNotNull() { + addCriterion("avatar is not null"); + return (Criteria) this; + } + + public Criteria andAvatarEqualTo(String value) { + addCriterion("avatar =", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarNotEqualTo(String value) { + addCriterion("avatar <>", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarGreaterThan(String value) { + addCriterion("avatar >", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarGreaterThanOrEqualTo(String value) { + addCriterion("avatar >=", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarLessThan(String value) { + addCriterion("avatar <", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarLessThanOrEqualTo(String value) { + addCriterion("avatar <=", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarLike(String value) { + addCriterion("avatar like", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarNotLike(String value) { + addCriterion("avatar not like", value, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarIn(List values) { + addCriterion("avatar in", values, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarNotIn(List values) { + addCriterion("avatar not in", values, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarBetween(String value1, String value2) { + addCriterion("avatar between", value1, value2, "avatar"); + return (Criteria) this; + } + + public Criteria andAvatarNotBetween(String value1, String value2) { + addCriterion("avatar not between", value1, value2, "avatar"); + return (Criteria) this; + } + + public Criteria andUserNameIsNull() { + addCriterion("user_name is null"); + return (Criteria) this; + } + + public Criteria andUserNameIsNotNull() { + addCriterion("user_name is not null"); + return (Criteria) this; + } + + public Criteria andUserNameEqualTo(String value) { + addCriterion("user_name =", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotEqualTo(String value) { + addCriterion("user_name <>", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameGreaterThan(String value) { + addCriterion("user_name >", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameGreaterThanOrEqualTo(String value) { + addCriterion("user_name >=", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLessThan(String value) { + addCriterion("user_name <", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLessThanOrEqualTo(String value) { + addCriterion("user_name <=", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameLike(String value) { + addCriterion("user_name like", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotLike(String value) { + addCriterion("user_name not like", value, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameIn(List values) { + addCriterion("user_name in", values, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotIn(List values) { + addCriterion("user_name not in", values, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameBetween(String value1, String value2) { + addCriterion("user_name between", value1, value2, "userName"); + return (Criteria) this; + } + + public Criteria andUserNameNotBetween(String value1, String value2) { + addCriterion("user_name not between", value1, value2, "userName"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNull() { + addCriterion("login_name is null"); + return (Criteria) this; + } + + public Criteria andLoginNameIsNotNull() { + addCriterion("login_name is not null"); + return (Criteria) this; + } + + public Criteria andLoginNameEqualTo(String value) { + addCriterion("login_name =", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotEqualTo(String value) { + addCriterion("login_name <>", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThan(String value) { + addCriterion("login_name >", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("login_name >=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThan(String value) { + addCriterion("login_name <", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLessThanOrEqualTo(String value) { + addCriterion("login_name <=", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameLike(String value) { + addCriterion("login_name like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotLike(String value) { + addCriterion("login_name not like", value, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameIn(List values) { + addCriterion("login_name in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotIn(List values) { + addCriterion("login_name not in", values, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameBetween(String value1, String value2) { + addCriterion("login_name between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andLoginNameNotBetween(String value1, String value2) { + addCriterion("login_name not between", value1, value2, "loginName"); + return (Criteria) this; + } + + public Criteria andPasswordIsNull() { + addCriterion("`password` is null"); + return (Criteria) this; + } + + public Criteria andPasswordIsNotNull() { + addCriterion("`password` is not null"); + return (Criteria) this; + } + + public Criteria andPasswordEqualTo(String value) { + addCriterion("`password` =", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotEqualTo(String value) { + addCriterion("`password` <>", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThan(String value) { + addCriterion("`password` >", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThanOrEqualTo(String value) { + addCriterion("`password` >=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThan(String value) { + addCriterion("`password` <", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThanOrEqualTo(String value) { + addCriterion("`password` <=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLike(String value) { + addCriterion("`password` like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotLike(String value) { + addCriterion("`password` not like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordIn(List values) { + addCriterion("`password` in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotIn(List values) { + addCriterion("`password` not in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordBetween(String value1, String value2) { + addCriterion("`password` between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotBetween(String value1, String value2) { + addCriterion("`password` not between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNull() { + addCriterion("telephone is null"); + return (Criteria) this; + } + + public Criteria andTelephoneIsNotNull() { + addCriterion("telephone is not null"); + return (Criteria) this; + } + + public Criteria andTelephoneEqualTo(String value) { + addCriterion("telephone =", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotEqualTo(String value) { + addCriterion("telephone <>", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThan(String value) { + addCriterion("telephone >", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneGreaterThanOrEqualTo(String value) { + addCriterion("telephone >=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThan(String value) { + addCriterion("telephone <", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLessThanOrEqualTo(String value) { + addCriterion("telephone <=", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneLike(String value) { + addCriterion("telephone like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotLike(String value) { + addCriterion("telephone not like", value, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneIn(List values) { + addCriterion("telephone in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotIn(List values) { + addCriterion("telephone not in", values, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneBetween(String value1, String value2) { + addCriterion("telephone between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andTelephoneNotBetween(String value1, String value2) { + addCriterion("telephone not between", value1, value2, "telephone"); + return (Criteria) this; + } + + public Criteria andObjectTypeIsNull() { + addCriterion("object_type is null"); + return (Criteria) this; + } + + public Criteria andObjectTypeIsNotNull() { + addCriterion("object_type is not null"); + return (Criteria) this; + } + + public Criteria andObjectTypeEqualTo(Integer value) { + addCriterion("object_type =", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeNotEqualTo(Integer value) { + addCriterion("object_type <>", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeGreaterThan(Integer value) { + addCriterion("object_type >", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("object_type >=", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeLessThan(Integer value) { + addCriterion("object_type <", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeLessThanOrEqualTo(Integer value) { + addCriterion("object_type <=", value, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeIn(List values) { + addCriterion("object_type in", values, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeNotIn(List values) { + addCriterion("object_type not in", values, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeBetween(Integer value1, Integer value2) { + addCriterion("object_type between", value1, value2, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectTypeNotBetween(Integer value1, Integer value2) { + addCriterion("object_type not between", value1, value2, "objectType"); + return (Criteria) this; + } + + public Criteria andObjectIdIsNull() { + addCriterion("object_id is null"); + return (Criteria) this; + } + + public Criteria andObjectIdIsNotNull() { + addCriterion("object_id is not null"); + return (Criteria) this; + } + + public Criteria andObjectIdEqualTo(Long value) { + addCriterion("object_id =", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotEqualTo(Long value) { + addCriterion("object_id <>", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThan(Long value) { + addCriterion("object_id >", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdGreaterThanOrEqualTo(Long value) { + addCriterion("object_id >=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThan(Long value) { + addCriterion("object_id <", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdLessThanOrEqualTo(Long value) { + addCriterion("object_id <=", value, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdIn(List values) { + addCriterion("object_id in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotIn(List values) { + addCriterion("object_id not in", values, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdBetween(Long value1, Long value2) { + addCriterion("object_id between", value1, value2, "objectId"); + return (Criteria) this; + } + + public Criteria andObjectIdNotBetween(Long value1, Long value2) { + addCriterion("object_id not between", value1, value2, "objectId"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + 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/SecUserLoginLog.java b/service/src/main/java/com/hfkj/entity/SecUserLoginLog.java new file mode 100644 index 0000000..a887289 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUserLoginLog.java @@ -0,0 +1,296 @@ +package com.hfkj.entity; + +import java.io.Serializable; +import java.util.Date; + +/** + * sec_user_login_log + * @author + */ +/** + * + * 代码由工具生成 + * + **/ +public class SecUserLoginLog implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 登录账户id + */ + private Long userId; + + /** + * 登录账户 + */ + private String userLoginName; + + /** + * 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 getUserLoginName() { + return userLoginName; + } + + public void setUserLoginName(String userLoginName) { + this.userLoginName = userLoginName; + } + + 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; + } + SecUserLoginLog other = (SecUserLoginLog) 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.getUserLoginName() == null ? other.getUserLoginName() == null : this.getUserLoginName().equals(other.getUserLoginName())) + && (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 + ((getUserLoginName() == null) ? 0 : getUserLoginName().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(", userLoginName=").append(userLoginName); + 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/SecUserLoginLogExample.java b/service/src/main/java/com/hfkj/entity/SecUserLoginLogExample.java new file mode 100644 index 0000000..9006f24 --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUserLoginLogExample.java @@ -0,0 +1,1303 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class SecUserLoginLogExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecUserLoginLogExample() { + 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 andUserLoginNameIsNull() { + addCriterion("user_login_name is null"); + return (Criteria) this; + } + + public Criteria andUserLoginNameIsNotNull() { + addCriterion("user_login_name is not null"); + return (Criteria) this; + } + + public Criteria andUserLoginNameEqualTo(String value) { + addCriterion("user_login_name =", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameNotEqualTo(String value) { + addCriterion("user_login_name <>", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameGreaterThan(String value) { + addCriterion("user_login_name >", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameGreaterThanOrEqualTo(String value) { + addCriterion("user_login_name >=", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameLessThan(String value) { + addCriterion("user_login_name <", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameLessThanOrEqualTo(String value) { + addCriterion("user_login_name <=", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameLike(String value) { + addCriterion("user_login_name like", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameNotLike(String value) { + addCriterion("user_login_name not like", value, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameIn(List values) { + addCriterion("user_login_name in", values, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameNotIn(List values) { + addCriterion("user_login_name not in", values, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameBetween(String value1, String value2) { + addCriterion("user_login_name between", value1, value2, "userLoginName"); + return (Criteria) this; + } + + public Criteria andUserLoginNameNotBetween(String value1, String value2) { + addCriterion("user_login_name not between", value1, value2, "userLoginName"); + 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/entity/SecUserRoleRel.java b/service/src/main/java/com/hfkj/entity/SecUserRoleRel.java new file mode 100644 index 0000000..a89e97e --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUserRoleRel.java @@ -0,0 +1,97 @@ +package com.hfkj.entity; + +import java.io.Serializable; + +/** + * sec_user_role_rel + * @author + */ + +/** + * + * 代码由工具生成 + * + **/ +public class SecUserRoleRel implements Serializable { + /** + * 主键 + */ + private Long id; + + /** + * 用户ID + */ + private Long userId; + + /** + * 角色ID + */ + private Long roleId; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + SecUserRoleRel other = (SecUserRoleRel) 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.getRoleId() == null ? other.getRoleId() == null : this.getRoleId().equals(other.getRoleId())); + } + + @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 + ((getRoleId() == null) ? 0 : getRoleId().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(", roleId=").append(roleId); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/service/src/main/java/com/hfkj/entity/SecUserRoleRelExample.java b/service/src/main/java/com/hfkj/entity/SecUserRoleRelExample.java new file mode 100644 index 0000000..05b536f --- /dev/null +++ b/service/src/main/java/com/hfkj/entity/SecUserRoleRelExample.java @@ -0,0 +1,402 @@ +package com.hfkj.entity; + +import java.util.ArrayList; +import java.util.List; + +public class SecUserRoleRelExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + private Integer limit; + + private Long offset; + + public SecUserRoleRelExample() { + 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 andRoleIdIsNull() { + addCriterion("role_id is null"); + return (Criteria) this; + } + + public Criteria andRoleIdIsNotNull() { + addCriterion("role_id is not null"); + return (Criteria) this; + } + + public Criteria andRoleIdEqualTo(Long value) { + addCriterion("role_id =", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotEqualTo(Long value) { + addCriterion("role_id <>", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThan(Long value) { + addCriterion("role_id >", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdGreaterThanOrEqualTo(Long value) { + addCriterion("role_id >=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThan(Long value) { + addCriterion("role_id <", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdLessThanOrEqualTo(Long value) { + addCriterion("role_id <=", value, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdIn(List values) { + addCriterion("role_id in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotIn(List values) { + addCriterion("role_id not in", values, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdBetween(Long value1, Long value2) { + addCriterion("role_id between", value1, value2, "roleId"); + return (Criteria) this; + } + + public Criteria andRoleIdNotBetween(Long value1, Long value2) { + addCriterion("role_id not between", value1, value2, "roleId"); + 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); + } + } +} diff --git a/service/src/main/java/com/hfkj/model/MenuTreeModel.java b/service/src/main/java/com/hfkj/model/MenuTreeModel.java new file mode 100644 index 0000000..1075403 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/MenuTreeModel.java @@ -0,0 +1,38 @@ +package com.hfkj.model; + +import com.hfkj.entity.SecMenu; + +import java.util.List; + +/** + * 菜单结构模型 + * @author hurui + */ +public class MenuTreeModel extends SecMenu { + + /** + * 子菜单列表 + */ + List childMenuList; + + /** + * 菜单权限 + */ + Boolean authority; + + public List getChildMenuList() { + return childMenuList; + } + + public void setChildMenuList(List childMenuList) { + this.childMenuList = childMenuList; + } + + public Boolean getAuthority() { + return authority; + } + + public void setAuthority(Boolean authority) { + this.authority = authority; + } +} diff --git a/service/src/main/java/com/hfkj/model/ResponseData.java b/service/src/main/java/com/hfkj/model/ResponseData.java new file mode 100644 index 0000000..64dd429 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/ResponseData.java @@ -0,0 +1,36 @@ +package com.hfkj.model; + +public class ResponseData { + + private String return_code; + + //错误描述 + private String return_msg; + + private Object return_data; + + public String getReturn_code() { + return return_code; + } + + public void setReturn_code(String return_code) { + this.return_code = return_code; + } + + public Object getReturn_data() { + return return_data; + } + + public void setReturn_data(Object return_data) { + this.return_data = return_data; + } + + public String getReturn_msg() { + return return_msg; + } + + public void setReturn_msg(String return_msg) { + this.return_msg = return_msg; + } + +} diff --git a/service/src/main/java/com/hfkj/model/SecUserModel.java b/service/src/main/java/com/hfkj/model/SecUserModel.java new file mode 100644 index 0000000..a3514bd --- /dev/null +++ b/service/src/main/java/com/hfkj/model/SecUserModel.java @@ -0,0 +1,38 @@ +package com.hfkj.model; + +import com.hfkj.entity.SecUser; + +public class SecUserModel extends SecUser { + + private String organizationName; //组织名称 + + private String companyName; //公司名称 + + private static final long serialVersionUID = 1L; + + public String getOrganizationName() { + return organizationName; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public static long getSerialVersionUID() { + return serialVersionUID; + } + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + + + public static long getSerialversionuid() { + return serialVersionUID; + } + +} diff --git a/service/src/main/java/com/hfkj/model/SecUserSessionObject.java b/service/src/main/java/com/hfkj/model/SecUserSessionObject.java new file mode 100644 index 0000000..75e1c39 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/SecUserSessionObject.java @@ -0,0 +1,43 @@ +package com.hfkj.model; + +import com.hfkj.entity.SecMenu; +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecUser; +import lombok.Data; + +import java.util.List; + +/** + * 系统用户登录session对象 + */ +@Data +public class SecUserSessionObject { + + /** + * 登录账户 + */ + private SecUser account; + + /** + * 角色信息 + */ + private SecRole role; + + /** + * 菜单 + */ + private List menuTree; + + /** + * 按钮 + */ + private List button; + + public SecUserSessionObject(SecUser account, SecRole role, List menuTree, List button){ + this.account = account; + this.role = role; + this.menuTree = menuTree; + this.button = button; + } + +} diff --git a/service/src/main/java/com/hfkj/model/UserTreeModel.java b/service/src/main/java/com/hfkj/model/UserTreeModel.java new file mode 100644 index 0000000..2070b83 --- /dev/null +++ b/service/src/main/java/com/hfkj/model/UserTreeModel.java @@ -0,0 +1,70 @@ +package com.hfkj.model; + +import java.util.ArrayList; +import java.util.List; + +public class UserTreeModel { + + private String title; + + private String key; + + private String phone; + + //节点类型 flase:组织架构;true:用户 + private Boolean type; + + private List children; + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public Boolean getType() { + return type; + } + + public void setType(Boolean type) { + this.type = type; + } + + public List getChildren() { + return children; + } + + public void setChildren(List children) { + this.children = children; + } + + /** + * 添加子节点. + * @param child + */ + public void add(UserTreeModel child) { + if (children == null) { + children = new ArrayList<>(); + } + children.add(child); + } + +} diff --git a/service/src/main/java/com/hfkj/msg/MsgTopic.java b/service/src/main/java/com/hfkj/msg/MsgTopic.java new file mode 100644 index 0000000..f1c90ad --- /dev/null +++ b/service/src/main/java/com/hfkj/msg/MsgTopic.java @@ -0,0 +1,16 @@ +package com.hfkj.msg; + +public enum MsgTopic { + + oilPriceTask("OIL-PRICE-TASK"); + + private String name; + + MsgTopic(String name){ + this.name = name; + } + + public String getName(){ + return name; + } +} diff --git a/service/src/main/java/com/hfkj/service/BsAgentService.java b/service/src/main/java/com/hfkj/service/BsAgentService.java new file mode 100644 index 0000000..491eba6 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsAgentService.java @@ -0,0 +1,57 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsAgent; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsAgentService + * @author: HuRui + * @date: 2024/2/28 + **/ +public interface BsAgentService { + + /** + * 编辑数据 + * @param data 数据 + */ + BsAgent editData(BsAgent data); + + /** + * 创建代理商 + * @param loginName 登录名称 + * @param agent 代理商 + */ + BsAgent createAgent(String loginName, BsAgent agent) throws Exception; + + /** + * 修改代理商 + * @param agent + * @return + * @throws Exception + */ + BsAgent updateAgent(BsAgent agent); + + /** + * 查询代理商 + * @param id + * @return + */ + BsAgent getAgentById(Long id); + + /** + * 根据代理商编号查询代理商 + * @param agentNo + * @return + */ + BsAgent getAgentByAgentNo(String agentNo); + + /** + * 查询代理商列表 + * @param param + * @return + */ + List getAgentList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/BsDeviceService.java b/service/src/main/java/com/hfkj/service/BsDeviceService.java new file mode 100644 index 0000000..69c0a18 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsDeviceService.java @@ -0,0 +1,35 @@ +package com.hfkj.service; + + +import com.hfkj.entity.BsDevice; + +import java.util.List; +import java.util.Map; + +/** + * 设备管理 + * @author hurui + */ +public interface BsDeviceService { + + /** + * 编辑设备 + * @param device + */ + void editDevice(BsDevice device); + + /** + * 查询设备详情 + * @param deviceId + * @return + */ + BsDevice getDetailById(Long deviceId); + + /** + * 查询设备列表 + * @param param + * @return + */ + List getDeviceList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/BsDiscountService.java b/service/src/main/java/com/hfkj/service/BsDiscountService.java new file mode 100644 index 0000000..f425319 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsDiscountService.java @@ -0,0 +1,66 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsDiscount; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsDiscountService + * @author: HuRui + * @date: 2024/3/18 + **/ +public interface BsDiscountService { + + /** + * 编辑数据局 + * @param data + */ + void editData(BsDiscount data); + + /** + * 编辑优惠券 + * @param discount + */ + void editDiscount(BsDiscount discount); + + /** + * 上线优惠券 + * @param discountNo + */ + void online(String discountNo); + + /** + * 下线优惠券 + * @param discountNo + */ + void done(String discountNo); + + + /** + * 删除 + * @param discountNo + */ + void delete(String discountNo); + + /** + * 查询详情 + * @param id + * @return + */ + BsDiscount getDetail(Long id); + + /** + * 查询详情 + * @param discountNo + * @return + */ + BsDiscount getDetail(String discountNo); + + /** + * 查询列表 + * @param param + * @return + */ + List getList(Map param); +} diff --git a/service/src/main/java/com/hfkj/service/BsDiscountStockBatchService.java b/service/src/main/java/com/hfkj/service/BsDiscountStockBatchService.java new file mode 100644 index 0000000..c64ba8f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsDiscountStockBatchService.java @@ -0,0 +1,43 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsDiscountStockBatch; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsDiscountStockBatchService + * @author: HuRui + * @date: 2024/3/19 + **/ +public interface BsDiscountStockBatchService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsDiscountStockBatch data); + + /** + * 增加库存 + * @param discountNo + * @param stockCount + */ + void addStock(String discountNo, Integer stockCount); + + /** + * 查询详情 + * @param batchNo + * @return + */ + BsDiscountStockBatch getStockBatchDetail(String batchNo); + + /** + * 查询库存批次列表 + * @param param + * @return + */ + List getStockBatchList(Map param); + + +} diff --git a/service/src/main/java/com/hfkj/service/BsDiscountStockCodeService.java b/service/src/main/java/com/hfkj/service/BsDiscountStockCodeService.java new file mode 100644 index 0000000..b85085e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsDiscountStockCodeService.java @@ -0,0 +1,27 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsDiscountStockCode; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsDiscountCodeService + * @author: HuRui + * @date: 2024/3/18 + **/ +public interface BsDiscountStockCodeService { + + /** + * 批量插入 + * @param codeList + */ + void insertList(List codeList); + + /** + * 查询列表 + * @param param + * @return + */ + List getCodeList(Map param); +} diff --git a/service/src/main/java/com/hfkj/service/BsGasOilGunNoService.java b/service/src/main/java/com/hfkj/service/BsGasOilGunNoService.java new file mode 100644 index 0000000..881e927 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsGasOilGunNoService.java @@ -0,0 +1,55 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilPrice; + +import java.util.List; + +/** + * @className: BsGasOilGunNoService + * @author: HuRui + * @date: 2024/3/12 + **/ +public interface BsGasOilGunNoService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsGasOilGunNo data); + + /** + * 删除 + * @param gunNoId + */ + void delete(Long gunNoId); + + /** + * 删除 + * @param merNo + */ + void delete(String merNo); + + /** + * 查询油站枪号列表 + * @param merNo + * @return + */ + List getOilGunNoList(String merNo); + + /** + * 查询详情 + * @param merNo 商户号 + * @param oilNo 油品 + * @param gunNo 枪号 + * @return + */ + BsGasOilGunNo getDetail(String merNo,String oilNo,String gunNo); + + /** + * 查询详情 + * @param gunNoId + * @return + */ + BsGasOilGunNo getDetail(Long gunNoId); +} diff --git a/service/src/main/java/com/hfkj/service/BsGasOilPriceOfficialService.java b/service/src/main/java/com/hfkj/service/BsGasOilPriceOfficialService.java new file mode 100644 index 0000000..1b02435 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsGasOilPriceOfficialService.java @@ -0,0 +1,48 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsGasOilPriceOfficial; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +/** + * 油品国标价 + * @author hurui + */ +public interface BsGasOilPriceOfficialService { + + /** + * 编辑价格 + * @param regionId + * @param oilNo + */ + void editPrice(Long regionId, String oilNo, BigDecimal price); + + /** + * 查询价格 + * @param regionId + * @param oilNo + * @return + */ + BsGasOilPriceOfficial getPrice(Long regionId, String oilNo); + + /** + * 查询价格列表 + * @param param + * @return + */ + List getPriceList(Map param); + + /** + * 刷新获取最新的国标价 + */ + void refreshPriceOfficial(); + + /** + * 刷新油站的国标价【全部】 + * @param regionId 区域 + * @param oilNo 油品 + */ + void refreshGasPriceOfficial(Long regionId, String oilNo); +} diff --git a/service/src/main/java/com/hfkj/service/BsGasOilPriceService.java b/service/src/main/java/com/hfkj/service/BsGasOilPriceService.java new file mode 100644 index 0000000..1b4a8ac --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsGasOilPriceService.java @@ -0,0 +1,63 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsGasOilPrice; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsGasOilPriceService + * @author: HuRui + * @date: 2024/3/5 + **/ +public interface BsGasOilPriceService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsGasOilPrice data); + + /** + * 编辑价格 + * @param data + */ + void editOilPrice(BsGasOilPrice data); + + /** + * 删除 + * @param data + */ + void delete(BsGasOilPrice data); + + /** + * 查询油价数据 + * @param id + * @return + */ + BsGasOilPrice getGasOilPrice(Long id); + + /** + * 查询油价数据 + * @param merId + * @param oilNo + * @return + */ + BsGasOilPrice getGasOilPrice(Long merId,String oilNo); + + /** + * 查询油价列表 + * @param param + * @return + */ + List getGasOilPriceList(Map param); + + + /** + * 根据区域和油品 查询数据列表 + * @param regionId + * @param oilNo + * @return + */ + List getPriceListByRegionAndOilNo(Long regionId, String oilNo); +} diff --git a/service/src/main/java/com/hfkj/service/BsGasOilPriceTaskService.java b/service/src/main/java/com/hfkj/service/BsGasOilPriceTaskService.java new file mode 100644 index 0000000..e85daec --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsGasOilPriceTaskService.java @@ -0,0 +1,58 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsGasOilPriceTask; + +import java.util.List; +import java.util.Map; + +/** + * 加油站价格任务 + * @author hurui + */ +public interface BsGasOilPriceTaskService { + + /** + * 编辑数据 + * @param gasOilPriceTask + */ + void editData(BsGasOilPriceTask gasOilPriceTask); + + /** + * 批量增加价格任务 + * @param taskList + */ + void batchAddTask(List taskList); + + /** + * 增加价格任务 + * @param gasOilPriceTask + */ + void addTask(BsGasOilPriceTask gasOilPriceTask); + + /** + * 业务处理 + * @param gasOilPriceTask + */ + void businessHandle(BsGasOilPriceTask gasOilPriceTask); + + /** + * 根据id 查询详情 + * @param taskId + * @return + */ + BsGasOilPriceTask getDetailById(Long taskId); + + /** + * 删除任务 + * @param taskId + */ + void delTask(Long taskId); + + /** + * 查询任务列表 + * @param param + * @return + */ + List getTaskList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java b/service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java new file mode 100644 index 0000000..feb531e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsMerchantPayConfigService.java @@ -0,0 +1,25 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsMerchantPayConfig; + +/** + * @className: BsMerchantPayConfigService + * @author: HuRui + * @date: 2024/3/13 + **/ +public interface BsMerchantPayConfigService { + + /** + * 编辑数据 + * @param data + */ + void editData(BsMerchantPayConfig data); + + /** + * 获取配置 + * @param merNo 商户 + * @return + */ + BsMerchantPayConfig getConfig(String merNo); + +} diff --git a/service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java b/service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java new file mode 100644 index 0000000..eb23185 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsMerchantQrCodeService.java @@ -0,0 +1,60 @@ +package com.hfkj.service; + +import com.google.zxing.WriterException; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantQrCode; +import com.hfkj.sysenum.MerchantQrCodeStatusEnum; +import com.hfkj.sysenum.MerchantQrCodeTypeEnum; + +import java.util.List; + +/** + * @className: BsMerchantQrCodeService + * @author: HuRui + * @date: 2024/3/4 + **/ +public interface BsMerchantQrCodeService { + + /** + * 编辑数据 + * @param data 数据 + */ + void editData(BsMerchantQrCode data); + + /** + * 生成商户二维码 + * @param merchant + */ + void generateMerQrCode(BsMerchant merchant) throws Exception; + + /** + * 修改二维码状态 + * @param qrCodeId + * @param qrCodeStatus + */ + void updateQrCodeStatus(Long qrCodeId, MerchantQrCodeStatusEnum qrCodeStatus); + + /** + * 查询二维码 + * @param id + * @return + */ + BsMerchantQrCode getMerQrCode(Long id); + + /** + * 查询二维码 + * @param merNo + * @param qrCodeType + * @return + */ + BsMerchantQrCode getMerQrCode(String merNo, MerchantQrCodeTypeEnum qrCodeType); + + /** + * 查询商户二维码列表 + * @param merNo + * @return + */ + List getMerQrCodeList(String merNo); + + +} diff --git a/service/src/main/java/com/hfkj/service/BsMerchantService.java b/service/src/main/java/com/hfkj/service/BsMerchantService.java new file mode 100644 index 0000000..c835619 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsMerchantService.java @@ -0,0 +1,68 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsMerchant; +import com.hfkj.sysenum.MerchantStatusEnum; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerchantService + * @author: HuRui + * @date: 2024/3/4 + **/ +public interface BsMerchantService { + + /** + * 编辑数据 + * @param merchant + */ + void editData(BsMerchant merchant); + + /** + * 创建商户 + * @param merchant + */ + void createMerchant(BsMerchant merchant) throws Exception; + + /** + * 重置密码 + * @param merNo + */ + void resetMerPwd(String merNo) throws Exception; + + /** + * 修改商户状态 + * @param merNo + * @param merchantStatus + */ + void updateMerStatus(String merNo, MerchantStatusEnum merchantStatus); + + /** + * 修改商户 + * @param merchant + */ + void updateMerchant(BsMerchant merchant); + + /** + * 查询商户 + * @param merNo + * @return + */ + BsMerchant getMerchant(String merNo); + + /** + * 查询商户 + * @param merId + * @return + */ + BsMerchant getMerchant(Long merId); + + /** + * 查询商户列表 + * @param param + * @return + */ + List getMerchantList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/BsMerchantUserService.java b/service/src/main/java/com/hfkj/service/BsMerchantUserService.java new file mode 100644 index 0000000..cfca075 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/BsMerchantUserService.java @@ -0,0 +1,28 @@ +package com.hfkj.service; + +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantUser; + +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerchantUserService + * @author: HuRui + * @date: 2024/5/31 + **/ +public interface BsMerchantUserService { + + /** + * 编辑数据 + * @param merchantUser + */ + void editData(BsMerchantUser merchantUser); + + /** + * 查询列表 + * @param param + * @return + */ + List getList(Map param); +} diff --git a/service/src/main/java/com/hfkj/service/CommonService.java b/service/src/main/java/com/hfkj/service/CommonService.java new file mode 100644 index 0000000..ee5041f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/CommonService.java @@ -0,0 +1,193 @@ +package com.hfkj.service; +/** + * @ClassName: CommonService + * @Description:TODO(共用接口) + * @author: 杜江 + * @date: 2020年07月07日 15:35:43 + * @Copyright: 2018 www.shinwoten.com Inc. All rights reserved. + */ + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecRegion; + +import java.util.List; +import java.util.Map; + +/** + *@ClassName CommonService + *@Description 共用接口 + *@Author 杜江 + *@Date 2020/7/7 15:35 + *@Version 1.0 + */ +public interface CommonService { + + /** + * @Title: getDictionaries + * @Description: 获取所有的数据字典 + * @author: 机器猫 + * @param: @param codeType + * @param: @return + * @return: List + * @throws + */ + Map> getDictionaries(); + + /** + * @Title: getDictionary + * @Description: 精确查找数据字典值 + * @author: 机器猫 + * @param: @param codeType + * @param: @param codeValue + * @param: @return + * @param: @throws Exception + * @return: SysDictionary + * @throws + */ + String getDictionaryCodeName(String codeType, String codeValue); + + /** + * @Title: mappingSysCode + * @Description: 根据codetype,codevalue获取系统字典数据 + * @author: 机器猫 + * @param: @param codeType + * @param: @param codeValue + * @param: @return + * @param: @throws Exception + * @return: SysDictionary + * @throws + */ + SecDictionary mappingSysCode(String codeType, String codeValue); + + /** + * @ClassName CommonService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description //TODO + * @createTime 14:53 2021/6/23 + **/ + Boolean findValue(String codeType, String codeValue); + + /** + * + * @Title: mappingSysName + * @Description: 根据codetype,codeName获取系统字典数据 + * @author: 杜江 + * @Date: 2020/8/21 14:13 + * @param: [codeType, codeName] + * @return: com.shinwoten.train.entity.SecDictionary + * @throws + */ + SecDictionary mappingSysName(String codeType, String codeName); + + /** + * @ClassName CommonService.java + * @author Sum1Dream + * @version 1.0.0 + * @Description //TODO + * @createTime 16:30 2021/6/23 + **/ + List mappingSysNameOl(String codeType); + + /** + * 根据codeType获取该类的所有字典数据 + * @param codeType + * @return + */ + List getDictionarys(String codeType); + + /** + * 根据codeType获取该类的所有字典数据 + * @param codeType + * @return + */ + List getDictionarysAndExt(String codeType, String ext1); + + List getIdAndName(String codeType); + + /** + * + * @Title: getProvinces + * @Description: 获取城市信息 + * @author: 机器猫 + * @param: @return + * @return: List + * @throws + */ + List getCities(); + + /** + * 查询省级列表 + * @return + */ + List getProvinceList(); + + /** + * + * @Title: getCities + * @Description: 根据parentID获取地市列表 + * @author: 机器猫 + * @param: @param provinceId + * @param: @return + * @return: List + * @throws + */ + List getRegionsByParentId(Long parentId); + + /** + * + * @Title: getCities + * @Description: 根据regionId 查询 + * @author: 胡锐 + * @param: @param provinceId + * @param: @return + * @return: List + * @throws + */ + SecRegion getRegionsById(Long regionId); + + /** + * + * @Title: getParentInfoByRegionId + * @Description: 根据区域Id获取父级目录 + * @author: 机器猫 + * @param: @param regionId + * @param: @return + * @return: Map key:province,city,region + * @throws + */ + Map getParentInfoByRegionId(Long regionId); + + /** + * + * @Title: getRegionName + * @Description: 组装区域名称 + * @author: 杜江 + * @Date: 2020/7/8 17:37 + * @param: [regionId] + * @return: java.lang.String + * @throws + */ + String getRegionName(Long regionId); + + + /** + * + * @Title: findByName + * @Description: 通过区域名称查询 + * @author: 杜江 + * @Date: 2020/7/10 15:43 + * @param: [name] + * @return: java.util.List + * @throws + */ + List findByName(String name); + + SecRegion getParentByRegion(Long regionId); + + void updateDictionary(SecDictionary secDictionary); + + SecRegion getRegionsByName(String regionName); + +} diff --git a/service/src/main/java/com/hfkj/service/FileUploadService.java b/service/src/main/java/com/hfkj/service/FileUploadService.java new file mode 100644 index 0000000..dc612ec --- /dev/null +++ b/service/src/main/java/com/hfkj/service/FileUploadService.java @@ -0,0 +1,39 @@ +package com.hfkj.service; + +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: FileUploadService + * @Description: 文件上传 + * @author: gongjia + * @date: 2019/10/30 11:36 + * @Copyright: 2019 www.shinwoten.com Inc. All rights reserved. + */ +public interface FileUploadService { + + /** + * + * @Title: upload + * @Description: 上传文件 + * @author: gongjia + * @param: [files, paramsMap] + * @return: java.util.List + * @throws + */ + Map upload(List files, Map paramsMap) throws Exception; + + /** + * + * @Title: deleteFile + * @Description: 删除文件 + * @author: 杜江 + * @Date: 2020/7/9 10:12 + * @param: [filePath] + * @return: boolean + * @throws + */ + boolean deleteFile(String filePath); +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsAgentServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsAgentServiceImpl.java new file mode 100644 index 0000000..db4b5c2 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsAgentServiceImpl.java @@ -0,0 +1,132 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsAgentMapper; +import com.hfkj.entity.BsAgent; +import com.hfkj.entity.BsAgentExample; +import com.hfkj.entity.SecUser; +import com.hfkj.service.BsAgentService; +import com.hfkj.service.sec.SecUserService; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsAgentServiceImpl + * @author: HuRui + * @date: 2024/2/28 + **/ +@Service("agentService") +public class BsAgentServiceImpl implements BsAgentService { + + @Resource + private BsAgentMapper agentMapper; + + @Resource + private SecUserService secUserService; + + @Resource + private RedisUtil redisUtil; + + // 缓存前缀 + private final static String CACHE_AGENT = "AGENT:"; + + @Override + public BsAgent editData(BsAgent data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + data.setStatus(1); + agentMapper.insert(data); + + data.setAgentNo("A"+data.getId()); + agentMapper.updateByPrimaryKey(data); + } else { + data.setUpdateTime(new Date()); + agentMapper.updateByPrimaryKey(data); + } + return data; + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public BsAgent createAgent(String loginName, BsAgent agent) throws Exception { + editData(agent); + + /*SecUser secUser = new SecUser(); + secUser.setUserName(agent.getName()); + secUser.setLoginName(loginName); + secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setAdminFlag(1); + secUser.setCompanyId(agent.getCompanyId()); + secUser.setRoleId(SecUserRoleIdEnum.roleId3.getRoleId()); + secUser.setObjectType(SecUserObjectTypeEnum.type3.getNumber()); + secUser.setObjectId(agent.getId()); + secUser.setStatus(1); + secUser.setCreateTime(new Date()); + secUser.setUpdateTime(new Date()); + secUserService.editUser(secUser);*/ + return agent; + } + + @Override + public BsAgent updateAgent(BsAgent agent) { + editData(agent); + + redisUtil.set(CACHE_AGENT + agent.getAgentNo(), agent); + return agent; + } + + @Override + public BsAgent getAgentById(Long id) { + return agentMapper.selectByPrimaryKey(id); + } + + @Override + public BsAgent getAgentByAgentNo(String agentNo) { + Object obj = redisUtil.get(CACHE_AGENT + agentNo); + if (obj != null) { + return (BsAgent) obj; + } + BsAgentExample example = new BsAgentExample(); + example.createCriteria().andAgentNoEqualTo(agentNo).andStatusNotEqualTo(0); + List list = agentMapper.selectByExample(example); + if (!list.isEmpty()) { + BsAgent agent = list.get(0); + redisUtil.set(CACHE_AGENT + agentNo, agent); + return agent; + } + return null; + } + + @Override + public List getAgentList(Map param) { + BsAgentExample example = new BsAgentExample(); + BsAgentExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getLong(param, "companyId") != null) { + criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "agentNo"))) { + criteria.andAgentNoLike("%" + MapUtils.getString(param, "agentNo") + "%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "agentName"))) { + criteria.andNameLike("%" + MapUtils.getString(param, "agentName") + "%"); + } + + example.setOrderByClause("create_time desc"); + return agentMapper.selectByExample(example); + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java new file mode 100644 index 0000000..abf1e1d --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsDeviceServiceImpl.java @@ -0,0 +1,68 @@ +package com.hfkj.service.impl; + +import com.hfkj.dao.BsDeviceMapper; +import com.hfkj.entity.BsDevice; +import com.hfkj.entity.BsDeviceExample; +import com.hfkj.service.BsDeviceService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("deviceService") +public class BsDeviceServiceImpl implements BsDeviceService { + + @Resource + private BsDeviceMapper deviceMapper; + + @Override + public void editDevice(BsDevice device) { + if (device.getId() == null) { + device.setCreateTime(new Date()); + device.setUpdateTime(new Date()); + device.setStatus(1); + deviceMapper.insert(device); + } else { + device.setUpdateTime(new Date()); + deviceMapper.updateByPrimaryKey(device); + } + } + + @Override + public BsDevice getDetailById(Long deviceId) { + return deviceMapper.selectByPrimaryKey(deviceId); + } + + @Override + public List getDeviceList(Map param) { + BsDeviceExample example = new BsDeviceExample(); + BsDeviceExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getInteger(param, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(param, "type")); + } + + if (MapUtils.getLong(param, "companyId") != null) { + criteria.andCompanyIdEqualTo(MapUtils.getLong(param, "companyId")); + } + + if (MapUtils.getLong(param, "agentId") != null) { + criteria.andAgentIdEqualTo(MapUtils.getLong(param, "agentId")); + } + + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "deviceName"))) { + criteria.andDeviceNameLike("%" + MapUtils.getString(param, "deviceName") + "%"); + } + + example.setOrderByClause("create_time desc"); + return deviceMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsDiscountServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDiscountServiceImpl.java new file mode 100644 index 0000000..291fb04 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsDiscountServiceImpl.java @@ -0,0 +1,151 @@ +package com.hfkj.service.impl; + +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 com.hfkj.dao.BsDiscountMapper; +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsDiscountExample; +import com.hfkj.service.BsDiscountService; +import com.hfkj.sysenum.DiscountStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsDiscountServiceImpl + * @author: HuRui + * @date: 2024/3/18 + **/ +@Service("discountService") +public class BsDiscountServiceImpl implements BsDiscountService { + + @Resource + private BsDiscountMapper discountMapper; + @Resource + private RedisUtil redisUtil; + // 缓存优惠券 + private final static String CACHE_DISCOUNT_KEY = "DISCOUNT:"; + + @Override + public void editData(BsDiscount data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + discountMapper.insert(data); + + data.setDiscountNo("D"+(10000+data.getId())); + discountMapper.updateByPrimaryKey(data); + } else { + data.setUpdateTime(new Date()); + discountMapper.updateByPrimaryKey(data); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void editDiscount(BsDiscount discount) { + editData(discount); + redisUtil.set(CACHE_DISCOUNT_KEY+discount.getDiscountNo(), discount); + } + + @Override + public void online(String discountNo) { + // 查询优惠券详情 + BsDiscount discount = getDetail(discountNo); + if (discount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (!discount.getStatus().equals(DiscountStatusEnum.status1.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态无法上线"); + } + discount.setRealityStartTime(new Date()); + discount.setStatus(DiscountStatusEnum.status2.getCode()); + editDiscount(discount); + } + + @Override + public void done(String discountNo) { + // 查询优惠券详情 + BsDiscount discount = getDetail(discountNo); + if (discount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (!discount.getStatus().equals(DiscountStatusEnum.status2.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前状态无法下线"); + } + discount.setRealityEndTime(new Date()); + discount.setStatus(DiscountStatusEnum.status3.getCode()); + editDiscount(discount); + } + + @Override + public void delete(String discountNo) { + // 查询优惠券详情 + BsDiscount discount = getDetail(discountNo); + if (discount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + if (!discount.getStatus().equals(DiscountStatusEnum.status1.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "状态错误"); + } + discount.setStatus(DiscountStatusEnum.status0.getCode()); + editData(discount); + // 删除缓存 + redisUtil.del(CACHE_DISCOUNT_KEY+discount.getDiscountNo()); + } + + @Override + public BsDiscount getDetail(Long id) { + return discountMapper.selectByPrimaryKey(id); + } + + @Override + public BsDiscount getDetail(String discountNo) { + Object obj = redisUtil.get(CACHE_DISCOUNT_KEY + discountNo); + if (obj != null) { + return (BsDiscount) obj; + } + BsDiscountExample example = new BsDiscountExample(); + example.createCriteria().andDiscountNoEqualTo(discountNo).andStatusNotEqualTo(DiscountStatusEnum.status0.getCode()); + List list = discountMapper.selectByExample(example); + if (!list.isEmpty()) { + BsDiscount discount = list.get(0); + redisUtil.set(CACHE_DISCOUNT_KEY + discountNo, discount); + } + return null; + } + + @Override + public List getList(Map param) { + BsDiscountExample example = new BsDiscountExample(); + BsDiscountExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(DiscountStatusEnum.status0.getCode()); + + if (StringUtils.isNotBlank(MapUtils.getString(param, ""))) { + criteria.andMerNoEqualTo(MapUtils.getString(param, "")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "discountName"))) { + criteria.andMerNoEqualTo(MapUtils.getString(param, "")); + } + + if (MapUtils.getInteger(param, "discountType") != null) { + criteria.andDiscountTypeEqualTo(MapUtils.getInteger(param, "discountType")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status") ); + } + + example.setOrderByClause("create_time desc"); + return discountMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsDiscountStockBatchServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDiscountStockBatchServiceImpl.java new file mode 100644 index 0000000..e182eb2 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsDiscountStockBatchServiceImpl.java @@ -0,0 +1,125 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.IdentifyUtil; +import com.hfkj.dao.BsDiscountStockBatchMapper; +import com.hfkj.entity.BsDiscount; +import com.hfkj.entity.BsDiscountStockBatch; +import com.hfkj.entity.BsDiscountStockBatchExample; +import com.hfkj.entity.BsDiscountStockCode; +import com.hfkj.service.BsDiscountService; +import com.hfkj.service.BsDiscountStockBatchService; +import com.hfkj.service.BsDiscountStockCodeService; +import com.hfkj.sysenum.DiscountStockCodeStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @className: BsDiscountStockBatchServiceImpl + * @author: HuRui + * @date: 2024/3/19 + **/ +@Service("discountStockBatchService") +public class BsDiscountStockBatchServiceImpl implements BsDiscountStockBatchService { + + @Resource + private BsDiscountStockBatchMapper discountStockBatchMapper; + @Resource + private BsDiscountStockCodeService discountStockCodeService; + @Resource + private BsDiscountService discountService; + + @Override + public void editData(BsDiscountStockBatch data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + discountStockBatchMapper.insert(data); + + data.setBatchNo(""+System.currentTimeMillis()); + discountStockBatchMapper.updateByPrimaryKey(data); + } else { + data.setUpdateTime(new Date()); + discountStockBatchMapper.updateByPrimaryKey(data); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void addStock(String discountNo, Integer stockCount) { + // 查询优惠券 + BsDiscount discount = discountService.getDetail(discountNo); + if (discount == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的优惠券"); + } + BsDiscountStockBatch batch = new BsDiscountStockBatch(); + batch.setDiscountId(discount.getId()); + batch.setDiscountNo(discount.getDiscountNo()); + batch.setDiscountName(discount.getDiscountName()); + batch.setBatchStockNum(stockCount); + batch.setStatus(1); + editData(batch); + + List stockCodeList = new ArrayList<>(); + BsDiscountStockCode discountCode; + for (int i = 0;i < stockCount;i++) { + discountCode = new BsDiscountStockCode(); + discountCode.setDiscountStockBatchId(batch.getId()); + discountCode.setDiscountStockBatchNo(batch.getBatchNo()); + discountCode.setDiscountId(discount.getId()); + discountCode.setDiscountNo(discount.getDiscountNo()); + discountCode.setDiscountName(discount.getDiscountName()); + discountCode.setStatus(DiscountStockCodeStatusEnum.status1.getCode()); + discountCode.setCreateTime(new Date()); + discountCode.setUpdateTime(new Date()); + stockCodeList.add(discountCode); + } + // 批量新增 + discountStockCodeService.insertList(stockCodeList); + + batch.setStartId(""+stockCodeList.get(0).getId()); + batch.setEndId(""+stockCodeList.get(stockCount-1).getId()); + editData(batch); + } + + @Override + public BsDiscountStockBatch getStockBatchDetail(String batchNo) { + BsDiscountStockBatchExample example = new BsDiscountStockBatchExample(); + example.createCriteria().andBatchNoEqualTo(batchNo).andStatusNotEqualTo(0); + List list = discountStockBatchMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public List getStockBatchList(Map param) { + BsDiscountStockBatchExample example = new BsDiscountStockBatchExample(); + BsDiscountStockBatchExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "discountNo"))) { + criteria.andDiscountNoLike("%"+MapUtils.getString(param, "discountNo")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "discountName"))) { + criteria.andDiscountNameLike("%"+MapUtils.getString(param, "discountName")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "batchNo"))) { + criteria.andBatchNoLike("%"+MapUtils.getString(param, "batchNo")+"%"); + } + + example.setOrderByClause("create_time desc"); + return discountStockBatchMapper.selectByExample(example); + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsDiscountStockCodeServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsDiscountStockCodeServiceImpl.java new file mode 100644 index 0000000..8944702 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsDiscountStockCodeServiceImpl.java @@ -0,0 +1,57 @@ +package com.hfkj.service.impl; + +import com.hfkj.dao.BsDiscountStockCodeMapper; +import com.hfkj.entity.BsDiscountStockCode; +import com.hfkj.entity.BsDiscountStockCodeExample; +import com.hfkj.service.BsDiscountStockCodeService; +import com.hfkj.sysenum.DiscountStockCodeStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +/** + * @className: BsDiscountCodeServiceImpl + * @author: HuRui + * @date: 2024/3/18 + **/ +@Service("discountCodeService") +public class BsDiscountStockCodeServiceImpl implements BsDiscountStockCodeService { + + @Resource + private BsDiscountStockCodeMapper discountStockCodeMapper; + + @Override + public void insertList(List codeList) { + discountStockCodeMapper.insertList(codeList); + } + + @Override + public List getCodeList(Map param) { + BsDiscountStockCodeExample example = new BsDiscountStockCodeExample(); + BsDiscountStockCodeExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(DiscountStockCodeStatusEnum.status0.getCode()); + + if (MapUtils.getLong(param, "codeId") != null) { + criteria.andIdEqualTo(MapUtils.getLong(param, "codeId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "discountNo"))) { + criteria.andDiscountNoLike("%"+MapUtils.getString(param, "discountNo")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "batchNo"))) { + criteria.andDiscountStockBatchNoLike("%"+MapUtils.getString(param, "batchNo")+"%"); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("id desc"); + return discountStockCodeMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsGasOilGunNoServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsGasOilGunNoServiceImpl.java new file mode 100644 index 0000000..77b1bf3 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsGasOilGunNoServiceImpl.java @@ -0,0 +1,104 @@ +package com.hfkj.service.impl; + +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 com.hfkj.dao.BsGasOilGunNoMapper; +import com.hfkj.entity.BsGasOilGunNo; +import com.hfkj.entity.BsGasOilGunNoExample; +import com.hfkj.service.BsGasOilGunNoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsGasOilGunNoServiceImpl + * @author: HuRui + * @date: 2024/3/12 + **/ +@Service("gasOilGunNoService") +public class BsGasOilGunNoServiceImpl implements BsGasOilGunNoService { + + @Resource + private BsGasOilGunNoMapper gasOilGunNoMapper; + @Resource + private RedisUtil redisUtil; + + private final static String GAS_OIL_NO_KEY = "GAS_OIL_NO:"; + + @Override + public void editData(BsGasOilGunNo data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + gasOilGunNoMapper.insert(data); + } else { + gasOilGunNoMapper.updateByPrimaryKey(data); + } + // 刷新缓存 + joinCache(data.getMerNo()); + } + + @Override + public void delete(Long gunNoId) { + BsGasOilGunNo oilGunNo = getDetail(gunNoId); + if (oilGunNo == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的数据"); + } + oilGunNo.setStatus(0); + editData(oilGunNo); + } + + @Override + public void delete(String merNo) { + BsGasOilGunNoExample example = new BsGasOilGunNoExample(); + example.createCriteria().andMerNoEqualTo(merNo).andStatusEqualTo(1); + List list = gasOilGunNoMapper.selectByExample(example); + for (BsGasOilGunNo oilGunNo : list) { + oilGunNo.setStatus(0); + gasOilGunNoMapper.updateByPrimaryKey(oilGunNo); + } + joinCache(merNo); + } + + @Override + public List getOilGunNoList(String merNo) { + Object obj = redisUtil.get(GAS_OIL_NO_KEY + merNo); + if (obj != null) { + return (List) obj; + } + return joinCache(merNo); + } + + @Override + public BsGasOilGunNo getDetail(String merNo, String oilNo, String gunNo) { + BsGasOilGunNoExample example = new BsGasOilGunNoExample(); + example.createCriteria().andMerNoEqualTo(merNo).andOilNoEqualTo(oilNo).andGunNoEqualTo(gunNo).andStatusEqualTo(1); + List list = gasOilGunNoMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public BsGasOilGunNo getDetail(Long gunNoId) { + return gasOilGunNoMapper.selectByPrimaryKey(gunNoId); + } + + /** + * 加入缓存 + * @param merNo + * @return + */ + private List joinCache(String merNo) { + BsGasOilGunNoExample example = new BsGasOilGunNoExample(); + example.createCriteria().andMerNoEqualTo(merNo).andStatusNotEqualTo(0); + example.setOrderByClause("gun_no"); + List list = gasOilGunNoMapper.selectByExample(example); + redisUtil.set(GAS_OIL_NO_KEY + merNo, list); + return list; + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceOfficialServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceOfficialServiceImpl.java new file mode 100644 index 0000000..4979fa8 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceOfficialServiceImpl.java @@ -0,0 +1,151 @@ +package com.hfkj.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.utils.HttpsUtils; +import com.hfkj.dao.BsGasOilPriceOfficialMapper; +import com.hfkj.entity.*; +import com.hfkj.service.BsGasOilPriceOfficialService; +import com.hfkj.service.BsGasOilPriceService; +import com.hfkj.service.CommonService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service("gasOilPriceOfficialService") +public class BsGasOilPriceOfficialServiceImpl implements BsGasOilPriceOfficialService { + + @Resource + private BsGasOilPriceOfficialMapper gasOilPriceOfficialMapper; + + @Resource + private BsGasOilPriceService highGasOilPriceService; + + @Resource + private CommonService commonService; + + @Override + public void editPrice(Long regionId, String oilNo, BigDecimal price) { + BsGasOilPriceOfficial priceOfficial = getPrice(regionId, oilNo); + if (priceOfficial != null) { + priceOfficial.setPriceOfficial(price); + gasOilPriceOfficialMapper.updateByPrimaryKey(priceOfficial); + } else { + SecDictionary oil = commonService.mappingSysCode("GAS_OIL_TYPE", oilNo.toString()); + SecRegion region = commonService.getRegionsById(regionId); + + priceOfficial = new BsGasOilPriceOfficial(); + priceOfficial.setRegionId(region.getRegionId()); + priceOfficial.setRegionName(region.getRegionName()); + priceOfficial.setOilNo(oil.getCodeValue()); + priceOfficial.setOilNoName(oil.getCodeName()); + priceOfficial.setPriceOfficial(price); + priceOfficial.setOilType(Integer.valueOf(oil.getExt1())); + priceOfficial.setOilTypeName(oil.getExt2()); + priceOfficial.setStatus(1); + gasOilPriceOfficialMapper.insert(priceOfficial); + } + } + + @Override + public BsGasOilPriceOfficial getPrice(Long regionId, String oilNo) { + BsGasOilPriceOfficialExample example = new BsGasOilPriceOfficialExample(); + example.createCriteria().andRegionIdEqualTo(regionId).andOilNoEqualTo(oilNo); + List list = gasOilPriceOfficialMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + @Override + public List getPriceList(Map param) { + BsGasOilPriceOfficialExample example = new BsGasOilPriceOfficialExample(); + BsGasOilPriceOfficialExample.Criteria criteria = example.createCriteria().andStatusEqualTo(1); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "regionName"))) { + criteria.andRegionNameLike("%" + MapUtils.getString(param, "regionName") + "%"); + } + + if (MapUtils.getLong(param, "regionId") != null) { + criteria.andRegionIdEqualTo(MapUtils.getLong(param, "regionId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "oilNo"))) { + criteria.andOilNoEqualTo(MapUtils.getString(param, "oilNo")); + } + + if (MapUtils.getInteger(param, "oilType") != null) { + criteria.andOilTypeEqualTo(MapUtils.getInteger(param, "oilType")); + } + + return gasOilPriceOfficialMapper.selectByExample(example); + } + + @Override + public void refreshPriceOfficial() { + Map heardParam = new HashMap<>(); + heardParam.put("Content-Type", "application/json"); + heardParam.put("Authorization", "APPCODE d7fb8449b8424fdbb60f01f53a04ce90"); + JSONObject dataObject = HttpsUtils.doGet("http://ali-todayoil.showapi.com/todayoil", new HashMap<>(), heardParam); + + if (dataObject.getInteger("showapi_res_code").equals(0)) { + JSONObject resBody = dataObject.getJSONObject("showapi_res_body"); + + JSONArray oilArray = resBody.getJSONArray("list"); + for (Object oil : oilArray) { + JSONObject oilObject = (JSONObject) oil; + + SecRegion region = commonService.getRegionsByName(oilObject.getString("prov")); + if (region != null) { + BigDecimal oilNo92 = oilObject.getBigDecimal("p92"); + if (oilNo92 != null) { + editPrice(region.getRegionId(), "92", oilNo92); + } + + BigDecimal oilNo95 = oilObject.getBigDecimal("p95"); + if (oilNo95 != null) { + editPrice(region.getRegionId(), "95", oilNo95); + } + + BigDecimal oilNo98 = oilObject.getBigDecimal("p98"); + if (oilNo98 != null) { + editPrice(region.getRegionId(), "98", oilNo98); + } + + BigDecimal oilNo0 = oilObject.getBigDecimal("p0"); + if (oilNo0 != null) { + editPrice(region.getRegionId(), "0", oilNo0); + } + + } + } + } + } + + @Override + public void refreshGasPriceOfficial(Long regionId, String oilNo) { + Map param = new HashMap<>(); + param.put("regionId", regionId); + param.put("oilNo", oilNo); + + List priceList = getPriceList(param); + for (BsGasOilPriceOfficial priceOfficial : priceList) { + // 查询区域下的油品 + List list = highGasOilPriceService.getPriceListByRegionAndOilNo(priceOfficial.getRegionId(), priceOfficial.getOilNo()); + for (BsGasOilPrice gasOilPrice : list) { + gasOilPrice.setPriceOfficial(priceOfficial.getPriceOfficial()); + gasOilPrice.setPriceGun(priceOfficial.getPriceOfficial().subtract(gasOilPrice.getGasStationDrop())); + gasOilPrice.setPriceVip(gasOilPrice.getPriceGun().subtract(gasOilPrice.getPreferentialMargin())); + highGasOilPriceService.editOilPrice(gasOilPrice); + } + } + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceServiceImpl.java new file mode 100644 index 0000000..bdf65f2 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsGasOilPriceServiceImpl.java @@ -0,0 +1,110 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsGasOilPriceMapper; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsGasOilPriceExample; +import com.hfkj.service.BsGasOilGunNoService; +import com.hfkj.service.BsGasOilPriceService; +import com.hfkj.sysenum.GasOilPriceStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsGasOilPriceServiceImpl + * @author: HuRui + * @date: 2024/3/5 + **/ +@Service("gasOilPriceService") +public class BsGasOilPriceServiceImpl implements BsGasOilPriceService { + + @Resource + private BsGasOilPriceMapper gasOilPriceMapper; + @Resource + private BsGasOilGunNoService gasOilGunNoService; + @Resource + private RedisUtil redisUtil; + + private final static String GAS_OIL_PRICE_KEY = "GAS_OIL_PRICE_KEY:"; + + @Override + public void editData(BsGasOilPrice data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + gasOilPriceMapper.insert(data); + } else { + data.setUpdateTime(new Date()); + gasOilPriceMapper.updateByPrimaryKey(data); + } + } + + @Override + public void editOilPrice(BsGasOilPrice data) { + editData(data); + + // 加入缓存 + redisUtil.set(GAS_OIL_PRICE_KEY + data.getId(), data); + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void delete(BsGasOilPrice data) { + data.setStatus(GasOilPriceStatusEnum.status0.getNumber()); + editOilPrice(data); + + // 删除抢号 + gasOilGunNoService.delete(data.getMerNo()); + } + + @Override + public BsGasOilPrice getGasOilPrice(Long id) { + return gasOilPriceMapper.selectByPrimaryKey(id); + } + + @Override + public BsGasOilPrice getGasOilPrice(Long merId, String oilNo) { + BsGasOilPriceExample example = new BsGasOilPriceExample(); + example.createCriteria() + .andMerIdEqualTo(merId) + .andOilNoEqualTo(oilNo) + .andStatusNotEqualTo(GasOilPriceStatusEnum.status0.getNumber()); + List list = gasOilPriceMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public List getGasOilPriceList(Map param) { + BsGasOilPriceExample example = new BsGasOilPriceExample(); + BsGasOilPriceExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(GasOilPriceStatusEnum.status0.getNumber()); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoEqualTo(MapUtils.getString(param, "merNo")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "oilNo"))) { + criteria.andOilNoEqualTo(MapUtils.getString(param, "oilNo")); + } + + example.setOrderByClause("oil_no"); + return gasOilPriceMapper.selectByExample(example); +} + + @Override + public List getPriceListByRegionAndOilNo(Long regionId, String oilNo) { + return gasOilPriceMapper.selectPriceListByRegionAndOilNo(regionId,oilNo); + } + + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java new file mode 100644 index 0000000..5171d2c --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsMerchantPayConfigServiceImpl.java @@ -0,0 +1,57 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsMerchantPayConfigMapper; +import com.hfkj.entity.BsMerchantPayConfig; +import com.hfkj.entity.BsMerchantPayConfigExample; +import com.hfkj.service.BsMerchantPayConfigService; +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsMerchantPayConfigServiceImpl + * @author: HuRui + * @date: 2024/3/13 + **/ +@Service("merchantPayConfigService") +public class BsMerchantPayConfigServiceImpl implements BsMerchantPayConfigService { + + @Resource + private BsMerchantPayConfigMapper merchantPayConfigMapper; + @Resource + private RedisUtil redisUtil; + + private final static String MER_PAY_CONFIG_KEY = "MER_PAY_CONFIG_KEY:"; + + @Override + public void editData(BsMerchantPayConfig data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + merchantPayConfigMapper.insert(data); + } else { + data.setUpdateTime(new Date()); + merchantPayConfigMapper.updateByPrimaryKey(data); + } + redisUtil.set(MER_PAY_CONFIG_KEY + data.getMerNo(), data); + } + + @Override + public BsMerchantPayConfig getConfig(String merNo) { + Object obj = redisUtil.get(MER_PAY_CONFIG_KEY + merNo); + if (obj != null) { + return (BsMerchantPayConfig)obj; + } + BsMerchantPayConfigExample example = new BsMerchantPayConfigExample(); + example.createCriteria().andMerNoEqualTo(merNo); + List list = merchantPayConfigMapper.selectByExample(example); + if (!list.isEmpty()) { + BsMerchantPayConfig config = list.get(0); + redisUtil.set(MER_PAY_CONFIG_KEY + config.getMerNo(), config); + return config; + } + return null; + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java new file mode 100644 index 0000000..fae1be2 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsMerchantQrCodeServiceImpl.java @@ -0,0 +1,160 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.QRCodeGenerator; +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 com.hfkj.config.CommonSysConst; +import com.hfkj.dao.BsMerchantQrCodeMapper; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantQrCode; +import com.hfkj.entity.BsMerchantQrCodeExample; +import com.hfkj.service.BsMerchantQrCodeService; +import com.hfkj.sysenum.MerchantQrCodeStatusEnum; +import com.hfkj.sysenum.MerchantQrCodeTypeEnum; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * @className: BsMerchantQrCodeServiceImpl + * @author: HuRui + * @date: 2024/3/4 + **/ +@Service("merchantQrCodeService") +public class BsMerchantQrCodeServiceImpl implements BsMerchantQrCodeService { + + @Resource + private BsMerchantQrCodeMapper merchantQrCodeMapper; + @Resource + private RedisUtil redisUtil; + private final static String CACHE_MER_QR_CODE_KEY = "MERCHANT_QR_CODE:"; + + @Override + public void editData(BsMerchantQrCode data) { + if (data.getId() == null) { + data.setCreateTime(new Date()); + data.setUpdateTime(new Date()); + merchantQrCodeMapper.insert(data); + } else { + data.setUpdateTime(new Date()); + merchantQrCodeMapper.updateByPrimaryKey(data); + } + } + + @Override + public void generateMerQrCode(BsMerchant merchant) throws Exception { + /** 综合二维码 **/ + BsMerchantQrCode compositeQrCode = new BsMerchantQrCode(); + compositeQrCode.setMerchantId(merchant.getId()); + compositeQrCode.setMerchantNo(merchant.getMerNo()); + compositeQrCode.setMerchantNo(merchant.getMerNo()); + compositeQrCode.setCodeType(MerchantQrCodeTypeEnum.type1.getNumber()); + compositeQrCode.setCodeContent("https://gratia-pay.dctpay.com?sn="+merchant.getMerNo()); + + // 二维码 + String compositeQrCodeFile = "/merchantQrCode/" + merchant.getId() + "/" + System.currentTimeMillis() + ".png"; + QRCodeGenerator.generateQRCodeImage( + compositeQrCode.getCodeContent(), + 350, + 350, + CommonSysConst.getSysConfig().getFilesystem() + compositeQrCodeFile); + compositeQrCode.setCodeImg(compositeQrCodeFile); + compositeQrCode.setStatus(MerchantQrCodeStatusEnum.status1.getNumber()); + compositeQrCode.setCreateTime(new Date()); + compositeQrCode.setUpdateTime(new Date()); + merchantQrCodeMapper.insert(compositeQrCode); + + /** 加油二维码 **/ + BsMerchantQrCode oilQrCode = new BsMerchantQrCode(); + oilQrCode.setMerchantId(merchant.getId()); + oilQrCode.setMerchantNo(merchant.getMerNo()); + oilQrCode.setMerchantNo(merchant.getMerNo()); + oilQrCode.setCodeType(MerchantQrCodeTypeEnum.type2.getNumber()); + oilQrCode.setCodeContent("https://gratia-pay.dctpay.com?sn="+merchant.getMerNo()); + + // 二维码 + String oilQrCodeFile = "/merchantQrCode/" + merchant.getId() + "/" + System.currentTimeMillis() + ".png"; + QRCodeGenerator.generateQRCodeImage( + compositeQrCode.getCodeContent(), + 350, + 350, + CommonSysConst.getSysConfig().getFilesystem() + oilQrCodeFile); + oilQrCode.setCodeImg(oilQrCodeFile); + oilQrCode.setStatus(MerchantQrCodeStatusEnum.status1.getNumber()); + oilQrCode.setCreateTime(new Date()); + oilQrCode.setUpdateTime(new Date()); + merchantQrCodeMapper.insert(oilQrCode); + + + /** 商城二维码 **/ + BsMerchantQrCode shopQrCode = new BsMerchantQrCode(); + shopQrCode.setMerchantId(merchant.getId()); + shopQrCode.setMerchantNo(merchant.getMerNo()); + shopQrCode.setMerchantNo(merchant.getMerNo()); + shopQrCode.setCodeType(MerchantQrCodeTypeEnum.type3.getNumber()); + shopQrCode.setCodeContent("https://gratia-pay.dctpay.com?sn="+merchant.getMerNo()); + + // 二维码 + String shopQrCodeFile = "/merchantQrCode/" + merchant.getId() + "/" + System.currentTimeMillis() + ".png"; + QRCodeGenerator.generateQRCodeImage( + compositeQrCode.getCodeContent(), + 350, + 350, + CommonSysConst.getSysConfig().getFilesystem() + shopQrCodeFile); + shopQrCode.setCodeImg(shopQrCodeFile); + shopQrCode.setStatus(MerchantQrCodeStatusEnum.status1.getNumber()); + shopQrCode.setCreateTime(new Date()); + shopQrCode.setUpdateTime(new Date()); + merchantQrCodeMapper.insert(shopQrCode); + } + + @Override + public void updateQrCodeStatus(Long qrCodeId, MerchantQrCodeStatusEnum qrCodeStatus) { + // 查询二维码 + BsMerchantQrCode qrCode = getMerQrCode(qrCodeId); + if (qrCode == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知二维码"); + } + qrCode.setStatus(qrCodeStatus.getNumber()); + editData(qrCode); + + redisUtil.set(CACHE_MER_QR_CODE_KEY + (qrCode.getMerchantNo() + "_" + qrCode.getCodeType()), qrCode); + } + + @Override + public BsMerchantQrCode getMerQrCode(Long id) { + return merchantQrCodeMapper.selectByPrimaryKey(id); + } + + @Override + public BsMerchantQrCode getMerQrCode(String merNo, MerchantQrCodeTypeEnum qrCodeType) { + Object obj = redisUtil.get(CACHE_MER_QR_CODE_KEY + (merNo + "_" + qrCodeType)); + if (obj == null) { + return (BsMerchantQrCode) obj; + } + BsMerchantQrCodeExample example = new BsMerchantQrCodeExample(); + example.createCriteria() + .andMerchantNoEqualTo(merNo) + .andCodeTypeEqualTo(qrCodeType.getNumber()) + .andStatusNotEqualTo(MerchantQrCodeStatusEnum.status0.getNumber()); + List list = merchantQrCodeMapper.selectByExample(example); + if (!list.isEmpty()) { + BsMerchantQrCode qrCode = list.get(0); + redisUtil.set(CACHE_MER_QR_CODE_KEY + (merNo + "_" + qrCodeType), qrCode); + return qrCode; + } + return null; + } + + @Override + public List getMerQrCodeList(String merNo) { + BsMerchantQrCodeExample example = new BsMerchantQrCodeExample(); + example.createCriteria().andMerchantNoEqualTo(merNo).andStatusNotEqualTo(MerchantQrCodeStatusEnum.status0.getNumber()); + example.setOrderByClause("code_type"); + return merchantQrCodeMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java new file mode 100644 index 0000000..aff1fe5 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsMerchantServiceImpl.java @@ -0,0 +1,171 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.MD5Util; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsMerchantMapper; +import com.hfkj.entity.BsMerchant; +import com.hfkj.entity.BsMerchantExample; +import com.hfkj.entity.SecUser; +import com.hfkj.service.BsMerchantQrCodeService; +import com.hfkj.service.BsMerchantService; +import com.hfkj.service.sec.SecUserService; +import com.hfkj.sysenum.MerchantStatusEnum; +import com.hfkj.sysenum.SecUserObjectTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @className: BsMerchantServiceImpl + * @author: HuRui + * @date: 2024/3/4 + **/ +@Service("merchantService") +public class BsMerchantServiceImpl implements BsMerchantService { + + @Resource + private BsMerchantMapper merchantMapper; + @Resource + private SecUserService secUserService; + @Resource + private BsMerchantQrCodeService merchantQrCodeService; + @Resource + private RedisUtil redisUtil; + private final static String CACHE_MER_KEY = "MERCHANT:"; + + @Override + public void editData(BsMerchant merchant) { + if (merchant.getId() == null) { + merchant.setCreateTime(new Date()); + merchant.setUpdateTime(new Date()); + merchantMapper.insert(merchant); + } else { + merchant.setUpdateTime(new Date()); + merchantMapper.updateByPrimaryKey(merchant); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void createMerchant(BsMerchant merchant) throws Exception { + editData(merchant); + + merchant.setMerNo(""+(10000 + merchant.getId())); + editData(merchant); + + if (secUserService.getDetailByLoginName(merchant.getContactsTel()) != null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "手机号已存在,请更换"); + } + SecUser secUser = new SecUser(); + secUser.setUserName(merchant.getMerName()); + secUser.setLoginName(merchant.getContactsTel()); + secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUser.setObjectType(SecUserObjectTypeEnum.type2.getCode()); + secUser.setObjectId(merchant.getId()); + secUser.setStatus(1); + secUser.setCreateTime(new Date()); + secUser.setUpdateTime(new Date()); + secUserService.editUser(secUser); + + // 生成加油站码库 + merchantQrCodeService.generateMerQrCode(merchant); + + // 加入缓存 + redisUtil.set(CACHE_MER_KEY + merchant.getMerNo(), merchant); + } + + @Override + public void updateMerchant(BsMerchant merchant) { + editData(merchant); + + redisUtil.set(CACHE_MER_KEY + merchant.getMerNo(), merchant); + } + + @Override + public void resetMerPwd(String merNo) throws Exception { + // 查询商户 + BsMerchant merchant = getMerchant(merNo); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户"); + } + // 查询商户登录账户 + SecUser secUser = secUserService.getDetail(SecUserObjectTypeEnum.type2, merchant.getId()); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户登录账户"); + } + secUser.setPassword(MD5Util.encode("123456".getBytes())); + secUserService.editUser(secUser); + } + + @Override + public void updateMerStatus(String merNo, MerchantStatusEnum merchantStatus) { + // 查询商户 + BsMerchant merchant = getMerchant(merNo); + if (merchant == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知商户"); + } + merchant.setStatus(merchantStatus.getNumber()); + editData(merchant); + + redisUtil.set(CACHE_MER_KEY + merNo, merchant); + } + + @Override + public BsMerchant getMerchant(String merNo) { + Object obj = redisUtil.get(CACHE_MER_KEY + merNo); + if (obj != null) { + return (BsMerchant) obj; + } + BsMerchantExample example = new BsMerchantExample(); + example.createCriteria().andMerNoEqualTo(merNo).andStatusNotEqualTo(MerchantStatusEnum.status0.getNumber()); + List list = merchantMapper.selectByExample(example); + if (!list.isEmpty()) { + BsMerchant merchant = list.get(0); + redisUtil.set(CACHE_MER_KEY + merNo, merchant); + return merchant; + } + return null; + } + + @Override + public BsMerchant getMerchant(Long merId) { + return merchantMapper.selectByPrimaryKey(merId); + } + + @Override + public List getMerchantList(Map param) { + BsMerchantExample example = new BsMerchantExample(); + BsMerchantExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(MerchantStatusEnum.status0.getNumber()); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoLike("%"+MapUtils.getString(param, "merNo")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { + criteria.andMerNameLike("%"+MapUtils.getString(param, "merName")+"%"); + } + + example.setOrderByClause("create_time desc"); + return merchantMapper.selectByExample(example); + } + + public static void main(String[] args) { + + Map param = new HashMap<>(); + param.put("merNoList", ""); + List merNoList = Arrays.stream(MapUtils.getString(param, "merNoList").split(",")).collect(Collectors.toList()); + for (String mer : merNoList) { + System.out.println(mer); + } + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java new file mode 100644 index 0000000..ca26778 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/BsMerchantUserServiceImpl.java @@ -0,0 +1,52 @@ +package com.hfkj.service.impl; + +import com.hfkj.dao.BsMerchantUserMapper; +import com.hfkj.entity.BsMerchantUser; +import com.hfkj.entity.BsMerchantUserExample; +import com.hfkj.service.BsMerchantUserService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: BsMerchantUserServiceImpl + * @author: HuRui + * @date: 2024/5/31 + **/ +public class BsMerchantUserServiceImpl implements BsMerchantUserService { + + @Resource + private BsMerchantUserMapper merchantUserMapper; + + @Override + public void editData(BsMerchantUser merchantUser) { + merchantUser.setUpdateTime(new Date()); + if (merchantUser.getId() == null){ + merchantUser.setCreateTime(new Date()); + merchantUserMapper.insert(merchantUser); + } else { + merchantUserMapper.updateByPrimaryKey(merchantUser); + } + } + + @Override + public List getList(Map param) { + BsMerchantUserExample example = new BsMerchantUserExample(); + BsMerchantUserExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "userPhone"))) { + criteria.andUserPhoneLike("%"+MapUtils.getString(param, "userPhone")+"%"); + } + + example.setOrderByClause("create_time desc"); + return merchantUserMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/impl/CommonServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/CommonServiceImpl.java new file mode 100644 index 0000000..01595cf --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/CommonServiceImpl.java @@ -0,0 +1,481 @@ +package com.hfkj.service.impl; + + +import com.alibaba.fastjson.JSONObject; +import com.alicp.jetcache.Cache; +import com.alicp.jetcache.anno.CacheType; +import com.alicp.jetcache.anno.CreateCache; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.dao.SecDictionaryMapper; +import com.hfkj.dao.SecRegionMapper; +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecDictionaryExample; +import com.hfkj.entity.SecRegion; +import com.hfkj.entity.SecRegionExample; +import com.hfkj.service.CommonService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.*; +import java.util.concurrent.locks.ReentrantLock; + + +@Service("iCommonService") +public class CommonServiceImpl implements CommonService { + + private long READ_STEP = 30*60*1000; //半小时刷新一次缓存的字典数据 + + private ReentrantLock lock = new ReentrantLock(); + + private ReentrantLock regionLock = new ReentrantLock(); + + private long lastReadTime = 0; + + private long regionLastReadTime = 0; + + @Resource + private SecRegionMapper regionMapper; + + @Resource + private SecDictionaryMapper dicMapper; + + private Map> dicCache = new HashMap>(); + @CreateCache(name = "cities:", cacheType = CacheType.REMOTE) + private Cache citiesCache; + @CreateCache(name = "region:", cacheType = CacheType.REMOTE) + private Cache> regionsCache; + @CreateCache(name = "regionStreet:", cacheType = CacheType.REMOTE) + private Cache> streetCache; + @CreateCache(name = "regionCommunity:", cacheType = CacheType.REMOTE) + private Cache> communityCache; + @CreateCache(name = "regionSingle:", cacheType = CacheType.REMOTE) + private Cache singleRegionCache; + + @Override + public Map> getDictionaries() { + refreshDic(); + return dicCache; + } + + /** + * @param codeType + * @param codeValue + * @throws + * @Title: getDictionary + * @Description: 精确查找数据字典值 + * @author: 机器猫 + * @param: @param codeType + * @param: @param codeValue + * @param: @return + * @param: @throws Exception + * @return: SysDictionary + */ + @Override + public String getDictionaryCodeName(String codeType, String codeValue) { + refreshDic(); + if(StringUtils.isBlank(codeType)){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + Map m = dicCache.get(codeType); + if (null == m) { + return ""; + } + SecDictionary sd = m.get(codeValue); + if (null == sd) { + return ""; + } + return sd.getCodeName(); + } + + /** + * @param codeType + * @param codeValue + * @throws + * @Title: mappingSysCode + * @Description: 根据codetype,codevalue获取系统字典数据 + * @author: 机器猫 + * @param: @param codeType + * @param: @param codeValue + * @param: @return + * @param: @throws Exception + * @return: SysDictionary + */ + @Override + public SecDictionary mappingSysCode(String codeType, String codeValue) { + refreshDic(); + if(StringUtils.isBlank(codeType)){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + Map m = dicCache.get(codeType); + if (null == m) { + return null; + } + SecDictionary sd = m.get(codeValue); + return sd; + } + + @Override + public SecDictionary mappingSysName(String codeType, String codeName) { + refreshDic(); + if(StringUtils.isBlank(codeType)){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + Map m = dicCache.get(codeType); + if (null == m) { + return null; + } + for(Map.Entry entry : m.entrySet()){ + String mapKey = entry.getKey(); + SecDictionary mapValue = entry.getValue(); + if (mapValue.getCodeName().equals(codeName)) { + return mapValue; + } + } + return null; + } + + /** + * 根据codeType获取该类的所有字典数据 + * + * @param codeType + * @return + */ + @Override + public List getDictionarys(String codeType) { + refreshDic(); + if (StringUtils.isEmpty(codeType)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "codeType is null"); + } + Map maps = dicCache.get(codeType); + if (null == maps) { + return new ArrayList<>(); + } + List rtn = new ArrayList<>(); + rtn.addAll(maps.values()); + return rtn; + } + + @Override + public List getDictionarysAndExt(String codeType, String ext1) { + refreshDic(); + if (StringUtils.isEmpty(codeType)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "codeType is null"); + } + Map maps = dicCache.get(codeType); + if (null == maps) { + return new ArrayList<>(); + } + List rtn = new ArrayList<>(); + for(SecDictionary dictionary : maps.values()){ + if (ext1.equals(dictionary.getExt1())) { + rtn.add(dictionary); + } + } + return rtn; + } + + @Override + public List getIdAndName(String codeType) { + refreshDic(); + if (StringUtils.isEmpty(codeType)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "codeType is null"); + } + Map maps = dicCache.get(codeType); + if (null == maps) { + return new ArrayList<>(); + } + List rtn = new ArrayList<>(); + for(SecDictionary dictionary : maps.values()){ + JSONObject jo = new JSONObject(); + jo.put("codeValue",dictionary.getCodeValue()); + jo.put("codeName",dictionary.getCodeName()); + rtn.add(jo); + } + return rtn; + } + + private void getDicFormDB(){ + SecDictionaryExample example = new SecDictionaryExample(); + example.createCriteria().andStatusEqualTo(1); + example.setOrderByClause(" sort_id asc"); + List dicList = dicMapper.selectByExample(example); + for(SecDictionary dic : dicList){ + if(dicCache.get(dic.getCodeType()) != null){ + Map typeList = dicCache.get(dic.getCodeType()); + typeList.put(dic.getCodeValue(), dic); + }else{ + Map temp = new HashMap(); + temp.put(dic.getCodeValue(), dic); + dicCache.put(dic.getCodeType(), temp); + } + } + lastReadTime = System.currentTimeMillis(); + } + + private void refreshDic() { + if (System.currentTimeMillis() - lastReadTime < READ_STEP) { + return; + } + if (lock.isLocked()) { //说明有线程已经在刷数据了 + if (null != dicCache && dicCache.size() > 0) { //如果有数据说明已经初始化过了,直接返回老数据 + return; + } + while (null == dicCache || dicCache.size()<1) { //说明初始化刷数据 等待10毫秒 + try { + Thread.sleep(10); + //此处是否需要添加一个超时机制? + } catch (InterruptedException ie) { + //忽略 + } + } + return; + } + try { + lock.lock(); + if (System.currentTimeMillis() - lastReadTime < READ_STEP) { + return; + } + getDicFormDB(); + } finally { + if (lock.isLocked()) { + lock.unlock(); + } + } + } + + @Override + public List getCities() { + refreshRegion(); + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andStatusEqualTo(1).andParentIdIsNull(); + return regionMapper.selectByExample(example); + } + private void refreshRegion(){ + if (System.currentTimeMillis() - regionLastReadTime < READ_STEP) { + return; + } + if (regionLock.isLocked()) { //说明有线程已经在刷数据了 + if (null != dicCache && dicCache.size() > 0) { //如果有数据说明已经初始化过了,直接返回老数据 + return; + } + while (null == dicCache || dicCache.size()<1) { //说明初始化刷数据 等待10毫秒 + try { + Thread.sleep(10); + //此处是否需要添加一个超时机制? + } catch (InterruptedException ie) { + //忽略 + } + } + return; + } + try { + regionLock.lock(); + if (System.currentTimeMillis() - regionLastReadTime < READ_STEP) { + return; + } + getRegionFromDB(); + } finally { + if (regionLock.isLocked()) { + regionLock.unlock(); + } + } + } + + private void getRegionFromDB(){ + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andStatusEqualTo(1).andParentIdIsNull(); + List citiesList = regionMapper.selectByExample(example); + for(SecRegion city : citiesList){ // 省 + citiesCache.put(city.getRegionId(), city); + singleRegionCache.put(city.getRegionId(), city); + List regions = getRegions(city.getRegionId()); + regionsCache.put(city.getRegionId(),regions); + for(SecRegion region : regions){ // 市 + singleRegionCache.put(region.getRegionId(), region); + List streets = getRegions(region.getRegionId()); + streetCache.put(region.getRegionId(), streets); + for(SecRegion street : streets){ // 去 + singleRegionCache.put(street.getRegionId(), street); + List communities = getRegions(street.getRegionId()); + communityCache.put(street.getRegionId(),communities); + for (SecRegion community : communities){ + singleRegionCache.put(community.getRegionId(),community); + } + } + } + } + regionLastReadTime = System.currentTimeMillis(); + } +/* private void getRegionFromDB(){ + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andStatusEqualTo(1).andParentIdIsNull(); + citiesCache = regionMapper.selectByExample(example); + for(SecRegion city : citiesCache){//市 + singleRegionCache.put(city.getRegionId(), city); + List regions = getRegions(city.getRegionId()); + regionsCache.put(city.getRegionId(),regions); + for(SecRegion region : regions){//区 + singleRegionCache.put(region.getRegionId(), region); + List streets = getRegions(region.getRegionId()); + streetCache.put(region.getRegionId(), streets); + for(SecRegion street : streets){ + singleRegionCache.put(street.getRegionId(), street); + List communities = getRegions(street.getRegionId()); + communityCache.put(street.getRegionId(),communities); + for (SecRegion community : communities){ + singleRegionCache.put(community.getRegionId(),community); + } + } + } + } + regionLastReadTime = System.currentTimeMillis(); + }*/ + + @Override + public List getProvinceList() { + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andParentIdIsNull().andStatusEqualTo(1); + return regionMapper.selectByExample(example); + } + + private List getRegions(Long parentId) { + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andStatusEqualTo(1).andParentIdEqualTo(parentId); + return regionMapper.selectByExample(example); + } + @Override + public List getRegionsByParentId(Long parentId) { + if(parentId == null){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); + } + refreshRegion(); + if(null != regionsCache.get(parentId)){ + return regionsCache.get(parentId); + }else if(null != streetCache.get(parentId)){ + return streetCache.get(parentId); + }else if(null != communityCache.get(parentId)){ + return communityCache.get(parentId); + }else{ + return null; + } + } + + @Override + public Map getParentInfoByRegionId(Long regionId) { + if(regionId == null){ + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR); + } + refreshRegion(); + Map map = new HashMap(); + Stack regionStack = getRegionStack(regionId,new Stack<>()); + if (regionStack.size() == 4){ + map.put("city",regionStack.pop()); + map.put("region",regionStack.pop()); + map.put("street",regionStack.pop()); + map.put("community",regionStack.pop()); + }else if (regionStack.size() == 3){ + map.put("city",regionStack.pop()); + map.put("region",regionStack.pop()); + map.put("street",regionStack.pop()); + }else if (regionStack.size() == 2){ + map.put("city",regionStack.pop()); + map.put("region",regionStack.pop()); + }else if (regionStack.size() == 1){ + map.put("city",regionStack.pop()); + } + return map; + } + + @Override + public String getRegionName(Long regionId) { + String regionName = ""; + Map map = getParentInfoByRegionId(regionId); + if (map.get("city") != null) { + regionName += map.get("city").getRegionName(); + } + if (map.get("region") != null) { + regionName += map.get("region").getRegionName(); + } + if (map.get("street") != null) { + regionName += map.get("street").getRegionName(); + } + if (map.get("community") != null) { + regionName += map.get("community").getRegionName(); + } + return regionName; + } + + private Stack getRegionStack(Long regionId, Stack regionStack){ + SecRegion region = singleRegionCache.get(regionId); + if (region != null){ + regionStack.push(region); + getRegionStack(region.getParentId(),regionStack); + } + return regionStack; + } + + @Override + public SecRegion getRegionsById(Long regionId) { + return regionMapper.selectByPrimaryKey(regionId); + } + + + @Override + public List findByName(String name) { + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andStatusEqualTo(1).andRegionNameEqualTo(name); + return regionMapper.selectByExample(example); + } + + @Override + public SecRegion getParentByRegion(Long regionId) { + SecRegion secRegion = getRegionsById(regionId); + if (secRegion != null && secRegion.getParentId() != null) { + while (true) { + secRegion = getRegionsById(secRegion.getParentId()); + if (secRegion.getParentId() == null) { + return secRegion; + } + } + } + return secRegion; + } + + @Override + public Boolean findValue(String codeType, String codeValue) { + SecDictionaryExample example = new SecDictionaryExample(); + example.createCriteria().andCodeTypeEqualTo(codeType).andCodeValueEqualTo(codeValue); + + List list = dicMapper.selectByExample(example); + + return list.size() > 0; + } + + @Override + public List mappingSysNameOl(String codeType) { + SecDictionaryExample example = new SecDictionaryExample(); + example.createCriteria().andCodeTypeEqualTo(codeType); + return dicMapper.selectByExample(example); + } + + @Override + public void updateDictionary(SecDictionary secDictionary) { + dicMapper.updateByPrimaryKeySelective(secDictionary); + } + + @Override + public SecRegion getRegionsByName(String regionName) { + SecRegionExample example = new SecRegionExample(); + example.createCriteria().andRegionNameLike("%" + regionName + "%"); + List list = regionMapper.selectByExample(example); + if (list.size() > 0) { + return list.get(0); + } + return null; + } + + +} diff --git a/service/src/main/java/com/hfkj/service/impl/FileUploadServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/FileUploadServiceImpl.java new file mode 100644 index 0000000..ac82530 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/FileUploadServiceImpl.java @@ -0,0 +1,118 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.Base64Util; +import com.hfkj.service.FileUploadService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Service(value = "fileUploadService") +public class FileUploadServiceImpl implements FileUploadService { + + @Override + @Transactional + public Map upload(List files, Map paramsMap) throws Exception { + + String pathPrefix = paramsMap.get("pathPrefix"); // 文件前缀 + String fileNameGenerator = paramsMap.get("fileNameGenerator"); // 文件名生成方式 + if (StringUtils.isBlank(pathPrefix) + || StringUtils.isBlank(fileNameGenerator)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + Map result = new HashMap<>(); + for (MultipartFile file : files) { + if (!file.isEmpty()) { + String fileName = file.getOriginalFilename(); // 获取文件名 + fileName = generateFileName(fileName, paramsMap); // 按照生成规则生成文件名 + result.put(file.getOriginalFilename(), fileName); + + File dest = new File(pathPrefix + File.separator + fileName); + if (!dest.getParentFile().exists()) { + dest.getParentFile().mkdirs(); + } + file.transferTo(dest); + } + } + + return result; + } + + @Override + public boolean deleteFile(String filePath) { + boolean delete_flag = false; + File file = new File(filePath); + if (file.exists() && file.isFile() && file.delete()) + delete_flag = true; + else + delete_flag = false; + return delete_flag; + } + + /** + * 根据不同规则生成文件名 + */ + private String generateFileName(String fileName, Map paramsMap) throws Exception{ + + /** + * 获取文件名后缀 + * (1)如果指定后缀,用指定的后缀名称 + * (2)如果未指定后缀,且文件有后缀,用文件自己的后缀 + * (3)如果未指定后缀,且文件无后缀,则生成的文件也没有后缀 + */ + String pathSuffix = paramsMap.get("pathSuffix"); + if (StringUtils.isBlank(pathSuffix)) { + if (fileName.lastIndexOf('.') != -1) { + pathSuffix = fileName.substring(fileName.lastIndexOf('.')); + } else { + pathSuffix = ""; + } + } + // 文件名前缀 + String name = fileName.substring(0, fileName.lastIndexOf(".")); + + // 生成文件名 + String result = null; + if ("generateFileNameById".equals(paramsMap.get("fileNameGenerator"))) { + // 对文件指定id进行Base64加密 + // todo 暂不使用,没有id + if (StringUtils.isBlank(paramsMap.get(fileName))) { + result = fileName; + } else { + result = Base64Util.encode(paramsMap.get(fileName)) + pathSuffix; + } + + } else if ("generateFileNameByTimeStamp".equals(paramsMap.get("fileNameGenerator"))) { + // 根据时间戳生成文件名 + + result = String.valueOf(System.currentTimeMillis()) + pathSuffix; + + } else if ("generateFileNameByOriginalName".equals(paramsMap.get("fileNameGenerator"))) { + // 按"原文件名"生成文件名 + + result = fileName; + + }else if ("generateFileNameAndTimeStamp".equals(paramsMap.get("fileNameGenerator"))) { + // 按"原文件名+时间戳"生成文件名 + + result = name + String.valueOf(System.currentTimeMillis()) + pathSuffix; + + } + + String childPath = paramsMap.get("childPath"); + if (StringUtils.isBlank(childPath)) { + childPath = ""; + } + return childPath + result; + } + +} diff --git a/service/src/main/java/com/hfkj/service/impl/HighGasOilPriceTaskServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/HighGasOilPriceTaskServiceImpl.java new file mode 100644 index 0000000..4bd0a9f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/impl/HighGasOilPriceTaskServiceImpl.java @@ -0,0 +1,218 @@ +package com.hfkj.service.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.DateUtil; +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.BsGasOilPriceTaskMapper; +import com.hfkj.entity.BsGasOilPrice; +import com.hfkj.entity.BsGasOilPriceOfficial; +import com.hfkj.entity.BsGasOilPriceTask; +import com.hfkj.entity.BsGasOilPriceTaskExample; +import com.hfkj.msg.MsgTopic; +import com.hfkj.service.BsGasOilPriceOfficialService; +import com.hfkj.service.BsGasOilPriceService; +import com.hfkj.service.BsGasOilPriceTaskService; +import com.hfkj.sysenum.GasTaskExecutionTypeEnum; +import com.hfkj.sysenum.GasTaskPriceTypeEnum; +import com.hfkj.sysenum.GasTaskStatusEnum; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +@Service("gasOilPriceTaskService") +public class HighGasOilPriceTaskServiceImpl implements BsGasOilPriceTaskService { + + @Resource + private RedisUtil redisUtil; + @Resource + private BsGasOilPriceTaskMapper gasOilPriceTaskMapper; + @Resource + private BsGasOilPriceService gasOilPriceService; + @Resource + private BsGasOilPriceOfficialService gasOilPriceOfficialService; + + @Override + public void editData(BsGasOilPriceTask gasOilPriceTask) { + if (gasOilPriceTask.getId() == null) { + gasOilPriceTask.setStatus(GasTaskStatusEnum.status1.getStatus()); + gasOilPriceTask.setCreateTime(new Date()); + gasOilPriceTask.setUpdateTime(new Date()); + gasOilPriceTaskMapper.insert(gasOilPriceTask); + } else { + gasOilPriceTaskMapper.updateByPrimaryKey(gasOilPriceTask); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRED) + public void batchAddTask(List taskList) { + for (BsGasOilPriceTask task : taskList) { + addTask(task); + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRED) + public void addTask(BsGasOilPriceTask gasOilPriceTask) { + editData(gasOilPriceTask); + // 立刻执行 + if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type1.getStatus())) { + businessHandle(gasOilPriceTask); + + } else if (gasOilPriceTask.getExecutionType().equals(GasTaskExecutionTypeEnum.type2.getStatus())) { + long time = DateUtil.getSecondDiff(new Date(), gasOilPriceTask.getStartTime()); + if (time >= 1) { + redisUtil.set(MsgTopic.oilPriceTask.getName() + "-" + gasOilPriceTask.getId(), "", time); + } else { + businessHandle(gasOilPriceTask); + } + } + } + + @Override + @Transactional(propagation= Propagation.REQUIRED) + public void businessHandle(BsGasOilPriceTask gasOilPriceTask) { + // 立刻执行 + gasOilPriceTask.setStartTime(new Date()); + gasOilPriceTask.setStatus(GasTaskStatusEnum.status2.getStatus()); + editData(gasOilPriceTask); + + // 国标价 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type1.getStatus())) { + // 查询国标价油品价格 + BsGasOilPriceOfficial price = gasOilPriceOfficialService.getPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + gasOilPriceOfficialService.editPrice(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo(), gasOilPriceTask.getPrice()); + + // 更新自建站的国标价 + gasOilPriceOfficialService.refreshGasPriceOfficial(gasOilPriceTask.getRegionId(), gasOilPriceTask.getOilNo()); + } + + // 油站价 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type2.getStatus())) { + // 查询油品价格 + BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setPriceGun(gasOilPriceTask.getPrice().subtract(price.getGasStationDrop())); + price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); + gasOilPriceService.editOilPrice(price); + } + + // 平台优惠 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type3.getStatus())) { + // 查询油品价格 + BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setPreferentialMargin(gasOilPriceTask.getPrice()); + price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); + gasOilPriceService.editOilPrice(price); + } + + // 油站直降 + if (gasOilPriceTask.getPriceType().equals(GasTaskPriceTypeEnum.type4.getStatus())) { + // 查询油品价格 + BsGasOilPrice price = gasOilPriceService.getGasOilPrice(gasOilPriceTask.getMerId(), gasOilPriceTask.getOilNo()); + if (price == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到油品价格"); + } + price.setGasStationDrop(gasOilPriceTask.getPrice()); + price.setPriceGun(price.getPriceOfficial().subtract(price.getGasStationDrop())); + price.setPriceVip(price.getPriceGun().subtract(price.getPreferentialMargin())); + gasOilPriceService.editOilPrice(price); + } + + } + + @Override + public BsGasOilPriceTask getDetailById(Long taskId) { + return gasOilPriceTaskMapper.selectByPrimaryKey(taskId); + } + + @Override + public void delTask(Long taskId) { + // 查询价格任务 + BsGasOilPriceTask detail = getDetailById(taskId); + if (detail == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到任务"); + } + if (!detail.getStatus().equals(GasTaskStatusEnum.status1.getStatus())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "任务当前状态无法删除"); + } + detail.setStatus(GasTaskStatusEnum.status0.getStatus()); + editData(detail); + + // 从redis中删除任务 + redisUtil.del(MsgTopic.oilPriceTask.getName() + "-" + taskId); + } + + @Override + public List getTaskList(Map param) { + BsGasOilPriceTaskExample example = new BsGasOilPriceTaskExample(); + BsGasOilPriceTaskExample.Criteria criteria = example.createCriteria() + .andStatusNotEqualTo(GasTaskStatusEnum.status0.getStatus()); + + if (MapUtils.getLong(param, "regionId") != null) { + criteria.andRegionIdEqualTo(MapUtils.getLong(param, "regionId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "regionName"))) { + criteria.andRegionNameLike("%" + MapUtils.getString(param, "regionName") + "%"); + } + + if (MapUtils.getLong(param, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(param, "merId")); + } + + if (MapUtils.getString(param, "merNoList") != null) { + criteria.andMerNoIn(Arrays.stream(MapUtils.getString(param, "merNoList").split(",")).collect(Collectors.toList())); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merName"))) { + criteria.andMerNameLike("%" + MapUtils.getString(param, "merName") + "%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "merNo"))) { + criteria.andMerNoLike("%" + MapUtils.getString(param, "merNo") + "%"); + } + + if (MapUtils.getInteger(param, "oilType") != null) { + criteria.andOilTypeEqualTo(MapUtils.getInteger(param, "oilType")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "oilNo"))) { + criteria.andOilNoEqualTo(MapUtils.getString(param, "oilNo")); + } + + if (MapUtils.getInteger(param, "priceType") != null) { + criteria.andPriceTypeEqualTo(MapUtils.getInteger(param, "priceType")); + } + + if (MapUtils.getInteger(param, "executionType") != null) { + criteria.andExecutionTypeEqualTo(MapUtils.getInteger(param, "executionType")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return gasOilPriceTaskMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/pay/NotifyService.java b/service/src/main/java/com/hfkj/service/pay/NotifyService.java new file mode 100644 index 0000000..f4c84b5 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/NotifyService.java @@ -0,0 +1,31 @@ +package com.hfkj.service.pay; + +import java.util.Map; + +/** + * @Description 支付宝/微信 支付回调 + * @author gongjia + * @date 2020/3/27 15:30 + * @Copyright 2019 www.shinwoten.com Inc. All rights reserved. + */ +public interface NotifyService { + + /** + * + * @Title alipayNotify + * @Description 支付宝 验签成功后业务调用 + * @author gongjia + * @param paramsMap 异步回调返回的参数 + */ + String alipayNotify(Map paramsMap) throws Exception; + + /** + * + * @Title alipayNotify + * @Description 微信 验签成功后业务调用 + * @author gongjia + * @param paramsMap 异步回调返回的参数 + */ + String wechatNotify(Map paramsMap) throws Exception; + +} diff --git a/service/src/main/java/com/hfkj/service/pay/PayRecordService.java b/service/src/main/java/com/hfkj/service/pay/PayRecordService.java new file mode 100644 index 0000000..61d8482 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/PayRecordService.java @@ -0,0 +1,22 @@ +package com.hfkj.service.pay; + +import java.util.Map; + +/** + * @ClassName: PayRecordService + * @Description: 支付纪录 + * @author: gongjia + * @date: 2020/3/27 9:48 + * @Copyright: 2019 www.shinwoten.com Inc. All rights reserved. + */ +public interface PayRecordService { + + /** + * + * @author gongjia + * @param paramsMap 支付纪录信息(支付宝或微信回调传回的信息) + * @param payType 支付方式:Alipay-支付宝 WechatPay-微信 + */ + int addPayRecord(Map paramsMap, String payType) throws Exception; + +} diff --git a/service/src/main/java/com/hfkj/service/pay/PayService.java b/service/src/main/java/com/hfkj/service/pay/PayService.java new file mode 100644 index 0000000..bc65b1d --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/PayService.java @@ -0,0 +1,22 @@ +package com.hfkj.service.pay; + +import java.util.Map; + +/** + * @ClassName: PayService + * @Description: 支付完成 不同模块实际的业务处理 + * @author: gongjia + * @date: 2020/3/27 16:28 + * @Copyright: 2019 www.shinwoten.com Inc. All rights reserved. + */ +public interface PayService { + + /** + * @desc 不同模块实际的业务处理 + * @param map 支付宝/微信 异步回调返回的参数 + * @param payType 支付方式:Alipay-支付宝 WechatPay-微信 + */ + void paySuccess(Map map, String payType) throws Exception; + + +} diff --git a/service/src/main/java/com/hfkj/service/pay/impl/GoodsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/pay/impl/GoodsOrderServiceImpl.java new file mode 100644 index 0000000..b0d7719 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/impl/GoodsOrderServiceImpl.java @@ -0,0 +1,39 @@ +package com.hfkj.service.pay.impl; + +import com.hfkj.service.pay.NotifyService; +import com.hfkj.service.pay.PayService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/27 00:35 + */ +@Service("goodsOrderService") +public class GoodsOrderServiceImpl implements PayService { + + private static Logger log = LoggerFactory.getLogger(GoodsOrderServiceImpl.class); + + @Resource + private NotifyService notifyService; + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW) + public void paySuccess(Map map, String payType) throws Exception { + if (payType.equals("Alipay")) { + // 支付宝支付 todo 暂未开发 + return; + } + if (payType.equals("WechatPay")) { + // 微信支付 + } + } + +} diff --git a/service/src/main/java/com/hfkj/service/pay/impl/NotifyServiceImpl.java b/service/src/main/java/com/hfkj/service/pay/impl/NotifyServiceImpl.java new file mode 100644 index 0000000..f8ce825 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/impl/NotifyServiceImpl.java @@ -0,0 +1,120 @@ +package com.hfkj.service.pay.impl; + +import com.hfkj.common.pay.entity.OrderType; +import com.hfkj.common.utils.SpringContextUtil; +import com.hfkj.service.pay.NotifyService; +import com.hfkj.service.pay.PayRecordService; +import com.hfkj.service.pay.PayService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Map; + +@Service(value = "notifyService") +public class NotifyServiceImpl implements NotifyService { + + private static Logger log = LoggerFactory.getLogger(NotifyServiceImpl.class); + + @Resource + private PayRecordService payRecordService; + + @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + public String alipayNotify(Map params) throws Exception { + String result = "failure"; + String trade_status = params.get("trade_status"); + if ("TRADE_SUCCESS".equals(trade_status)) { + // 交易支付成功 默认触发 + + String orderType = params.get("passback_params"); + PayService payService = getPayService(orderType); + if (payService != null) { + payService.paySuccess(params, "Alipay"); // 商户内部实际的交易业务处理 + log.info("支付宝异步通知 -> 业务处理完成"); + result = "success"; + } else { + log.info("支付宝异步通知 -> 业务处理:payService获取失败"); + } + + } else if ("TRADE_CLOSED".equals(trade_status)) { + // 未付款交易超时关闭,或支付完成后全额退款 默认触发 + + // todo 业务流程 + + log.info("支付宝异步通知 -> 未付款交易超时关闭,或支付完成后全额退款"); + result = "success"; + } else if ("WAIT_BUYER_PAY".equals(trade_status)) { + // 交易创建,等待买家付款 默认不触发 + + // todo 业务流程 + + log.info("支付宝异步通知 -> 交易创建,等待买家付款"); + result = "success"; + } else if ("TRADE_FINISHED".equals(trade_status)) { + // 交易结束,不可退款 默认不触发 + + // todo 业务流程 + + log.info("支付宝异步通知 -> 交易结束,不可退款"); + result = "success"; + } + + // 增加支付纪录(实际是支付宝回调纪录) + payRecordService.addPayRecord(params, "Alipay"); + return result; + } + + @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) + public String wechatNotify(Map paramsMap) throws Exception { + String resXml = null; + + if ("SUCCESS".equals(paramsMap.get("return_code")) && "SUCCESS".equals(paramsMap.get("result_code"))) { + log.info("微信支付 -> 异步通知:支付成功,进入订单处理"); + // 订单类型 + String orderType = paramsMap.get("attach"); + PayService payService = getPayService(orderType); + if (payService != null) { + payService.paySuccess(paramsMap, "WechatPay"); // 商户内部实际的交易业务处理 + log.info("微信支付 -> 异步通知:订单处理完成"); + } else { + log.error("微信支付 -> 异步通知:业务处理,payService获取失败"); + } + + // 通知微信.异步确认成功.必写.不然会一直通知后台.八次之后就认为交易失败了 + resXml = "" + "" + + "" + " "; + } else { + log.error("微信支付 -> 异步通知:支付失败,错误信息:" + paramsMap.get("err_code_des")); + resXml = "" + "" + "" + " "; + } + + if ("SUCCESS".equals(paramsMap.get("return_code"))) { + // 增加支付纪录(实际是微信回调纪录) + payRecordService.addPayRecord(paramsMap, "WechatPay"); + } + return resXml; + } + + /** + * @desc 根据回调回传参数 选择业务service + * @param orderType 订单类型(回传参数) + */ + private PayService getPayService(String orderType) throws Exception{ + PayService payService = null; + for (OrderType item : OrderType.values()) { + if (item.getModuleCode().equals(orderType)) { + payService = (PayService) SpringContextUtil.getBean(item.getService()); + break; + } + } + + return payService; + } + +} diff --git a/service/src/main/java/com/hfkj/service/pay/impl/PayRecordServiceImpl.java b/service/src/main/java/com/hfkj/service/pay/impl/PayRecordServiceImpl.java new file mode 100644 index 0000000..df95af3 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/pay/impl/PayRecordServiceImpl.java @@ -0,0 +1,24 @@ +package com.hfkj.service.pay.impl; + +import com.hfkj.service.pay.PayRecordService; +import org.springframework.stereotype.Service; + +import java.util.Map; + +@Service(value = "payRecordService") +public class PayRecordServiceImpl implements PayRecordService { + + @Override + public int addPayRecord(Map paramsMap, String payType) throws Exception { + if ("Alipay".equals(payType)) { + + } else if ("WechatPay".equals(payType)) { + + } else { + return 0; + } + + return 0; + } + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecDictionaryService.java b/service/src/main/java/com/hfkj/service/sec/SecDictionaryService.java new file mode 100644 index 0000000..ca1bb5e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecDictionaryService.java @@ -0,0 +1,37 @@ +package com.hfkj.service.sec; + +import com.hfkj.entity.SecDictionary; + +import java.util.List; + +/** + * @className: SecDictionaryService + * @author: HuRui + * @date: 2024/4/23 + **/ +public interface SecDictionaryService { + + /** + * 获取数据字典 + * @return + */ + List getDictionary(); + + /** + * 获取数据字典 + * @param codeType + * @return + */ + List getDictionary(String codeType); + + /** + * 获取数据字典 + * @param codeType + * @param codeValue + * @return + */ + SecDictionary getDictionary(String codeType, String codeValue); + + + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecMenuService.java b/service/src/main/java/com/hfkj/service/sec/SecMenuService.java new file mode 100644 index 0000000..04d4dc3 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecMenuService.java @@ -0,0 +1,77 @@ +package com.hfkj.service.sec; + +import com.hfkj.entity.SecMenu; +import com.hfkj.model.MenuTreeModel; +import com.hfkj.sysenum.SecMenuTypeEnum; + +import java.util.List; +import java.util.Map; + +/** + * @className: SecMenuService + * @author: HuRui + * @date: 2024/3/26 + **/ +public interface SecMenuService { + + /** + * 创建 + * @param menu 菜单 + */ + void create(SecMenu menu); + + /** + * 修改 + * @param menu 菜单 + */ + void update(SecMenu menu); + + /** + * 删除数据 + * @param menuId + */ + void delete(Long menuId); + + /** + * 查询详情 + * @param menuId + * @return + */ + SecMenu queryDetail(Long menuId); + + /** + * 查询菜单列表 + * @param param + * @return + */ + List getList(Map param); + + /** + * 查询角色菜单 + * @param roleId 角色id + * @param menuType 菜单类型 + * @return + */ + List queryRoleMenu(Long roleId, SecMenuTypeEnum menuType); + + /** + * 查询菜单列表 + * @return + */ + List getAllList(); + + /** + * 分配系统菜单 + * @param roleId 角色id + * @return + */ + void assignMenu(Long roleId, List menuIds); + + /** + * 查询系统菜单结构 + * @param roleId 角色id + * @return + */ + List queryMenuTree(Long roleId); + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecRoleMenuRelService.java b/service/src/main/java/com/hfkj/service/sec/SecRoleMenuRelService.java new file mode 100644 index 0000000..9251e0b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecRoleMenuRelService.java @@ -0,0 +1,46 @@ +package com.hfkj.service.sec; + +import com.hfkj.entity.SecRoleMenuRel; + +import java.util.List; + +/** + * @className: SecRoleMenuRelService + * @author: HuRui + * @date: 2024/3/26 + **/ +public interface SecRoleMenuRelService { + + /** + * 批量增加 + * @param dataList + */ + void batchAdd(List dataList); + + /** + * 删除 + * @param relId 关系id + */ + void delete(Long relId); + + /** + * 删除 + * @param roleId 角色id + */ + void deleteByRole(Long roleId); + + /** + * 查询角色菜单关系 + * @param roleId 角色id + * @return + */ + List getRelListByRole(Long roleId); + + /** + * 查询角色菜单关系 + * @param menuId 菜单id + * @return + */ + List getRelListByMenu(Long menuId); + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecRoleService.java b/service/src/main/java/com/hfkj/service/sec/SecRoleService.java new file mode 100644 index 0000000..450b92a --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecRoleService.java @@ -0,0 +1,42 @@ +package com.hfkj.service.sec; + +import com.hfkj.entity.SecRole; + +import java.util.List; +import java.util.Map; + +/** + * @className: SecRoleService + * @author: HuRui + * @date: 2024/3/26 + **/ +public interface SecRoleService { + + /** + * 编辑数据 + * @param role 数据 + */ + void editData(SecRole role); + + /** + * 删除 + * @param roleId 角色id + */ + void delete(Long roleId); + + /** + * 查询详情 + * @param roleId 角色id + * @return + */ + SecRole getDetail(Long roleId); + + + /** + * 查询集合 + * @param param 参数 + * @return + */ + List getList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecUserLoginLogService.java b/service/src/main/java/com/hfkj/service/sec/SecUserLoginLogService.java new file mode 100644 index 0000000..b3d7417 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecUserLoginLogService.java @@ -0,0 +1,37 @@ +package com.hfkj.service.sec; + +import com.hfkj.entity.SecUser; +import com.hfkj.entity.SecUserLoginLog; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Map; + +/** + * 登录账户 + * @className: SecUserLoginLogService + * @author: HuRui + * @date: 2024/4/3 + **/ +public interface SecUserLoginLogService { + + /** + * 创建 + * @param userLoginLog + */ + void create(SecUserLoginLog userLoginLog); + + /** + * 异步创建登录日志 + * @param user + */ + void asyncCreateLog(SecUser user, HttpServletRequest request); + + /** + * 查询日志列表 + * @param param + * @return + */ + List getLogList(Map param); + +} diff --git a/service/src/main/java/com/hfkj/service/sec/SecUserService.java b/service/src/main/java/com/hfkj/service/sec/SecUserService.java new file mode 100644 index 0000000..99715b1 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/SecUserService.java @@ -0,0 +1,67 @@ +package com.hfkj.service.sec; + +import com.hfkj.common.security.SessionObject; +import com.hfkj.entity.SecUser; +import com.hfkj.sysenum.SecUserObjectTypeEnum; + +import java.util.List; +import java.util.Map; + +/** + * @className: SecUserService + * @author: HuRui + * @date: 2024/3/26 + **/ +public interface SecUserService { + + /** + * 编辑数据 + * @param data + */ + void editUser(SecUser data); + + /** + * 重置密码 + * @param userId + */ + void resetPwd(Long userId) throws Exception; + /** + * 查询详情 + * @param id + * @return + */ + SecUser getDetail(Long id); + + /** + * 查询详情 + * @param objectType + * @param objectId + * @return + */ + SecUser getDetail(SecUserObjectTypeEnum objectType, Long objectId); + + /** + * 根据登录账户查询详情 + * @param loginName + * @return + */ + SecUser getDetailByLoginName(String loginName); + + /** + * 查询列表 + * @param param + * @return + */ + List getList(Map param); + + /** + * 登录 + * @param loginName 登录账户 + * @param password 登录密码【未加密字符串】 + * @return + */ + SessionObject login(String loginName, String password) throws Exception; + + + +} diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecDictionaryServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecDictionaryServiceImpl.java new file mode 100644 index 0000000..ac37a2b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecDictionaryServiceImpl.java @@ -0,0 +1,59 @@ +package com.hfkj.service.sec.impl; + +import com.hfkj.common.utils.RedisUtil; +import com.hfkj.dao.SecDictionaryMapper; +import com.hfkj.entity.SecDictionary; +import com.hfkj.entity.SecDictionaryExample; +import com.hfkj.service.sec.SecDictionaryService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @className: SecDictionaryServiceImpl + * @author: HuRui + * @date: 2024/4/23 + **/ +@Service("secDictionaryService") +public class SecDictionaryServiceImpl implements SecDictionaryService { + + @Resource + private SecDictionaryMapper secDictionaryMapper; + @Resource + private RedisUtil redisUtil; + // 缓存KEY + private final String cacheKey = "SEC_DICTIONARY"; + + @Override + public List getDictionary() { + Object cache = redisUtil.get(cacheKey); + if (cache != null) { + return (List) cache; + } + SecDictionaryExample example = new SecDictionaryExample(); + example.setOrderByClause("sort_id"); + List list = secDictionaryMapper.selectByExample(example); + redisUtil.set(cacheKey, list); + return list; + } + + @Override + public List getDictionary(String codeType) { + return getDictionary().stream().filter(o -> o.getCodeType().equals(codeType)).collect(Collectors.toList()); + } + + @Override + public SecDictionary getDictionary(String codeType, String codeValue) { + List list = getDictionary().stream() + .filter(o -> o.getCodeType().equals(codeType) && o.getCodeValue().equals(codeValue)) + .collect(Collectors.toList()); + if (!list.isEmpty()) { + return list.get(0); + } else { + return null; + } + } + +} 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 new file mode 100644 index 0000000..c640379 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecMenuServiceImpl.java @@ -0,0 +1,298 @@ +package com.hfkj.service.sec.impl; + +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 com.hfkj.common.utils.StreamUtil; +import com.hfkj.dao.SecMenuMapper; +import com.hfkj.entity.SecMenu; +import com.hfkj.entity.SecMenuExample; +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecRoleMenuRel; +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 org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * @className: SecMenuServiceImpl + * @author: HuRui + * @date: 2024/3/28 + **/ +@Service("secMenuService") +public class SecMenuServiceImpl implements SecMenuService { + + @Resource + private SecMenuMapper secMenuMapper; + @Resource + private SecRoleService secRoleService; + @Resource + private SecRoleMenuRelService secRoleMenuRelService; + @Resource + private RedisUtil redisUtil; + // 缓存k + private static final String CACHE_MENU = "SEC_MENU"; + private static final String CACHE_ROLE_MENU = "SEC_ROLE_MENU"; + + @Override + public void create(SecMenu menu) { + menu.setCreateTime(new Date()); + menu.setUpdateTime(new Date()); + secMenuMapper.insert(menu); + // 加入缓存 + redisUtil.hset(CACHE_MENU, ""+menu.getId(), menu); + } + + @Override + public void update(SecMenu menu) { + menu.setCreateTime(new Date()); + menu.setUpdateTime(new Date()); + secMenuMapper.updateByPrimaryKey(menu); + + // 查询角色菜单 + List relList = secRoleMenuRelService.getRelListByMenu(menu.getId()); + for (SecRoleMenuRel rel : relList) { + // 删除角色菜单缓存 + redisUtil.hdel(CACHE_ROLE_MENU, ""+rel.getRoleId()); + } + + // 更新菜单缓存 + redisUtil.hset(CACHE_MENU, ""+menu.getId(), menu); + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void delete(Long menuId) { + // 查询菜单 + SecMenu secMenu = queryDetail(menuId); + if (secMenu == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); + } + secMenuMapper.deleteByPrimaryKey(menuId); + + // 查询角色菜单 + List relList = secRoleMenuRelService.getRelListByMenu(menuId); + for (SecRoleMenuRel rel : relList) { + secRoleMenuRelService.delete(rel.getId()); + // 删除角色菜单缓存 + redisUtil.hdel(CACHE_ROLE_MENU, ""+rel.getRoleId()); + } + // 删除缓存 + redisUtil.hdel(CACHE_MENU, ""+secMenu.getId()); + } + + @Override + public SecMenu queryDetail(Long menuId) { + Object cacheObj = redisUtil.hget(CACHE_MENU, "" + menuId); + if (cacheObj != null) { + return (SecMenu) cacheObj; + } + SecMenu menu = secMenuMapper.selectByPrimaryKey(menuId); + // 更新菜单缓存 + redisUtil.hset(CACHE_MENU, ""+menu.getId(), menu); + return menu; + } + + @Override + public List getList(Map param) { + SecMenuExample example = new SecMenuExample(); + SecMenuExample.Criteria criteria = example.createCriteria(); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "menuName"))) { + criteria.andMenuNameLike("%"+MapUtils.getString(param, "menuName")+"%"); + } + + if (MapUtils.getInteger(param, "menuType") != null) { + criteria.andMenuTypeEqualTo(MapUtils.getInteger(param, "menuType")); + } + + example.setOrderByClause("menu_sort desc"); + return secMenuMapper.selectByExample(example); + } + + @Override + public List queryRoleMenu(Long roleId, SecMenuTypeEnum menuType) { + // 获取角色菜单关系 + Map roleMenuRelMap = secRoleMenuRelService.getRelListByRole(roleId).stream() + .collect(Collectors.toMap(SecRoleMenuRel::getMenuId, Function.identity())); + + // 获取系统菜单 + List menuList = getAllList().stream() + .filter(o->o.getMenuType().equals(menuType.getCode())) + .collect(Collectors.toList()); + + Iterator iterator = menuList.iterator(); + while (iterator.hasNext()) { + if (roleMenuRelMap.get(iterator.next().getId()) == null) { + iterator.remove(); + } + } + return menuList; + } + + @Override + public List getAllList() { + Map cacheObj = redisUtil.hmget(CACHE_MENU); + if (!cacheObj.isEmpty()) { + return new ArrayList<>(cacheObj.values()); + } + SecMenuExample example = new SecMenuExample(); + example.createCriteria(); + List menuList = secMenuMapper.selectByExample(example); + for (SecMenu menu : menuList) { + redisUtil.hset(CACHE_MENU, ""+menu.getId(), menu); + } + return menuList; + } + + @Override + @Transactional(propagation= Propagation.REQUIRES_NEW,rollbackFor= {RuntimeException.class}) + public void assignMenu(Long roleId, List menuIds) { + // 查询角色 + SecRole secRole = secRoleService.getDetail(roleId); + if (secRole == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的角色"); + } + // 记录更新时间 + secRoleService.editData(secRole); + + // 删除角色权限旧数据 + secRoleMenuRelService.deleteByRole(roleId); + + SecRoleMenuRel rel; + List relList = new ArrayList<>(); + for (Long menuId : menuIds) { + rel = new SecRoleMenuRel(); + rel.setRoleId(roleId); + rel.setMenuId(menuId); + relList.add(rel); + } + // 根据菜单id去重 + List collectList = relList.stream().filter(StreamUtil.distinctByKey(b -> b.getMenuId())).collect(Collectors.toList()); + // 角色新菜单权限 + secRoleMenuRelService.batchAdd(collectList); + // 更新缓存 + redisUtil.hdel(CACHE_ROLE_MENU, ""+roleId); + } + + @Override + public List queryMenuTree(Long roleId) { + List treeModelList = new ArrayList<>(); + MenuTreeModel menuTree; + + if (roleId != null) { + // 获取缓存 + Object cacheObj = redisUtil.hget(CACHE_ROLE_MENU, ""+roleId); + if (cacheObj != null) { + return (List) cacheObj; + } + // 获取缓存菜单 + Map secMenuMap = (Map) redisUtil.hmget(CACHE_MENU); + if (secMenuMap.isEmpty()) { + getAllList(); // 刷新缓存 + secMenuMap = (Map) redisUtil.hmget(CACHE_MENU); + } + // 角色菜单 + List roleMenuList = new ArrayList<>(); + // 查询角色菜单关系 + List roleMenuRelList = secRoleMenuRelService.getRelListByRole(roleId); + for (SecRoleMenuRel rel : roleMenuRelList) { + Object obj = secMenuMap.get(""+rel.getMenuId()); + roleMenuList.add((SecMenu) obj); + } + // 获取最顶层菜单 + List topLevelMenuList = roleMenuList.stream() + .filter(o -> o.getMenuPSid() == null) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + for (SecMenu topLevelMenu : topLevelMenuList) { + if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + menuTree = new MenuTreeModel(); + menuTree.setId(topLevelMenu.getId()); + menuTree.setMenuName(topLevelMenu.getMenuName()); + menuTree.setMenuType(topLevelMenu.getMenuType()); + menuTree.setMenuUrl(topLevelMenu.getMenuUrl()); + menuTree.setMenuUrlImg(topLevelMenu.getMenuUrlImg()); + menuTree.setMenuPSid(topLevelMenu.getMenuPSid()); + menuTree.setMenuSort(topLevelMenu.getMenuSort()); + menuTree.setMenuDesc(topLevelMenu.getMenuDesc()); + // 获取下级菜单 + menuTree.setChildMenuList(recursionMenu(roleMenuList, topLevelMenu.getId())); + treeModelList.add(menuTree); + } + } + // 存入缓存 + redisUtil.hset(CACHE_ROLE_MENU, ""+roleId, treeModelList); + return treeModelList; + } else { + List menuList = getAllList(); + // 获取最顶层菜单 + List topLevelMenuList = menuList.stream() + .filter(o -> o.getMenuPSid() == null) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + for (SecMenu topLevelMenu : topLevelMenuList) { + if (topLevelMenu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + menuTree = new MenuTreeModel(); + menuTree.setId(topLevelMenu.getId()); + menuTree.setMenuName(topLevelMenu.getMenuName()); + menuTree.setMenuType(topLevelMenu.getMenuType()); + menuTree.setMenuUrl(topLevelMenu.getMenuUrl()); + menuTree.setMenuUrlImg(topLevelMenu.getMenuUrlImg()); + menuTree.setMenuPSid(topLevelMenu.getMenuPSid()); + menuTree.setMenuSort(topLevelMenu.getMenuSort()); + menuTree.setMenuDesc(topLevelMenu.getMenuDesc()); + // 获取下级菜单 + menuTree.setChildMenuList(recursionMenu(menuList, topLevelMenu.getId())); + treeModelList.add(menuTree); + } + } + return treeModelList; + } + } + + /** + * 递归获取菜单 + * @param dataSource 数据源 + * @param parentMenuId 父级菜单id + * @return + */ + public List recursionMenu(List dataSource, Long parentMenuId) { + List treeModelList = new ArrayList<>(); + MenuTreeModel menuTree; + + List collect = dataSource.stream() + .filter(o -> o.getMenuPSid() != null && o.getMenuPSid().equals(parentMenuId)) + .sorted(Comparator.comparing(SecMenu::getMenuSort)) + .collect(Collectors.toList()); + for (SecMenu menu : collect) { + if (menu.getMenuType().equals(SecMenuTypeEnum.type1.getCode())) { + menuTree = new MenuTreeModel(); + menuTree.setId(menu.getId()); + menuTree.setMenuName(menu.getMenuName()); + menuTree.setMenuType(menu.getMenuType()); + menuTree.setMenuUrl(menu.getMenuUrl()); + menuTree.setMenuUrlImg(menu.getMenuUrlImg()); + menuTree.setMenuPSid(menu.getMenuPSid()); + menuTree.setMenuSort(menu.getMenuSort()); + menuTree.setMenuDesc(menu.getMenuDesc()); + menuTree.setChildMenuList(recursionMenu(dataSource, menu.getId())); + treeModelList.add(menuTree); + } + } + return treeModelList; + } + +} diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecRoleMenuRelServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecRoleMenuRelServiceImpl.java new file mode 100644 index 0000000..c873b5b --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecRoleMenuRelServiceImpl.java @@ -0,0 +1,53 @@ +package com.hfkj.service.sec.impl; + +import com.hfkj.dao.SecRoleMenuRelMapper; +import com.hfkj.entity.SecRoleMenuRel; +import com.hfkj.entity.SecRoleMenuRelExample; +import com.hfkj.service.sec.SecRoleMenuRelService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @className: SecRoleMenuRelServiceImpl + * @author: HuRui + * @date: 2024/4/1 + **/ +@Service("secRoleMenuRel") +public class SecRoleMenuRelServiceImpl implements SecRoleMenuRelService { + + @Resource + private SecRoleMenuRelMapper secRoleMenuRelMapper; + + @Override + public void batchAdd(List dataList) { + secRoleMenuRelMapper.batchAdd(dataList); + } + + @Override + public void delete(Long relId) { + secRoleMenuRelMapper.deleteByPrimaryKey(relId); + } + + @Override + public void deleteByRole(Long roleId) { + SecRoleMenuRelExample example = new SecRoleMenuRelExample(); + example.createCriteria().andRoleIdEqualTo(roleId); + secRoleMenuRelMapper.deleteByExample(example); + } + + @Override + public List getRelListByRole(Long roleId) { + SecRoleMenuRelExample example = new SecRoleMenuRelExample(); + example.createCriteria().andRoleIdEqualTo(roleId); + return secRoleMenuRelMapper.selectByExample(example); + } + + @Override + public List getRelListByMenu(Long menuId) { + SecRoleMenuRelExample example = new SecRoleMenuRelExample(); + example.createCriteria().andMenuIdEqualTo(menuId); + return secRoleMenuRelMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/sec/impl/SecRoleServiceImpl.java b/service/src/main/java/com/hfkj/service/sec/impl/SecRoleServiceImpl.java new file mode 100644 index 0000000..43b0e1c --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecRoleServiceImpl.java @@ -0,0 +1,71 @@ +package com.hfkj.service.sec.impl; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.dao.SecRoleMapper; +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecRoleExample; +import com.hfkj.service.sec.SecRoleService; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @className: SecRoleServiceImpl + * @author: HuRui + * @date: 2024/3/26 + **/ +@Service("secRoleService") +public class SecRoleServiceImpl implements SecRoleService { + + @Resource + private SecRoleMapper secRoleMapper; + + @Override + public void editData(SecRole role) { + role.setUpdateTime(new Date()); + if (role.getId() == null) { + role.setCreateTime(new Date()); + secRoleMapper.insert(role); + } else { + secRoleMapper.updateByPrimaryKey(role); + } + } + + @Override + public void delete(Long roleId) { + // 查询角色 + SecRole secRole = getDetail(roleId); + if (secRole == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到数据"); + } + secRole.setStatus(0); + editData(secRole); + } + + @Override + public SecRole getDetail(Long roleId) { + return secRoleMapper.selectByPrimaryKey(roleId); + } + + @Override + public List getList(Map param) { + SecRoleExample example = new SecRoleExample(); + SecRoleExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(0); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "roleName"))) { + criteria.andRoleNameLike("%"+MapUtils.getString(param, "roleName")+"%"); + } + + example.setOrderByClause("create_time desc"); + return secRoleMapper.selectByExample(example); + } + + +} 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 new file mode 100644 index 0000000..e47075a --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserLoginLogServiceImpl.java @@ -0,0 +1,98 @@ +package com.hfkj.service.sec.impl; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.utils.AliyunService; +import com.hfkj.common.utils.RequestUtils; +import com.hfkj.dao.SecUserLoginLogMapper; +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 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: SecUserLoginLogServiceImpl + * @author: HuRui + * @date: 2024/4/3 + **/ +@Service("secUserLoginLogService") +public class SecUserLoginLogServiceImpl implements SecUserLoginLogService { + + @Resource + private SecUserLoginLogMapper secUserLoginLogMapper; + + @Override + public void create(SecUserLoginLog userLoginLog) { + userLoginLog.setCreateTime(new Date()); + secUserLoginLogMapper.insert(userLoginLog); + } + + @Override + public void asyncCreateLog(SecUser user, HttpServletRequest request) { + // 创建一个单线程的线程池 + ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(); + // 异步记录登录信息 + singleThreadExecutor.submit(new Runnable() { + @Override + public void run() { + SecUserLoginLog loginLog = new SecUserLoginLog(); + loginLog.setUserId(user.getId()); + loginLog.setUserLoginName(user.getLoginName()); + 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) { + SecUserLoginLogExample example = new SecUserLoginLogExample(); + SecUserLoginLogExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(param, "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(param, "userId")); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "userLoginName"))) { + criteria.andUserLoginNameEqualTo(MapUtils.getString(param, "userLoginName")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + return secUserLoginLogMapper.selectByExample(example); + } + + +} 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 new file mode 100644 index 0000000..6b8633d --- /dev/null +++ b/service/src/main/java/com/hfkj/service/sec/impl/SecUserServiceImpl.java @@ -0,0 +1,178 @@ +package com.hfkj.service.sec.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.MD5Util; +import com.hfkj.dao.SecUserMapper; +import com.hfkj.entity.SecMenu; +import com.hfkj.entity.SecRole; +import com.hfkj.entity.SecUser; +import com.hfkj.entity.SecUserExample; +import com.hfkj.model.MenuTreeModel; +import com.hfkj.model.SecUserSessionObject; +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 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: SecUserServiceImpl + * @author: HuRui + * @date: 2024/3/26 + **/ +@Service("secUserService") +public class SecUserServiceImpl implements SecUserService { + + @Resource + private SecUserMapper secUserMapper; + @Resource + private UserCenter userCenter; + @Resource + private SecUserLoginLogService secUserLoginLogService; + @Resource + private SecRoleService secRoleService; + @Resource + private SecMenuService secMenuService; + + @Override + public void editUser(SecUser data) { + data.setUpdateTime(new Date()); + if (data.getId() == null) { + data.setCreateTime(new Date()); + secUserMapper.insert(data); + } else { + secUserMapper.updateByPrimaryKey(data); + } + } + + @Override + public void resetPwd(Long userId) throws Exception { + // 查询账户 + SecUser secUser = getDetail(userId); + if (secUser == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未知的账户"); + } + secUser.setPassword(MD5Util.encode("123456".getBytes())); + editUser(secUser); + } + + @Override + public SecUser getDetail(Long id) { + return secUserMapper.selectByPrimaryKey(id); + } + + @Override + public SecUser getDetail(SecUserObjectTypeEnum objectType, Long objectId) { + SecUserExample example = new SecUserExample(); + example.createCriteria() + .andObjectTypeEqualTo(objectType.getCode()) + .andObjectIdEqualTo(objectId) + .andStatusNotEqualTo(SecUserStatusEnum.status0.getCode()); + List list = secUserMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public SecUser getDetailByLoginName(String loginName) { + SecUserExample example = new SecUserExample(); + example.createCriteria().andLoginNameEqualTo(loginName).andStatusNotEqualTo(SecUserStatusEnum.status0.getCode()); + List list = secUserMapper.selectByExample(example); + if (!list.isEmpty()) { + return list.get(0); + } + return null; + } + + @Override + public List getList(Map param) { + SecUserExample example = new SecUserExample(); + SecUserExample.Criteria criteria = example.createCriteria().andStatusNotEqualTo(SecUserStatusEnum.status0.getCode()); + + if (StringUtils.isNotBlank(MapUtils.getString(param, "userName"))) { + criteria.andUserNameLike("%"+MapUtils.getString(param, "userName")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "loginName"))) { + criteria.andLoginNameLike("%"+MapUtils.getString(param, "loginName")+"%"); + } + + if (StringUtils.isNotBlank(MapUtils.getString(param, "telephone"))) { + criteria.andTelephoneLike("%"+MapUtils.getString(param, "telephone")+"%"); + } + + if (MapUtils.getInteger(param, "objectType") != null) { + criteria.andObjectTypeEqualTo(MapUtils.getInteger(param, "objectType")); + } + + if (MapUtils.getInteger(param, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(param, "status")); + } + + example.setOrderByClause("create_time desc"); + List list = secUserMapper.selectByExample(example); + for (SecUser user : list) { + user.setPassword(null); + } + return list; + } + + @Override + public SessionObject login(String loginName, String password) throws Exception { + // 查询用户 + SecUser user = getDetailByLoginName(loginName); + if (user == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户不存在"); + } + if (!user.getStatus().equals(SecUserStatusEnum.status1.getCode())) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录失败!当前账户已被禁用"); + } + if (!user.getPassword().equals(MD5Util.encode(password.getBytes()))) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录密码错误"); + } + user.setPassword(null); + + // 查询账户角色 + SecRole role = secRoleService.getDetail(user.getRoleId()); + if (role == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "登录账户角色不存在,请联系管理员进行分配"); + } + // 角色菜单 + List menuTree = secMenuService.queryMenuTree(role.getId()); + // 角色按钮 + List button = secMenuService.queryRoleMenu(role.getId(), SecMenuTypeEnum.type2); + + // token 生成格式:账户id + 时间戳 + String token = AESEncodeUtil.aesEncrypt(user.getId()+"_"+System.currentTimeMillis(), "O8gTZ6wIovDPjhsaz0zAoqZmm3jtjIcO"); + + SessionObject sessionObject = new SessionObject(token, new SecUserSessionObject(user, role, menuTree, button)); + userCenter.save(sessionObject); + + // 异步记录登录信息 + secUserLoginLogService.asyncCreateLog(user, (HttpServletRequest) RequestContextHolder.getRequestAttributes().resolveReference(RequestAttributes.REFERENCE_REQUEST)); + + return sessionObject; + } + + +} diff --git a/service/src/main/java/com/hfkj/sysenum/DeviceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/DeviceTypeEnum.java new file mode 100644 index 0000000..475b822 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/DeviceTypeEnum.java @@ -0,0 +1,43 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 设备类型 + * @author hurui + */ +public enum DeviceTypeEnum { + type1(1 , "商鹏云打印"), + ; + + private Integer type; + private String name; + + DeviceTypeEnum(int type , String name) { + this.type = type; + this.name = name; + } + + public static String getNameByType(Integer type) { + for (DeviceTypeEnum ele : values()) { + if(Objects.equals(type,ele.getType())) return ele.getName(); + } + return null; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/DiscountStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/DiscountStatusEnum.java new file mode 100644 index 0000000..ae4d58c --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/DiscountStatusEnum.java @@ -0,0 +1,46 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 优惠券状态 + * @author hurui + */ +public enum DiscountStatusEnum { + status0(0 , "删除"), + status1(1 , "编辑中"), + status2(2 , "已上线"), + status3(3 , "已结束"), + ; + + private Integer code; + private String name; + + DiscountStatusEnum(int code , String name) { + this.code = code; + this.name = name; + } + + public static String getNameByType(Integer code) { + for (DiscountStatusEnum ele : values()) { + if(Objects.equals(code,ele.getCode())) return ele.getName(); + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/DiscountStockCodeStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/DiscountStockCodeStatusEnum.java new file mode 100644 index 0000000..ca4ebb6 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/DiscountStockCodeStatusEnum.java @@ -0,0 +1,46 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 优惠券code状态 + * @author hurui + */ +public enum DiscountStockCodeStatusEnum { + status0(0 , "删除"), + status1(1 , "未领取"), + status2(2 , "未使用"), + status3(3 , "已使用"), + ; + + private Integer code; + private String name; + + DiscountStockCodeStatusEnum(int code , String name) { + this.code = code; + this.name = name; + } + + public static String getNameByType(Integer code) { + for (DiscountStockCodeStatusEnum ele : values()) { + if(Objects.equals(code,ele.getCode())) return ele.getName(); + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/DiscountTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/DiscountTypeEnum.java new file mode 100644 index 0000000..996c4ba --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/DiscountTypeEnum.java @@ -0,0 +1,45 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 优惠券状态 + * @author hurui + */ +public enum DiscountTypeEnum { + type1(1 , "满减"), + type2(2 , "抵扣"), + type3(3 , "折扣"), + ; + + private Integer code; + private String name; + + DiscountTypeEnum(int code , String name) { + this.code = code; + this.name = name; + } + + public static String getNameByType(Integer code) { + for (DiscountTypeEnum ele : values()) { + if(Objects.equals(code,ele.getCode())) return ele.getName(); + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/DiscountUseScopeEnum.java b/service/src/main/java/com/hfkj/sysenum/DiscountUseScopeEnum.java new file mode 100644 index 0000000..81d79ba --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/DiscountUseScopeEnum.java @@ -0,0 +1,44 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 优惠券状态 + * @author hurui + */ +public enum DiscountUseScopeEnum { + type1(1 , "加油"), + type2(2 , "商城"), + ; + + private Integer code; + private String name; + + DiscountUseScopeEnum(int code , String name) { + this.code = code; + this.name = name; + } + + public static String getNameByType(Integer code) { + for (DiscountUseScopeEnum ele : values()) { + if(Objects.equals(code,ele.getCode())) return ele.getName(); + } + return null; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/GasOilPriceStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/GasOilPriceStatusEnum.java new file mode 100644 index 0000000..79c9c5b --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/GasOilPriceStatusEnum.java @@ -0,0 +1,49 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * @className: GasOilPriceStatusEnum + * @author: HuRui + * @date: 2024/3/5 + **/ +public enum GasOilPriceStatusEnum { + status0(0, "删除"), + status1(1, "正常"), + status2(2, "禁用"), + ; + + private Integer number; + + private String name; + + GasOilPriceStatusEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static GasOilPriceStatusEnum getNameByType(Integer type) { + for (GasOilPriceStatusEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/GasOilPriceTaskExecutionTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/GasOilPriceTaskExecutionTypeEnum.java new file mode 100644 index 0000000..187d916 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/GasOilPriceTaskExecutionTypeEnum.java @@ -0,0 +1,49 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * 任务执行方式 + * @className: GasOilPriceStatusEnum + * @author: HuRui + * @date: 2024/3/15 + **/ +public enum GasOilPriceTaskExecutionTypeEnum { + type1(1, "立刻执行"), + type2(2, "定时执行"), + ; + + private Integer number; + + private String name; + + GasOilPriceTaskExecutionTypeEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static GasOilPriceTaskExecutionTypeEnum getNameByType(Integer type) { + for (GasOilPriceTaskExecutionTypeEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/GasTaskExecutionTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/GasTaskExecutionTypeEnum.java new file mode 100644 index 0000000..c15952c --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/GasTaskExecutionTypeEnum.java @@ -0,0 +1,35 @@ +package com.hfkj.sysenum; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskExecutionTypeEnum { + type1(1 , "立刻执行"), + type2(2 , "定时执行"), + ; + + private Integer status; + private String name; + + GasTaskExecutionTypeEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/GasTaskPriceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/GasTaskPriceTypeEnum.java new file mode 100644 index 0000000..2639ee8 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/GasTaskPriceTypeEnum.java @@ -0,0 +1,37 @@ +package com.hfkj.sysenum; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskPriceTypeEnum { + type1(1 , "国标价"), + type2(2 , "油站价"), + type3(3 , "平台优惠"), + type4(4 , "油站直降"), + ; + + private Integer status; + private String name; + + GasTaskPriceTypeEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/GasTaskStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/GasTaskStatusEnum.java new file mode 100644 index 0000000..efb223a --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/GasTaskStatusEnum.java @@ -0,0 +1,36 @@ +package com.hfkj.sysenum; + +/** + * 加油站价格任务 + * @author hurui + */ +public enum GasTaskStatusEnum { + status0(0 , "删除"), + status1(1 , "等待中"), + status2(2 , "已执行"), + ; + + private Integer status; + private String name; + + GasTaskStatusEnum(int status , String name) { + this.status = status; + this.name = name; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeStatusEnum.java new file mode 100644 index 0000000..8955c0d --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeStatusEnum.java @@ -0,0 +1,49 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * @className: MerchantStatusEnum + * @author: HuRui + * @date: 2024/3/4 + **/ +public enum MerchantQrCodeStatusEnum { + status0(0, "删除"), + status1(1, "正常"), + status2(2, "禁用"), + ; + + private Integer number; + + private String name; + + MerchantQrCodeStatusEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static MerchantQrCodeStatusEnum getNameByType(Integer type) { + for (MerchantQrCodeStatusEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeTypeEnum.java new file mode 100644 index 0000000..261cd54 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/MerchantQrCodeTypeEnum.java @@ -0,0 +1,49 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * @className: MerchantStatusEnum + * @author: HuRui + * @date: 2024/3/4 + **/ +public enum MerchantQrCodeTypeEnum { + type1(1, "综合二维码"), + type2(2, "加油二维码"), + type3(3, "商城二维码"), + ; + + private Integer number; + + private String name; + + MerchantQrCodeTypeEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static MerchantQrCodeTypeEnum getNameByType(Integer type) { + for (MerchantQrCodeTypeEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/MerchantStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/MerchantStatusEnum.java new file mode 100644 index 0000000..c31cb0a --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/MerchantStatusEnum.java @@ -0,0 +1,49 @@ +package com.hfkj.sysenum; + +import java.util.Objects; + +/** + * @className: MerchantStatusEnum + * @author: HuRui + * @date: 2024/3/4 + **/ +public enum MerchantStatusEnum { + status0(0, "删除"), + status1(1, "正常"), + status2(2, "禁用"), + ; + + private Integer number; + + private String name; + + MerchantStatusEnum(int number, String name) { + this.number = number; + this.name = name; + } + + public static MerchantStatusEnum getNameByType(Integer type) { + for (MerchantStatusEnum ele : values()) { + if (Objects.equals(type,ele.getNumber())) { + return ele; + } + } + return null; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java new file mode 100644 index 0000000..1aa9b97 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/SecMenuTypeEnum.java @@ -0,0 +1,47 @@ +package com.hfkj.sysenum; + +/** + * 菜单类型 + * @className: SecMenuTypeEnum + * @author: HuRui + * @date: 2024/4/2 + **/ +public enum SecMenuTypeEnum { + + /** + * 菜单 + */ + type1(1, "菜单"), + + /** + * 按钮 + */ + type2(2, "按钮"), + ; + + private int code; + + private String name; + + + SecMenuTypeEnum(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; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java new file mode 100644 index 0000000..a7174dd --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/SecUserLoginLogStatusEnum.java @@ -0,0 +1,46 @@ +package com.hfkj.sysenum; + +/** + * 登录日志状态 + * @className: SecUserLoginLogStatusEnum + * @author: HuRui + * @date: 2024/4/3 + **/ +public enum SecUserLoginLogStatusEnum { + /** + * 正常 + */ + status1(1, "正常"), + + /** + * 风险 + */ + status2(2, "风险"), + ; + + private int code; + + private String name; + + + SecUserLoginLogStatusEnum(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; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java new file mode 100644 index 0000000..70b811e --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/SecUserObjectTypeEnum.java @@ -0,0 +1,47 @@ +package com.hfkj.sysenum; + +/** + * 账户类型 + * @className: SecUserObjectTypeEnum + * @author: HuRui + * @date: 2024/4/23 + **/ +public enum SecUserObjectTypeEnum { + + /** + * 系统账户 + */ + type1(1, "系统账户"), + + /** + * 商户 + */ + type2(2, "商户"), + ; + + private int code; + + private String name; + + + SecUserObjectTypeEnum(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; + } +} diff --git a/service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java b/service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java new file mode 100644 index 0000000..5796eb5 --- /dev/null +++ b/service/src/main/java/com/hfkj/sysenum/SecUserStatusEnum.java @@ -0,0 +1,52 @@ +package com.hfkj.sysenum; + +/** + * 系统用户状态 + * @className: SecUserStatusEnum + * @author: HuRui + * @date: 2024/3/26 + **/ +public enum SecUserStatusEnum { + + /** + * 删除 + */ + status0(0, "删除"), + + /** + * 正常 + */ + status1(1, "正常"), + + /** + * 禁用 + */ + status2(2, "禁用"), + ; + + private int code; + + private String name; + + + SecUserStatusEnum(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; + } +} diff --git a/service/src/main/resources/dev/commonConfig.properties b/service/src/main/resources/dev/commonConfig.properties new file mode 100644 index 0000000..e69de29 diff --git a/service/src/main/resources/pre/commonConfig.properties b/service/src/main/resources/pre/commonConfig.properties new file mode 100644 index 0000000..e69de29 diff --git a/service/src/main/resources/prod/commonConfig.properties b/service/src/main/resources/prod/commonConfig.properties new file mode 100644 index 0000000..e69de29