获取时间后页面展示多了个‘.0’

1:Controller中
if(StringUtils.isNotNullOrEmptyStr(model.getApplyDate())){
model.setApplyDate(model.getApplyDate()+" 00:00:00");//00前面有空格
}
2:对应Mapper.xml中
To_Char(T5.APPLYDATE,“YYYY-MM-DD HH24:MI:SS”) as applyDate ;

这样就可以了。页面中的时间显示就不会多了个“.0”.
当然这是我们公司大佬写的,可能跟各位的不太一样。

后来发现其实Controller中不需要那样做,直接Mapper.xml中转换一下就可以了。

猜你喜欢

转载自blog.csdn.net/little_dream2018/article/details/84525155