|
|
|
@ -51,18 +51,14 @@ namespace :subjects do
|
|
|
|
|
"'#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')")
|
|
|
|
|
puts "index: #{index}; worker_number: #{Parallel.worker_number}"
|
|
|
|
|
puts "####str: #{str}"
|
|
|
|
|
if str.size == 50
|
|
|
|
|
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
|
|
|
|
|
puts sql
|
|
|
|
|
ActiveRecord::Base.connection.execute sql
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if str.size > 0
|
|
|
|
|
sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
|
|
|
|
|
puts sql
|
|
|
|
|
ActiveRecord::Base.connection.execute sql
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
# if str.size > 0
|
|
|
|
|
# sql = "REPLACE INTO subject_records(#{column_value}) VALUES #{str.uniq.join(",")}"
|
|
|
|
|
# puts sql
|
|
|
|
|
# ActiveRecord::Base.connection.execute sql
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
puts("---------------------data_statistic_end")
|
|
|
|
|
Rails.logger.info("---------------------data_statistic_end")
|
|
|
|
|
end
|
|
|
|
|