| | |
| | | /// <param name="pa"></param> |
| | | /// <returns></returns> |
| | | public IEnumerable<OA_Kaipiaoshenqing> SelectModelPage(Pagination pa, Guid FirmId, string CreateTimeStart, string CreateTimeEnd, |
| | | string Kaipiaoshenqing, string Kehuqianshou, string BusinessManagerId, string CustormerName) |
| | | string Kaipiaoshenqing, string Kehuqianshou, string BusinessManagerId, string CustormerName, string PayStates, string HuikuanStates) |
| | | { |
| | | string Condition = " and ok.FirmId ='" + FirmId + "' "; |
| | | string Condition = " and ok.FirmId ='" + FirmId + "' and ok.ApprovalStatus = 1 "; |
| | | |
| | | if (!string.IsNullOrEmpty(CreateTimeStart)) |
| | | Condition += " and DATEDIFF(day,ok.[CreateTime],'" + CreateTimeStart + "')<=0 "; |
| | |
| | | if (!string.IsNullOrEmpty(CustormerName)) |
| | | Condition += " and oe.CompanyName like '%" + CustormerName + "%'"; |
| | | |
| | | if (!string.IsNullOrEmpty(PayStates)) |
| | | { |
| | | if (PayStates == "2") |
| | | { |
| | | Condition += " and not EXISTS ( select eoe.[KaipiaoshenqingId] from [EC_OrderExtend] eoe inner join [EC_OrderBasic] eob on eob.Keyid = eoe.Keyid where ok.Keyid = eoe.[KaipiaoshenqingId] and eob.PayState !=-1 ) "; |
| | | } |
| | | else if (PayStates == "1") |
| | | { |
| | | Condition += " and EXISTS ( select eoe.[KaipiaoshenqingId] from [EC_OrderExtend] eoe inner join [EC_OrderBasic] eob on eob.Keyid = eoe.Keyid where ok.Keyid = eoe.[KaipiaoshenqingId] and eob.PayState !=-1 ) "; |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(HuikuanStates)) |
| | | { |
| | | if (HuikuanStates == "2") |
| | | { |
| | | Condition += " and ok.Huikuanmoney >0 "; |
| | | } |
| | | else if (HuikuanStates == "1") |
| | | { |
| | | Condition += " and ( ok.Huikuanmoney is null or ok.Huikuanmoney <=0) "; |
| | | } |
| | | } |
| | | |
| | | Query query = new Query(); |
| | | IList<Criterion> criterias = new List<Criterion>() |
| | | { |
| | | new Criterion("", Condition), |
| | | |
| | | new Criterion("orderBy"," SellerOrderId desc ") |
| | | new Criterion("orderBy"," CreateTime desc ") |
| | | }; |
| | | query.Criteria = criterias; |
| | | return _IOA_KaipiaoshenqingDAL.SelectModelPage(query, pa); |