package com.bonus.canteen.core.allocation.canteen.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bonus.canteen.core.allocation.canteen.model.AllocArea;
import com.bonus.canteen.core.allocation.canteen.vo.AllocAreaTreeVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface AllocAreaMapper extends BaseMapper<AllocArea> {
//   @LeNiuDataPermission(
//      alias = "t1",
//      permissionType = DataPermissionTypeEnum.PERMISSION_AREA
//   )
//   Page<AllocArea> pageArea(@Param("page") Page<AllocArea> page, @Param("param") AllocAreaParam param);
//
//   @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND first_area_name IS NOT NULL AND second_area_name IS NULL"})
//   String getLatestFirstAreaNum();
//
//   @Select({"SELECT area_num FROM alloc_area WHERE area_id = #{areaId}"})
//   String getAreaNumById(Long areaId);
//
//   @Select({"SELECT MAX(area_num) FROM alloc_area WHERE if_del = 2 AND super_id = #{superId}"})
//   String getLatestAreaNum(Long superId);
//
//   @Select({"SELECT area_id, area_name FROM alloc_area WHERE if_del = 2 AND area_name = #{areaName}"})
//   AllocArea getAreaIdByName(String areaName);
//
//   @LeNiuDataPermission(
//      alias = "t1",
//      permissionType = DataPermissionTypeEnum.PERMISSION_AREA
//   )
   List<AllocAreaTreeVO> listAllTreeArea();

   List<AllocAreaTreeVO> listSystemArea(Long tenantId);

//   @Select({"SELECT area_id FROM alloc_area WHERE super_id = #{superId} AND if_del = 2"})
//   List<Long> listChildAreaId(Long superId);
//
//   @Select({"SELECT super_id FROM alloc_area WHERE area_id = #{areaId}"})
//   Long getSuperIdByAreaId(Long areaId);
//
//   @Select({"SELECT area_id FROM alloc_area WHERE super_id = -1 ORDER BY id DESC LIMIT 1"})
//   Long getTopAreaId();
//
//   @Select({"SELECT merchant_name FROM merc_merchant LIMIT 1"})
//   String getMerchantName();
//
//   List<AllocAreaVO> listAreaByUserRole(@Param("authPO") MgrUserAuthPO mgrUserAuthPO);
}
