// Path: src/com/easyhousing/dao/UserCollectRentHouseDao.java
// public interface UserCollectRentHouseDao {
// 	public void insertUserCollectRentHouse(UserCollectRentHouse u);
// 	public void deleteUserCollectRentHouse(UserCollectRentHouse u);
// 	public List<UserCollectRentHouse> selectAllByUserId(UserCollectRentHouse u);
// 	public UserCollectRentHouse selectAllByUserIdRentHouseId(UserCollectRentHouse u);
// }
// 
// Path: src/com/easyhousing/model/UserCollectRentHouse.java
// public class UserCollectRentHouse {
// 
// 	private int userId;
// 	private int rentHouseId;
// 	private Date collectTime;
// 	
// 	public int getUserId() {
// 		return userId;
// 	}
// 	public void setUserId(int userId) {
// 		this.userId = userId;
// 	}
// 	public int getRentHouseId() {
// 		return rentHouseId;
// 	}
// 	public void setRentHouseId(int rentHouseId) {
// 		this.rentHouseId = rentHouseId;
// 	}
// 	public Date getCollectTime() {
// 		return collectTime;
// 	}
// 	public void setCollectTime(Date collectTime) {
// 		this.collectTime = collectTime;
// 	}
// }
// 
// Path: src/com/easyhousing/service/RentHouseCollect.java
// public interface RentHouseCollect {
// 	public void insert(int userId, int rentHouseId);
// 	public void delete(int userId, int rentHouseId);
// 	public int selectByUserIdRentHouseId(int userId, int rentHouseId);
// }


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.easyhousing.dao.UserCollectRentHouseDao;
import com.easyhousing.model.UserCollectRentHouse;
import com.easyhousing.service.RentHouseCollect;
package com.easyhousing.service.impl;



@Service("rentHouseCollectService")
public class RentHouseCollectImpl implements RentHouseCollect{

	@Autowired
	private UserCollectRentHouseDao userCollectRentHouseDao;
	
	@Override
	public void insert(int userId, int rentHouseId) {
		UserCollectRentHouse userCollectRentHouse = new UserCollectRentHouse();
		userCollectRentHouse.setRentHouseId(rentHouseId);
		userCollectRentHouse.setUserId(userId);
		//userCollectRentHouse.setCollectTime(collectTime);
		userCollectRentHouseDao.insertUserCollectRentHouse(userCollectRentHouse);
		System.err.println("collectrenthouse ok!");
	}

	@Override
	public int selectByUserIdRentHouseId(int userId, int rentHouseId) {
		UserCollectRentHouse userCollectRentHouse = new UserCollectRentHouse();
		userCollectRentHouse.setRentHouseId(rentHouseId);
		userCollectRentHouse.setUserId(userId);
		userCollectRentHouse = userCollectRentHouseDao.selectAllByUserIdRentHouseId(userCollectRentHouse);
// Path: src/com/easyhousing/dao/UserCollectRentHouseDao.java
// public interface UserCollectRentHouseDao {
// 	public void insertUserCollectRentHouse(UserCollectRentHouse u);
// 	public void deleteUserCollectRentHouse(UserCollectRentHouse u);
// 	public List<UserCollectRentHouse> selectAllByUserId(UserCollectRentHouse u);
// 	public UserCollectRentHouse selectAllByUserIdRentHouseId(UserCollectRentHouse u);
// }
// 
// Path: src/com/easyhousing/model/UserCollectRentHouse.java
// public class UserCollectRentHouse {
// 
// 	private int userId;
// 	private int rentHouseId;
// 	private Date collectTime;
// 	
// 	public int getUserId() {
// 		return userId;
// 	}
// 	public void setUserId(int userId) {
// 		this.userId = userId;
// 	}
// 	public int getRentHouseId() {
// 		return rentHouseId;
// 	}
// 	public void setRentHouseId(int rentHouseId) {
// 		this.rentHouseId = rentHouseId;
// 	}
// 	public Date getCollectTime() {
// 		return collectTime;
// 	}
// 	public void setCollectTime(Date collectTime) {
// 		this.collectTime = collectTime;
// 	}
// }
// 
// Path: src/com/easyhousing/service/RentHouseCollect.java
// public interface RentHouseCollect {
// 	public void insert(int userId, int rentHouseId);
// 	public void delete(int userId, int rentHouseId);
// 	public int selectByUserIdRentHouseId(int userId, int rentHouseId);
// }


// Path: src/com/easyhousing/service/impl/RentHouseCollectImpl.java
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.easyhousing.dao.UserCollectRentHouseDao;
import com.easyhousing.model.UserCollectRentHouse;
import com.easyhousing.service.RentHouseCollect;

package com.easyhousing.service.impl;



@Service("rentHouseCollectService")
public class RentHouseCollectImpl implements RentHouseCollect{

	@Autowired
	private UserCollectRentHouseDao userCollectRentHouseDao;
	
	@Override
	public void insert(int userId, int rentHouseId) {
		UserCollectRentHouse userCollectRentHouse = new UserCollectRentHouse();
		userCollectRentHouse.setRentHouseId(rentHouseId);
		userCollectRentHouse.setUserId(userId);
		//userCollectRentHouse.setCollectTime(collectTime);
		userCollectRentHouseDao.insertUserCollectRentHouse(userCollectRentHouse);
		System.err.println("collectrenthouse ok!");
	}

	@Override
	public int selectByUserIdRentHouseId(int userId, int rentHouseId) {
		UserCollectRentHouse userCollectRentHouse = new UserCollectRentHouse();
		userCollectRentHouse.setRentHouseId(rentHouseId);
		userCollectRentHouse.setUserId(userId);
		userCollectRentHouse = userCollectRentHouseDao.selectAllByUserIdRentHouseId(userCollectRentHouse);
		if(userCollectRentHouse == null)