package com.shinsoft.sto.service.impl.ware;

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.shinsoft.sto.mapper.ware.StoreChangeMapper;
import com.shinsoft.sto.model.ware.StoreChange;
import com.shinsoft.sto.model.system.ResponseCodeMsg;
import com.shinsoft.sto.model.system.ResultJSON;
import com.shinsoft.sto.service.ware.StoreChangeService;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class StoreChangeServiceImpl extends ServiceImpl<StoreChangeMapper, StoreChange> implements StoreChangeService {

    @Override
    public ResultJSON query(int page, int rows, Map<String, Object> map) {
        try {
            Page<StoreChange> pageParam = new Page<>(page, rows);
            IPage<StoreChange> result = baseMapper.selectStoreChangePage(pageParam, map);
            return ResultJSON.success(result);
        } catch (Exception ex) {
            ex.printStackTrace();
            return ResultJSON.error(ResponseCodeMsg.CODE_EX, ex.getMessage());
        }
    }
}

