package com.blueland.ebpm.home.dao;

import org.springframework.stereotype.Repository;

import com.blueland.bpm.common.base.BaseIbatis3Dao;
import com.blueland.bpm.identity.model.User;

@Repository
public class UserEntityDao extends BaseIbatis3Dao<User,String>{
	/**
	 * 更新用户数据
	 * @param user
	 * @return
	 */
	public int updateByUserId(User user) {
		return getSqlSessionTemplate().update("UserEntity.updateByUserId",user);
	}

	public int insertObj(User user) {
		return getSqlSessionTemplate().insert("UserEntity.insert",user);
	}

	public int deleteByUserId(String userId) {
		return getSqlSessionTemplate().delete("UserEntity.deleteByUserId",userId);
	}
	/**
	 * 查询用户信息
	 * @param staffPostCode
	 * @return
	 */
	public User findUserByUserId(String userId) {
		return getSqlSessionTemplate().selectOne("UserEntity.findUserByUserId", userId);
	}

	public User findUserByRemark(String remark) {
		return getSqlSessionTemplate().selectOne("UserEntity.findUserByRemark", remark);
	}
	/**
	 * 根据用户 num 更新数据
	 * @param user
	 */
	public int updateByRemark(User user) {
		return getSqlSessionTemplate().update("UserEntity.updateByRemark",user);
	}

	public int updateStatusByUserId(String userId) {
		return getSqlSessionTemplate().update("UserEntity.updateStatusByUserId",userId);
	}

   public int updateQyStatusByUserId(String userId) {
	   return getSqlSessionTemplate().update("UserEntity.updateQyStatusByUserId", userId);
   }
	
}
