package com.steerinfo.ems.zghbjkbz.service.impl;

import com.steerinfo.framework.mapper.IBaseMapper;
import com.steerinfo.framework.service.impl.BaseServiceImpl;
import com.steerinfo.framework.service.pagehelper.PageHelper;
import com.steerinfo.framework.service.pagehelper.PageList;
import com.steerinfo.ems.zghbjkbz.model.Zghbjkbz;
import com.steerinfo.ems.zghbjkbz.mapper.ZghbjkbzMapper;
import com.steerinfo.ems.zghbjkbz.service.IZghbjkbzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;

/**
 * ZghbjkbzService服务实现：
 * @author generator
 * @version 1.0-SNAPSHORT 2020-03-18 03:26
 * 类描述
 * 修订历史：
 * 日期：2020-03-11
 * 作者：generator
 * 参考：
 * 描述：ZghbjkbzService服务实现
 * @see null
 * @Copyright 湖南视拓信息技术股份有限公司. All rights reserved.
 */
@Service(value = "zghbjkbzService")
public class ZghbjkbzServiceImpl extends BaseServiceImpl<Zghbjkbz, String> implements IZghbjkbzService {
	
	@Autowired
    private ZghbjkbzMapper zghbjkbzMapper;
	
	@Override
    protected IBaseMapper<Zghbjkbz, String> getMapper() {
        return zghbjkbzMapper;
    }
	
	@Override
	public PageList<Zghbjkbz> getDataForPage(HashMap<String, Object> parmas, Integer pageNum, Integer pageSize) {
		PageHelper.startPage(pageNum, pageSize);
    	List<Zghbjkbz> rows = zghbjkbzMapper.selectByParameters(parmas);
    	for(int i = 0; i< rows.size(); i++)
        {
    		Zghbjkbz zghb = rows.get(i);
    		String cName = zghb.getcName().substring(0, 1).toLowerCase() + zghb.getcName().substring(1);
    		zghb.setcName(cName.replaceAll("_", ""));
        }
    	PageList<Zghbjkbz> pageInfo = new PageList(rows);
    	return pageInfo;
	}
}
