Exemple #1
0
 internal protected void Table()
 {
     Spacing(X);
     if (DC.Crud == CrudEnum.Join)
     {
         var dic = DC.Parameters.FirstOrDefault(it => it.Action == ActionEnum.From);
         var tbm = DC.XC.GetTableModel(dic.TbMType);
         DbSql.TableX(tbm.TbName, X); As(X); DbSql.TableXAlias(dic.TbAlias, X);
         JoinX();
     }
     else
     {
         var tbm = DC.XC.GetTableModel(DC.TbM1);
         DbSql.TableX(tbm.TbName, X);
     }
 }
Exemple #2
0
        /****************************************************************************************************************************/

        private void JoinX()
        {
            Spacing(X);
            foreach (var dp in DC.Parameters)
            {
                if (dp.Crud != CrudEnum.Join)
                {
                    continue;
                }
                switch (dp.Action)
                {
                case ActionEnum.From:
                    /* 已处理 */
                    break;

                case ActionEnum.InnerJoin:
                case ActionEnum.LeftJoin:
                    var tbm = DC.XC.GetTableModel(dp.TbMType);
                    CRLF(X); Tab(X);
                    Action(dp.Action, X, DC); Spacing(X); DbSql.TableX(tbm.TbName, X); As(X); DbSql.TableXAlias(dp.TbAlias, X);
                    break;

                case ActionEnum.On:
                    CRLF(X); Tab(X); Tab(X);
                    Action(dp.Action, X, DC); Spacing(X); DbSql.Column(dp.TbAlias, dp.TbCol, X); Compare(dp.Compare, X, DC); DbSql.Column(dp.TableAliasTwo, dp.ColumnTwo, X);
                    break;
                }
            }
        }