package com.zhgd.xmgl.modules.basicdata.controller.government;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.annotation.OperLog;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.basicdata.dto.TeamInfoDto;
import com.zhgd.xmgl.modules.basicdata.entity.TeamInfo;
import com.zhgd.xmgl.modules.basicdata.service.ITeamInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
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.RestController;


/**
 * @Title: Controller
 * @Description: 班组
 * @author： pengj
 * @date： 2023-03-13
 * @version： V1.0
 */
@RestController
@RequestMapping("/gov/teamInfo")
@Slf4j
@Api(tags = "班组管理")
public class GovTeamInfoController {
    @Autowired
    private ITeamInfoService teamInfoService;

    /**
     * 分页列表查询
     *
     * @return
     */
    @OperLog(operModul = "班组管理", operType = "分页查询", operDesc = "分页列表查询班组信息")
    @ApiOperation(value = " 分页列表查询班组信息", notes = "分页列表查询班组信息", httpMethod = "GET")
    @GetMapping(value = "/page")
    public Result<IPage<TeamInfoDto>> queryPageList(Page page) {
        QueryWrapper<TeamInfo> wrapper = Wrappers.<TeamInfo>query();
        IPage<TeamInfoDto> pageList = teamInfoService.getPageList(page, wrapper);
        return Result.success(pageList);
    }
}
