嗨森逛服务
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/HighGoldRecServiceImpl.java

46 lines
1.3 KiB

package com.hai.service.impl;
import com.hai.dao.HighGoldRecMapper;
import com.hai.entity.HighGoldRec;
import com.hai.entity.HighGoldRecExample;
import com.hai.service.HighGoldRecService;
import org.apache.commons.collections4.MapUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @Auther: 胡锐
* @Description:
* @Date: 2021/3/27 10:03
*/
@Service("highGoldRecService")
public class HighGoldRecServiceImpl implements HighGoldRecService {
@Resource
private HighGoldRecMapper highGoldRecMapper;
@Override
public void insertGoldRec(HighGoldRec highGoldRec) {
highGoldRecMapper.insert(highGoldRec);
}
@Override
public List<HighGoldRec> getGoldRec(Map<String, Object> map) {
HighGoldRecExample example = new HighGoldRecExample();
HighGoldRecExample.Criteria criteria = example.createCriteria();
if (MapUtils.getLong(map, "userId") != null) {
criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId"));
}
if (MapUtils.getLong(map, "goldType") != null) {
criteria.andGoldTypeEqualTo(MapUtils.getLong(map, "goldType"));
}
example.setOrderByClause("create_time desc");
return highGoldRecMapper.selectByExample(example);
}
}