string[] s_array = Convert.ToString(hsParams[WIP_CUSTCHECK_FIELDS.FIELDS_DEVICENUM]).Split(','); string devicenums = string.Empty; foreach (string s in s_array) { devicenums += "'" + s.Trim() + "',"; } if (!string.IsNullOrEmpty(devicenums)) { devicenums = devicenums.TrimEnd(','); sqlCommand.AppendFormat(" and t2." + WIP_CUSTCHECK_FIELDS.FIELDS_DEVICENUM + " in ({0})", devicenums); }
//终检时间 if (hsParams.ContainsKey(WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "1") && hsParams.ContainsKey(WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "2")) { sqlCommand.AppendFormat(" and t2." + WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + " between CONVERT(datetime,'{0}') and CONVERT(datetime,'{1}')", Convert.ToString(hsParams[WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "1"]), Convert.ToString(hsParams[WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "2"])); blCustCheck = true; } else if (hsParams.ContainsKey(WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "1")) { sqlCommand.AppendFormat(" and t2." + WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + ">=CONVERT(datetime,'{0}')", Convert.ToString(hsParams[WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "1"])); blCustCheck = true; } else if (hsParams.ContainsKey(WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "2")) { sqlCommand.AppendFormat(" and t2." + WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "<=CONVERT(datetime,'{0}')", Convert.ToString(hsParams[WIP_CUSTCHECK_FIELDS.FIELDS_CREATE_TIME + "2"])); blCustCheck = true; }