package io.modules.item.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import cn.hutool.core.util.StrUtil;
import io.common.service.impl.CrudServiceImpl;
import io.modules.item.dao.AreaDao;
import io.modules.item.dto.AreaDTO;
import io.modules.item.entity.AreaEntity;
import io.modules.item.service.AreaService;
import org.springframework.stereotype.Service;
import java.util.Map;

/**
 * 地区信息
 *
 * @author Mark #
 * @since 1.0.0 2025-02-14
 */
@Service
public class AreaServiceImpl extends CrudServiceImpl<AreaDao, AreaEntity, AreaDTO> implements AreaService {

    @Override
    public QueryWrapper<AreaEntity> getWrapper(Map<String, Object> params){
        String areaId = (String)params.get("areaId");
        String father = (String)params.get("father");
        QueryWrapper<AreaEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StrUtil.isNotBlank(areaId), "area_id", areaId);
        wrapper.eq(StrUtil.isNotBlank(father), "father", father);
        return wrapper;
    }


}