package com.huimv.modular.basefarminfo.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.huimv.core.annotion.BusinessLog;
import com.huimv.core.annotion.Permission;
import com.huimv.core.enums.LogAnnotionOpTypeEnum;
import com.huimv.core.pojo.response.ResponseData;
import com.huimv.core.pojo.response.SuccessResponseData;
import com.huimv.modular.basefarminfo.entity.BaseFarmInfoEntity;
import com.huimv.modular.basefarminfo.mapper.BaseFarmInfoMapper;
import com.huimv.modular.baseregion.param.BaseRegionParam;
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.List;


/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2022-03-22 18:10:26
 */
@RestController
@RequestMapping("/basefarminfo")
public class BaseFarmInfoController {

     @Autowired
     private BaseFarmInfoMapper  baseFarmInfoMapper;

    //展示牧场
    @GetMapping("/list")
    public ResponseData page(BaseRegionParam baseRegionParam) {
        QueryWrapper<BaseFarmInfoEntity> queryWrapper = new QueryWrapper<>();
        //queryWrapper.eq("eartag_no", String.valueOf(i));
        List<BaseFarmInfoEntity> baseFarmInfoEntities = baseFarmInfoMapper.selectList(queryWrapper);




        return new SuccessResponseData(baseFarmInfoEntities);



    }




















  /*  @Autowired
    private BaseFarmInfoService baseFarmInfoService;

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

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


    *//**
     * 信息
     *//*
    @RequestMapping("/info/{id}")
    @RequiresPermissions("generator:basefarminfo:info")
    public R info(@PathVariable("id") Integer id){
		BaseFarmInfoEntity baseFarmInfo = baseFarmInfoService.getById(id);

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

    *//**
     * 保存
     *//*
    @RequestMapping("/save")
    @RequiresPermissions("generator:basefarminfo:save")
    public R save(@RequestBody BaseFarmInfoEntity baseFarmInfo){
		baseFarmInfoService.save(baseFarmInfo);

        return R.ok();
    }

    *//**
     * 修改
     *//*
    @RequestMapping("/update")
    @RequiresPermissions("generator:basefarminfo:update")
    public R update(@RequestBody BaseFarmInfoEntity baseFarmInfo){
		baseFarmInfoService.updateById(baseFarmInfo);

        return R.ok();
    }

    *//**
     * 删除
     *//*
    @RequestMapping("/delete")
    @RequiresPermissions("generator:basefarminfo:delete")
    public R delete(@RequestBody Integer[] ids){
		baseFarmInfoService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }
*/
}
