package com.huimv.produce.produce.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huimv.common.utils.Result;
import com.huimv.common.utils.ResultCode;
import com.huimv.produce.produce.entity.ProdPayableRank;
import com.huimv.produce.produce.service.IProdPayableRankService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * <p>
 *   应付表
 * </p>
 *
 * @author astupidcoder
 * @since 2021-11-25
 */
@RestController
@RequestMapping("/prodPayableRank")
public class ProdPayableRankController {
    @Autowired
    private IProdPayableRankService prodPayableRankService;

    @GetMapping("/listPayable")
    public Result getCost(@RequestParam(name = "farmId") Integer farmId){
        List<ProdPayableRank> list = prodPayableRankService.list(new QueryWrapper<ProdPayableRank>().eq("farm_id", farmId).eq("add_date", new Date()));
        return new Result(ResultCode.SUCCESS,list);
    }
}
