在MyBatis中,动态SQL标签〈if〉判断String类型的字段是否为空字符串的正确用法是()


在MyBatis中,动态SQL标签〈if〉判断String类型的字段是否为空字符串的正确用法是()

A、〈if test="userName != null and userName != '' "〉〈/if〉

B、〈if test="userName != null userName != '' "〉〈/if〉

C、〈if test="userName != null or userName != '' "〉〈/if〉

D、〈if test="userName != null || userName != '' "〉〈/if〉

正确答案:A


Tag:MyBatis数据持久化框架 字段 字符串 时间:2024-04-20 21:28:40