示例#1
0
        public void AddNewlyCreatedObjectHashTypes()
        {
            // for new sd_sid / hash type combinations

            string sql_string = @"INSERT INTO ad.object_hashes(sd_oid, 
                 hash_type_id, composite_hash)
                 SELECT ia.sd_oid, ia.hash_type_id, ia.composite_hash
                 FROM sd.to_ad_object_atts ia
                 WHERE ia.status = 1";

            dbu.ExecuteSQL(sql_string);
            _logger.Information("Inserting new object hashtype combinations in object hash records");
        }
        public void TransferStudyHashes()
        {
            for (int n = 11; n < 21; n++)
            {
                string sql_string = @"INSERT INTO ad.study_hashes(sd_sid,
                  hash_type_id, composite_hash)
                  SELECT s.sd_sid, 
                  hash_type_id, composite_hash
                  FROM sd.study_hashes s
                  INNER JOIN sd.to_ad_study_recs ts
                  ON s.sd_sid = ts.sd_sid
                  where ts.status = 1
                  and s.hash_type_id = " + n.ToString();

                int res = dbu.ExecuteSQL(sql_string);
                if (res > 0)
                {
                    _logger.Information("Inserting " + res.ToString() + " new study hashes - type " + n.ToString());
                }
            }
        }
        public void TransferObjectHashes()
        {
            for (int n = 50; n < 64; n++)
            {
                string sql_string = @"INSERT INTO ad.object_hashes(sd_oid, 
                 hash_type_id, composite_hash)
                 SELECT d.sd_oid,  
                 hash_type_id, composite_hash
                 FROM sd.object_hashes d
                 INNER JOIN sd.to_ad_object_recs nd
                 ON d.sd_oid = nd.sd_oid
                 WHERE nd.status = 1
                 and d.hash_type_id = " + n.ToString();

                int res = dbu.ExecuteSQL(sql_string);
                if (res > 0)
                {
                    _logger.Information("Inserting " + res.ToString() + " new object hashes - type " + n.ToString());
                }
            }
        }