package com.goafanti.user.service;

import java.util.List;
import java.util.Map;

import com.goafanti.app.bo.UserBasicInfo;
import com.goafanti.common.model.User;
import com.goafanti.core.mybatis.page.Pagination;
import com.goafanti.user.bo.OrgUnitNames;
import com.goafanti.user.bo.UserBaseBo;
import com.goafanti.user.bo.UserDownLoadBo;
import com.goafanti.user.bo.UserNames;
import com.goafanti.user.bo.UserPageHomeBo;
import com.goafanti.user.bo.UserPartnerDetailBo;

public interface UserService {

	User selectByPrimaryKey(String userId);

	String selectNumberByPrimaryKey(String userId);

	int updateByPrimaryKeySelective(User u);

	User insert(User user);

	User selectByMobieAndType(String mobile, Integer type);
	
	User selectByNameAndType(String username, Integer type);

	User insertRegister(User user, String unitName, String contacts);

	UserBaseBo selectUserBase(String userId);
	
	UserPageHomeBo selectUserPageHomeBoByUserId(String userId);

	UserDownLoadBo selectUserDownLoadBoByUserId(String userId);

	List<OrgUnitNames> selectDemandUnitNames();

	List<UserNames> selectDemandUserNames();

	Map<String, String> selectAchievementUserOwner(String name);

	List<OrgUnitNames> selectAchievementOrgOwner(String name);

	String findUserNameByNameAndMobile(String name, String mobile);

	String findOrgNameByNameAndMobile(String name, String mobile);

	UserBasicInfo selectBaseInfo();
	
	User selectByNumber(String easemobName);
	
	List<User> selectUserByRoleName(String roleName);
	
	UserPartnerDetailBo findUserPartnerDetail(String uid);
	
	List<UserPartnerDetailBo> findUserPartner();

	Integer selectByMobieAndTypeCount(String trim);

	
	
	Pagination<User> getUserInfo(User user, Integer pageNo, Integer pageSize);
	
	/**
	 * 查看除了自己是否还有其他人使用这个号码
	 * @param user
	 * @return
	 */
	int getCountByMobile(String id, String mobile,Integer type);

	String updateGetInvitationCode(String uid);

	void saveVoucher(User us);

	boolean checkeToInviteCode(String beInviteCode);

	Pagination<User> selectOrganizationList(User user, Integer pageNo, Integer pageSize);
	
}
