在我们SQL中一般支持三种数据类型. date:日历日期,包括年(四位),月和日. time: 一天中的时间,包括小时,分和秒.可以用变量time(p)来表示秒的小数点后的数字位数(默认是0). 通过制定 time with timezone,还可以把时区信息连同时间一起存储. timestamp: date 和 time的组合. 可以用变量timestamp(p)来表示秒的小数点后的数字位数(这里默认值为6).如果指定with timezone,则时区信息也会被存储 日期和时间类型的值可按如下…
1.mybatis判断是否为空或null <if test="type!=null and type!=''"> AND type = #{type} </if> 2.Mybatis中的like查询 今天要做一个模糊查询 用的Mybatis 开始写的是: select id,bookName,author,publisher,donor,status,createDate,lastUpdate from book <where> <if tes…
mybatis.xml中有if判断条件判断参数不为空时,赋值为0的Integer参数被MyBatis判断为空,因此不执行<if test="param != null and param != ''"></if>的SQL. 所以在做项目时一定要注意,用到MyBatis时,避免用0来做值. 解决方法: <if test="status !=null and (status!='' or status == 0)"> AND t1.`…
SELECT @type=t.name, @prec=c.prec FROM sysobjects o JOIN syscolumns c on o.id=c.id JOIN systypes t on c.xusertype=t.xusertype WHERE o.name = @SortTable AND c.name = @SortName…
有时候我们在js中会直接判断变量是否存在值,下面列举一些情况: var a = 0; var b = 1; var c = ' '; var d; console.log( a ? 1 : null); //null console.log( b ? 1 : console.log( c ? 1 : null); //null console.log( d ? 1 : null); //null 上述情况中我们c,d没有值,所以结果是null,但是a的值是0,结果也是null,这里就涉及到一个特…