package com.vctgo.system.mapper;

import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vctgo.common.mybatisplus.mapper.BaseMapperX;
import com.vctgo.system.domain.SysAreaSetting;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

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

/**
 * 区域设置Mapper接口
 *
 * @author caesar
 * @date 2023-05-30
 */
@Repository
public interface SysAreaSettingMapper extends BaseMapperX<SysAreaSetting>
{

    /**
     * 查询区域设置列表-分页
     *
     * @param sysAreaSetting 区域设置
     * @return 区域设置集合
     */
    IPage<SysAreaSetting> selectTenantAreaPageList(Page page,@Param("query") SysAreaSetting sysAreaSetting);

    /**
     * 查询区域设置列表
     *
     * @param sysAreaSetting 区域设置
     * @return 区域设置集合
     */
    @InterceptorIgnore(tenantLine = "1")
    List<SysAreaSetting> selectSysAreaSettingList(@Param("query") SysAreaSetting sysAreaSetting);

    /**
     * 查询区域设置列表
     *
     * @param sysAreaSetting 区域设置
     * @return 区域设置集合
     */
    List<SysAreaSetting> selectTenantAreaSettingList(@Param("query") SysAreaSetting sysAreaSetting);

    /**
     * 根据相应参数查询是否存在该品牌
     *
     * @param params 参数
     * @return 玩具品牌管理集合
     */
    List<SysAreaSetting> selectAreaListByParams(@Param("params") Map<String, Object> params);

    /**
     * 更新回收站玩具状态
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int updateDeletedStatusByIds(@Param("ids") String ids,
                                 @Param("query") SysAreaSetting sysAreaSetting);

    /**
     * 批量删除区域设置
     *
     * @param areaIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteSysAreaSettingByAreaIds(Long[] areaIds);

    /**
     * 查询区域设置列表
     * @param locationIds
     * @return
     */
    List<SysAreaSetting> getAreaSettingInfo(@Param("locationIds")String locationIds);


    List<SysAreaSetting> getAreaNameByIds(@Param("areaIds") List<Long> areaIds);

    List<SysAreaSetting> selectAreaNameByIds(@Param("areaIds") List<Long> areaIds);

}
