 package com.huimv.acquisition.controller;

 import com.huimv.acquisition.entity.DailyTabulateDataEntity;
 import com.huimv.acquisition.result.R;
 import com.huimv.acquisition.service.DailyTabulateDataService;
 import com.huimv.acquisition.utils.PageUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;

 import java.util.Arrays;
 import java.util.Map;


 /**
  * 耳标每日汇总表
  *
  * @author yinhao
  * @version ${version}
  * @date 2021-08-04 14:59:05
  */
 @RestController
 @RequestMapping("management/dailytabulatedata")
 public class DailyTabulateDataController {
     @Autowired
     private DailyTabulateDataService dailyTabulateDataService;

     /**
      * 列表
      */
     @RequestMapping("/list")
     public R list(@RequestParam Map<String, Object> params){
         PageUtils page = dailyTabulateDataService.queryPage(params);

         return R.ok().put("page", page);
     }


     /**
      * 信息
      */
     @RequestMapping("/info/{id}")
     public R info(@PathVariable("id") Integer id){
         DailyTabulateDataEntity dailyTabulateData = dailyTabulateDataService.getById(id);

         return R.ok().put("dailyTabulateData", dailyTabulateData);
     }

     /**
      * 保存
      */
     @RequestMapping("/save")
     public R save(@RequestBody DailyTabulateDataEntity dailyTabulateData){
         dailyTabulateDataService.save(dailyTabulateData);

         return R.ok();
     }

     /**
      * 修改
      */
     @RequestMapping("/update")
     public R update(@RequestBody DailyTabulateDataEntity dailyTabulateData){
         dailyTabulateDataService.updateById(dailyTabulateData);

         return R.ok();
     }

     /**
      * 删除
      */
     @RequestMapping("/delete")
     public R delete(@RequestBody Integer[] ids){
         dailyTabulateDataService.removeByIds(Arrays.asList(ids));

         return R.ok();
     }

 }
