2020
11-11
11-11
shell语言date的用法实例
今天没干什么正事儿,都开了会了,写点儿关于shell脚本语言的知识吧,这个也是前两天完成一个业务方的需求的时候使用到的方法,分享出来,希望对大家有点用吧。 首先,我们来看,date函数在shell中一般是怎么用的。这种最常见的,就是在脚本中需要输出日志的时候,打印日志的生成时间,而打印的方法,我比较习惯于使用下面的方法:LOG_FILE="/var/log/script.log"exec2>>${LOG_FILE}functionmy_l...
继续阅读 >
在今天的一次代码编写中,突然遇到了一个奇怪的问题,在使用mybatis进行Date类型插入时,可以很顺利的就插入进数据库中了,可是当我想从mysql中取出Date类型的值注入java中的Date类型时,发现传递过来的值是空的,但是不管是映射还是命名规范都是正确的,就非常的奇怪。数据库设计:映射类的设计:@DatapublicclassBorrowTime{//借书时间privateDateborrowTime;//过期时间privateDateexpiredTime;}mapper类:@Select("...
#Repositoryimporttest.demo.domain.entity.TestEntity;importorg.springframework.data.jpa.repository.support.JpaRepositoryImplementation;importorg.springframework.stereotype.Repository;@RepositorypublicinterfaceTestEntityRepositoryextendsJpaRepositoryImplementation<TestEntity,Integer>{}#Serviceimportorg.springframework.validation.annotation.Validated;importjavax.validation.constraints.NotBl...