package com.goafanti.common.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.goafanti.app.bo.UserBasicInfo;
import com.goafanti.common.model.Admin;
import com.goafanti.common.model.JtMessageConsumer;
import com.goafanti.common.model.OrganizationContactBook;
import com.goafanti.common.model.User;
import com.goafanti.common.model.UserExample;
import com.goafanti.user.bo.UserBaseBo;
import com.goafanti.user.bo.UserDownLoadBo;
import com.goafanti.user.bo.UserPartnerDetailBo;

public interface UserMapper {
	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	long countByExample(UserExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int deleteByExample(UserExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int deleteByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int insert(User record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int insertSelective(User record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	List<User> selectByExample(UserExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	User selectByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int updateByExampleSelective(@Param("record") User record, @Param("example") UserExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int updateByExample(@Param("record") User record, @Param("example") UserExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int updateByPrimaryKeySelective(User record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user
	 * @mbg.generated  Thu May 31 15:33:56 CST 2018
	 */
	int updateByPrimaryKey(User record);

	UserBaseBo selectUserBaseByUserId(String uid);

	UserDownLoadBo selectUserDownLoadBoByUserId(String id);

	String findUserByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);

	String findOrgByNameAndMobile(@Param("name") String name, @Param("mobile") String mobile);

	Long selectNumberByPrimaryKey(String userId);
	
	User selectByMobieAndType(@Param("mobile")String mobile, @Param("type")Integer type);

	List<OrganizationContactBook> findAllContacts(String uid);

	UserBasicInfo selectBaseInfo(@Param("id")String id);

	User selectByNumber(@Param("easemobName")String easemobName);
	
	List<Admin> findAdminName(String aid);

	List<User> selectUserByRoleName(@Param("roleName")String roleName);

	User selectByNameAndType(@Param("username")String username,@Param("type") Integer type);
	
	UserPartnerDetailBo findUserPartnerDetail(String uid);
	

	List<UserPartnerDetailBo> findUserPartner();

	Integer selectByMobieAndTypeCount(String mobile);
	
	List<JtMessageConsumer> getAllUser();
	
	int getCountByMobile(@Param("id")String id,@Param("mobile")String mobile,@Param("type")Integer type);

	List<String> getUserListMobile();

	String getInvitationCode(String uid);

	User getToInviteCode(String toInviteCode);
}
