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

import com.unis.crk.cplbusiness.entity.DataCrkywCpljyxxFlt001;
import com.unis.crk.cplbusiness.mapper.DataCrkywCpljyxxFlt001Mapper;
import com.unis.crk.cplbusiness.service.IDataCrkywCpljyxxFlt001Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.commons.lang.StringUtils;

import java.util.List;
import java.util.Map;
import org.springframework.transaction.annotation.Transactional;
import cn.hutool.json.JSONObject;
import javax.annotation.Resource;
import com.unis.crk.cplbusiness.entity.vo.DataCrkywCpljyxxFlt001Vo;
/**
 * <p>
 * 成品粮质检子表 服务实现类
 * </p>
 *
 * @author TangSong
 * @since 2022-03-21
 */
@Service
public class DataCrkywCpljyxxFlt001ServiceImpl extends ServiceImpl<DataCrkywCpljyxxFlt001Mapper, DataCrkywCpljyxxFlt001> implements IDataCrkywCpljyxxFlt001Service {

    @Resource
    private DataCrkywCpljyxxFlt001Mapper dataCrkywCpljyxxFlt001Mapper;



    /**
     *修改成品粮质检子表
     * @param param 成品粮质检子表业务数据
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject update(DataCrkywCpljyxxFlt001 param){
        return null;
    }
    /**
     *删除成品粮质检子表数据
     * @param id 成品粮质检子表主键尖
     * @return
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public JSONObject delete(String id){
        return null;
        }

    /**
     * 按照条件查询成品粮质检子表信息
     * @param pageQuery
     * @throws Exception
     */
    @Override
    public IPage<Map<String,Object>> findPageVo(DataCrkywCpljyxxFlt001Vo pageQuery){
        {
        //条形查询器
        QueryWrapper<DataCrkywCpljyxxFlt001> queryWrapper = new QueryWrapper<>();
        //分页相关
        Page<DataCrkywCpljyxxFlt001> p =new Page<>(pageQuery.getPage(),pageQuery.getLimit());

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

    @Override
    public List<DataCrkywCpljyxxFlt001> getLitByMainDatId(String mainDataId) {
        List<DataCrkywCpljyxxFlt001> litByMainDatId = dataCrkywCpljyxxFlt001Mapper.getLitByMainDatId(mainDataId);
        return litByMainDatId;
    }


}
