91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

關于H3 BPM數據庫如何實現排序取數據的問題

發布時間:2020-06-19 22:47:33 來源:網絡 閱讀:345 作者:lwl_BPM 欄目:數據庫

問題:

在打印模板中獲取子表內容,從數據庫中取數據,而當前項目數據庫里面數據按年度錄入,但是只需要顯示近3年的數據,插件如何實現排序取數據?

解決方法

1、先直接寫一個SQL語句,把近3年排序后的數據讀取出來

2、在調用子表接口加載數據

3、示例:

var monthly = DateTime.Now.Month;

            var selectsql = string.Format(@"SELECT

                                              t1.Yearly,

                                              t1.Monthly,

                                              t1.BudgetUnitName,

                                              t1.BudgetUnitCode,

                                              t1.BudgetItemName,

                                              t1.BudgetItemCode,

                                              t1.Budget

                                              FROM XL_YS_BudgetPay t1

                                              WHERE t1.Yearly = {0}

                                              --AND Monthly > {1}

                                              AND t1.BudgetUnitCode = '{2}'

                                              AND BudgetItemCode = '{3}'

                                              ORDER BY Monthly", yearly, monthly, budgetunitcode, budgetitemcode);

 

var dt = OThinker.H3.WorkSheet.AppUtility.Engine.Query.QueryTable(selectsql);

var list = new List<BizObject>();

 

var monthlist = new List<string> { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "December" };

 

if (dt.Rows.Count > 0)

{

//DeptCostBudgetInfo 為子表名稱

              BizObjectSchema childSchema = this.ActionContext.Schema.GetProperty("DeptCostBudgetInfo").ChildSchema;

 

               var bizObject = new BizObject(this.ActionContext.Engine, childSchema, this.ActionContext.User.UserID);

               bizObject["DataType"] = "原始";

               bizObject["BudgetItemName"] = dt.Rows[0]["BudgetItemName"].ToString();

               bizObject["BudgetItemCode"] = dt.Rows[0]["BudgetItemCode"].ToString();

 

               var bizObject2 = new BizObject(this.ActionContext.Engine, childSchema, this.ActionContext.User.UserID);

               bizObject2["DataType"] = "修改";

               bizObject2["BudgetItemName"] = dt.Rows[0]["BudgetItemName"].ToString();

               bizObject2["BudgetItemCode"] = dt.Rows[0]["BudgetItemCode"].ToString();

 

               for (int i = 0; i < monthlist.Count; i++)

               {

                 bizObject[monthlist] = dt.Rows["Budget"].ToString();

                 bizObject2[monthlist] = dt.Rows["Budget"].ToString();

                }

 

                list.Add(bizObject);

                list.Add(bizObject2);

               }

 

               if (bos != null)

               {

                   if (bos.Length > 1)

                   {

                       list.AddRange(bos);

 

                   }

               }

               this.ActionContext.InstanceData["DeptCostBudgetInfo"].Value = list.ToArray();

               ActionContext.InstanceData.Submit();


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

上饶县| 昌图县| 吉林省| 大埔区| 天长市| 温州市| 运城市| 微博| 应城市| 珲春市| 逊克县| 洮南市| 榆中县| 潞西市| 江山市| 昭觉县| 襄汾县| 霍邱县| 蓝田县| 达尔| 上栗县| 随州市| 察雅县| 夏邑县| 木兰县| 鹿邑县| 武汉市| 资溪县| 金溪县| 文登市| 绥芬河市| 阳城县| 宁海县| 保德县| 读书| 开鲁县| 花莲市| 巴塘县| 南澳县| 锦州市| 墨竹工卡县|