package com.chinacreator.process.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Component;

import com.chinacreator.process.bean.CSftpBean;
import com.chinacreator.process.util.DataSource;
import com.frameworkset.common.poolman.SQLExecutor;

@Component
public class CSftpDao {

	public List<CSftpBean> queryByDay() throws SQLException {
		String sql = "with tt as "
				+ "(select a.rowid rid, PROVINCECODE,userid,DISCNTCODE,DISCNTSTARTDATE ordertime,DISCNTENDDATE endtime,b.ORDERSTATUS,b.channelid,DISCNTPACKAGEID packageid,DISCNTPRODUCTID productid from (select * from wosdk.td_product_ordersyn where  ORIGIN !=3) a , "
				+ "(select userid,orderchannel channelid,status ORDERSTATUS from td_order_relations where cpid ='changshi' and trunc(ordertime)=trunc(sysdate-1)) b "
				+ "where a.SERIALNUMBER(+) =b.userid)  select * from tt where rid in (select max(rid)  from tt group by userid)";
		return SQLExecutor.queryListWithDBName(CSftpBean.class, DataSource.NET3G, sql, new Object());
	}

	public void queryByMonth() {
		String sql = "11";
	}

}
