package com.sa.ibiz.demo.demo.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import java.util.Map;
import org.apache.ibatis.annotations.Select;
import com.sa.ibiz.demo.demo.domain.User;
import com.sa.ibiz.demo.demo.service.dto.UserSearchFilter;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import java.io.Serializable;
import com.baomidou.mybatisplus.core.toolkit.Constants;
public interface UserMapper extends BaseMapper<User>{
    @CacheEvict( value="entity",key = "'User:'+#p0.userid")
    void updateOne(@Param("user") User user);
    List<User> searchDefault(@Param("srf") UserSearchFilter searchfilter,@Param("ew") Wrapper<User> wrapper) ;
    Page<User> searchDefault(IPage page, @Param("srf") UserSearchFilter searchfilter, @Param("ew") Wrapper<User> wrapper) ;
    @Select("${sql}")
    List<Map<String,Object>> selectRow( @Param("sql")String sql);
    @Override
    @Cacheable( value="entity",key = "'User:'+#p0")
    User selectById(Serializable id);
    @Override
    @CacheEvict( value="entity",key = "'User:'+#p0.userid")
    int updateById(@Param(Constants.ENTITY) User entity);
    @Override
    @CacheEvict( value="entity",key = "'User:'+#p0.userid")
    int insert(User entity);
    @Override
    @CacheEvict( value="entity",key = "'User:'+#p0")
    int deleteById(Serializable id);
}