package com.br.accounts.service.copy;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.br.accounts.entity.Accounts;
import com.br.accounts.repository.AccountsRepository;

@Service
public class AccountsService {
	
	@Autowired
	public AccountsRepository consultareposi;
	
	
	public Accounts getbyId(int id) {
		return consultareposi.getById(id);
		
	}

	
	public List<Accounts> getAll() {
		return consultareposi.getAllConsulta();
	}


	public void update(Accounts consulta) {
		consultareposi.update(consulta);
	}

	
	public void delete(int id) {
		consultareposi.delete(id);		
	}

	
	public void add(Accounts consulta) {
		consultareposi.add(consulta);
	}

}

@@ -705,33 +705,147 @@
 ts consulta) %7B%0A%09
-%09
+      if (consulta.getSituacao() ==0)%7B%0A%09%09  consulta.setSituacao(1);%0A%09%09  consulta.setDataCreat(new Date());%0A%09%09%7D%0A%09%09  
 consultareposi.a
@@ -861,11 +861,10 @@
 ta);%0A%09%7D%0A
-%0A
 %7D%0A

Update AccountsService.java