package com.nantian.cloud.jljc.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.nantian.cloud.jljc.entity.TFaFixedAssets;
import com.nantian.cloud.jljc.entity.TFaProjectMaterial;
import com.nantian.cloud.jljc.entity.TFaUnionPiece;
import com.nantian.cloud.jljc.service.TFaFixedAssetsService;
import com.nantian.cloud.jljc.service.TFaProjectMaterialService;
import com.nantian.cloud.jljc.service.TFaUnionPieceService;
import com.nantian.sc.cloud.common.core.util.R;
import com.nantian.sc.cloud.common.log.annotation.SysLog;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 固定资产投资项目节能审查接件项目资料表 前端控制器
 * </p>
 *
 * @author fyf
 * @since 2022-02-15
 */
@CrossOrigin
@AllArgsConstructor
@RestController
@RequestMapping("/tFaProjectMaterial")
public class TFaProjectMaterialController {

    @Autowired
    TFaProjectMaterialService tFaProjectMaterialService;

    @Autowired
    TFaUnionPieceService tFaUnionPieceService;


    @GetMapping("/getFileList/{id}/{fileForm}")
    @SysLog("根据id删除固定资产投资项目节能审查接件项目资料表")
    public R getFileList(@PathVariable Integer id,@PathVariable Integer fileForm){
        List<TFaProjectMaterial> list = tFaProjectMaterialService.list(
                new QueryWrapper<TFaProjectMaterial>()
                        .eq("file_form",fileForm)
                        .eq("project_id", id)
                        .eq("del_flag", 1));
        return R.ok(list);
    }
}
