コード例 #1
0
ファイル: FormulaDal.cs プロジェクト: colin-chang/chanyi
        public List <Formula> GetFormula(FormulaFilter filter, int pageIndex, int pageSize, out int totalCount)
        {
            string querySql = "select \"row_number\"() over(ORDER BY f.\"IsEnable\" desc,f.\"CreateTime\" desc) as \"rownum\",f.\"Id\",f.\"Name\",f.\"ApplyTo\",f.\"SideEffect\",e.\"Name\" as \"PrincipalName\",u.\"UserName\" as \"OperatorName\",f.\"IsEnable\",f.\"Remark\",f.\"CreateTime\" from \"T_Formula\" f join \"T_Employee\" e on e.\"Id\"=f.\"PrincipalId\" join \"T_User\" u on u.\"Id\"=f.\"OperatorId\"";

            string countSql = "select count(f.\"Id\") from \"T_Formula\" f join \"T_Employee\" e on e.\"Id\"=f.\"PrincipalId\" join \"T_User\" u on u.\"Id\"=f.\"OperatorId\"";

            return(GetPagedData <Formula, FormulaFilter>(pageIndex, pageSize, out totalCount, countSql, querySql, filter));
        }
コード例 #2
0
ファイル: FormulaDal.cs プロジェクト: colin-chang/chanyi
        public List <Formula> GetFormula(FormulaFilter filter, int rowsCount)
        {
            string querySql = "select \"row_number\"() over(ORDER BY f.\"IsEnable\" desc,f.\"CreateTime\" desc) as \"rownum\",f.\"Id\",f.\"Name\",f.\"ApplyTo\",f.\"SideEffect\",e.\"Name\" as \"PrincipalName\",u.\"UserName\" as \"OperatorName\",f.\"IsEnable\",f.\"Remark\",f.\"CreateTime\" from \"T_Formula\" f join \"T_Employee\" e on e.\"Id\"=f.\"PrincipalId\" join \"T_User\" u on u.\"Id\"=f.\"OperatorId\"";

            return(GetRuledRowsData <Formula, FormulaFilter>(rowsCount, querySql, filter));
        }