Пример #1
0
        public List <ProductionMakeWorkOrderView> GetProductionMakeWorkOrderView(string whereSql)
        {
            //创建视图SQL
            var sqlCmd = MsGenerateSql.SelectFromTable <ProductionMakeWorkOrder>().
                         LeftJoin <WorkOrder, ProductionMakeWorkOrder>((t1, t2) =>
                                                                       t1.WorkOrderId == t2.WorkOrderId).
                         LeftJoin <ProductionVersion, ProductionMakeWorkOrder>((t1, t2) =>
                                                                               t1.ProductionVersionId == t2.ProductionVersionId).Distinct();
            //.Where<ProductionMakeWorkOrder>((t) => t.ProductionVersionId == ProductionVersionId);
            //设置视图返回值
            string sql = sqlCmd.AutoMapDisplayItem <ProductionMakeWorkOrderView>().GenerateSql();


            sql = sql + "  " + whereSql;

            //执行视图SQL
            return(BaseEntityFac.GetEntityView <ProductionMakeWorkOrderView>(sql));
        }