package com.gyee.frame.service.export;

import com.gyee.frame.common.dataSources.DataSource;
import com.gyee.frame.common.dataSources.DataSourceType;
import com.gyee.frame.mapper.graphicbilling.WorkticketMapper;
import com.gyee.frame.model.excel.Woworktickeask;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author gfhd
 * @since 2022-11-23
 */
@Service
public class WorkticketService {

    @Resource
    private WorkticketMapper workticketMapper;

    @DataSource(value = DataSourceType.TICKET)
    public List<Woworktickeask> getsomething(String time){
        Date date = new Date();
        try {
            date = DateUtils.parseDate(time, "yyyy-MM-dd HH:mm:ss");
        } catch (ParseException e) {
            e.printStackTrace();
        }
        return workticketMapper.selectByTime(date);
    }
}
