package com.steerinfo.meterwork.meterworkrailwayrecmain.service.impl;

import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.meterwork.meterworkrailwayreceived.model.MeterWorkRailwayReceived;
import com.steerinfo.meterwork.meterworkrailwayrecmain.model.MeterWorkRailwayRecMain;
import com.steerinfo.meterwork.meterworkrailwayrecmain.mapper.MeterWorkRailwayRecMainMapper;
import com.steerinfo.meterwork.meterworkrailwayrecmain.service.IMeterWorkRailwayRecMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

/**
 * MeterWorkRailwayRecMain服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2022-02-21 03:42
 * 类描述
 * 修订历史：
 * 日期：2022-02-21
 * 作者：generator
 * 参考：
 * 描述：MeterWorkRailwayRecMain服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "meterWorkRailwayRecMainService")
public class MeterWorkRailwayRecMainServiceImpl extends BaseServiceImpl<MeterWorkRailwayRecMain, String> implements IMeterWorkRailwayRecMainService {

    @Resource
    private MeterWorkRailwayRecMainMapper meterWorkRailwayRecMainMapper;

    @Override
    protected IBaseMapper<MeterWorkRailwayRecMain, String> getMapper() {
        return meterWorkRailwayRecMainMapper;
    }

    @Override
    public RESTfulResult checkandadd(MeterWorkRailwayRecMain model) throws Exception {
        try{
            RESTfulResult rm = new RESTfulResult();
            rm.setCode("200");
            rm.setData(model.getActualNo());
            meterWorkRailwayRecMainMapper.insertSelective(model);
            rm.setMessage("成功");
            return rm;
        }
        catch (Exception e){
            throw e;
        }
    }

    @Override
    public List<MeterWorkRailwayRecMain> listBynoPage(HashMap<String, Object> parmas) {
        return meterWorkRailwayRecMainMapper.listBynoPage(parmas);
    }
}
