李振海的gravatar头像
李振海 2017-11-07 15:59:56

spring boot+Spring+Spring MVC+Mybatis+Thymeleaf+Druid开发简单用户增删改查实例

简单的框架,Thymeleaf是3,0的 ,2.0的话标签必须闭合,3.0不需要,所以集成了3.0,数据连接池是阿里的Druid,监控界面是http://localhost:8080/druid/login.html 账号root ,密码123spring boot+Spring+Spring MVC+Mybatis+Thymeleaf+Druid开发简单用户增删改查实例

spring boot+Spring+Spring MVC+Mybatis+Thymeleaf+Druid开发简单用户增删改查实例spring boot+Spring+Spring MVC+Mybatis+Thymeleaf+Druid开发简单用户增删改查实例spring boot+Spring+Spring MVC+Mybatis+Thymeleaf+Druid开发简单用户增删改查实例

这是userMapper.java  采用注解的方式

/**

 * Created by beyondLi on 2017/6/19.

 */

@Mapper // 声明是一个Mapper,与springbootApplication中的@MapperScan二选一写上即可

@Repository

public interface UserMapper {



@Insert("insert into user(username,age,time) values (#{username},#{age},#{time})")

public void addUser(User user);



@Select("select * from user where id = #{id}")

public User selectUserById(int id);

@Select("select * from user")

public List<User> selectUserAll();



@Update("update user set username=#{userName},age=#{age},time=#{time} where id=#{id}")

public void updateUser(User user);



@Delete("delete from user where id=#{id}")

public void deleteUser(int id);



}

打赏

已有1人打赏

最代码官方的gravatar头像

文件名:demo.zip,文件大小:131.116K 下载
最代码最近下载分享源代码列表最近下载
oulingqiao  LV13 2023年12月10日
王乐22222  LV10 2022年5月13日
lyws1986  LV17 2021年12月21日
尹恒yingying  LV18 2021年10月25日
mudingc木钉  LV30 2021年7月7日
SYX__0707  LV6 2021年4月6日
zuidaima1560  LV3 2020年5月5日
sxxpliaolei  LV1 2020年4月24日
mhaogg  LV1 2020年4月19日
kris666  LV3 2020年3月30日
最代码最近浏览分享源代码列表最近浏览
牛牛要爆炸了  LV2 1月17日
skook7  LV2 2023年12月14日
oulingqiao  LV13 2023年12月10日
guviva  LV6 2023年6月12日
lironggang  LV38 2023年3月22日
bluece 2023年1月12日
暂无贡献等级
38735466  LV11 2023年1月8日
Gillian000 2022年12月6日
暂无贡献等级
内心向阳  LV4 2022年11月30日
Yaolinchen 2022年9月26日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友