package com.fizz.business.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fizz.business.domain.ModCoilMap;
import com.fizz.business.mapper.ModCoilMapMapper;
import com.fizz.business.service.ModCoilMapService;
import org.springframework.stereotype.Service;

@Service
public class ModCoilMapServiceImpl extends ServiceImpl<ModCoilMapMapper, ModCoilMap> implements ModCoilMapService {


    @Override
    public void saveModCoilInfo( ModCoilMap modCoilMap){

        this.baseMapper.insert(modCoilMap);

    }

    @Override
    public void updateModCoil(String coilId) {

        LambdaQueryWrapper<ModCoilMap> queryWrapper = new LambdaQueryWrapper<>();

        queryWrapper.eq(ModCoilMap::getCoilid,coilId);

        ModCoilMap coilMap = this.baseMapper.selectOne(queryWrapper);

        if (coilMap == null){
            return;
        }
        coilMap.setPosid(0);

        this.baseMapper.updateById(coilMap);



    }

}