package net.lab1024.sa.admin.module.business.wms.base.address.dao;

import java.util.List;

import net.lab1024.sa.admin.module.business.wms.base.address.domain.entity.AddressEntity;
import net.lab1024.sa.admin.module.business.wms.base.address.domain.form.AddressQueryForm;
import net.lab1024.sa.admin.module.business.wms.base.address.domain.form.AddressSelect;
import net.lab1024.sa.admin.module.business.wms.base.address.domain.vo.AddressVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.lab1024.sa.admin.module.business.wms.base.item.domain.form.ItemQueryForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.cursor.Cursor;
import org.springframework.stereotype.Component;

/**
 * 收货地址 Dao
 *
 * @Author hj
 * @Date 2024-12-26 15:35:23
 * @Copyright 友仓
 */

@Mapper
@Component
public interface AddressDao extends BaseMapper<AddressEntity> {

    /**
     * 分页 查询
     *
     * @param page
     * @param queryForm
     * @return
     */
    List<AddressVO> queryPage(Page page, @Param("queryForm") AddressQueryForm queryForm);

    /**
     * 下拉分页查询
     *
     * @param page
     * @param addressSelect
     * @return
     */
    List<AddressVO> queryAddress(Page page, @Param("addressSelect") AddressSelect addressSelect);

    /**
     * 流式查询
     * @return
     */
    @Select("SELECT name,person,telephone,address FROM t_address")
    @Options(fetchSize = 2000)
    Cursor<AddressVO> selectAllByCursor();

    //游标分页
    List<AddressVO> listByCursor(@Param("lastId") Long lastId, @Param("pageSize") int pageSize,@Param("queryForm") AddressQueryForm queryForm);


}
