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.
56 lines
1.9 KiB
56 lines
1.9 KiB
package com.hai.service.impl;
|
|
|
|
import com.hai.dao.HighTyAgentPriceMapper;
|
|
import com.hai.entity.HighTyAgentPrice;
|
|
import com.hai.entity.HighTyAgentPriceExample;
|
|
import com.hai.service.HighTyAgentPriceService;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
|
|
@Service("highTyAgentPriceService")
|
|
public class HighTyAgentPriceServiceImpl implements HighTyAgentPriceService {
|
|
|
|
@Resource
|
|
private HighTyAgentPriceMapper tyAgentPriceMapper;
|
|
|
|
@Override
|
|
public void editTyAgentPrice(HighTyAgentPrice tyAgentPrice) {
|
|
if (tyAgentPrice.getId() == null) {
|
|
tyAgentPrice.setCreateTime(new Date());
|
|
tyAgentPrice.setUpdateTime(new Date());
|
|
tyAgentPrice.setStatus(1);
|
|
tyAgentPriceMapper.insert(tyAgentPrice);
|
|
} else {
|
|
tyAgentPrice.setUpdateTime(new Date());
|
|
tyAgentPriceMapper.updateByPrimaryKey(tyAgentPrice);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public HighTyAgentPrice getDetail(Integer belongType, Long oilStationId, String oilNo) {
|
|
HighTyAgentPriceExample example = new HighTyAgentPriceExample();
|
|
example.createCriteria()
|
|
.andBelongTypeEqualTo(belongType)
|
|
.andStatusEqualTo(1)
|
|
.andOilStationIdEqualTo(oilStationId)
|
|
.andOilNoEqualTo(oilNo);
|
|
List<HighTyAgentPrice> list = tyAgentPriceMapper.selectByExample(example);
|
|
if (list.size() > 0) {
|
|
return list.get(0);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Override
|
|
public List<HighTyAgentPrice> getPriceList(Integer belongType, Long oilStationId) {
|
|
HighTyAgentPriceExample example = new HighTyAgentPriceExample();
|
|
example.createCriteria()
|
|
.andBelongTypeEqualTo(belongType)
|
|
.andOilStationIdEqualTo(oilStationId)
|
|
.andStatusEqualTo(1);
|
|
return tyAgentPriceMapper.selectByExample(example);
|
|
}
|
|
}
|
|
|