- 博客(1)
- 收藏
- 关注
原创 当传入参数类型是Int时且传值为0时 mybatis会自动将0改为空串
问题描述: mybatis Integer值或Long值传0问题 mybatis将传入的Integer类型或Long类型的0识别成空字符串的问题 传0无效 例子: and role=${pd.role} 当把role为integer类型 role=0 时没进条件。 因此可以理解为 and role=${pd.role} 解决方法 1:把integer类型改为int类型或String类型 2:值判断不为空就行 and role=${pd.role} 3:使用增强版的判断 <if test=“
2020-09-22 15:59:25 383
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人