package com.dayou.service.impl;

import com.dayou.entity.AssetsEvaluationTargetPurpose;
import com.dayou.mapper.AssetsEvaluationTargetPurposeMapper;
import com.dayou.service.IAssetsEvaluationTargetPurposeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.dayou.utils.ExcelUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.ArrayList;
import org.springframework.transaction.annotation.Transactional;
import com.dayou.enums.BatchTaskTypeEnum;

/**
 * <p>
 * 资产评估对象评估目的表 服务实现类
 * </p>
 *
 * @author GouGengquan
 * @since 2024-04-07
 */
@Service
public class AssetsEvaluationTargetPurposeServiceImpl extends ServiceImpl<AssetsEvaluationTargetPurposeMapper, AssetsEvaluationTargetPurpose> implements IAssetsEvaluationTargetPurposeService {

    @Autowired
    AssetsEvaluationTargetPurposeMapper assetsEvaluationTargetPurposeMapper;

    /**
     * 获取所有资产评估目的集合
     * @return List<AssetsEvaluationTargetPurpose>
     */
    @Override
    public List<AssetsEvaluationTargetPurpose> getPurpose() {
        return assetsEvaluationTargetPurposeMapper.getPurpose();
    }

    @Override
    @SuppressWarnings("unchecked")
    public Page<AssetsEvaluationTargetPurpose> selectPage(Page page,AssetsEvaluationTargetPurpose assetsEvaluationTargetPurpose){
        return this.page(page, new QueryWrapper<AssetsEvaluationTargetPurpose>(assetsEvaluationTargetPurpose));
    }


    @Override
    public AssetsEvaluationTargetPurpose detail(Long id){
        return this.getById(id);
    }

    @Override
    public Boolean add(AssetsEvaluationTargetPurpose assetsEvaluationTargetPurpose){
        return  this.save(assetsEvaluationTargetPurpose);
    }

    @Override
    public Boolean update(AssetsEvaluationTargetPurpose assetsEvaluationTargetPurpose){
        return  this.updateById(assetsEvaluationTargetPurpose);
    }

    @Override
    public Boolean delete(Long id){
        //逻辑删除
        return this.removeById(id);
    }
}
