package com.unis.crk.cplbusiness.service.impl;

import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.unis.crk.cplbusiness.entity.DataCrkywCpltzdxxFlt001;
import com.unis.crk.cplbusiness.entity.vo.DataCrkywCpltzdxxFlt001Vo;
import com.unis.crk.cplbusiness.mapper.DataCrkywCpltzdxxFlt001Mapper;
import com.unis.crk.cplbusiness.service.IDataCrkywCpltzdxxFlt001Service;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 成品粮出入库-通知单从表 服务实现类
 * </p>
 *
 * @author TangSong
 * @since 2022-03-23
 */
@Service
public class DataCrkywCpltzdxxFlt001ServiceImpl extends ServiceImpl<DataCrkywCpltzdxxFlt001Mapper, DataCrkywCpltzdxxFlt001> implements IDataCrkywCpltzdxxFlt001Service {

    @Resource
    private DataCrkywCpltzdxxFlt001Mapper dataCrkywCpltzdxxFlt001Mapper;



    /**
     * 按照条件查询成品粮出入库-通知单从表信息
     * @param pageQuery
     * @throws Exception
     */
    @Override
    public IPage<Map<String,Object>> findPageVo(DataCrkywCpltzdxxFlt001Vo pageQuery){
        {
        //条形查询器
        QueryWrapper<DataCrkywCpltzdxxFlt001> queryWrapper = new QueryWrapper<>();
        //分页相关
        Page<DataCrkywCpltzdxxFlt001> p =new Page<>(pageQuery.getPage(),pageQuery.getLimit());

        IPage<Map<String,Object>> page = dataCrkywCpltzdxxFlt001Mapper.selectMyMapsPage(p,queryWrapper);
        return page;
        }
    }

    @Override
    public List<Map<String, Object>> getCplCrkTzdFltList(String dataId) {
        return dataCrkywCpltzdxxFlt001Mapper.getCplCrkTzdFltList(dataId);
    }
    @Override
    public List<DataCrkywCpltzdxxFlt001> getFltForMainDataId(String dataId) {
        return dataCrkywCpltzdxxFlt001Mapper.getFltForMainDataId(dataId);
    }


}
