自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(25)
  • 收藏
  • 关注

原创 痘痘人生

讲一件不开心的事情,这件事情断断续续的影响着我,长达十几年之久,到现在来说,依然可以让我憋不住发起火来。小学五六年级的时候,不经意间脸上就会冒起来一个小痘痘,而当时并没有意识到,痘痘会越长越多,无可救药的疯长,我从来没有想过,它要伴随我整个青春时光[泪][泪][泪] 后来到了初中一年级的时候,在印象里痘痘已经遍布满脸了,我突然意识到这个问题的时候会惊慌的不知所措,然后...

2020-04-10 22:34:28 301

原创 Elastic-Job + Spring Boot 分布式定时作业

1.概念Elastic-job 是由当当网基于quartz 二次开发之后的分布式调度解决方案 , 由两个相对独立的子项目Elastic-Job-Lite和Elastic-Job-Cloud组成 。Elastic-job主要的设计理念是无中心化的分布式定时调度框架,思路来源于Quartz的基于数据库的高可用方案。但数据库没有分布式协调功能,所以在高可用方案的基础上增加了弹性扩容和数据分片的思路...

2020-04-06 16:29:46 735

原创 Mybatis Plus 逆向工程生成mapper、model、service、controller

package com.ftvalue.poppy;import com.baomidou.mybatisplus.annotation.DbType;import com.baomidou.mybatisplus.generator.AutoGenerator;import com.baomidou.mybatisplus.generator.InjectionConfig;impor...

2019-03-10 10:48:08 1186

原创 Mybatis的Example进行Oracle分页查询

首先在生成的Example类中增加分页变量,并且添加get/set方法: 修改Example查询语句,原有的selectByExample方法不要改,复制一下另外命名: 

2019-01-30 16:45:31 532

原创 Mysql/Oracle按日期查询无法获取到结束日期数据的解决办法

