package com.cool.store.dao;

import com.cool.store.entity.OperationsConsultantAssignDO;
import com.cool.store.mapper.OperationsConsultantAssignMapper;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Auther zx_szh
 * @Date 2025/12/25 14:29
 * @Version 1.0
 */
@Repository
public class OperationsConsultantAssignDAO {

    @Resource
    private OperationsConsultantAssignMapper operationsConsultantAssignMapper;


    /**
     * 新增分配数据
     * @param operationsConsultantAssignDO
     * @return
     */
    public Integer addOperationsConsultantAssign(OperationsConsultantAssignDO operationsConsultantAssignDO){
        return operationsConsultantAssignMapper.insertSelective(operationsConsultantAssignDO);
    }

    /**
     * 根据Id更新数据
     * @param operationsConsultantAssignDO
     * @return
     */
    public Integer updateById(OperationsConsultantAssignDO operationsConsultantAssignDO){
        return operationsConsultantAssignMapper.updateByPrimaryKey(operationsConsultantAssignDO);
    }

    /**
     * 根据门店信息查询分配信息
     * @param shopId
     * @return
     */
    public OperationsConsultantAssignDO selectByShopId(Long shopId){
        if(shopId == null){
            return null;
        }
        return operationsConsultantAssignMapper.selectByShopId(shopId);
    }

    /**
     * 获取未分配的数据
     * @param keyword
     * @return
     */
    public List<OperationsConsultantAssignDO> getNoAssign(String keyword,List<String> regionIds){
        return operationsConsultantAssignMapper.getNoAssign(keyword,regionIds);
    }







}
