$row=$this->db->fetchAll("select count(*) from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d'))");
$sum=$row[0]['count'];
$sql="select * from reference where id in (select refid from mdref where uuid in (select uuid from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d')) order by reference limit ? offset ?";
$state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword ilike '%波段机载微波辐射计') and id in (select id from keyword where keytype='theme' and keyword='航空遥感')");
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword ilike '%波段机载微波辐射计') and id in (select id from keyword where keytype='theme' and keyword='航空遥感') order by timebegin,title limit ? offset ?";
$state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='激光雷达') and id in (select id from keyword where keytype='theme' and keyword='航空遥感')");
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='激光雷达') and id in (select id from keyword where keytype='theme' and keyword='航空遥感') order by timebegin,title limit ? offset ?";
$state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='红外广角双模式成像仪WiDAS') and id in (select id from keyword where keytype='theme' and keyword='航空遥感')");
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='红外广角双模式成像仪WiDAS') and id in (select id from keyword where keytype='theme' and keyword='航空遥感') order by timebegin,title limit ? offset ?";
$state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='成像光谱仪OMIS-II') and id in (select id from keyword where keytype='theme' and keyword='航空遥感')");
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='theme' and keyword='成像光谱仪OMIS-II') and id in (select id from keyword where keytype='theme' and keyword='航空遥感') order by timebegin,title limit ? offset ?";
$sql="select uuid,title,id,description from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keyword='".$key."') order by timebegin,title limit ? offset ?";
$state=$this->db->query("select keyword.keyword,count(*) from keyword left join metadata on keyword.id=metadata.id where keyword.keytype='place' and metadata.source='0595169a-279e-4b95-819f-129d0ba4280d' group by keyword.keyword order by count desc");
$state=$this->db->query("select k.keyword,count(k.keyword) from keyword k left join metadata m on k.id=m.id where k.keytype='theme' and m.source='0595169a-279e-4b95-819f-129d0ba4280d' group by k.keyword order by k.keyword");
$state=$this->db->query("select keyword.keyword,count(*) from keyword left join metadata on keyword.id=metadata.id where keyword.keytype='temporal' and metadata.source='0595169a-279e-4b95-819f-129d0ba4280d' group by keyword.keyword order by keyword.keyword");
$sql="select uuid,title,id,description from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and ".$where." order by timebegin,title limit ? offset ?";
$sql="select id,uuid,west,south,north,east,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null and timebegin::date>date('2007-01-01')";
$rows=$this->db->fetchAll("select id,uuid,description,title,timebegin,timeend from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and timebegin is not null order by timebegin,title");
$row=$this->db->fetchAll("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from category where code=".$code.")");
$sum=$row[0]['count'];
$this->view->category=$this->db->fetchAll('select c.code,name,name_zh,count(*) from category c,categorycode cc where c.code=cc.code group by c.code,cc.name,cc.name_zh');
$sql="select uuid,title,description,id from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select distinct id from category where code=".$code.") order by timebegin,title limit ? offset ?";
$state=$this->db->query("select count(*) from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."')");
$sql="select uuid,title from metadata where source='0595169a-279e-4b95-819f-129d0ba4280d' and id in (select id from keyword where keytype='".$type."' and keyword='".$keyword."') order by timebegin,title limit ? offset ?";