package com.fuint.common.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fuint.common.param.PageParam;
import com.fuint.framework.exception.BusinessCheckException;
import com.fuint.framework.web.PageResult;
import com.fuint.repository.bean.TableInfoBean;
import com.fuint.repository.model.MtTableInfo;

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

/**
 * 餐桌信息业务接口
 *
 * Created by pzg
 * CopyRight https://www.fuint.cn
 */
public interface TableInfoService extends IService<MtTableInfo> {


    /**
     * 添加餐桌信息
     *
     * @param  mtTableInfo
     * @throws BusinessCheckException
     * @return
     */
    MtTableInfo addTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException;

    /**
     * 根据ID获取餐桌信息信息
     *
     * @param id ID
     * @throws BusinessCheckException
     * @return
     */
    MtTableInfo queryTableInfoById(Long id) throws BusinessCheckException;

    /**
     * 根据ID删除餐桌信息
     *
     * @param id ID
     * @param operator 操作人
     * @throws BusinessCheckException
     * @return
     */
    void deleteTableInfo(Long id, String operator) throws BusinessCheckException;

    /**
     * 更新餐桌信息
     * @param  mtTableInfo
     * @throws BusinessCheckException
     * @return
     * */
    MtTableInfo updateTableInfo(MtTableInfo mtTableInfo) throws BusinessCheckException;

    /**
     * 根据条件搜索餐桌信息
     *
     * @param params 查询参数
     * @throws BusinessCheckException
     * @return
     * */
    List<MtTableInfo> queryTableInfoListByParams(Map<String, Object> params) throws BusinessCheckException;

	List<MtTableInfo> selectTableListByStoreId(Long storeId, String categoryName) throws BusinessCheckException;





    /**
     * 校验分类是否存在
     */
    boolean existCategory(Long categoryId);

    /**
     * 根据桌分类id查询具体的餐桌信息
     * @param categoryId
     * @return
     */
    List<MtTableInfo> findByCategoryId(Long categoryId);

    /**
     * 保存餐桌信息
     * @param entity
     * @return
     * @throws BusinessCheckException
     */
    boolean saveTable(MtTableInfo entity) throws BusinessCheckException;

    /**
     * 修改餐桌信息接口
     * @param updateEntity
     * @return
     */
    boolean updateTable(MtTableInfo updateEntity) throws BusinessCheckException;

    PageResult<TableInfoBean> selectTableList(String tableName, Integer tableStatus, PageParam param) throws BusinessCheckException;
}
