package com.th.demo.service.impl.ware;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.th.demo.mapping.ware.InRecordMapper;
import com.th.demo.mapping.ware.OutRecordMapper;
import com.th.demo.mapping.ware.TrackRecordMapper;
import com.th.demo.model.ware.InRecord;
import com.th.demo.model.ware.OutRecord;
import com.th.demo.model.ware.TrackRecord;
import com.th.demo.service.ware.TrackService;
import com.th.demo.tools.JSONTools;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("TrackService")
public class TrackServiceImpl implements TrackService {

    @Autowired
    public TrackRecordMapper trackRecorddMapper;
String result="";
    @Override
    public String query(int page, int rows, String plateNo, String userId, String belongId) {

        PageHelper.startPage(page, rows);
        List<TrackRecord> list = trackRecorddMapper.select(plateNo, userId, belongId);
        PageInfo<TrackRecord> pageInfo = new PageInfo<>(list);
        result = JSONTools.toString(pageInfo);
        return result;

    }
}
