package com.dayou.service.impl;

import com.dayou.entity.AssetsValueType;
import com.dayou.mapper.AssetsValueTypeMapper;
import com.dayou.service.IAssetsValueTypeService;
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 AssetsValueTypeServiceImpl extends ServiceImpl<AssetsValueTypeMapper, AssetsValueType> implements IAssetsValueTypeService {

    @Autowired
    AssetsValueTypeMapper assetsValueTypeMapper;

    /**
     * 获取所有资产价值类型
     * @return List<AssetsValueType>
     */
    @Override
    public List<AssetsValueType> getAssetsValueType() {
        return assetsValueTypeMapper.getAssetsValueType();
    }

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


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

    @Override
    public Boolean add(AssetsValueType assetsValueType){
        return  this.save(assetsValueType);
    }

    @Override
    public Boolean update(AssetsValueType assetsValueType){
        return  this.updateById(assetsValueType);
    }

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