package com.goafanti.common.dao;

import com.goafanti.common.model.UserLockRelease;
import com.goafanti.common.model.UserLockReleaseExample;
import com.goafanti.customer.bo.LockingReleaseBo;

import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

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 oldAid
	 * @param aid
	 * @param uid
	 * @return
	 */
	int updateUserLock(@Param("uid")String uid,@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);

	List<LockingReleaseBo> selectWaitReleaseCustomer(String aid);

	List<LockingReleaseBo> selectWaitReleaseBusiness(String aid);

	void updateReleaseLock(@Param("time")String time);

	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);


	void updateBatchReleaseProject(@Param("uids")List<String> uids, @Param("receiveId")String receiveId, @Param("aid")String aid);

	void updateBatchlockProject(@Param("uid")List<String> uids, @Param("receiveId")String receiveId, @Param("aid")String aid);

	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);

}