if(Config.DbInfo.DbType.Equals(DBType.SQLServer))
{
sql= "IF EXISTS (SELECT 1 FROM wifi.imsi_model_status WHERE device_id = @device_id and wireless='" + row[0].GetString() + "') UPDATE wifi.imsi_model_status SET model_status = @model_status,version=@version,serialnumber=@serialnumber, Log_Time=" + SysConst.time_sqlserver + "WHERE device_id = @device_id and wireless='" + row[0].GetString() + "' ELSE INSERT INTO wifi.imsi_model_status(Log_Time, device_id, wireless,model_status,version,serialnumber) VALUES(" + SysConst.time_sqlserver + ", @device_id,'" + row[0].GetString() + "', @model_status,@version,@serialnumber)";
cmdParms= new IDataParameter[4];
cmdParms[0] = new SqlParameter("@device_id", deviceId);
cmdParms[1] = new SqlParameter("@model_status", row[1].GetString());
cmdParms[2] = new SqlParameter("@version", ver);
cmdParms[3] = new SqlParameter("@serialnumber", ser);
sqlDic.Add(sql, cmdParms);
}else if(Config.DbInfo.DbType.Equals(DBType.Oracle))
{
sql= "MERGE INTO wifi.imsi_model_status a USING (select count(*) co from wifi.imsi_model_status WHERE device_id = :device_id and wireless='" + row[0].GetString() + "') b ON (b.co<>0) WHEN MATCHED THEN UPDATE SET Log_Time=" + SysConst.time_sql + ",model_status = :model_status,version=:version,serialnumber=:serialnumber WHERE device_id = :device_id and wireless='" + row[0].GetString() + "' WHEN NOT MATCHED THEN INSERT (Log_Time, device_id,wireless, model_status,version,serialnumber) VALUES(" + SysConst.time_sql + ", :device_id, '" + row[0].GetString() + "',:model_status,:version,:serialnumber)";
cmdParms= new IDataParameter[4];
cmdParms[0] = new OracleParameter(":device_id", deviceId);
cmdParms[1] = new OracleParameter(":model_status", row[1].GetString());
cmdParms[2] = new OracleParameter(":version", ver);
cmdParms[3] = new OracleParameter(":serialnumber", ser);
sqlDic.Add(sql, cmdParms);
}