package com.goafanti.common.dao;

import com.goafanti.common.bo.userDaysBo;
import com.goafanti.common.model.UserLockRelease;
import com.goafanti.common.model.UserLockReleaseExample;
import com.goafanti.customer.bo.LockingReleaseBo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface UserLockReleaseMapper {

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	long countByExample(UserLockReleaseExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int deleteByExample(UserLockReleaseExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int deleteByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int insert(UserLockRelease record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int insertSelective(UserLockRelease record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	List<UserLockRelease> selectByExample(UserLockReleaseExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	UserLockRelease selectByPrimaryKey(String id);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int updateByExampleSelective(@Param("record") UserLockRelease record,
			@Param("example") UserLockReleaseExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int updateByExample(@Param("record") UserLockRelease record, @Param("example") UserLockReleaseExample example);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int updateByPrimaryKeySelective(UserLockRelease record);

	/**
	 * This method was generated by MyBatis Generator. This method corresponds to the database table user_lock_release
	 * @mbg.generated  Mon May 07 09:56:32 CST 2018
	 */
	int updateByPrimaryKey(UserLockRelease record);

	int deleteLockByOrder(@Param("orderNo")String orderNo,@Param("businessProjectId") String businessProjectId);

	/**
	 * 重新锁定
	 * @param aid
	 * @param uid
	 * @return
	 */
	int updateUserLock(@Param("uid")String uid,@Param("aid")String aid,@Param("oldStatus")Integer oldStatus,@Param("newStatus")Integer newStatus);

	int updateUsersLock(@Param("uList")List<String> uList,@Param("aid")String aid,@Param("oldStatus")Integer oldStatus,@Param("newStatus")Integer newStatus);

	int updateUserTypeLock(@Param("uid")String uid,@Param("aid")String aid,@Param("type")Integer type,
			@Param("newStatus")Integer newStatus,@Param("date") Date date);
	void updateUserTypeLockList(@Param("list")List<String> list, @Param("aid")String aid,@Param("type")Integer type,
			@Param("newStatus")Integer newStatus,@Param("date") Date date);

	List<LockingReleaseBo> selectWaitReleaseCustomer(@Param("aid")String aid);

	List<LockingReleaseBo> selectWaitReleaseBusiness(String aid);


	void updatePendingReleaseLock(@Param("lockIds")String lockIds);

	List<LockingReleaseBo> selectPendinglockUserList();

	void updateProject(@Param("uid")String uid, @Param("aid")String aid, @Param("businessProjectId")String businessProjectId);

	List<LockingReleaseBo> checkTask(@Param("buyerId")String buyerId, @Param("commodityId")String commodityId);


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

	List<LockingReleaseBo> checkUserProject(@Param("uid")String uid, @Param("pid")String pid, @Param("aid")String aid);

	List<userDaysBo> selectUserDays(@Param("aid")String aid,  @Param("y")Integer y);



	int insertList(List<UserLockRelease> ulrList);

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

	int selectByUidGetCount(@Param("aid")String aid, @Param("uid")String uid);

	void updateReleaseList( @Param("list")List<String> list);

	void updateReleaseUser(String orderNo);

	void updateByAidAndUid( @Param("uid")String uid);

	List<userDaysBo> selectChannelUserDays(@Param("days")Integer days, @Param("aid")String aid);

	List<String> selectByids(List<String> uids);

	void insertChannelList(@Param("list")List<String> list, @Param("aid")String aid);

	void updateChannelList(@Param("list")List<String> list);

	List<userDaysBo> selectChannelNotFollow(@Param("days")Integer days, @Param("aid")String aid);


}
