package com.steerinfo.baseinfo.meterbaseprint.service.impl;

import com.steerinfo.baseinfo.meterbaseprint.mapper.MeterBasePrintMapper;
import com.steerinfo.baseinfo.meterbaseprint.model.MeterBasePrint;
import com.steerinfo.baseinfo.meterbaseprint.service.IMeterBasePrintService;
import com.steerinfo.framework.controller.RESTfulResult;
import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.meterwork.meterworkrailwayactual.model.MeterWorkRailwayActual;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

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

    @Resource
    private MeterBasePrintMapper meterBasePrintMapper;

    @Override
    protected IBaseMapper<MeterBasePrint, String> getMapper() {
        return meterBasePrintMapper;
    }

    @Override
    public RESTfulResult noPage(HashMap<String, Object> param) {
        RESTfulResult rm = new RESTfulResult();
        rm.setFailed();
        try {
            List<MeterBasePrint> rows = meterBasePrintMapper.selectByParameters(param);
            rm.setSucceed();
            rm.setCode("200");
            rm.setData(rows);
            rm.setMessage("操作成功,总共"+ rows.size() +"条数据!!");
        }catch(Exception e) {
            e.printStackTrace();
            rm.setMessage("操作异常！！>>>" + e.getMessage());
        }
        return rm;
    }
}
