using MMoneyCoderSharp.Data.Request;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static MMoneyCoderSharp.DBDefine;

namespace MMoneyCoderSharp.DB
{
    /// <summary>
    /// </summary>
    internal class INDUSTRY_FORGIEN_PAN : ADataObject
    {

        public INDUSTRY_FORGIEN_PAN(string recvCode)
        {
            this.mDataCode = recvCode;
        }

        string mDataCode = "";

         /// <summary>
         /// 금일 데이터 쿼리
         /// </summary>
         string queryToday = @"SELECT b.f_knam part_name, 
		a.f_last part_idx, 
		a.f_sign chg_type, 
		ABS(round(a.f_diff, 2)) part_chg, 
		round(a.f_rate, 2) rate 
		FROM t_world_ix_eq_sise a, t_world_ix_eq_master b 
		WHERE a.f_symb = b.f_symb 
		and b.f_knam = '{0}'";

        public override IDataRequest buildData()
        {

            string bufQuery = "";

            bufQuery += String.Format(queryToday, mDataCode);

            mRequestQuery.Add("", bufQuery);

            return this;
        }
    }
}
