zoukankan      html  css  js  c++  java
  • mysql中,数据库字段为时间戳转时间的处理方法

    //上个界面传过来的时间,可能是一个时间段,可能是当天
    String startTime = ctr.getPara("startDate").replaceAll(" ","");
    String endTime = ctr.getPara("endDate").replaceAll(" ","");
    if (StringUtils.notBlank(startTime) && StringUtils.notBlank(endTime) ){
    //线上
    onlineWhere +=" AND FROM_UNIXTIME( a.claim_time / 1000, '%Y-%m-%d' ) >= '"+startTime+"' " +
    " AND FROM_UNIXTIME( a.claim_time / 1000, '%Y-%m-%d' ) <= '"+endTime+"'" ;
    //准入
    admittanceWhere +=" AND FROM_UNIXTIME( a.claim_time / 1000, '%Y-%m-%d' ) >= '"+startTime+"' " +
    " AND FROM_UNIXTIME( a.claim_time / 1000, '%Y-%m-%d' ) <= '"+endTime+"' " ;
    }else {
    //线上
    onlineWhere += " and FROM_UNIXTIME(a.claim_time/1000,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') " ;
    //准入
    admittanceWhere += " and FROM_UNIXTIME(a.claim_time/1000,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d') " ;
    }
  • 相关阅读:
    全表扫描
    服务器信息表
    事务的丢失更新
    oracle core 概述
    oracle命中率模型计算
    性能量化之cpu
    一个sql导致temp表空间爆掉
    oracle稳定执行计划1
    oracle热点表online rename
    oracle构建一致性读
  • 原文地址:https://www.cnblogs.com/xiaoniuniu886/p/10535139.html
Copyright © 2011-2022 走看看