當前位置: 首頁>>代碼示例>>Java>>正文


Java SqlQuery類代碼示例

本文整理匯總了Java中org.skife.jdbi.v2.sqlobject.SqlQuery的典型用法代碼示例。如果您正苦於以下問題:Java SqlQuery類的具體用法?Java SqlQuery怎麽用?Java SqlQuery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SqlQuery類屬於org.skife.jdbi.v2.sqlobject包,在下文中一共展示了SqlQuery類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: FROM

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery("SELECT *, RESULT.ID AS RESULT_ID, RESULT.ERRNO FROM (SELECT T.TASK_ID, MT.MONITOR_ID, M.NAME AS MONITOR_NAME, T.ACCOUNT_ID, T.NAME, TASK_INTERVAL AS 'INTERVAL', CONFIG_JSON, T.STATUS, T.CREATION_TIME, T.MODIFIED_TIME FROM SNM_TASK T " +
"LEFT JOIN SNM_MONITOR_TASK MT ON MT.TASK_ID = T.TASK_ID " +
"LEFT JOIN SNM_MONITOR M ON M.MONITOR_ID = MT.MONITOR_ID " +
"WHERE T.ACCOUNT_ID = :accountId AND T.STATUS <ne> :taskDeleteStatus GROUP BY T.TASK_ID, MONITOR_ID) AS TMP " +
"LEFT JOIN ( " +
        "SELECT R.ID, R.COLLECTED_TIME, R.MONITOR_ID, R.TASK_ID, R.ERRNO " +
        "FROM SNM_NIPING_RESULT AS R " +
        "INNER JOIN  " +
        "( " +
        "SELECT MAX(RES2.ID) AS ID " +
        "FROM SNM_NIPING_RESULT RES2 " +
        "INNER JOIN ( " +
        "SELECT MAX(COLLECTED_TIME) AS T1, MONITOR_ID, TASK_ID FROM SNM_NIPING_RESULT WHERE COLLECTED_TIME <ge> :lasthour AND TYPE = :type GROUP BY TASK_ID, MONITOR_ID " +
        ") AS RES1 " +
        "ON RES2.COLLECTED_TIME = RES1.T1 AND RES1.MONITOR_ID = RES2.MONITOR_ID AND RES1.TASK_ID = RES2.TASK_ID " +
        "GROUP BY RES2.COLLECTED_TIME, RES2.TASK_ID, RES2.MONITOR_ID\n" +
        ") AS RES3 " +
        "ON R.ID = RES3.ID "+
") AS RESULT ON TMP.MONITOR_ID = RESULT.MONITOR_ID AND TMP.TASK_ID = RESULT.TASK_ID " +
" ORDER BY TMP.CREATION_TIME DESC")
@RegisterMapper(TaskMapper.class)
List<Task> selectByAccountId(@Bind("accountId") String accountId, @Bind("taskDeleteStatus") int taskDeleteStatus, @Bind("lasthour") Date lasthour, @Bind("type") int type, @Define("ne") String notEqual, @Define("ge") String greaterThan);
 
開發者ID:CloudWise-OpenSource,項目名稱:SAPNetworkMonitor,代碼行數:23,代碼來源:TaskDao.java

示例2: MAX

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery("SELECT R.TASK_ID, R.AV2, R.TR2, R.ERRNO, R.MONITOR_ID, M.MONITOR_ID, M.NAME, M.IP, M.COUNTRY, M.PROVINCE, M.CITY, M.ISP " +
        "FROM SNM_NIPING_RESULT AS R " +
        "INNER JOIN " +
        "( " +
        "SELECT MAX(RES2.ID) AS ID " +
        "FROM SNM_NIPING_RESULT RES2 " +
        "INNER JOIN ( " +
        "SELECT MAX(COLLECTED_TIME) AS T1, MONITOR_ID, TASK_ID FROM SNM_NIPING_RESULT WHERE ACCOUNT_ID = :accountId AND TASK_ID = :taskId AND TYPE = :type GROUP BY TASK_ID, MONITOR_ID " +
        ") AS RES1 " +
        "ON RES2.COLLECTED_TIME = RES1.T1 AND RES1.MONITOR_ID = RES2.MONITOR_ID AND RES1.TASK_ID = RES2.TASK_ID " +
        "GROUP BY RES2.COLLECTED_TIME, RES2.TASK_ID, RES2.MONITOR_ID " +
        ") AS RES3 " +
        "ON R.ID = RES3.ID " +
        "INNER JOIN SNM_MONITOR M ON M.MONITOR_ID = R.MONITOR_ID")
