package com.zjsgfa.project.zjsgfa.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zjsgfa.framework.aspectj.lang.annotation.Log;
import com.zjsgfa.framework.aspectj.lang.enums.BusinessType;
import com.zjsgfa.project.zjsgfa.domain.SjFzqkms;
import com.zjsgfa.project.zjsgfa.service.ISjFzqkmsService;
import com.zjsgfa.framework.web.controller.BaseController;
import com.zjsgfa.framework.web.domain.AjaxResult;
import com.zjsgfa.common.utils.poi.ExcelUtil;
import com.zjsgfa.framework.web.page.TableDataInfo;

/**
 * 方案邻井复杂描述Controller
 * 
 * @author ruoyi
 * @date 2026-02-28
 */
@RestController
@RequestMapping("/system/sjFzqkms")
public class SjFzqkmsController extends BaseController
{
    @Autowired
    private ISjFzqkmsService sjFzqkmsService;

    /**
     * 查询方案邻井复杂描述列表
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:list')")
    @GetMapping("/list")
    public TableDataInfo list(SjFzqkms sjFzqkms)
    {
        startPage();
        List<SjFzqkms> list = sjFzqkmsService.selectSjFzqkmsList(sjFzqkms);
        return getDataTable(list);
    }

    /**
     * 导出方案邻井复杂描述列表
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:export')")
    @Log(title = "方案邻井复杂描述", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, SjFzqkms sjFzqkms)
    {
        List<SjFzqkms> list = sjFzqkmsService.selectSjFzqkmsList(sjFzqkms);
        ExcelUtil<SjFzqkms> util = new ExcelUtil<SjFzqkms>(SjFzqkms.class);
        util.exportExcel(response, list, "方案邻井复杂描述数据");
    }

    /**
     * 获取方案邻井复杂描述详细信息
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:query')")
    @GetMapping(value = "/{zbid}")
    public AjaxResult getInfo(@PathVariable("zbid") Long id)
    {
        SjFzqkms sjFzqkms = sjFzqkmsService.selectSjFzqkmsById(id);
        if(sjFzqkms==null){
            sjFzqkms=new SjFzqkms();
        }
        return success(sjFzqkms);
    }

    /**
     * 新增方案邻井复杂描述
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:add')")
    @Log(title = "方案邻井复杂描述", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SjFzqkms sjFzqkms)
    {
        return toAjax(sjFzqkmsService.insertSjFzqkms(sjFzqkms));
    }

    /**
     * 修改方案邻井复杂描述
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:edit')")
    @Log(title = "方案邻井复杂描述", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SjFzqkms sjFzqkms)
    {
        return toAjax(sjFzqkmsService.updateSjFzqkms(sjFzqkms));
    }

    /**
     * 删除方案邻井复杂描述
     */
    //@PreAuthorize("@ss.hasPermi('system:sjFzqkms:remove')")
    @Log(title = "方案邻井复杂描述", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(sjFzqkmsService.deleteSjFzqkmsByIds(ids));
    }
}
