1、使用mybatis的selectList方法,如果数据表中没有数据返回,则返回空集合[ ],而不会返回null,这是mybatis作的封装
@Override public List<ContactInfoEntity> getContactInfoListByRegistId(Long registId) { return getSqlSession().selectList("ContactInfo.getContactInfoListByRegistId", registId); }
2、使用mybatis的selectOne方法,如果数据表中没有数据返回,则返回null
@Override public CustomerEntity getCustomerByCustomerNo(String customerNo)