package org.dromara.zhishu.service.impl;

import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.common.mybatis.core.page.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor;
import org.dromara.zhishu.mapper.TShopDepotAotuMapper;
import org.springframework.stereotype.Service;
import org.dromara.zhishu.domain.bo.TShopDepotAotuBo;
import org.dromara.zhishu.domain.vo.TShopDepotAotuVo;
import org.dromara.zhishu.service.ITShopDepotAotuService;

import java.util.ArrayList;
import java.util.List;

/**
 * 店铺自动发布仓库关联Service业务层处理
 *
 * @author Lion Li
 * @date 2025-09-05
 */
@RequiredArgsConstructor
@Service
public class TShopDepotAotuServiceImpl implements ITShopDepotAotuService {

    private final TShopDepotAotuMapper baseMapper;

    /**
     * 查询店铺自动发布仓库关联
     *
     * @param id 主键
     * @return 店铺自动发布仓库关联
     */
    @Override
    public TShopDepotAotuVo queryById(Long id){
        return baseMapper.selectVoById(id);
    }

    /**
     * 分页查询店铺自动发布仓库关联列表
     * 联表查询获取店铺名称和仓库名称，支持按名称搜索
     *
     * @param bo        查询条件
     * @param pageQuery 分页参数
     * @return 店铺自动发布仓库关联分页列表
     */
    @Override
    public TableDataInfo<TShopDepotAotuVo> queryPageList(TShopDepotAotuBo bo, PageQuery pageQuery) {

        System.out.println(bo.getDepotName());
        Page<TShopDepotAotuVo> result = baseMapper.selectVoPageByCondition(pageQuery.build(), bo);
        return TableDataInfo.build(result);
    }

    /**
     * 查询所有店铺自动发布仓库关联列表
     * 联表查询获取店铺名称和仓库名称，支持按名称搜索
     *
     * @param bo 查询条件
     * @return 店铺自动发布仓库关联列表
     */
    @Override
    public List<TShopDepotAotuVo> queryList(TShopDepotAotuBo bo) {
        System.out.println(bo.getDepotName());
        return baseMapper.selectVoListByCondition(bo);
    }
}