- 博客(5)
- 收藏
- 关注
原创 MyBatis在字段返回为null不返回字段
在用mybatis时没有用实体作为返回(用的是Map) 因此出现了 在返回参数为null的时候 不会返回字段,出现情况:在移动端get一个空的字段就会报NullPointerException;解决方案:在mybatis-config.xml中配置 <settings> <setting name="cacheEnabled" value="true"/>
2016-11-21 17:06:10 11307 2
原创 SQL:将统计出来的结果进行名次排序
SELECT id, read_total,( SELECT COUNT(read_total) FROM t_circle_topic WHERE ct.read_total <= read_total ) AS rankFROM t_circ
2016-11-18 11:39:07 12233
原创 MYSQL统计一周,一个月的数据
统计一周select * from `表名`ct where week(`时间字段`) = week(now()) ORDER BY 我的例子:select * from t_circle_topic ct where week(ct.create_time) = week(now()) ORDER BY ct.create_time DESC;统计一个月select * from `表名`wh
2016-11-18 10:41:59 8255
原创 工具类
常用工具类的收集 /** * 根据出生日期计算年龄 * * @param strBirthDate(yyyy-mm-dd or yyyy/mm/dd) * @return */ public static String getPersonAgeByBirthDate(Date dateBirthDate){
2016-11-03 11:35:11 211
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人