package cn.com.countrygarden.bi.main.controller.dmn;

import cn.com.countrygarden.bi.main.core.Result;
import cn.com.countrygarden.bi.main.model.dmn.CostInformation;
import cn.com.countrygarden.bi.main.service.dmn.CostInformationService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: backEnd
 * @description: 字表费用控制层
 * @author: bug大神
 * @create: 2024-07-25 16:04
 **/

@RestController("CostInformationController")
@RequestMapping("/api/dmn/CostInformationController")
public class CostInformationController {
    @Autowired
    private CostInformationService costInformationService;
    //        测试查询
    @RequestMapping("/getCostInformation")
    public Result getcostInformation() {
        return costInformationService.getCostInformation();
    }
    @RequestMapping("/getCostInformationBydnmId")
    public Result getcostInformation1(@Param(value = "id") Integer id) {
        return costInformationService.getCostInformationBydnmId(id);
    }
    //        测试添加
    @RequestMapping("/addCostInformation")
    public Result addcostInformation(@RequestBody CostInformation costInformation) {
        return costInformationService.addCostInformation(costInformation);
    }
    //        测试删除
    @RequestMapping("/delCostInformation")
    public Result delcostInformation(@Param(value = "id") Integer id)  {
        return costInformationService.deleteCostInformationById(id);
    }
    //        测试修改
    @RequestMapping("/updateCostInformation")
    public Result updatecostInformation(@RequestBody CostInformation costInformation) {
        return costInformationService.updateCostInformationById(costInformation);
    }
}