通常按照时间段查询的方法有两种(数据库时间字段为DATE等非字符串类型):将传入的时间参数转换为date类型:to_date()函数,例如: to_date(#{startDate},'yyyy-mm-dd hh24:mi:ss') 将数据库的时间字段转换为字符串类型:to_char()函数,例如: to_char(TRADE_DATE, 'yyyy-mm-dd') 解决办法...

2019-01-30 16:35:13 736

原创 简单高效的JAVA日期处理工具类 -- 日期时间加减,大小比较

package com.game.admin.util;import org.joda.time.DateTime;import org.joda.time.format.DateTimeFormat;import org.joda.time.format.DateTimeFormatter;import java.text.ParseException;import java.t...

2019-01-30 16:18:55 2360 1

原创 非常实用的BigDecimal加减乘除、大小比较工具类

package com.game.admin.util;import java.math.BigDecimal;import java.math.RoundingMode;public class BigDecimalUtils { /** * 小数的精度 */ private static int precision = 2; /* ...

2019-01-30 16:16:06 1194 1

原创 druid-1.0.29数据源导致报错“connect holder is null”

首先这个报错是因为应用的数据库连接长时间空闲,导致数据库把连接断掉了,但是应用的连接池认为该连接仍然有效,所以继续使用该连接时就会拿不到connect,就会报“connect holder is null”的错误 由于我们公司的mysql数据库的wait_timeout设置的时间比较短,所以当应用数据量上去的时候,也会出现“connect holder is null”的错误 综上所述:有两个...

2018-10-26 14:32:01 2623 1

原创 Redis+spring boot

1.配置文件:redis: database: 0 host: //redisIp port: 16376 password: ifValue@QA-Redis888@666 timeout: 30000 pool: max-active: 50 max-wait: 1000 max-idle: 10 ...

2018-03-14 16:42:04 176

原创 Mybatis 一对多 多对一查询实例

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="com.ftvalu

2018-03-14 16:33:27 206

转载 mybatis注解映射SQL

注解@Insert @Update @Select @ Delete举例说明注解的用法:public interface StudentMapper{ @Insert("insert into student (stud_id, name, email, addr_id, phone)values(#{studId},#{name},#{email},#{address.addrId}...

2018-03-14 16:18:28 251

原创 spring- boot 发送邮件接口+freemarker视图模板引擎

1.创建模板引擎服务:package com.ftvalue.customer.service;import freemarker.cache.ClassTemplateLoader;import freemarker.cache.TemplateLoader;import freemarker.template.Configuration;import freemarker.templat

2017-12-22 14:20:21 1194

原创 解决spring-boot项目中无法读取yml配置文件属性问题

1.创建Config:package com.ftvalue.customer.config;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Configuration;/** * Created by 郝丹辉 on 2017/9/20

2017-12-22 14:12:38 10392

原创 Spring-boot +Gradle依赖管理+Mybatis 配置文件

task wrapper(type: Wrapper) { gradleVersion = '3.5'}buildscript { ext { springBootVersion = '1.5.6.RELEASE' } repositories { mavenCentral() } dependencies {

2017-12-22 14:02:19 2135

原创 Spring-Boot Log4j配置文件

<?xml version="1.0" encoding="UTF-8"?><Configuration> <Properties> <Property name="logPath">/opt/logs/accounting</Property> </Properties> <Appenders> <Console name="Console

2017-12-22 13:58:42 379

原创 开发API必备神器---ApiDoc的使用

在开发后台接口的过程中,我们肯定要提供一份api接口文档给终端app。目前大多数的app的接口请求应该都是http+json的方式。 但是一直苦于做不出份漂亮的api文档,用word写,也太丑了。。怎么才能做出一份像腾讯、新浪微博等各种开放api平台那样漂亮的api文档呢?找了好久发现了今天的主角-apidoc。官网地址:http://apidocjs.com开放API已经成为当下主流平台的一个要素

2017-12-22 11:25:29 3789 2

原创 Spring-boot -- 配置文件

#端口号配置server: port: 19012 tomcat: uri-encoding: UTF-8#日志配置logging: config: classpath:log4j2.xml level: org: springframework: web: INFO#Mybatis配置Mapper扫描路径mybatis: map

2017-12-14 14:30:07 232

原创 基础工具---校验密码规则

校验密码长度为8-20位,必须由字母数字和特殊符号组成:public static boolean checkPassStrength(String pwd) { String reg = "^(?=.*[a-zA-Z])(?=.*\\d)(?=.*[#@!~%^&*])[a-zA-Z\\d#@!~%^&*].{7,19}$"; Pattern r = Pattern

2017-12-14 11:58:38 686

原创 基础工具---解决中文乱码(HTTP中文乱码)

package com.ftvalue.customer.util;import org.springframework.http.HttpInputMessage;import org.springframework.http.HttpOutputMessage;import org.springframework.http.MediaType;import org.springframew

2017-12-14 11:56:19 966

原创 基础工具---SHA1加密

private static final char[] HEX_DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'}; /** * Takes the raw bytes from the digest and formats them

2017-12-14 11:53:20 165

原创 基础工具---MD5加密

public static String md5(byte[] data) { MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { e.

2017-12-14 11:52:12 123

原创 基础工具---获取自定义长度随机数

/***纯数字随机数*/public static String createRandom( int length) { String retStr = ""; String strTable = "1234567890"; int len = strTable.length(); boolean bDone = true;

2017-12-14 11:50:54 330

原创 金额---元转分

/** * 功能描述:金额字符串转换:单位元转成单分 * * @param s 传入需要转换的金额字符串 * @return 转换后的金额字符串 */ public static String yuanToFen(String s) { if (StringUtils.isBlank(s)) { ret

2017-12-14 11:47:57 248

原创 基础工具类---HTTP协议

package com.ftvalue.customer.util;/** *HttpUtil.java */import lombok.extern.slf4j.Slf4j;import org.apache.http.HttpHeaders;import org.springframework.http.HttpEntity;import org.springframework.http

2017-12-14 11:46:11 270

原创 基础工具类--时间日期处理

一、日期的加减:SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd") Calendar calendar = Calendar.getInstance() params.effectiveStartDate = sdf.format(calendar.getTime())

2017-12-13 15:39:21 137

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除