Ejemplo n.º 1
0
  @Override
  public Page getByRoleId(UserCriteria userCriteria) {
    Page page = new Page();

    List<User> list = userMapper.selectByRoleId(userCriteria);
    page.setRows(list);
    int total = userMapper.countByRoleId(userCriteria);
    page.setTotal(total);
    return page;
  }
Ejemplo n.º 2
0
 @Override
 public Page getByOrgId(UserCriteria userCriteria) {
   Page page = new Page();
   @SuppressWarnings("rawtypes")
   List list = userMapper.selectByOrgId(userCriteria);
   page.setRows(list);
   int total = userMapper.countByOrgId(userCriteria);
   page.setTotal(total);
   return page;
 }
Ejemplo n.º 3
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.jcin.cms.service.system.IUserService#select(com.jcin.cms.utils.Page)
  */
 @Override
 public Page select(Page page) {
   super.select(page);
   // setOrderByClause("SER_NO  asc , ORG_ID desc");
   UserCriteria userCriteria = new UserCriteria();
   userCriteria.setOrderByClause("id desc");
   userCriteria.setPage(page);
   @SuppressWarnings("rawtypes")
   List list = userMapper.selectByExample(userCriteria);
   page.setRows(list);
   int total = userMapper.countByExample(userCriteria);
   page.setTotal(total);
   return page;
 }
Ejemplo n.º 4
0
 // @Override
 @Override
 public Page select(UserCriteria criteria) {
   Page page = new Page();
   if (null != criteria) {
     if (null != criteria.getPage()) {
       page = criteria.getPage();
     }
   }
   @SuppressWarnings("rawtypes")
   List list = userMapper.selectByExample(criteria);
   page.setRows(list);
   int total = userMapper.countByExample(criteria);
   page.setTotal(total);
   return page;
 }
Ejemplo n.º 5
0
 @Override
 public boolean checkUsernamePassword(String username, String password) {
   UserCriteria userCriteria = new UserCriteria();
   userCriteria.createCriteria().andUsernameEqualTo(username).andPasswordEqualTo(password);
   List<User> list = userMapper.selectByExample(userCriteria);
   return (null != list && list.size() > 0) ? true : false;
 }
Ejemplo n.º 6
0
 @Override
 public User findByUsername(String username) {
   UserCriteria userCriteria = new UserCriteria();
   userCriteria.createCriteria().andUsernameEqualTo(username);
   List<User> list = userMapper.selectByExample(userCriteria);
   return (null != list && list.size() > 0) ? list.get(0) : null;
 }
Ejemplo n.º 7
0
  /*
   * (non-Javadoc)
   *
   * @see
   * com.jcin.cms.service.system.IUserService#selectByPrimaryKey(java.lang
   * .String)
   */
  @Override
  public User selectByPrimaryKey(String id) {
    super.selectByPrimaryKey(id);

    User article = userMapper.selectByPrimaryKey(id);
    return article;
  }
Ejemplo n.º 8
0
  /*
   * (non-Javadoc)
   *
   * @see
   * com.jcin.cms.service.system.IUserService#deleteByPrimaryKey((java.lang
   * .String ))
   */
  @Override
  @Transactional(readOnly = false)
  public int deleteByPrimaryKey(String id) {
    // super.deleteByPrimaryKey(id);

    int result = userMapper.deleteByPrimaryKey(id);
    return result;
  }
Ejemplo n.º 9
0
 @Override
 public boolean updatePassword(User user) {
   // User user2 = userMapper.selectByPrimaryKey(user.getId());
   // user2.setPassword(user.getPassword());
   userMapper.updateByPrimaryKeySelective(user);
   //		systemRealm.clearCachedAuthorizationInfo(user.getUsername());
   return true;
 }
Ejemplo n.º 10
0
 /*
  * (non-Javadoc)
  *
  * @see com.jcin.cms.service.system.IUserService#deleteBatch(List)
  */
 @Override
 @Transactional(readOnly = false)
 public int deleteBatch(List<String> list) {
   UserCriteria userCriteria = new UserCriteria();
   userCriteria.createCriteria().andIdIn(list);
   int result = userMapper.deleteByExample(userCriteria);
   super.deleteBatch(list);
   return result;
 }
Ejemplo n.º 11
0
 /*
  * (non-Javadoc)
  *
  * @see com.jcin.cms.service.system.IUserService#insertBatch(List)
  */
 @Override
 @Transactional(readOnly = false)
 public int insertBatch(List<User> list) {
   int result = userMapper.insertBatch(list);
   super.insertBatch(list);
   for (User user : list) {
     String password = PasswordHelper.encryptPassword(user.getPassword());
     user.setPassword(password);
   }
   return result;
 }
Ejemplo n.º 12
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.jcin.cms.service.system.IUserService#update(com.jcin.cms.service.
  * system. User)
  */
 @Override
 @Transactional(readOnly = false)
 public String update(User record) {
   // super.update(record);
   record.setUpdateDate(new Date());
   if ("".equals(record.getMemberLebelId())) {
     record.setMemberLebelId(null);
   }
   int result = userMapper.updateByPrimaryKeySelective(record);
   return record.getId();
 }
Ejemplo n.º 13
0
 /*
  * (non-Javadoc)
  *
  * @see
  * com.jcin.cms.service.system.IUserService#insert(com.jcin.cms.service.
  * system. User)
  */
 @Override
 @Transactional(readOnly = false)
 public String insert(User record) {
   if (record.getId() == null) super.insert(record);
   if ("".equals(record.getMemberLebelId())) {
     record.setMemberLebelId(null);
   }
   String password = PasswordHelper.encryptPassword(record.getPassword());
   record.setPassword(password);
   record.setCreateDate(new Date());
   int result = userMapper.insert(record);
   String id = record.getId();
   return id;
 }
Ejemplo n.º 14
0
 /*
  * (non-Javadoc)
  *
  * @see com.jcin.cms.service.system.IUserService#selectAll()
  */
 @Override
 public List<User> selectAll() {
   List<User> list = userMapper.selectByExample(null);
   return list;
 }