本文整理匯總了Java中org.skife.jdbi.v2.sqlobject.Bind類的典型用法代碼示例。如果您正苦於以下問題:Java Bind類的具體用法?Java Bind怎麽用?Java Bind使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Bind類屬於org.skife.jdbi.v2.sqlobject包,在下文中一共展示了Bind類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: FROM
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的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);
示例2: MAX
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的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);
示例3: updateResponseDeadline
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim SET response_deadline = :responseDeadline "
+ "WHERE id = :claimId"
)
void updateResponseDeadline(
@Bind("claimId") Long claimId,
@Bind("responseDeadline") LocalDate responseDeadline
);
示例4: updateSettlement
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim "
+ " SET settlement = :settlement::JSONB "
+ " WHERE id = :claimId"
)
void updateSettlement(
@Bind("claimId") Long claimId,
@Bind("settlement") String settlement
);
示例5: acceptOffer
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim "
+ " SET "
+ " settlement = :settlement::JSONB, settlement_reached_at = :settlementReachedAt "
+ " WHERE id = :claimId"
)
void acceptOffer(
@Bind("claimId") Long claimId,
@Bind("settlement") String settlement,
@Bind("settlementReachedAt") LocalDateTime settlementReachedAt
);
示例6: getBySubmitterId
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.submitter_id = :submitterId" + ORDER_BY_ID_DESCENDING)
List<Claim> getBySubmitterId(@Bind("submitterId") String submitterId);
示例7: claim
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@GetGeneratedKeys
@SqlUpdate("INSERT INTO claim ( "
+ "submitter_id, "
+ "claim, "
+ "letter_holder_id, "
+ "issued_on, "
+ "response_deadline, "
+ "external_id, "
+ "submitter_email, "
+ "reference_number"
+ ") "
+ "VALUES ("
+ ":submitterId, "
+ ":claim::JSONB, "
+ ":letterHolderId, "
+ ":issuedOn, "
+ ":responseDeadline, "
+ ":externalId, "
+ ":submitterEmail, "
+ "next_reference_number()"
+ ")")
Long saveSubmittedByClaimant(
@Bind("claim") String claim,
@Bind("submitterId") String submitterId,
@Bind("letterHolderId") String letterHolderId,
@Bind("issuedOn") LocalDate issuedOn,
@Bind("responseDeadline") LocalDate responseDeadline,
@Bind("externalId") String externalId,
@Bind("submitterEmail") String submitterEmail
);
示例8: linkLetterHolder
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim SET letter_holder_id = :letterHolderId WHERE id = :claimId"
)
Integer linkLetterHolder(
@Bind("claimId") Long claimId,
@Bind("letterHolderId") String letterHolderId
);
示例9: linkSealedClaimDocument
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim SET sealed_claim_document_management_self_path = :documentSelfPath"
+ " WHERE id = :claimId"
)
Integer linkSealedClaimDocument(
@Bind("claimId") Long claimId,
@Bind("documentSelfPath") String documentSelfPath
);
示例10: linkDefendant
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE claim SET defendant_id = :defendantId WHERE id = :claimId"
)
Integer linkDefendant(
@Bind("claimId") Long claimId,
@Bind("defendantId") String defendantId
);
示例11: now
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlUpdate(
"UPDATE CLAIM SET "
+ "response = :response::JSONB, "
+ "defendant_id = :defendantId, "
+ "defendant_email = :defendantEmail, "
+ "responded_at = now() AT TIME ZONE 'utc' "
+ "WHERE id = :claimId"
)
void saveDefendantResponse(
@Bind("claimId") Long claimId,
@Bind("defendantId") String defendantId,
@Bind("defendantEmail") String defendantEmail,
@Bind("response") String response
);
示例12: getByLetterHolderId
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.letter_holder_id = :letterHolderId")
Optional<Claim> getByLetterHolderId(@Bind("letterHolderId") String letterHolderId);
示例13: getClaimByExternalId
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SingleValueResult
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.external_id = :externalId")
Optional<Claim> getClaimByExternalId(@Bind("externalId") String externalId);
示例14: getByDefendantId
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlQuery(SELECT_FROM_STATEMENT + " WHERE claim.defendant_id = :defendantId" + ORDER_BY_ID_DESCENDING)
List<Claim> getByDefendantId(@Bind("defendantId") String defendantId);
示例15: getPixelUser
import org.skife.jdbi.v2.sqlobject.Bind; //導入依賴的package包/類
@SqlQuery("SELECT pixels.id, pixels.x, pixels.y, pixels.color, pixels.time, users.username, users.pixel_count, users.pixel_count_alltime FROM pixels LEFT JOIN users ON pixels.who = users.id WHERE x = :x AND y = :y AND most_recent ORDER BY time DESC LIMIT 1")
DBPixelPlacementUser getPixelUser(@Bind("x") int x, @Bind("y") int y);