Beispiel #1
0
 public ActionResult GetMdmDeptPageList(MdmDeptMstrQuery query)
 {
     try
     {
         var result = _mdmDeptMstrRepository.GetMdmDeptPageList(query);
         return(Page(result.Data, result.Page));
     }
     catch (Exception ex)
     {
         return(Fail(ex.Message));
     }
 }
        /// <summary>
        /// 获取部门分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public PagerList <dynamic> GetMdmDeptPageList(MdmDeptMstrQuery query)
        {
            return(_sqlQuery.Select(@"
                DEPT_ID,
                DEPT_NO,
                DEPT_NAME,
               (
		           CASE DEPT_STATUS
		           WHEN 1 THEN
			           '启用'
		           ELSE
			           '禁用'
		           END
	                    ) AS DEPT_STATUS"    )
                   .Filter("DEPT_NAME", query.DEPT_NAME, Operator.Contains)
                   .Filter("DEPT_NO", query.DEPT_NO, Operator.Contains)
                   .Filter("BG_NO", AbpSession.BG_NO)
                   .Filter("DEL_FLAG", "1")
                   .OrderBy("CREATE_DATE desc")
                   .GetPageList <dynamic>(@"MDM_DEPT_MSTR", Context.Database.GetDbConnection(), query));
        }