Newer
Older
huludao / src / main / java / com / newfiber / api / pc / service / impl / WarnInfoServiceImpl.java
package com.newfiber.api.pc.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.newfiber.api.pc.dao.WarnInfoMapper;
import com.newfiber.api.pc.model.entity.WarnInfo;
import com.newfiber.api.pc.service.WarnInfoService;
import org.springframework.stereotype.Service;

/**
 * @ClassName WarnInfoServiceImpl
 * @Description TODO
 * @Author 张鸿志
 * @Date 2021年6月24日20:01:09 20:01
 * Version 1.0
 **/
@Service
public class WarnInfoServiceImpl extends ServiceImpl<WarnInfoMapper, WarnInfo> implements WarnInfoService {

    @Override
    public boolean existWarnAppr() {
        EntityWrapper<WarnInfo> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("status",0);
        return this.selectOne(entityWrapper)  == null ? false :true;
    }


    @Override
    public void closeWarnInfo() {
        EntityWrapper<WarnInfo> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("status",0);
        WarnInfo warnInfo = this.selectOne(entityWrapper);
        warnInfo.setStatus(1);
        this.updateById(warnInfo);
    }
}