package com.cirle.scientific.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.cirle.scientific.dao.*;
import com.cirle.scientific.dto.*;
import com.cirle.scientific.po.*;
import com.cirle.scientific.pojo.BizCodeEnum;
import com.cirle.scientific.pojo.Result;
import com.cirle.scientific.service.QkjTaskService;
import com.cirle.scientific.service.SysRegionService;
import com.cirle.scientific.service.UserService;
import com.cirle.scientific.utils.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;


@Service
@Slf4j
@Transactional
public class SysRegionServiceImpl implements SysRegionService {


    @Autowired
    RegionDao regionDao;

    @Override
    public List<SysRegion> getRegion(Integer pid) {
        if (pid == null) {
            return Collections.emptyList();
        }
        return regionDao.findByParentId(pid);
    }
}
