package com.zzsn.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzsn.entity.Basedata;
import com.zzsn.mapper.BaseDataMapper;
import com.zzsn.service.BaseDataService;
import java.util.HashMap;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class BaseDataServiceImpl extends ServiceImpl<BaseDataMapper, Basedata>
        implements BaseDataService
{
    private static final Logger log = LoggerFactory.getLogger(BaseDataServiceImpl.class);

    @Autowired
    private BaseDataMapper baseDataMapper;

    @Transactional
    public Long getserialno() {
        log.info("生成bid");
        Map map = new HashMap();
        map.put("serialNo", null);
        map.put("e", null);
        this.baseDataMapper.getserialno(map);
        String error = (String)map.get("e");
        if (error == null) {
            return Long.valueOf((String)map.get("serialNo"));
        }
        return null;
//        this.baseDataMapper.autoIncrement();
//        String orderId= this.baseDataMapper.getorderId();
//        return Long.valueOf(orderId);
    }
}