@RegisterMapper(MonitorNiPingResultMapper.class)
List<MonitorNiPingResult> selectByTaskId(@Bind("accountId") String accountId, @Bind("taskId") String taskId, @Bind("type") int type);
 
開發者ID:CloudWise-OpenSource,項目名稱:SAPNetworkMonitor,代碼行數:17,代碼來源:MonitorNiPingResultDao.java

示例3: getStateIds

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery("SELECT stateId FROM q_values " +
        "WHERE :x BETWEEN x-5 AND x+5 AND :y BETWEEN y-5 AND y+5 " +
        "AND targetObjectType=:targetObjectType " +
        "AND :aboveCount BETWEEN aboveCount-2 AND aboveCount+2" +
        "AND :leftCount BETWEEN leftCount-2 AND leftCount+2 " +
        "AND :rightCount BETWEEN rightCount-2 AND rightCount+2 " +
        "AND :belowCount BETWEEN belowCount-2 AND belowCount+2 " +
        "AND :distanceToPig BETWEEN distanceToPig-3 AND distanceToPig+3 " +
        "AND trajectorytype=:trajectoryType "+
        "AND pigsLeft =:pigsLeft")
List<Integer> getStateIds(@Bind("x") int x,
                          @Bind("y") int y,
                          @Bind("targetObjectType") String targetObjectType,
                          @Bind("aboveCount") int aboveCount,
                          @Bind("leftCount") int leftCount,
                          @Bind("rightCount") int rightCount,
                          @Bind("belowCount") int belowCount,
                          @Bind("distanceToPig") double distanceToPig,
                          @Bind("trajectoryType") String trajectoryType,
                          @Bind("pigsLeft") int pigsLeft);
 
開發者ID:jgonsior,項目名稱:AngryProgrammers,代碼行數:21,代碼來源:QValuesDAO.java

