美文网首页
接口类UserInfoMapper中方法传对象/参数

接口类UserInfoMapper中方法传对象/参数

作者: 墨色尘埃 | 来源:发表于2017-11-09 15:09 被阅读0次
@Mapper
public interface UserInfoMapper {
    @Insert("INSERT INTO APP_USER (USER_ID,USER_NAME,PASSWORD) values(#{userId},#{userName},#{password})")
    int insertUserInfo(UserInfo userInfo);

    @Insert("INSERT INTO APP_USER (USER_ID,USER_NAME,PASSWORD) values(#{userId},#{userName},#{password})")
    int insertUserInfo(@Param("userId") String userId, @Param("userName") String userName, @Param("password") String password);

}

在java类中使用

    ........
    //方法一:
    UserInfo info = new UserInfo();
    info.setUserName(userId);
    info.setUserId(Integer.toString(nmUser.getZdStaffId()));
    info.setPassword(encoder.encode("567890"));
    userInfoMapper.insertUserInfo(info);

    //方法二:
    userInfoMapper.insertUserInfo(userId, userName, password);

相关文章

  • 接口类UserInfoMapper中方法传对象/参数

    在java类中使用

  • isMemberOfClass和isKindOfClass

    对象调用,参数就需要传类对象class类调用,参数就需要传元类对象meta-class

  • 一阶段day15-01类和对象

    类中方法:对象方法、类方法、静态方法 1、对象方法: a、直接声明在类中b、自带参数selfc、通过对象调用 2、...

  • 将ArrayList集合作为参数进行初始化类对象

    用集合做参数:先在main方法中,创建book对象,放进接口之后,接口作为参数进行传递,对person对象进行初始...

  • 2018-10-18类和对象总结

    1.类方法和静态方法 类中的方法: 对象方法, 类方法, 静态方法 对象方法:a、自带参数selfb、直接声明在类...

  • day14- 类和对象2

    一.类中的方法 类中的方法分为:对象方法, 类方法和静态方法 对象方法a.直接声明在类中b.有默认参数selfc....

  • day14 类和对象

    1.类中的方法 类中的方法分为:对象方法、类方法、静态方法 1.对象方法 a.直接声明在类中 b.有默认参数sel...

  • python-day15类和对象

    一、类方法和静态方法 类中的方法:对象方法、类方法和静态方法 1.对象方法: a.直接声明在类中b.自带参数sel...

  • day-总结

    类中的方法分为:对象方法, 类方法和静态方法1.对象方法a.直接声明在类中b.有默认参数selfc.通过对象去调用...

  • day-14 类和对象

    类中的方法分为:对象方法, 类方法和静态方法1.对象方法a.直接声明在类中b.有默认参数selfc.通过对象去调用...

网友评论

      本文标题:接口类UserInfoMapper中方法传对象/参数

      本文链接:https://www.haomeiwen.com/subject/ybapmxtx.html