public R_SN_STATION_DETAIL GetSNLastPassStationDetail(string SN, OleExec DB) { R_SN_STATION_DETAIL R_Sn_Station_Detail = null; Row_R_SN_STATION_DETAIL Rows = (Row_R_SN_STATION_DETAIL)NewRow(); DataTable Dt = new DataTable(); string result = string.Empty; string StrSql = string.Empty; StrSql = $@"select*from (select*from r_sn_station_detail where sn='{SN}' and repair_failed_flag='0' order by edit_time desc)a where rownum=1 "; Dt = DB.ExecSelect(StrSql).Tables[0]; if (Dt.Rows.Count > 0) { Rows.loadData(Dt.Rows[0]); R_Sn_Station_Detail = Rows.GetDataObject(); } return(R_Sn_Station_Detail); }
public List <R_SN_STATION_DETAIL> GetSNStationDetailByPanel(string PanelSn, OleExec DB) { List <R_SN_STATION_DETAIL> R_SN_STATION_DETAIL_LIST = new List <R_SN_STATION_DETAIL>(); R_SN_STATION_DETAIL R_Sn_Station_Detail = null; Row_R_SN_STATION_DETAIL Rows = (Row_R_SN_STATION_DETAIL)NewRow(); DataTable Dt = new DataTable(); string result = string.Empty; string StrSql = string.Empty; StrSql = $@"SELECT * FROM R_SN_STATION_DETAIL WHERE SN IN (SELECT SN FROM R_PANEL_SN WHERE PANEL = '{PanelSn}') order by id "; Dt = DB.ExecSelect(StrSql).Tables[0]; foreach (DataRow r in Dt.Rows) { Rows.loadData(r); R_Sn_Station_Detail = Rows.GetDataObject(); R_SN_STATION_DETAIL_LIST.Add(R_Sn_Station_Detail); } return(R_SN_STATION_DETAIL_LIST); }