嗨森逛服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hai-server/hai-service/src/main/java/com/hai/service/impl/HighUserServiceImpl.java

64 lines
1.9 KiB

package com.hai.service.impl;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighUserMapper;
import com.hai.entity.HighUser;
import com.hai.entity.HighUserExample;
import com.hai.service.HighUserService;
import com.sun.xml.bind.v2.model.core.ID;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @author Sum1Dream
*/
@Service("highUserServiceImpl")
public class HighUserServiceImpl implements HighUserService {
@Resource
private HighUserMapper highUserMapper;
@Override
public List<HighUser> getListUser(Map<String, String> map) {
HighUserExample example = new HighUserExample();
HighUserExample.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(map.get("phone"))) {
criteria.andPhoneEqualTo(Long.valueOf(map.get("phone")));
}
if (StringUtils.isNotBlank(map.get("name"))) {
criteria.andNameLike("%" + map.get("name") + "%");
}
if (StringUtils.isNotBlank(map.get("status"))) {
criteria.andStatusEqualTo(Integer.valueOf(map.get("status")));
}
if (StringUtils.isNotBlank(map.get("regTimeStart")) && StringUtils.isNotBlank(map.get("regTimeEnd"))) {
criteria.andRegTimeBetween(
DateUtil.format(map.get("regTimeStart") , "yyyy-MM-dd HH:mm:ss") ,
DateUtil.format(map.get("regTimeEnd") , "yyyy-MM-dd HH:mm:ss"));
}
return highUserMapper.selectByExample(example);
}
@Override
public HighUser findByUserId(Long userId) {
return highUserMapper.selectByPrimaryKey(userId);
}
@Override
public void updateUser(HighUser highUser) {
highUserMapper.updateByPrimaryKeySelective(highUser);
}
@Override
public void insertUser(HighUser highUser) {
highUserMapper.insert(highUser);
}
}