public static void newRecord(string goods_id, int currentnode, int nextnode, int action) { object[] args = { goods_id, currentnode, nextnode, action, goods_id }; string sql = string.Format("insert into record (cargo_id,time,currentnode,nextnode,action,send_id) values ('{0}',now(),{1},{2},{3},(select count(*) from record as b where cargo_id='{4}'))", args); DBO.execute(sql); }
public static DataSet getRecord(string time, int action, int cuttentnode) { string sql = string.Format("select * from record as a where a.currentnode= {0} and a.action={1} and DATE_FORMAT(time,'%Y-%m-%d') like'{2}%' and not exists (select * from record as b where a.cargo_id = b.cargo_id and b.send_id>a.send_id)", cuttentnode, action, time); return(DBO.execute(sql)); }
public static DataSet getDate(int currentnode, int action) { string sql = string.Format("select distinct DATE_FORMAT(a.time,'%Y-%m-%d') as date from record as a where a.action = {1} and a.currentnode= {0} and not exists (select * from record as b where a.cargo_id = b.cargo_id and b.send_id>a.send_id)", currentnode, action); return(DBO.execute(sql)); }
public static DataSet getRecord(string goods_id) { string sql = string.Format("select time,a.name,b.name,action from record,node as a,node as b where cargo_id = '{0}' and currentnode= a.id and nextnode=b.id order by send_id ", goods_id); return(DBO.execute(sql)); }