Package com.sm.web.rbac.model

Source Code of com.sm.web.rbac.model.AccountModel

package com.sm.web.rbac.model;

import java.util.List;

import org.springframework.stereotype.Service;

import com.sm.framework.base.BaseModel;
import com.sm.framework.tag.paginate.Page;
import com.sm.framework.util.queryModel.QueryModel;
import com.sm.framework.util.string.StringUtil;
import com.sm.web.rbac.pojo.Account;

/**
* ��Ŀ��schoolMedia��Ŀ
*
* �������˻�Model
*
* ����ʱ�䣺2012-12-2 ����2:37:32 �����ˣ���С�� �汾��version 0.10
*
* �޸�ʱ�䣺2012-12-2 ����2:37:32 �޸��ˣ���С�� �޶��汾��version 0.10
*/
@Service
public class AccountModel extends BaseModel<Account> {

  /**
   * �������˻��б�
   *
   * @param account
   * @param page
   * @return 2012-12-2 ����2:57:51 ��С��
   */
  public List<Account> queryAccountListPage(Account account, Page page) {

    QueryModel model = new QueryModel();

    if (null != account) {
      model.combLike("account", account.getAccount());
    }
    // ����id��Ѱ
    model.setOrder("id DESC");
    return super.queryByModel(model);
  }

  /**
   * �����������ʺ�
   *
   * @param account
   *            2012-12-9 ����8:01:09 ��С��
   */
  public void addAccount(Account account) {
    super.save(account);
  }

  /**
   * ������ɾ���ʺ�
   *
   * @param accountId
   *            2012-12-9 ����8:03:33 ��С��
   */
  public void deleteAccount(Integer accountId) {
    super.delete(accountId);
  }

  /**
   * ����������ɾ���ʺ�
   *
   * @param accountIds
   *            2012-12-13 ����9:00:14 ��С��
   */
  public void deleteAccount(String accountIds) {
    super.delete(accountIds);
  }

  /**
   * �������޸��ʺ�
   *
   * @param account
   * @return 2012-12-9 ����8:07:26 ��С��
   */
  public Account updateAccount(Account account) {
    return super.update(account);
  }

  /**
   * ����������id �����ʺ�
   *
   * @param accountId
   * @return 2012-12-9 ����8:17:54 ��С��
   */
  public Account findAccount(Integer accountId) {
    return super.findById(accountId);
  }

  /**
   * ������ͨ���ʺź������ȡ�˻�
   *
   * @param account
   * @param password
   * @return 2012-12-2 ����3:17:00 ��С��
   */
  public Account getAccount(String account, String password) {
    QueryModel model = new QueryModel();
    if (!StringUtil.isEmpty(account) && !StringUtil.isEmpty(password)) {
      model.combEquals("account", account);
      model.combEquals("password", password);
    }
    return super.findByModel(model);
  }
}
TOP

Related Classes of com.sm.web.rbac.model.AccountModel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.