package com.pannk.demo.mapper;

import com.pannk.demo.entity.SysUserEntity;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * Created by wolf on 20-11-9.
 */
@Mapper
public interface SysUserMapper {

    List<SysUserEntity> list();

    /**
     * @param sysUserEntity
     */
    void save(SysUserEntity sysUserEntity);

    /**
     * 更新
     *
     * @param sysUserEntity
     */
    void update(SysUserEntity sysUserEntity);

    /**
     * 删除
     *
     * @param id
     */
    void delete(Long id);

    /**
     * 分页
     *
     * @param limit
     * @param pageSize
     */
    List<SysUserEntity> page(@Param("limit") int limit, @Param("pageSize") int pageSize);

    /**
     * 查询数量
     *
     * @return
     */
    int count();

    /**
     * 毗邻删除
     *
     * @param ids
     */
    void batchDelete(List<Long> ids);

    /**
     * 以用户名查询
     *
     * @param userName
     * @return
     */
    @Select("select * from sys_user where user_name=#{userName,jdbcType=VARCHAR}")
    List<SysUserEntity> selectByName(String userName);

    /**
     * 条件查询
     *
     * @param map
     * @return
     */
    List<SysUserEntity> selectByCond(Map<String, Object> map);
}
