首页>代码>spring boot+mybatis+layui构建的用户增删改查实例,支持分页查询,模糊查询>/SpringBootMybatisDemo/src/main/java/com/example/SpringBootMybatisDemo/mapper/UserMapper.java
01 | package com.example.SpringBootMybatisDemo.mapper; |
02 |
03 | import com.example.SpringBootMybatisDemo.entity.User; |
04 | import org.apache.ibatis.annotations.*; |
05 | import org.springframework.stereotype.Repository; |
06 |
07 | import java.util.List; |
08 | import java.util.Map; |
09 |
10 | /** |
11 | * 创建人:thj |
12 | * 创建时间: 2018/6/26 9:28 |
13 | * 用途: |
14 | */ |
15 |
16 | //@Repository |
17 | public interface UserMapper { |
18 |
19 | // @Select("SELECT * FROM USER WHERE id = #{id}") |
20 | User getUserById(Integer id); |
21 |
22 | // @Select("SELECT * FROM USER") |
23 | public List<User> getUserList(String name, int page, int limit); |
24 |
25 | // @Insert("insert into USER(name, age) values(#{username}, #{age})") |
26 | public int add(User user); |
27 |
28 | // @Update("UPDATE USER SET name = #{user.name} , age = #{user.age} WHERE id = #{id}") |
29 | public int update(User user); |
30 |
31 | // @Delete("DELETE FROM USER WHERE id = #{id} ") |
32 | public int delete(Integer id); |
33 |
34 |
35 | int getUserCount(); |
36 | } |

dane168 LV8
2月23日
zhengguangshun LV4
2024年8月26日
可乐要加冰1 LV8
2024年6月20日
ma406805131 LV19
2024年5月11日
汤汤汤要学编程 LV11
2023年6月27日
iceboard LV2
2023年5月31日
zhaoming200677 LV13
2022年12月3日
呵呵哈哈哈 LV10
2022年9月3日
lucuey LV1
2022年7月8日
cab123123 LV8
2022年4月25日