package com.gyee.frame.service;

import com.gyee.frame.common.base.BaseService;
import com.gyee.frame.common.support.Convert;
import com.gyee.frame.mapper.auto.DailyratingmainMapper;
import com.gyee.frame.mapper.auto.Daylygradeassessmentmain2Mapper;
import com.gyee.frame.model.auto.Dailyratingmain;
import com.gyee.frame.model.auto.DailyratingmainExample;
import com.gyee.frame.model.auto.Daylygradeassessmentmain2;
import com.gyee.frame.model.auto.Daylygradeassessmentmain2Example;
import com.gyee.frame.util.DateUtils;
import com.gyee.frame.util.SnowflakeIdWorker;
import com.gyee.frame.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;


@Service
public class DailyratingmainService implements BaseService<Dailyratingmain, DailyratingmainExample> {
	@Resource
	private DailyratingmainMapper DailyratingmainMapper;
	




	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date recorddate) {

		List<Dailyratingmain> list=new ArrayList<>();

		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(recorddate) ) {

			DailyratingmainExample example=new DailyratingmainExample();
			example.setOrderByClause("recorddate DESC");

			DailyratingmainExample.Criteria criteria =example.createCriteria();

			Date endDate= DateUtils.addDays(recorddate,1);
			criteria.andRecorddateGreaterThanOrEqualTo(recorddate).andRecorddateLessThan(endDate);

			criteria.andWtidEqualTo(wtId);
			list= DailyratingmainMapper.selectByExample(example);

		}
		return list;

	}

	public List<Dailyratingmain> getDaylygradeassessmentmain2ListBywtId(String wtId, Date beginDate, Date endDate) {

		List<Dailyratingmain> list=new ArrayList<>();

		if (StringUtils.notEmp(wtId) && StringUtils.notEmp(beginDate) && StringUtils.notEmp(endDate) ) {

			DailyratingmainExample example=new DailyratingmainExample();
			example.setOrderByClause("recorddate DESC");

			DailyratingmainExample.Criteria criteria =example.createCriteria();

			criteria.andRecorddateGreaterThanOrEqualTo(beginDate).andRecorddateLessThan(endDate);

			criteria.andWtidEqualTo(wtId);
			list= DailyratingmainMapper.selectByExample(example);

		}
		return list;

	}

	@Override
	public int deleteByPrimaryKey(String id) {
		return 0;
	}

	@Override
	public int insertSelective(Dailyratingmain record) {
		return 0;
	}

	@Override
	public Dailyratingmain selectByPrimaryKey(String id) {
		return null;
	}

	@Override
	public int updateByPrimaryKeySelective(Dailyratingmain record) {
		return 0;
	}

	@Override
	public int updateByExampleSelective(Dailyratingmain record, DailyratingmainExample example) {
		return 0;
	}

	@Override
	public int updateByExample(Dailyratingmain record, DailyratingmainExample example) {
		return 0;
	}

	@Override
	public List<Dailyratingmain> selectByExample(DailyratingmainExample example) {
		return null;
	}

	@Override
	public long countByExample(DailyratingmainExample example) {
		return 0;
	}

	@Override
	public int deleteByExample(DailyratingmainExample example) {
		return 0;
	}
}
