package com.goafanti.common.dao;

import com.goafanti.common.model.UserBusiness;
import com.goafanti.common.model.UserBusinessExample;
import com.goafanti.customer.bo.BusinessListBo;
import com.goafanti.customer.bo.BussinessFollowBo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface UserBusinessMapper {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	long countByExample(UserBusinessExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int deleteByExample(UserBusinessExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int deleteByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int insert(UserBusiness record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int insertSelective(UserBusiness record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	List<UserBusiness> selectByExample(UserBusinessExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	UserBusiness selectByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int updateByExampleSelective(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int updateByExample(@Param("record") UserBusiness record, @Param("example") UserBusinessExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int updateByPrimaryKeySelective(UserBusiness record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_business
	 * @mbg.generated  Sat May 05 10:50:19 CST 2018
	 */
	int updateByPrimaryKey(UserBusiness record);

	List<BusinessListBo> selectBusinessGlossory();

	int judgeBusiness(@Param("uid")String uid,@Param("businessProjectId")String businessProjectId,@Param("aid")String aid);

	List<BusinessListBo> selectBusinessByUAid(@Param("uid")String uid, @Param("aid")String aid);
	
	List<BusinessListBo> selectLockedBusinessByUAid(@Param("uid")String uid, @Param("aid")String aid);
	
	List<BusinessListBo> selectBusinessProjectByUAPid(@Param("uid")String uid, @Param("aid")String aid, @Param("pid")String pid);

	BussinessFollowBo findBusinessDetail(@Param("businessId")String businessId);

	BussinessFollowBo findFollowOneBusiness(@Param("ufbId") String ufbId);
	
	int selectFollowCountByUAid(@Param("uid")String uid, @Param("aid")String aid);

	void updateDimissionTransfer(@Param("aid")String aid, @Param("transferId")String transferId);

	int checkLock(@Param("aid")String aid, @Param("uid")String uid, @Param("pid")String pid);

	void updateAidByUidAndPid(@Param("aid") String aid, @Param("uid") String uid, @Param("pid") String pid);
}