Changeset c9dd3b4 in observatorio for simulacion/ModuloDinamico


Ignore:
Timestamp:
Jan 20, 2015, 5:39:07 PM (9 years ago)
Author:
Alejandro <amujica@…>
Branches:
simulacion
Children:
a0523b8
Parents:
d7bfb1f
Message:

Funcionalidad para que cuando no haya declaracion de empleados de una empresa menor o igual al ano en estudio, tome en cuenta el proxino ano superior

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simulacion/ModuloDinamico/queries.C

    rfaed520 rc9dd3b4  
    698698
    699699  if (not query.next())
    700     return std::tuple<real, real, real>(0.0, 0.0, 0.0);
     700    {
     701      query.clear();
     702      str_query.clear();
     703
     704      str_query.addSelect(DB::ADMINISTRATIVE);
     705      str_query.addSelect(DB::OPERATING);
     706      str_query.addSelect(DB::WORKDAY);
     707
     708      str_query.addFrom(DB::COMPANY_OCCUPANCY_TABLE_NAME);
     709
     710      str_query.addWhere(op(DB::COMPANY_RIF, single_quote(rif)));
     711      str_query.addWhere(op(DB::ACTIVE, "TRUE"));
     712      str_query.addWhere(op(DB::INSERTION_DATE, single_quote(max_date), ">"));
     713
     714      str_query.addOrderBy(DB::INSERTION_DATE);
     715
     716      str_query.setOrderByOption("ASC");
     717
     718      if (not query.exec(str_query))
     719        {
     720          std::string msg = "Cannot execute query: " + std::string(str_query);
     721          throw std::logic_error(msg);
     722        }
     723
     724      if (not query.next())
     725        return std::tuple<real, real, real>(0.0, 0.0, 0.0);
     726    }
    701727
    702728  real administrative = std::atof(query.getValue(0));
Note: See TracChangeset for help on using the changeset viewer.