package com.lz.modules.equipment.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.common.utils.PageUtils;
import com.lz.modules.equipment.dao.OneCodeMapper;
import com.lz.modules.equipment.entity.OneCode;
import com.lz.modules.equipment.entity.OneCodeReq;
import com.lz.modules.equipment.service.OneCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* <p>
*  服务类
* </p>
*
* @author quyixiao
* @since 2020-07-29
*/

@Service
public class OneCodeServiceImpl extends ServiceImpl<OneCodeMapper, OneCode> implements OneCodeService {


    @Autowired
	private OneCodeMapper oneCodeMapper;



	@Override
	public OneCode selectOneCodeById(Long id){
		return oneCodeMapper.selectOneCodeById(id);
	}



	@Override
	public Long insertOneCode(OneCode oneCode){
		return oneCodeMapper.insertOneCode(oneCode);
	}



	@Override
	public int updateOneCodeById(OneCode oneCode){
		return oneCodeMapper.updateOneCodeById(oneCode);
	}



	@Override
	public int updateCoverOneCodeById(OneCode oneCode){
		return oneCodeMapper.updateCoverOneCodeById(oneCode);
	}



	@Override
	public int deleteOneCodeById(Long id){
		return oneCodeMapper.deleteOneCodeById(id);
	}

	@Override
	public Long insertOneCodes(List<String> codes){
		return oneCodeMapper.insertOneCodes(codes);
	}

	@Override
	public List<String> selectNoPrints(){
		return oneCodeMapper.selectNoPrints();
	}

	@Override
	public OneCode selectByCode(String code){
		return oneCodeMapper.selectByCode(code);
	}

	@Override
	public Long updatePrintOneCodes(List<String> codes){
		return oneCodeMapper.updatePrintOneCodes(codes);
	}

	@Override
	public PageUtils selectByReq(OneCodeReq req){
		PageUtils pageUtils = PageUtils.startPage(req.getPage(), req.getRows()).doSelect(
				page -> oneCodeMapper.selectByCondition(page, req)
		);
		return pageUtils;
	}

}
