摘要: MONTH(20210101) --> 截取月份 LPAD(参数, 总长度, 补什么) --> 填充字符串左边 LPAD(123, 5, 0) --> 00123 LPAD(MONTH(20210101), 2, 0) --> 01 阅读全文
posted @ 2021-07-27 17:18 仲秋呀 阅读(624) 评论(0) 推荐(1)
摘要: /** * @Description : 把byte转化为KB、MB、GB **/ public static String getNetFileSizeDescription(long size) { StringBuffer bytes = new StringBuffer(); Decimal 阅读全文
posted @ 2021-07-23 14:37 仲秋呀 阅读(1469) 评论(0) 推荐(0)
摘要: /** * 相对时间 * @param date 传入时间 与 当前时间做比较 返回相差的日期 > 相对时间 * @return */ public static String dateToRelativeTime(Date date){ SimpleDateFormat df = new Simp 阅读全文
posted @ 2021-07-23 14:35 仲秋呀 阅读(134) 评论(0) 推荐(0)
摘要: /** * 返回 天 时 分 秒 * @param date 传入时间 与 当前时间做比较 返回相差的日期 > 返回 天 时 分 秒 * @return */ public static String dateToDayHourMinuteSecond(Date date){ SimpleDateF 阅读全文
posted @ 2021-07-23 14:35 仲秋呀 阅读(73) 评论(0) 推荐(0)
摘要: 下方 这个是 传入 String类型 /** * 8位数字日期格式 转换成带 "-" 的格式化 20210701 --> 2021-07-01 * @param number * @return */ public static String numberToDateFormat(String nu 阅读全文
posted @ 2021-07-23 14:33 仲秋呀 阅读(743) 评论(0) 推荐(0)
摘要: /** * divisor 除数 * dividend 被除数 */ public String getPercentage() { int v = (int) ((new BigDecimal((float) divisor / dividend ).setScale(2, BigDecimal. 阅读全文
posted @ 2021-04-23 17:20 仲秋呀 阅读(70) 评论(0) 推荐(0)
摘要: 在DML中 , 模糊查询用 LIKE '%' 实现 , 那么在Mybatis中怎么去实现呢? 一顿操作猛如虎 , 敲出以下代码 : 1 <select id='test'> 2 SELECT 3 * 4 FROM 5 test 6 WHERE 7 test_name LIKE %{test_name 阅读全文
posted @ 2021-01-25 14:40 仲秋呀 阅读(70) 评论(0) 推荐(0)