public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int status, string key, int bankeStatus, int capitalType, string bankEname)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "BankId desc";
else
select.OrderStr = orderStr;
select.ColumnName = " B.BankId,B.BankName,B.BankEname,B.BankFullName,B.BankShort,B.CapitalType,B.BankStatus,bd.StatusName,sd.DetailName,bt.BankName as ParentBankName,B.ParentId,case ISNULL(B.SwitchBack,0) when 0 then '否' when 1 then '是' end as SwitchBack ";
select.TableName = " dbo.Bank B left join dbo.BDStatusDetail bd on B.BankStatus = bd.DetailId left join dbo.BDStyleDetail sd on sd.StyleDetailId=B.CapitalType left join Bank bt on bt.BankId=B.ParentId ";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" bd.StatusId = 1 ");
if (status > 0)
sb.AppendFormat(" and B.BankStatus = {0}", status);
if (!string.IsNullOrEmpty(key))
sb.AppendFormat(" and B.BankFullName like '%{0}%'", key);
if (capitalType > 0)
sb.AppendFormat(" and B.CapitalType = {0}", capitalType);
if (!string.IsNullOrEmpty(bankEname))
sb.AppendFormat(" and B.BankEname like '%{0}%'", bankEname);
select.WhereStr = sb.ToString();
return select;
}
开发者ID:weiliji,项目名称:NFMT,代码行数:29,代码来源:BankBLL.cs
示例9: GetCashSelectModel
public SelectModel GetCashSelectModel(int pageIndex, int pageSize, string orderStr, int pledgeApplyId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "psd.ContractNo desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" psd.ContractNo as StockContractNo,psd.Deadline,SUM(Hands) as Hands,bank.BankName as AccountName ");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fin_PledgeApply pa ");
sb.AppendFormat(" inner join dbo.Fin_PledgeApplyStockDetail psd on pa.PledgeApplyId = psd.PledgeApplyId and psd.DetailStatus ={0} ", (int)Common.StatusEnum.已生效);
sb.Append(" left join NFMT_Basic..Bank bank on pa.FinancingBankId = bank.BankId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" pa.PledgeApplyId ={0} group by psd.ContractNo,psd.Deadline,bank.BankName ", pledgeApplyId);
select.WhereStr = sb.ToString();
return select;
}
/// <summary>
/// 可配货库存列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="orderStr"></param>
/// <returns></returns>
public SelectModel GetCanSalesSelect(int pageIndex, int pageSize, string orderStr, string sids = "", int contractId = 0, int StockApplyId = 0, string dids = "", string refNo = "", int ownCorpId = 0)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "sto.StockId asc";
else
select.OrderStr = orderStr;
if (string.IsNullOrEmpty(dids))
dids = "0";
int readyStatus = (int)Common.StatusEnum.已生效;
select.ColumnName = "sto.StockId,sn.RefNo,sto.UintId,sto.CurNetAmount,mu.MUName,sto.StockStatus,sd.StatusName,sto.CorpId,cor.CorpName,sto.AssetId,ass.AssetName,sto.BrandId,bra.BrandName,soad.ApplyAmount,ISNULL(sto.CurNetAmount,0) - ISNULL(soad.ApplyAmount,0) as LastAmount,ISNULL(sto.CurNetAmount,0) - ISNULL(soad.ApplyAmount,0) as NetAmount,sto.Bundles - isnull(soad.ApplyBundles,0) as LaveBundles,sto.Bundles - isnull(soad.ApplyBundles,0) as Bundles,dp.DPName,sto.CardNo ";
int statusId = (int)Common.StatusTypeEnum.库存状态;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" dbo.St_Stock sto ");
sb.AppendFormat(" inner join NFMT.dbo.Con_Contract con on con.AssetId = sto.AssetId and con.UnitId = sto.UintId and con.ContractId = {0} ", contractId);
sb.Append(" inner join dbo.St_StockName sn on sto.StockNameId = sn.StockNameId ");
sb.AppendFormat(" left join NFMT_Basic.dbo.BDStatusDetail sd on sd.DetailId = sto.StockStatus and sd.StatusId ={0} ", statusId);
sb.Append(" left join NFMT_User.dbo.Corporation cor on cor.CorpId = sto.CorpId ");
sb.Append(" left join NFMT_Basic.dbo.Asset ass on ass.AssetId = sto.AssetId ");
sb.Append(" left join NFMT_Basic.dbo.Brand bra on bra.BrandId = sto.BrandId ");
sb.Append(" left join NFMT_Basic.dbo.DeliverPlace dp on dp.DPId = sto.DeliverPlaceId ");
sb.Append(" left join NFMT_Basic.dbo.MeasureUnit mu on mu.MUId = sto.UintId ");
sb.AppendFormat("left join (select sum(NetAmount) as ApplyAmount,sum(Bundles) as ApplyBundles,StockId from NFMT.dbo.St_StockOutApplyDetail where DetailStatus ={0} and DetailId not in ({1}) group by StockId) as soad on soad.StockId = sto.StockId", readyStatus, dids);
select.TableName = sb.ToString();
sb.Clear();
int planStockInStatus = (int)StockStatusEnum.预入库存;
int planCustomsStatus = (int)StockStatusEnum.新拆库存;
sb.AppendFormat(" sto.StockStatus between {0} and {1} ", planStockInStatus, planCustomsStatus);
sb.AppendFormat(" and ISNULL(sto.CurNetAmount,0) - ISNULL(soad.ApplyAmount,0) > 0 ");
if (StockApplyId > 0)
{
sb.AppendFormat(" and sto.StockId not in (select StockId from dbo.St_StockOutApplyDetail where StockOutApplyId ={0} and DetailStatus ={1} ) ", StockApplyId, readyStatus);
}
if (!string.IsNullOrEmpty(sids))
{
sids = sids.Trim();
sb.AppendFormat(" and sto.StockId not in ({0})", sids);
}
if (!string.IsNullOrEmpty(refNo))
sb.AppendFormat(" and sn.RefNo like '%{0}%'", refNo);
if (ownCorpId > 0)
sb.AppendFormat(" and sto.CorpId={0} ", ownCorpId);
select.WhereStr = sb.ToString();
return select;
}
开发者ID:weiliji,项目名称:NFMT,代码行数:67,代码来源:StockBLL.cs
示例13: GetSelectModel
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int masterId, bool isHas = false, string clauseText = "")
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
int status = (int)NFMT.Common.StatusEnum.已生效;
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "cc.ClauseId desc";
else
select.OrderStr = orderStr;
select.ColumnName = " cc.ClauseText,cc.ClauseEnText,ccr.RefId,cc.ClauseId,ccr.Sort,ccr.IsChose ";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
if (isHas)
{
select.TableName = " dbo.ClauseContract_Ref ccr left join dbo.ContractClause cc on cc.ClauseId = ccr.ClauseId left join dbo.ContractMaster cm on cm.MasterId = ccr.MasterId ";
sb.AppendFormat(" ccr.RefStatus ={0} and cc.ClauseStatus = {0} ", status);
sb.AppendFormat(" and ccr.MasterId = {0} ", masterId);
}
else
{
select.TableName = string.Format(" dbo.ContractClause cc left join dbo.ClauseContract_Ref ccr on ccr.ClauseId = cc.ClauseId and MasterId = {0} and RefStatus = {1} left join dbo.ContractMaster cm on cm.MasterId = ccr.MasterId ", masterId, status);
sb.AppendFormat(" ccr.ClauseId is null and cc.ClauseStatus = {0}", status);
if (!string.IsNullOrEmpty(clauseText))
sb.AppendFormat(" and cc.ClauseText like '%{0}%' ", clauseText);
}
select.WhereStr = sb.ToString();
return select;
}
/// <summary>
/// 获取分页查询对象
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="orderStr"></param>
/// <param name="status"></param>
/// <param name="key"></param>
/// <param name="producerName"></param>
/// <returns></returns>
public SelectModel GetSelectModel(int pageIndex, int pageSize, string orderStr, int brandStatus, string key, int producerName)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "BrandId desc";
else
select.OrderStr = orderStr;
select.ColumnName = " BrandId,b.ProducerId,pd.ProducerName as ProducerName,BrandName,BrandFullName,BrandInfo,BrandStatus,bd.StatusName as BrandStatusName ";
select.TableName = " Brand b inner join dbo.BDStatusDetail bd on b.BrandStatus=bd.DetailId inner join dbo.Producer pd on b.ProducerId=pd.ProducerId ";
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" bd.StatusId = 1 ");
if (producerName > 0)
sb.AppendFormat(" and b.ProducerId= {0}", producerName);
if (brandStatus > 0)
sb.AppendFormat(" and BrandStatus = {0}", brandStatus);
if (!string.IsNullOrEmpty(key))
sb.AppendFormat(" and BrandName like '%{0}%'", key);
select.WhereStr = sb.ToString();
return select;
}
开发者ID:weiliji,项目名称:NFMT,代码行数:38,代码来源:BrandBLL.cs
示例15: GetSelectModelForHand
public SelectModel GetSelectModelForHand(int pageIndex, int pageSize, string orderStr, int pledgeApplyId, int repoApplyId)
{
NFMT.Common.SelectModel select = new NFMT.Common.SelectModel();
select.PageIndex = pageIndex;
select.PageSize = pageSize;
if (string.IsNullOrEmpty(orderStr))
select.OrderStr = "rad.StockDetailId desc";
else
select.OrderStr = orderStr;
System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append(" rad.DetailId,rad.StockDetailId,rad.RepoTime,rad.ContractNo,rad.StockId,rad.RefNo,pasd.NetAmount as PledgeNetAmount,pasd.Hands as PledgeHands,pasd.Memo,ISNULL(alStock.AlreadyNetAmount,0) as AlreadyNetAmount,ISNULL(alStock.AlreadyHands,0) as AlreadyHands,rad.AccountName,rad.NetAmount,ROUND(rad.NetAmount/ass.AmountPerHand,0) as Hands,rad.Price,rad.ExpiringDate");
select.ColumnName = sb.ToString();
sb.Clear();
sb.Append(" dbo.Fin_RepoApplyDetail rad ");
sb.Append(" left join dbo.Fin_PledgeApplyStockDetail pasd on rad.StockDetailId = pasd.StockDetailId ");
sb.Append(" left join dbo.Fin_PledgeApply pa on pasd.PledgeApplyId = pa.PledgeApplyId ");
sb.Append(" left join ( ");
sb.Append(" select StockId,SUM(ISNULL(NetAmount,0)) as AlreadyNetAmount,SUM(ISNULL(Hands,0)) as AlreadyHands ");
sb.Append(" from dbo.Fin_RepoApplyDetail ");
sb.AppendFormat(" where DetailStatus >= {0} and RepoApplyId <> {1} ", (int)Common.StatusEnum.已录入, repoApplyId);
sb.Append(" group by StockId ");
sb.Append(" ) alStock on rad.StockId = alStock.StockId ");
sb.Append(" left join NFMT_Basic..Asset ass on ass.AssetId = pa.AssetId ");
select.TableName = sb.ToString();
sb.Clear();
sb.AppendFormat(" rad.RepoApplyId = {0} and rad.DetailStatus = {1} ", repoApplyId, (int)Common.StatusEnum.已生效);
select.WhereStr = sb.ToString();
return select;
}
请发表评论