package cn.com.oa.service.impl;

import cn.com.oa.mapper.CarInoutRecordMapper;
import cn.com.oa.model.CarInoutRecord;
import cn.com.oa.service.CarInoutRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

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

/**
* @author tianx
* @description 针对表【car_inout_record(车辆进出识别记录表)】的数据库操作Service实现
* @createDate 2025-07-07 16:56:19
*/
@Service
public class CarInoutRecordServiceImpl extends ServiceImpl<CarInoutRecordMapper, CarInoutRecord>
    implements CarInoutRecordService{

    @Override
    public Map<Integer, List<CarInoutRecord>> getCarInRecordsByDateGroupByWhiteList(CarInoutRecord record) {
        HashMap<Integer, List<CarInoutRecord>> map = new HashMap<>();
        // 免费车
        Integer free = 2;
        // 临时车
        Integer temp = 1;
        // 入库
        Integer in = 1;
//        CarInoutRecord freeRecord = new CarInoutRecord();
//        freeRecord.setWhitelistType(free);
//        freeRecord.setDirection(in);
//        freeRecord.setTimeStamp(record.getTimeStamp());
        record.setWhitelistType(free);
        List<CarInoutRecord> freeList = this.baseMapper.getCarInRecordsByDateGroupByWhiteList(record);
        System.out.println(freeList.getClass());
        map.put(free, freeList);
//        CarInoutRecord tempRecord = new CarInoutRecord();
//        tempRecord.setWhitelistType(temp);
//        tempRecord.setDirection(in);
//        tempRecord.setTimeStamp(record.getTimeStamp());
        record.setWhitelistType(temp);
        List<CarInoutRecord> tempList = this.baseMapper.getCarInRecordsByDateGroupByWhiteList(record);
        map.put(temp, tempList);
        return map;
    }
}




