package cn.com.qmth.stmms.biz.user.service.query;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import cn.com.qmth.stmms.biz.common.BaseQuery;
import cn.com.qmth.stmms.biz.user.model.User;
import cn.com.qmth.stmms.common.enums.Role;
import cn.com.qmth.stmms.common.enums.UserType;

public class UserSearchQuery extends BaseQuery<User> {

    private int schoolId;

    private UserType type;

    private String loginName;

    private String name;

    private Set<Role> includeRoles;

    private Date lastLoginTime;

    public int getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(int schoolId) {
        this.schoolId = schoolId;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Set<Role> getIncludeRoles() {
        return includeRoles;
    }

    public void addIncludeRole(Role role) {
        if (includeRoles == null) {
            includeRoles = new HashSet<Role>();
        }
        if (role != null) {
            includeRoles.add(role);
        }
    }

    public UserType getType() {
        return type;
    }

    public void setType(UserType type) {
        this.type = type;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }
}
