package com.xinelu.manage.mapper.receiveAddressInfo;

import com.xinelu.manage.domain.receiveAddressInfo.ReceiveAddressInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 收货人地址信息Mapper接口
 *
 * @author xinyilu
 * @date 2022-10-18
 */
public interface ReceiveAddressInfoMapper {
    /**
     * 查询收货人地址信息
     *
     * @param id 收货人地址信息主键
     * @return 收货人地址信息
     */
    ReceiveAddressInfo selectReceiveAddressInfoById(Long id);

    /**
     * 查询收货人地址信息列表
     *
     * @param receiveAddressInfo 收货人地址信息
     * @return 收货人地址信息集合
     */
    List<ReceiveAddressInfo> selectReceiveAddressInfoList(ReceiveAddressInfo receiveAddressInfo);

    /**
     * 新增收货人地址信息
     *
     * @param receiveAddressInfo 收货人地址信息
     * @return 结果
     */
    int insertReceiveAddressInfo(ReceiveAddressInfo receiveAddressInfo);

    /**
     * 修改收货人地址信息
     *
     * @param receiveAddressInfo 收货人地址信息
     * @return 结果
     */
    int updateReceiveAddressInfo(ReceiveAddressInfo receiveAddressInfo);

    /**
     * 删除收货人地址信息
     *
     * @param id 收货人地址信息主键
     * @return 结果
     */
    int deleteReceiveAddressInfoById(Long id);

    /**
     * 批量删除收货人地址信息
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteReceiveAddressInfoByIds(Long[] ids);

    /**
     * 查询当前收货地址是否存在
     *
     * @param patientId      会员id
     * @param receiveName    收货人名称
     * @param receivePhone   收货人电话
     * @param receiveAddress 收货地址
     * @return 数量
     */
    int getReceiveAddressInfo(@Param("patientId") Long patientId, @Param("receiveName") String receiveName,
                              @Param("receivePhone") String receivePhone, @Param("receiveAddress") String receiveAddress);
}
