1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| package com.kagarise.kira.mapper;
import com.kagarise.kira.entity.User; import com.kagarise.kira.provider.UserSqlProvider; import org.apache.ibatis.annotations.*;
import java.util.List;
@Mapper public interface UserMapper {
@Select("SELECT * FROM user") List<User> findAll();
@SelectProvider(type = UserSqlProvider.class, method = "selectUser") User selectUser(User user);
@InsertProvider(type = UserSqlProvider.class, method = "insertUser") @Options(useGeneratedKeys = true, keyProperty = "userId", keyColumn = "user_id") boolean insertUser(User user);
@DeleteProvider(type = UserSqlProvider.class, method = "deleteUser") boolean deleteUser(int userId);
@UpdateProvider(type = UserSqlProvider.class, method = "updateUser") boolean updateUser(User user); }
|