package com.xzx.gc.pay.service;
|
|
|
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.date.DateUtil;
|
import com.xzx.gc.common.constant.Constants;
|
import com.xzx.gc.entity.PlatformAccountInfo;
|
import com.xzx.gc.pay.mapper.PlatformAccountInfoMapper;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import org.springframework.transaction.annotation.Transactional;
|
import tk.mybatis.mapper.entity.Example;
|
|
@Service
|
@Transactional
|
@Slf4j
|
public class PlatformAccountInfoService {
|
|
@Autowired
|
private PlatformAccountInfoMapper platformAccountInfoMapper;
|
|
public void add(PlatformAccountInfo platformAccountInfo){
|
platformAccountInfo.setDelFlag(Convert.toShort(Constants.DEL_NOT_FLAG));
|
platformAccountInfo.setCreateTime(DateUtil.now());
|
platformAccountInfoMapper.insertSelective(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;
|
}
|
|
public void updateMoney(String money){
|
platformAccountInfoMapper.updateMoney(Convert.toBigDecimal(money,Constants.MONEY_INIT));
|
}
|
|
public void updateHbb(String money){
|
platformAccountInfoMapper.updateHbb(Convert.toBigDecimal(money,Constants.MONEY_INIT));
|
}
|
}
|