package com.chushang.inspection.project.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chushang.common.mybatis.page.CommonParam;
import com.chushang.common.mybatis.utils.PageResult;
import com.chushang.common.mybatis.utils.WrapperUtils;
import com.chushang.inspection.project.po.InspectionConfig;
import com.chushang.inspection.project.query.InsConfigQuery;
import com.chushang.inspection.project.vo.InsConfigVO;
import com.chushang.oss.entity.vo.FileSourceVo;
import org.springframework.web.multipart.MultipartFile;

/**
  * @auther: zhao
  * @date: 2024/6/18 15:39
  */
public interface InspectionConfigService extends IService<InspectionConfig>{


    default PageResult pageList(InsConfigQuery query){
        CommonParam commonParam = CommonParam.buildPageRequest();
        LambdaQueryWrapper<InspectionConfig> configSql = WrapperUtils.builder(query, commonParam);
        IPage<InspectionConfig> page = this.page(
                new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()),
                configSql
        );
        return new PageResult(page);
    }

    InsConfigVO getByAlias(String alias);


    void updateByEntityId(InspectionConfig config);

    void saveEntity(InspectionConfig config);
}
