刚开始玩mysql if条件等于具体值 的判断

mysql等于具体某值的判断时,要加上.toString()函数

 <if test="dataSort !=null and dataSort !='' and dataSort =='1'.toString()">
          order by  price asc
      </if>
  <if test="dataSort == null or dataSort =='0'.toString()">
          order by  addtime desc
  </if>

猜你喜欢

转载自qieyi28.iteye.com/blog/2256581