Example #1
0
        public static string GetListSql(string conditionSql)
        {
            string localeCode = CommonUtil.GetAppLocaleCode();

            string sql =
                "SELECT" +
                " to_char(order_result_reserve_datetime, '" + Properties.Resources.FORMAT_DATE + "') as reserve_date" +
                ",to_char(order_result_reserve_datetime, 'HH24:MI:SS') as reserve_time" +
                ",to_char(order_result_start_datetime, '" + Properties.Resources.FORMAT_DATE + "') as start_date" +
                ", to_char(order_result_start_datetime, 'HH24:MI:SS') as start_time" +
                ", to_char(order_result_datetime, '" + Properties.Resources.FORMAT_DATE + "') as result_date" +
                ", to_char(order_result_datetime, 'HH24:MI:SS') as result_time" +
                ", (" + SectionMaster.SelectNameSql(localeCode, "order_result_from_sect") + ") AS req_sect" +
                ", (" + StationMaster.SelectNameByPointSql(localeCode, "order_result_from_pt") + ") AS req_station" +
                ", CASE WHEN order_result_round_flg = 1 OR order_result_forward_list is NULL THEN order_result_stop_to_sects ELSE order_result_forward_list END AS to_sect" +
                ", order_result_stop_to_points AS to_station" +
                ", (" + CartMaster.SelectNameSql(localeCode, "order_result_cart_id") + ") AS cart_id" +
                ", (" + MuMaster.SelectNameSql(localeCode, "order_result_mu_id") + ") AS mu_id" +
//    ", order_result_cart_id AS cart_id" +
//    ", order_result_mu_id AS mu_id" +
                ", CASE order_result_status WHEN 0 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_0 + "' WHEN 1 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_1 + "' WHEN 10 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_10 + "' WHEN 20  THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_20 + "' WHEN 100 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_100 + "' ELSE CAST(order_result_status AS text) END AS status" +
                " FROM order_result_log";

            if (conditionSql == null || conditionSql.Length == 0)
            {
                conditionSql = DBAccess.GetTodayConditionSql("order_result_datetime");
            }
            sql += " WHERE " + conditionSql;
            sql += " ORDER BY order_result_datetime DESC, order_result_start_datetime DESC, order_result_reserve_datetime DESC";

            return(sql);
        }
Example #2
0
        internal static string SelectNameSql(string localeCode)
        {
            List <string> values = new List <string>();

            values.Add(MuMaster.SelectIdAndNameSql(localeCode, 1));        //  MU名一覧
            values.Add(TabletMaster.SelectIdAndNameSql(localeCode, 2));    //  タブレット名一覧
            values.Add(MonitorMaster.SelectIdAndNameSql(localeCode, 3));   //  監視モニタ名一覧
            string unionSql = string.Join(" UNION ", values);

            string sql = "SELECT * FROM (" +
                         unionSql +
                         ") AS TMP ";

            sql += " ORDER BY option, id";

            return(sql);
        }