|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.Wrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
|---|
|  |  |  | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
|---|
|  |  |  | import com.doumee.biz.system.SystemDictDataBiz; | 
|---|
|  |  |  | import com.doumee.core.utils.DateUtil; | 
|---|
|  |  |  | import com.doumee.dao.business.model.Member; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageData; | 
|---|
|  |  |  | import com.doumee.service.business.third.model.PageWrap; | 
|---|
|  |  |  | 
|---|
|  |  |  | public void updateById(SystemUser systemUser) { | 
|---|
|  |  |  | systemUserMapper.updateById(systemUser); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | 
|---|
|  |  |  | .eq(SystemUser::getDeleted,Constants.ZERO) | 
|---|
|  |  |  | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) | 
|---|
|  |  |  | .leftJoin(Member.class,Member::getId,SystemUser::getMemberId) | 
|---|
|  |  |  | .leftJoin(" position p on p.id = t2.POSITION_ID ") | 
|---|
|  |  |  | .and(StringUtils.isNotBlank(systemUser.getUsername()),ms->ms.like(SystemUser::getUsername,systemUser.getUsername()) | 
|---|
|  |  |  | .or().like(SystemUser::getMobile,systemUser.getUsername()) | 
|---|
|  |  |  | .or().like(SystemUser::getRealname,systemUser.getUsername())) | 
|---|
|  |  |  | 
|---|
|  |  |  | .like(StringUtils.isNotBlank(systemUser.getUsername()),SystemUser::getUsername,systemUser.getUsername()) | 
|---|
|  |  |  | .like(StringUtils.isNotBlank(systemUser.getCompanyName()),Company::getName,systemUser.getCompanyName()) | 
|---|
|  |  |  | .apply(StringUtils.isNotBlank(systemUser.getCompanySpecialId())," find_in_set('"+systemUser.getCompanySpecialId()+"',REPLACE(t1.company_path,'/',','))") | 
|---|
|  |  |  | .orderByAsc( Company::getPinyin ) | 
|---|
|  |  |  | .orderByAsc( Company::getSortnum ) | 
|---|
|  |  |  | .orderByAsc( " p.SORTNUM " ) | 
|---|
|  |  |  | .orderByAsc(SystemUser::getPinyin) | 
|---|
|  |  |  | ; | 
|---|
|  |  |  | List<SystemUser> result = systemUserJoinMapper.selectJoinList( SystemUser.class, wrapper); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | MPJLambdaWrapper<SystemUser> queryWrapper = new MPJLambdaWrapper<>(); | 
|---|
|  |  |  | queryWrapper.selectAll(SystemUser.class); | 
|---|
|  |  |  | queryWrapper.eq(SystemUser::getDeleted, Constants.ZERO); | 
|---|
|  |  |  | queryWrapper.leftJoin(Company.class,Company::getId,SystemUser::getCompanyId); | 
|---|
|  |  |  | queryWrapper.eq(Company::getType,Constants.ONE); | 
|---|
|  |  |  | queryWrapper.orderByAsc(SystemUser::getPinyin); | 
|---|
|  |  |  | queryWrapper.leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) | 
|---|
|  |  |  | .leftJoin(" position p on p.id = t2.POSITION_ID "); | 
|---|
|  |  |  | queryWrapper.eq(Company::getType,Constants.ONE) | 
|---|
|  |  |  | .orderByAsc( Company::getSortnum ) | 
|---|
|  |  |  | .orderByAsc( " p.SORTNUM " ) | 
|---|
|  |  |  | .orderByAsc(SystemUser::getPinyin); | 
|---|
|  |  |  | List<SystemUser> result = systemUserJoinMapper.selectJoinList( SystemUser.class, queryWrapper); | 
|---|
|  |  |  | return result; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void jobForOpenProhibitStatus() { | 
|---|
|  |  |  | systemUserMapper.update(null,new UpdateWrapper<SystemUser>().lambda() | 
|---|
|  |  |  | .set(SystemUser::getProhibitStatus,Constants.ZERO) | 
|---|
|  |  |  | .set(SystemUser::getErrTimes,Constants.ZERO) | 
|---|
|  |  |  | .setSql(" PROHIBIT_REMARK = '于"+ DateUtil.getCurrDateTime()+"自动解除禁止登录!' ") | 
|---|
|  |  |  | .eq(SystemUser::getProhibitStatus,Constants.ONE) | 
|---|
|  |  |  | .apply("  now() > PROHIBIT_TIME " ) | 
|---|
|  |  |  | ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|