Beispiel #1
0
        public static TempKscjInfo QueryKscj(String glbm, String sfzmhm)
        {
            TempKscjInfo info = null;
            String       sql  = "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=1 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";

            sql += " union ";
            sql += "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=2 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";
            sql += " union ";
            sql += "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=3 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";
            String queryStr = string.Format(sql, new string[] { glbm, sfzmhm });

            //IDataAccess access = new OracleDataHelper(System.Configuration.ConfigurationManager.AppSettings["DefaultConnString2"]);
            DataTable dt = GetInnerDbAccess().SelectDataTable(queryStr, "tmp");

            if (dt != null && dt.Rows.Count > 0)
            {
                info         = new TempKscjInfo();
                info.km1     = Convert.ToInt32(dt.Rows[0][1]);
                info.km1yyrq = dt.Rows[0][2].ToString();
                if (dt.Rows.Count > 1)
                {
                    info.km2     = Convert.ToInt32(dt.Rows[1][1]);
                    info.km2yyrq = dt.Rows[1][2].ToString();
                }
                if (dt.Rows.Count > 2)
                {
                    info.km3     = Convert.ToInt32(dt.Rows[2][1]);
                    info.km3yyrq = dt.Rows[2][2].ToString();
                }
            }
            return(info);
        }
Beispiel #2
0
        public static TempKscjInfo QueryKscj(String glbm, String sfzmhm)
        {
            TempKscjInfo info = null;
            String sql = "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=1 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";
            sql += " union ";
            sql += "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=2 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";
            sql += " union ";
            sql += "(select kskm \"kskm\",zt \"zt\",to_char(ykrq,'yyyy-MM-dd') \"yyrq\" from (select kskm,nvl(zt,0) zt,nvl(ykrq,sysdate) ykrq from fzkyy.st_drv_preasign a where kskm=3 and glbm like '{0}%' and sfzmhm='{1}' order by ykrq desc) where rownum=1)";
            String queryStr = string.Format(sql, new string[] { glbm, sfzmhm });

            //IDataAccess access = new OracleDataHelper(System.Configuration.ConfigurationManager.AppSettings["DefaultConnString2"]);
            DataTable dt = GetInnerDbAccess().SelectDataTable(queryStr, "tmp");
            if (dt != null && dt.Rows.Count > 0)
            {
                info = new TempKscjInfo();
                info.km1 = Convert.ToInt32(dt.Rows[0][1]);
                info.km1yyrq = dt.Rows[0][2].ToString();
                if (dt.Rows.Count > 1)
                {
                    info.km2 = Convert.ToInt32(dt.Rows[1][1]);
                    info.km2yyrq = dt.Rows[1][2].ToString();
                }
                if (dt.Rows.Count > 2)
                {
                    info.km3 = Convert.ToInt32(dt.Rows[2][1]);
                    info.km3yyrq = dt.Rows[2][2].ToString();
                }

            }
            return info;
        }