package com.xzx.gc.order.service; import cn.hutool.core.convert.Convert; import com.xzx.gc.common.constant.Constants; import com.xzx.gc.entity.PlatformAccountInfo; import com.xzx.gc.order.mapper.PlatformAccountInfoMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import tk.mybatis.mapper.entity.Example; import java.util.List; @Service @Transactional public class PlatformAccountInfoService { @Autowired private PlatformAccountInfoMapper platformAccountInfoMapper; /** * 更新环保币 */ public void updateHbb(String money){ platformAccountInfoMapper.updateHbb(Convert.toBigDecimal(money,Constants.MONEY_INIT)); } /** * 更新积分 */ public void updateScore(String score){ platformAccountInfoMapper.updateScore(Convert.toBigDecimal(score,Constants.MONEY_INIT)); } public List find(){ PlatformAccountInfo platformAccountInfo=new PlatformAccountInfo(); platformAccountInfo.setDelFlag(Convert.toShort(0)); return platformAccountInfoMapper.select(platformAccountInfo); } public PlatformAccountInfo findByKey(String key){ Example example=new Example(PlatformAccountInfo.class); Example.Criteria criteria = example.createCriteria(); criteria.andEqualTo("fieldKey",key); criteria.andEqualTo("delFlag",Constants.DEL_NOT_FLAG); PlatformAccountInfo platformAccountInfo = platformAccountInfoMapper.selectOneByExample(example); return platformAccountInfo; } }