日常工作积累

来源:互联网 发布:ios游戏 知乎 编辑:程序博客网 时间:2024/06/16 00:26
<!-- 判断当前时间在某一时间段内,包含起始时间 -->
SELECT b.product_id, b.product_name, b.product_price, b.product_level, b.validity, b.commend
, b.product_site, b.publish_date, b.list_top, b.good_product, b.hot_product, b.class_name, b.display_start_date
, b.display_end_date, b.product_no, b.oper_time, b.recommend_product, s.status
, c.cust_name FROM product b LEFT JOIN (SELECT COUNT(t.id) AS STATUS,t.product_id FROM th_product_sku t INNER JOIN product p ON t.product_id = p.product_id 
GROUP BY t.product_id ) s ON s.product_id = b.product_id INNER JOIN company c ON b.cust_id = c.cust_id 
WHERE STR_TO_DATE(DATE_FORMAT(b.display_start_date,'%Y-%m-%d'),'%Y-%m-%d') <= STR_TO_DATE(NOW(),'%Y-%m-%d')
AND  STR_TO_DATE(DATE_FORMAT(b.display_end_date,'%Y-%m-%d'),'%Y-%m-%d') >= STR_TO_DATE(NOW(),'%Y-%m-%d')
AND b.product_type = 0 AND b.display=1 AND 
b.validity =1 AND b.cust_id =100000000002577
<!-- 判断当前时间在某一时间段内,包含起始时间 -->


<!-- jsp中时间格式化 -->
<fmt:formatDate value="${activityapply.createTime}" type="both" pattern="yyyy-MM-dd"></fmt:formatDate>
<!-- jsp中时间格式化 -->


<!-- java中时间格式化 -->
SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dateFormater.format(activityApply.getCreateTime())
<!-- java中时间格式化 -->


<!-- 数据截取固定长度展示 -->
<c:if test="${leavewords.title == 'null' }">
${fn:substring(leavewords.content, 0, 15)}
</c:if>
<c:if test="${leavewords.title == '' }">
${fn:substring(leavewords.content, 0, 15)}
</c:if>
<c:if test="${leavewords.title != 'null' }">
${fn:substring(leavewords.title, 0, 15)}
</c:if>
<!-- 数据截取固定长度展示 -->


<!-- 文本框默认显示,点击不显示,删除再显示 -->
<span><input id="userName_forget" name="" type="text" class="input1" value="请输入您的用户名" onfocus="if (value =='请输入您的用户名'){value =''}" onblur="if (value ==''){value='请输入您的用户名'}" /></span>

<!-- 文本框默认显示,点击不显示,删除再显示 -->


<!-- eclipse报错,解决内存溢出问题 -->
-Xmx1024M -Xms512M -XX:MaxPermSize=256m
<!-- eclipse报错,解决内存溢出问题 -->


<!-- 获得当前时间的拼接字符串 -->
private String getTime() {
Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR); 
int month = c.get(Calendar.MONTH) + 1; 
String monthString = "";
if(month < 10){
monthString = "0" + month;
}else{
monthString = "" + month;
}
int date = c.get(Calendar.DATE);
String dateString = "";
if(date < 10){
dateString = "0" + date;
}else{
dateString = date + "";
}
String timeString = year + monthString + dateString;
return timeString;
}
<!-- 获得当前时间的拼接字符串 -->