package org.springblade.modules.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.modules.entity.CyryEntity;
import org.springblade.modules.mapper.CyryMapper;
import org.springblade.modules.service.CyryService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CyryServiceImpl extends ServiceImpl<CyryMapper, CyryEntity> implements CyryService {
	@Override
	public boolean updatezxById(CyryEntity cyryEntity) {
		return baseMapper.updatezxById(cyryEntity);
	}

	@Override
	public List<CyryEntity> selectCyryByXydm(String tyshxydm) {
		List<CyryEntity> list = baseMapper.selectCyryByXydm(tyshxydm);
		if (list.size() > 0) {
			for (CyryEntity cyry:list) {
				String dzbm = cyry.getXz();
				cyry.setXz(baseMapper.getFwxzByRkDzxx(dzbm));
			}
		}
		return list;
	}

	@Override
	public CyryEntity selectCyryBySfzh(String gmsfhm) {
		return baseMapper.selectCyryBySfzh(gmsfhm);
	}
}
