| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.moral.common.util.MyBatisBaseMapUtil;
|
| | | import com.moral.common.util.*;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.springframework.util.ObjectUtils;
|
| | |
| | | import com.moral.common.bean.Constants;
|
| | | import com.moral.common.bean.PageBean;
|
| | | import com.moral.common.exception.BusinessException;
|
| | | import com.moral.common.util.Crypto;
|
| | | import com.moral.common.util.ResourceUtil;
|
| | | import com.moral.common.util.ValidateUtil;
|
| | | import com.moral.entity.OperateUser;
|
| | | import com.moral.mapper.OperateUserMapper;
|
| | | import com.moral.service.OperateUserService;
|
| | |
| | | private static Class ENTITY_CLASS = OperateUser.class;
|
| | | @Resource
|
| | | private OperateUserMapper operateUserMapper;
|
| | |
|
| | | @Override
|
| | | public boolean isUniqueProperty(String propertyName, Object value){
|
| | | Example example = new Example(ENTITY_CLASS);
|
| | | example.or().andEqualTo(propertyName,value);
|
| | | return operateUserMapper.selectCountByExample(example)==0;
|
| | | }
|
| | | @Override
|
| | | public OperateUser getOperateUserByMobile(String mobile) {
|
| | | OperateUser operateUser = new OperateUser();
|
| | |
| | | if (parameters.containsKey("sorter")) {
|
| | | example.setOrderByClause((String) parameters.get("sorter"));
|
| | | }
|
| | | criteria.andEqualTo("isDelete", Constants.IS_DELETE_FALSE);
|
| | | Object isDelete = parameters.get("isDelete");
|
| | | criteria.andEqualTo("isDelete",isDelete!=null?isDelete:0);
|
| | | // criteria.andEqualTo("isDelete", Constants.IS_DELETE_FALSE);
|
| | | PageHelper.startPage(Integer.valueOf((String) parameters.get("pi")), Integer.valueOf((String) parameters.get("ps")));
|
| | | List<OperateUser> operateUsers = operateUserMapper.selectByExample(example);
|
| | | return new PageBean<OperateUser>(operateUsers);
|
| | |
| | | operateUser.setPassword(Crypto.md5(ResourceUtil.getValue("password")));
|
| | | return operateUserMapper.insertSelective(operateUser);
|
| | | }else {
|
| | | if(!StringUtils.isNullOrEmpty(operateUser.getPassword())){
|
| | | // 明码加密
|
| | | operateUser.setPassword(Crypto.md5(operateUser.getPassword()));
|
| | | }
|
| | | return operateUserMapper.updateByPrimaryKeySelective(operateUser);
|
| | | }
|
| | | }
|
| | |
| | | public PageBean queryByPageBean(PageBean pageBean) {
|
| | | return MyBatisBaseMapUtil.queryPage(operateUserMapper,pageBean,ENTITY_CLASS);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Integer updateOperateUser(OperateUser operateUser) {
|
| | | return operateUserMapper.updateByPrimaryKeySelective(operateUser);
|
| | | }
|
| | | }
|