package com.fdkankan.modeling.service.impl;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fdkankan.common.constant.RecStatus;
import com.fdkankan.common.constant.TbStatus;
import com.fdkankan.modeling.entity.ScenePro;
import com.fdkankan.modeling.mapper.ISceneProMapper;
import com.fdkankan.modeling.service.ISceneProService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * pro场景表 服务实现类
 * </p>
 *
 * @author dengsixing
 * @since 2021-12-23
 */
@Service
public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro> implements ISceneProService {


    @Override
    public void updateStatus(String str, int i) {

    }

    @Override
    public ScenePro findBySceneNum(String projectNum) {
        List<ScenePro> list = this.list(new QueryWrapper<ScenePro>()
                .eq("tb_status", TbStatus.VALID.code())
                .eq("rec_status", RecStatus.VALID.code())
                .eq("scene_code", projectNum));
        if(CollUtil.isEmpty(list)){
            return null;
        }
        return list.get(0);
    }

    @Override
    public void updateTime(String projectNum, Long space, int payStatus, String toJSONString, long computeTime) {

    }
}
