Java 类ims.admin.vo.domain.AppUserShortVoAssembler 实例源码

项目:AvoinApotti    文件:ReadAuditViewImpl.java   
/**
* List all app users for the combo
*/
public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:AvoinApotti    文件:AuditListImpl.java   
/**
* List all app users for the combo
*/
public AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        query.append(" order by user.username");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openMAXIMS    文件:ReadAuditViewImpl.java   
/**
* List all app users for the combo
*/
public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'xxxxx' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openMAXIMS    文件:AuditListImpl.java   
/**
* List all app users for the combo
*/
public AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'xxxxx' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        query.append(" order by user.username");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openMAXIMS    文件:ReadAuditViewImpl.java   
/**
* List all app users for the combo
*/
public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openMAXIMS    文件:AuditListImpl.java   
/**
* List all app users for the combo
*/
public AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        query.append(" order by user.username");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openmaxims-linux    文件:ReadAuditViewImpl.java   
/**
* List all app users for the combo
*/
public ims.admin.vo.AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:openmaxims-linux    文件:AuditListImpl.java   
/**
* List all app users for the combo
*/
public AppUserShortVoCollection listAppUsers(java.lang.String name)
{
    StringBuilder query = new StringBuilder();
    query.append("from AppUser as user where user.username != 'imsadmin' ");

    if (name != null)
    {
        query.append(" and (UPPER(user.username) LIKE :NAME)");

        ArrayList<String> paramNames = new ArrayList<String>();
        paramNames.add("NAME");
        ArrayList<Object> paramValues = new ArrayList<Object>();
        paramValues.add("%" + name.toUpperCase() + "%");

        query.append(" order by user.username");

        return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString(), paramNames, paramValues));
    }

    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(getDomainFactory().find(query.toString()));
}
项目:AvoinApotti    文件:SystemJobNotificationDialogImpl.java   
public AppUserShortVoCollection getAppUsers(String username)
{
    DomainFactory factory = getDomainFactory();
    String hqlString = "from AppUser appUser where appUser.isActive = :ACTIVE and appUser.username like :USERNAME";
    List appUsers = factory.find(hqlString, new String[] {"ACTIVE", "USERNAME"}, new Object[] {Boolean.TRUE, username});
    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(appUsers);
}
项目:AvoinApotti    文件:SystemJobsImpl.java   
public AppUserShortVo getAppUsersShort(AppUserShortVo voRef) 
{
    if (voRef == null)
        return null;

    DomainFactory factory = getDomainFactory();
    AppUser domAppUser = (AppUser)factory.getDomainObject(AppUser.class, voRef.getID_AppUser()); 

    return AppUserShortVoAssembler.create(domAppUser);
}
项目:AvoinApotti    文件:RulesEditorComponentImpl.java   
public AppUserShortVo getAppUserShortVo(AppUserRefVo refVo)
{
    if (refVo == null)
        throw new RuntimeException("Cannot get AppUserShortVo for null AppUserShortRefVo");

    AppUser doAppUser = (AppUser) getDomainFactory().getDomainObject(AppUser.class, refVo.getID_AppUser());
    return AppUserShortVoAssembler.create(doAppUser);       
}
项目:openMAXIMS    文件:SystemJobNotificationDialogImpl.java   
public AppUserShortVoCollection getAppUsers(String username)
{
    DomainFactory factory = getDomainFactory();
    String hqlString = "from AppUser appUser where appUser.isActive = :ACTIVE and appUser.username like :USERNAME";
    List appUsers = factory.find(hqlString, new String[] {"ACTIVE", "USERNAME"}, new Object[] {Boolean.TRUE, username});
    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(appUsers);
}
项目:openMAXIMS    文件:PatientSearchConfigurationImpl.java   
@Override
public AppUserShortVo getApptUserShort(AppUserRefVo userId) 
{
    if (userId != null)
    {   
     AppUser user = (AppUser) getDomainFactory().getDomainObject(AppUser.class,userId.getID_AppUser());
        return AppUserShortVoAssembler.create(user);
    }
    return null;
}
项目:openMAXIMS    文件:SystemJobsImpl.java   
public AppUserShortVo getAppUsersShort(AppUserShortVo voRef) 
{
    if (voRef == null)
        return null;

    DomainFactory factory = getDomainFactory();
    AppUser domAppUser = (AppUser)factory.getDomainObject(AppUser.class, voRef.getID_AppUser()); 

    return AppUserShortVoAssembler.create(domAppUser);
}
项目:openMAXIMS    文件:RulesEditorComponentImpl.java   
public AppUserShortVo getAppUserShortVo(AppUserRefVo refVo)
{
    if (refVo == null)
        throw new RuntimeException("Cannot get AppUserShortVo for null AppUserShortRefVo");

    AppUser doAppUser = (AppUser) getDomainFactory().getDomainObject(AppUser.class, refVo.getID_AppUser());
    return AppUserShortVoAssembler.create(doAppUser);       
}
项目:openMAXIMS    文件:SystemJobNotificationDialogImpl.java   
public AppUserShortVoCollection getAppUsers(String username)
{
    DomainFactory factory = getDomainFactory();
    String hqlString = "from AppUser appUser where appUser.isActive = :ACTIVE and appUser.username like :USERNAME";
    List appUsers = factory.find(hqlString, new String[] {"ACTIVE", "USERNAME"}, new Object[] {Boolean.TRUE, username});
    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(appUsers);
}
项目:openMAXIMS    文件:SystemJobsImpl.java   
public AppUserShortVo getAppUsersShort(AppUserShortVo voRef) 
{
    if (voRef == null)
        return null;

    DomainFactory factory = getDomainFactory();
    AppUser domAppUser = (AppUser)factory.getDomainObject(AppUser.class, voRef.getID_AppUser()); 

    return AppUserShortVoAssembler.create(domAppUser);
}
项目:openMAXIMS    文件:RulesEditorComponentImpl.java   
public AppUserShortVo getAppUserShortVo(AppUserRefVo refVo)
{
    if (refVo == null)
        throw new RuntimeException("Cannot get AppUserShortVo for null AppUserShortRefVo");

    AppUser doAppUser = (AppUser) getDomainFactory().getDomainObject(AppUser.class, refVo.getID_AppUser());
    return AppUserShortVoAssembler.create(doAppUser);       
}
项目:openmaxims-linux    文件:SystemJobNotificationDialogImpl.java   
public AppUserShortVoCollection getAppUsers(String username)
{
    DomainFactory factory = getDomainFactory();
    String hqlString = "from AppUser appUser where appUser.isActive = :ACTIVE and appUser.username like :USERNAME";
    List appUsers = factory.find(hqlString, new String[] {"ACTIVE", "USERNAME"}, new Object[] {Boolean.TRUE, username});
    return AppUserShortVoAssembler.createAppUserShortVoCollectionFromAppUser(appUsers);
}
项目:openmaxims-linux    文件:SystemJobsImpl.java   
public AppUserShortVo getAppUsersShort(AppUserShortVo voRef) 
{
    if (voRef == null)
        return null;

    DomainFactory factory = getDomainFactory();
    AppUser domAppUser = (AppUser)factory.getDomainObject(AppUser.class, voRef.getID_AppUser()); 

    return AppUserShortVoAssembler.create(domAppUser);
}
项目:openmaxims-linux    文件:RulesEditorComponentImpl.java   
public AppUserShortVo getAppUserShortVo(AppUserRefVo refVo)
{
    if (refVo == null)
        throw new RuntimeException("Cannot get AppUserShortVo for null AppUserShortRefVo");

    AppUser doAppUser = (AppUser) getDomainFactory().getDomainObject(AppUser.class, refVo.getID_AppUser());
    return AppUserShortVoAssembler.create(doAppUser);       
}
项目:AvoinApotti    文件:ApplicationUsersImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:AvoinApotti    文件:RulesEditorComponentImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:AvoinApotti    文件:DiagnosisComplicationsImpl.java   
public AppUserShortVo getAppUser(AppUserVo user) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (user.getUsername() != null && user.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(user.getUsername().trim().toUpperCase() + "%");      
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + user.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (user.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (user.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(user.getIsActive());     
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    if(l != null && l.size() > 0)
    {
        AppUser domUser = (AppUser)l.get(0);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());

        return voUser;

    }
    return null;

}
项目:openMAXIMS    文件:PDSBackOfficeWorklistImpl.java   
public ims.admin.vo.AppUserShortVoCollection listUsers(ims.admin.vo.AppUserShortVo filter)
{

    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    if (filter.getUsername() != null && filter.getUsername().length() > 0)

    {
        hql = " from AppUser u ";
        clause.append(" upper(u.username) like :username");
        names.add("username");
        values.add("%" + filter.getUsername().trim().toUpperCase() + "%");
        andStr = " and ";
    }       
    clause.append(andStr + " u.isActive = :isActive" );
    names.add("isActive");
    values.add(Boolean.TRUE);       
    andStr = " and ";

    clause.append(andStr).append(" u.username != 'xxxxx'");
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();
    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List<?> list = factory.find(hql, names, values);

    for (int i = 0; i < list.size(); i++)
    {
        AppUser domUser = (AppUser) list.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);    
    }
    return ret.sort();

}
项目:openMAXIMS    文件:ApplicationUsersImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    if (appUserFilter.getLockedIsNotNull())
    {
        clause.append(andStr + " u.locked = :isLocked" );
        names.add("isLocked");
        values.add(appUserFilter.getLocked());      
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'xxxxx'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openMAXIMS    文件:PatientSearchConfigurationImpl.java   
@Override
public AppUserShortVoCollection listUsers(AppUserShortVo filter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    if (filter.getUsername() != null && filter.getUsername().length() > 0)
    {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + filter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
    }       
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(Boolean.TRUE);       
        andStr = " and ";

    clause.append(andStr).append(" u.username != 'xxxxx'");
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();
    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List<?> list = factory.find(hql, names, values);

    for (int i = 0; i < list.size(); i++)
    {
        AppUser domUser = (AppUser) list.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);    
    }
    return ret.sort();
}
项目:openMAXIMS    文件:RulesEditorComponentImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'xxxxx'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openMAXIMS    文件:DiagnosisComplicationsImpl.java   
public AppUserShortVo getAppUser(AppUserVo user) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (user.getUsername() != null && user.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(user.getUsername().trim().toUpperCase() + "%");      
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + user.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (user.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (user.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(user.getIsActive());     
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'xxxxx'");  
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    if(l != null && l.size() > 0)
    {
        AppUser domUser = (AppUser)l.get(0);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());

        return voUser;

    }
    return null;

}
项目:openMAXIMS    文件:ApplicationUsersImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openMAXIMS    文件:RulesEditorComponentImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openMAXIMS    文件:DiagnosisComplicationsImpl.java   
public AppUserShortVo getAppUser(AppUserVo user) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (user.getUsername() != null && user.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(user.getUsername().trim().toUpperCase() + "%");      
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + user.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (user.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (user.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(user.getIsActive());     
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    if(l != null && l.size() > 0)
    {
        AppUser domUser = (AppUser)l.get(0);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());

        return voUser;

    }
    return null;

}
项目:openmaxims-linux    文件:ApplicationUsersImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openmaxims-linux    文件:RulesEditorComponentImpl.java   
public AppUserShortVoCollection listAppUsers(AppUserShortVo appUserFilter) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (appUserFilter.getUsername() != null && appUserFilter.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(appUserFilter.getUsername().trim().toUpperCase() + "%");     
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + appUserFilter.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (appUserFilter.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (appUserFilter.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(appUserFilter.getIsActive());        
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  // wdev-7907
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    for (int i = 0; i < l.size(); i++)
    {
        AppUser domUser = (AppUser)l.get(i);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());
        ret.add(voUser);

    }
    return ret.sort();
}
项目:openmaxims-linux    文件:DiagnosisComplicationsImpl.java   
public AppUserShortVo getAppUser(AppUserVo user) 
{
    DomainFactory factory = getDomainFactory();
    String andStr = " ";
    StringBuffer clause = new StringBuffer();

    ArrayList<String> names = new ArrayList<String>();
    ArrayList<Object> values = new ArrayList<Object>();

    String hql = "  from AppUser u ";

    boolean mosRequired = !ConfigFlag.GEN.ALLOW_NON_MOS_USERS.getValue();

    if (user.getUsername() != null && user.getUsername().length() > 0)
    {
        if (mosRequired)
        {
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
            clause.append(" upper(mos.appUser.username) like :username");//name.upperSurname like :username");
            names.add("username");
            values.add(user.getUsername().trim().toUpperCase() + "%");      
            andStr = " and ";               
        }
        else
        {
            hql = " from AppUser u ";
            clause.append(" upper(u.username) like :username");
            names.add("username");
            values.add("%" + user.getUsername().trim().toUpperCase() + "%");
            andStr = " and ";
        }
    }       
    else if (user.getUsername() == null)
    {
        if (mosRequired)
            hql = " select u from MemberOfStaff mos inner join mos.appUser u ";
    }

    if (user.getIsActive() != null)
    {
        clause.append(andStr + " u.isActive = :isActive" );
        names.add("isActive");
        values.add(user.getIsActive());     
        andStr = " and ";
    }

    clause.append(andStr).append(" u.username != 'imsadmin'");  
    andStr=" and ";

    if (andStr.equals(" and "))
    {
        hql += " where ";
    }
    hql += clause.toString();

    AppUserShortVoCollection ret = new AppUserShortVoCollection();
    List l = factory.find(hql, names, values);
    if(l != null && l.size() > 0)
    {
        AppUser domUser = (AppUser)l.get(0);
        AppUserShortVo voUser = AppUserShortVoAssembler.create(domUser);
        if (domUser.getMos() != null && domUser.getMos().getName() != null)
            voUser.setUserRealName(domUser.getMos().getName().toString());

        return voUser;

    }
    return null;

}