package com.hai.service.impl; import com.hai.dao.OutRechargePriceMapper; import com.hai.entity.*; import com.hai.service.OutRechargePriceService; import io.swagger.models.auth.In; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; import java.util.Map; @Service("outRechargePriceServiceImpl") public class OutRechargePriceServiceImpl implements OutRechargePriceService { @Resource private OutRechargePriceMapper outRechargePriceMapper; @Override public List getListRechargePrice(Map map) { OutRechargePriceExample example = new OutRechargePriceExample(); OutRechargePriceExample.Criteria criteria = example.createCriteria(); if (StringUtils.isNotBlank(map.get("type"))) { criteria.andTypeEqualTo(Integer.valueOf(map.get("type"))); } example.setOrderByClause("create_time desc"); return outRechargePriceMapper.selectByExample(example); } @Override public OutRechargePrice findById(Long id) { return outRechargePriceMapper.selectByPrimaryKey(id); } @Override public void insertRechargePrice(OutRechargePrice outRechargePrice) { outRechargePriceMapper.insert(outRechargePrice); } @Override public void updateRechargePrice(OutRechargePrice outRechargePrice) { outRechargePriceMapper.updateByPrimaryKey(outRechargePrice); } @Override public void deletePrice(Long id) { outRechargePriceMapper.deleteByPrimaryKey(id); } }