using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using WebAPI.Dapper; namespace WebAPI.Service { public class ProcessDal { public static List GetProcessList(string hName,int hLevel,string hNumber,string hBillSubType) { var sqlBuilder = new StringBuilder(); sqlBuilder.Append("select a.HItemID,a.HNumber,a.HName ,a.HLevel,a.HTypeFlow ,a.HTypeCount ,a.HBillSubType "); sqlBuilder.Append(",a.HEndFlag,a.HStopFlag,b.hname,a.HSNo,a.HProcessID_K3,a.HFixPrice,a.HOverFixPrice "); sqlBuilder.Append(",a.HEndFlag,a.HStopFlag,b.hname,a.HSNo,a.HProcessID_K3,a.HFixPrice,a.HOverFixPrice "); sqlBuilder.Append(",a.HAutoTrunFlag,a.HRemark ,a.HProcessID_K3 from gy_Process a left join h_v_IF_Department b on a.HDeptID=b.hitemid where 1=1 "); if (!string.IsNullOrEmpty(hName)) sqlBuilder.Append(" and a.HName like '%@hName%'"); if(!string.IsNullOrEmpty(hNumber)) sqlBuilder.Append(" and a.HNumbe like '%@hNumber%'"); if (!string.IsNullOrEmpty(hBillSubType)) sqlBuilder.Append(" and a.HBillSubType like '%@hBillSubType%'"); if(hLevel!=0) sqlBuilder.Append(" and a.HLevel=@hLevel"); var list = SqlPools.GetInstance("YqnConn").GetModelList(sqlBuilder.ToString(), new { hName, hLevel, hNumber, hBillSubType }); return list; } public static Models.M_StationBillMail GetProcessDetail(int hItemID) { var sql = "select HNumber,HHelpCode,HName,HNumber,HDeptID,HProcMulID,HRemark,HSNo,HFixPrice,HOverFixPrice,HBillSubType,HStopflag, HTypeFlow, HTypeCount, HAutoTrunFlag, HItemID from Gy_Process where HItemID=@hItemID"; var model = SqlPools.GetInstance("YqnConn").GetModel(sql, new { hItemID }); return model; } } }