mybatis获取前端传过来的值为null

比眉伴天荒 2023-03-02 10:16 109阅读 0赞
  1. <if test="qo.startTime !='' and qo.startTime !=null">
  2. and update_time <![CDATA[ >= ]]> #{qo.startTime,jdbcType=VARCHAR}
  3. </if>
  4. <if test="qo.endTime !='' and qo.endTime !=null">
  5. and update_time <![CDATA[ <= ]]> #{qo.endTime,jdbcType=VARCHAR}
  6. </if>
  7. <if test="qo.endTime ='' and qo.startTime =''>
  8. and update_time > DATE_SUB(now(), INTERVAL 1 month)
  9. </if>

我在获取endTime死活取不到,取到的是null,原因是最下面的判断条件少加了=,判断=null是俩个=,结果我就获取不到值,

但是我把endTime换成startTime就能取到,

mybatis真他娘的是个奇葩!

发表评论

表情:
评论列表 (有 0 条评论,109人围观)

还没有评论,来说两句吧...

相关阅读