示例4: getBySubmitterId

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.submitter_id = :submitterId" + ORDER_BY_ID_DESCENDING)
List<Claim> getBySubmitterId(@Bind("submitterId") String submitterId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:3,代碼來源:ClaimRepository.java

示例5: X

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
/**
 * NOTE: we don't limit by the geometry so all tiles get all data (which caches well)
 * This could (should) be revised for e.g. Aves
 */
@SqlQuery("SELECT"
          + "  X(geom) AS longitude,"
          + "  Y(geom) AS latitude,"
          + "  yearCounts"
          + "  FROM lepidoptera"
          + "  WHERE speciesKey=:speciesKey")
List<PointFeature> getSpeciesCounts(@Bind("speciesKey") int speciesKey);
 
開發者ID:gbif,項目名稱:species-population,代碼行數:12,代碼來源:DataDAO.java

示例6: getQValue

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery("SELECT q_value FROM q_values WHERE stateId=:stateId AND x=:x AND y=:y AND targetObjectType=:targetObjectType AND aboveCount=:aboveCount " +
        "AND leftCount=:leftCount AND rightCount=:rightCount AND belowCount=:belowCount AND distanceToPig=:distanceToPig AND trajectorytype=:trajectoryType AND pigsLeft=:pigsLeft;")
double getQValue(
        @Bind("stateId") int stateId,
        @Bind("x") int x,
        @Bind("y") int y,
        @Bind("targetObjectType") String targetObjectType,
        @Bind("aboveCount") int aboveCount,
        @Bind("leftCount") int leftCount,
        @Bind("rightCount") int rightCount,
        @Bind("belowCount") int belowCount,
        @Bind("distanceToPig") double distanceToPig,
        @Bind("trajectoryType") String trajectoryType,
        @Bind("pigsLeft") int pigsLeft
);
 
開發者ID:jgonsior,項目名稱:AngryProgrammers,代碼行數:16,代碼來源:QValuesDAO.java

示例7: count

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery("SELECT count(stateId) FROM q_values WHERE x=:x AND y=:y AND targetObjectType=:targetObjectType AND aboveCount=:aboveCount " +
        "AND leftCount=:leftCount AND rightCount=:rightCount AND belowCount=:belowCount AND distanceToPig=:distanceToPig AND trajectorytype=:trajectoryType AND pigsLeft=:pigsLeft")
int countStateIds(@Bind("x") int x,
                  @Bind("y") int y,
                  @Bind("targetObjectType") String targetObjectType,
                  @Bind("aboveCount") int aboveCount,
                  @Bind("leftCount") int leftCount,
                  @Bind("rightCount") int rightCount,
                  @Bind("belowCount") int belowCount,
                  @Bind("distanceToPig") double distanceToPig,
                  @Bind("trajectoryType") String trajectoryType);
 
開發者ID:jgonsior,項目名稱:AngryProgrammers,代碼行數:12,代碼來源:QValuesDAO.java

示例8: getRepairUnitByClusterAndTables

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery(SQL_GET_REPAIR_UNIT_BY_CLUSTER_AND_TABLES)
@Mapper(RepairUnitMapper.class)
RepairUnit getRepairUnitByClusterAndTables(
    @Bind("clusterName") String clusterName,
    @Bind("keyspaceName") String keyspaceName,
    @Bind("columnFamilies") Collection<String> columnFamilies,
    @Bind("nodes") Collection<String> nodes,
    @Bind("datacenters") Collection<String> datacenters,
    @Bind("blacklisted_tables") Collection<String> blacklistedTables);
 
開發者ID:thelastpickle,項目名稱:cassandra-reaper,代碼行數:10,代碼來源:IStoragePostgreSql.java

示例9: findAll

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + ORDER_BY_ID_DESCENDING)
List<Claim> findAll();
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:3,代碼來源:ClaimRepository.java

示例10: getByLetterHolderId

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.letter_holder_id = :letterHolderId")
Optional<Claim> getByLetterHolderId(@Bind("letterHolderId") String letterHolderId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:4,代碼來源:ClaimRepository.java

示例11: getClaimByExternalId

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.external_id = :externalId")
Optional<Claim> getClaimByExternalId(@Bind("externalId") String externalId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:4,代碼來源:ClaimRepository.java

示例12: getByDefendantId

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.defendant_id = :defendantId" + ORDER_BY_ID_DESCENDING)
List<Claim> getByDefendantId(@Bind("defendantId") String defendantId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:3,代碼來源:ClaimRepository.java

示例13: getByClaimReferenceNumber

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.reference_number = :claimReferenceNumber")
Optional<Claim> getByClaimReferenceNumber(@Bind("claimReferenceNumber") String claimReferenceNumber);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:4,代碼來源:ClaimRepository.java

示例14: getByClaimReferenceAndSubmitter

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.reference_number = :claimReferenceNumber "
    + "AND claim.submitter_id = :submitterId")
Optional<Claim> getByClaimReferenceAndSubmitter(@Bind("claimReferenceNumber") String claimReferenceNumber,
                                                @Bind("submitterId") String submitterId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:6,代碼來源:ClaimRepository.java

示例15: getByExternalReference

import org.skife.jdbi.v2.sqlobject.SqlQuery; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.submitter_id = :submitterId "
    + " AND claim.claim ->>'externalReferenceNumber' = :externalReference" + ORDER_BY_ID_DESCENDING)
List<Claim> getByExternalReference(@Bind("externalReference") String externalReference,
                                   @Bind("submitterId") String submitterId);
 
開發者ID:hmcts,項目名稱:cmc-claim-store,代碼行數:5,代碼來源:ClaimRepository.java


注:本文中的org.skife.jdbi.v2.sqlobject.SqlQuery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。