Exemplo n.º 1
0
        /// <summary>
        /// 根据供应商系统编号取得代收结算单系统编号列表
        /// </summary>
        /// <param name="vendorSysNo">供应商系统编号</param>
        /// <returns></returns>
        public List <int> GetVendorSettleSysNoListByVendorSysNo(int vendorSysNo, List <int> pmSysNoList)
        {
            CustomDataCommand dataCommand = DataCommandManager.CreateCustomDataCommandFromConfig("GetVendorSettleSysNoListByVendorSysNo");

            using (DynamicQuerySqlBuilder sqlBuilder = new DynamicQuerySqlBuilder(
                       dataCommand.CommandText, dataCommand, null, "SysNo desc"))
            {
                sqlBuilder.ConditionConstructor.AddCondition(QueryConditionRelationType.AND, "VendorSysNo", DbType.Int32, "@VendorSysNo", QueryConditionOperatorType.Equal, vendorSysNo);
                if (pmSysNoList != null && pmSysNoList.Count > 0)
                {
                    sqlBuilder.ConditionConstructor.AddInCondition(QueryConditionRelationType.AND, "PMSysNo", DbType.Int32, pmSysNoList);
                }

                dataCommand.CommandText = sqlBuilder.BuildQuerySql();
                return(dataCommand.ExecuteFirstColumn <Int32>());
            }
        }