zoukankan      html  css  js  c++  java
  • 关于Date

    1.java DateUtil工具包可将"Wed, 21 Dec 2022 14:20:00 GMT"格式的字符串专程Date类型:

    Date expiration = DateUtil.parseRfc822Date("Wed, 21 Dec 2022 14:20:00 GMT");

    2.mysql有now()之类的函数

    mysql还有ON DUPLICATE KEY触发器

    @SQL("INSERT INTO $T_ORDER_EXTEND (order_id, IMEI_extend) values ( :1, :2) ON DUPLICATE KEY UPDATE IMEI_extend = :2 , update_time = :3")
    int updateIMEIExtendCode(Integer orderId, Long IMEIExtendCode, String date);

    3.过期时间

    private final Long cacheTime = 60 * 60 * 1000 * 4L;
    private Long initTime = 0L;
    
    private void refreshDictionary() {
            Long nowTime = System.currentTimeMillis();
            if (nowTime >= initTime) {
                initTime = nowTime + cacheTime;
                List<CardDictionary> list = dictionaryMapper.getAll();
                if (CollectionUtils.isNotEmpty(list)) {
                    for (CardDictionary card : list) {
                        cardNoAndName.put(card.getCardNo()+"_"+card.getCardName(), card.getCardName());
                    }
                }
            }
        }

    每次查询都先refreshDictionary()

    4.Java8 LocalDateTime

    http://blog.csdn.net/u011277123/article/details/53665028


    LocalDateTime 与 Date的转换
    https://www.cnblogs.com/exmyth/p/6425878.html

  • 相关阅读:
    vuex 命名空间
    vue-touchjs
    Jackson最简单用法
    Bootstrap登录样式
    Left/Right/Inner Join用法和区别
    VS2015安装提示出现“安装包丢失或损坏”解决方法
    HTML之禁止输入文本
    jQuery之call()方法的使用
    jQuery操作cookie
    jQuery常用的查找Dom元素方法
  • 原文地址:https://www.cnblogs.com/peanutk/p/8494087.html
Copyright © 2011-2022 走看看