当前位置: 首页 > news >正文

asp网站源码适合ps做图的素材网站

asp网站源码,适合ps做图的素材网站,百度推广优化师是什么,做网站 好苦逼Mybatis 是一个持久层框架,用于简化数据库的操作,和Spring 没有任何关系,我们现在能使用它是因为 Spring Boot 把Mybatis 的依赖给引入进来了,在 pom.xml 里面 Mybatis 如何进行重命名? 看最后两行代码,这样就能重命名了 package com.example.mybatisdemo.mapper;import com…

Mybatis 是一个持久层框架,用于简化数据库的操作,和Spring 没有任何关系,我们现在能使用它是因为 Spring Boot 把Mybatis 的依赖给引入进来了,在 pom.xml 里面

Mybatis 如何进行重命名?

看最后两行代码,这样就能重命名了

package com.example.mybatisdemo.mapper;import com.example.mybatisdemo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;import java.util.List;@Mapper
public interface UserInfoMapper {@Select("select * from userInfo")List<UserInfo> selectAll();@Select("select * from userInfo where id = #{id}")UserInfo selectOne(Integer id);@Select("select * from userInfo where id= #{userId}")UserInfo selectOne2(@Param("userId")Integer id);
}

 Mybatis 的增操作

package com.example.mybatisdemo.mapper;import com.example.mybatisdemo.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;import java.util.List;@Mapper
public interface UserInfoMapper {@Insert(" insert into userinfo(username,password,age,gender,phone) " +"value(#{username},#{password},#{age},#{gender},#{phone})")Integer insert(UserInfo userInfo);}

依旧是右键,generate ,test,勾选,OK

package com.example.mybatisdemo.mapper;import com.example.mybatisdemo.model.UserInfo;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;import java.util.List;import static org.junit.jupiter.api.Assertions.*;@Slf4j
@SpringBootTest
class UserInfoMapperTest {@Autowiredprivate UserInfoMapper userInfoMapper;@Testvoid insert() {UserInfo userInfo = new UserInfo();userInfo.setUsername("zhaoliu");userInfo.setPassword("123");userInfo.setAge(45);userInfo.setGender(0);userInfo.setPhone("1775423");Integer result = userInfoMapper.insert(userInfo);log.info("insert 方法,执行结果:{}",result);}
}

就能看到运行结果了 

然后在Mysql查查看有没有插入成功 

没毛病

http://www.yayakq.cn/news/70586/

相关文章:

  • 怀来建设局网站手机端网站开发价格
  • php网站开发txt淄博什么兼职的网站建设
  • 风险网站怎么解决方案0453牡丹江信息网
  • 集团网站设计建设新余网站开发公司
  • 广州建站公司兴田德润活动wordpress内外网访问
  • 营销型网站建设的标准河南做网站公司汉狮
  • 建设部门三类人员官方网站网址提交入口
  • 南昌市会做网站有哪几家陪诊app开发
  • 子页网站设计广西防城港建设厅网站
  • 甘肃网站建设方案及案例做网络推广可以通过哪些渠道推广
  • 外贸自建站模板企业网站建设主要类型及选择
  • 专业行业网站开发报价建设工程施工合同编号
  • 电商seo推广如何做 网站的seo
  • 南京设计网站建设旅游电子商务网站的建设
  • 网站建设依循的原则东莞seo整站优化
  • 公司网站主页设计图片wordpress 仿虎嗅主题
  • 东营网站开发公司培训心得体会总结
  • 做网站可以用自己的主机网站建设中图片是什么
  • 忻州推广型网站建设一站式商家服务平台
  • 河北省建设网站锁安装什么驱动wordpress图片设置水印2019
  • 物流跟踪网站建设网站乱码
  • 有几个网站可以做代发的学电子商务后悔死了
  • 做企业网站用服务器资阳房地产网站建设
  • 响应式网站和自适应网站备案被注销 2016
  • 网站建设 运维 管理包括哪些网站设计考虑要素
  • 做网站页面的软件如何开发一个聊天软件
  • 好的公司网站建设济南家居行业网站开发
  • 网站集群建设中标利用帝国软件如何做网站
  • 做网站网站怎么赚钱郴州网站制作公司
  • 网站网站建设哪家便宜茶类网站建设方案