content: package com.cy.service.impl;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.springframework.transaction.annotation.Transactional;
  
  import com.cy.dao.interfaces.PersoninfoDaoInter;
  import com.cy.dao.interfaces.UserDaoInter;
  import com.cy.entity.Personinfo;
  import com.cy.entity.Status;
  import com.cy.service.interfaces.PersoninfoServiceInter;
  import com.cy.service.interfaces.UserServiceInter;
  
  @Transactional
  public class PersoninfoServiceImpl implements PersoninfoServiceInter {
  
  	//ʹPersoninfoDaoInterӿڶ󣬲setʵע
  	private PersoninfoDaoInter personinfoDaoInter;
  	//ʹUserDAOInterӿڶ󣬲setʵע
  	private UserDaoInter userDaoInter;
  	public void setPersoninfoDaoInter(PersoninfoDaoInter personinfoDaoInter) {
  		this.personinfoDaoInter = personinfoDaoInter;
  	}
  	public void setUserDaoInter(UserDaoInter userDaointer) {
  		this.userDaoInter = userDaointer;
  	}
  	
  	//޸ĸϢ
  	@Override
  	public boolean modifyPersoninfo(Personinfo personinfo) {
  		personinfoDaoInter.modifyPersoninfo(personinfo);
  		return true;
  	}
  	
      //Ա˻״̬ѯûϢ,״̬Ϊ0ʾȡû
  	@Override
  	public List searchPersoninfo(Status status) {
          List users = new ArrayList();
          //System.out.println(status.getId());
          if(status.getId() != 0) {
          	//˻״̬ŲΪ0ݱŻȡӦĿͻ¼
          	//status = userDaoInter.getStatus(status.getId());
          	//System.out.println("a"+status.getId());
          	users = personinfoDaoInter.searchPersoninfo(status.getId());
          } else {
          	//Ϊ0ȡпͻļ¼
          	users = personinfoDaoInter.getAllPersoninfo();
          }
  		return users;
  	}
  	//ԱûʵֲѯûϢ
  	@Override
  	public List searchPersoninfo(Personinfo personinfo) {
  		return personinfoDaoInter.searchPersoninfo(personinfo);
  	}
  	//ԱӸϢ
  	@Override
  	public boolean add(Personinfo personinfo) {
  		return personinfoDaoInter.add(personinfo);
  	}
  
  }
  