package org.springblade.modules.sqjw.sydw.service.impl;

import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.sqjw.sydw.mapper.CyryMapper;
import org.springblade.modules.sqjw.sydw.pojo.entity.CyryEntity;
import org.springblade.modules.sqjw.sydw.pojo.vo.UserVO;
import org.springblade.modules.sqjw.sydw.service.CyryService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CyryServiceImpl extends BaseServiceImpl<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);
	}

	@Override
	public void updateCyry(CyryEntity cyryEntity) {
		baseMapper.updateCyry(cyryEntity);
	}

	@Override
	public UserVO djxx(Long userId) {
		return baseMapper.djxx(userId);
	}
}
