接口 GroupCapacityMapper

    • 方法详细资料

      • insertIntoSelect

        java.lang.String insertIntoSelect()
        INSERT INTO SELECT statement. Used to insert query results into a table.

        Example: INSERT INTO group_capacity (group_id, quota,`usage`, `max_size`, max_aggr_count, max_aggr_size,gmt_create, gmt_modified) SELECT ?, ?, count(*), ?, ?, ?, ?, ? FROM config_info;

        返回:
        sql.
      • insertIntoSelectByWhere

        java.lang.String insertIntoSelectByWhere()
        INSERT INTO SELECT statement. Used to insert query results into a table.

        Where condition: group_id=? AND tenant_id = ''

        Example: INSERT INTO group_capacity (group_id, quota,`usage`, `max_size`, max_aggr_count, max_aggr_size,gmt_create, gmt_modified) SELECT ?, ?, count(*), ?, ?, ?, ?, ? FROM config_info where group_id=? AND tenant_id = '';

        返回:
        sql.
      • incrementUsageByWhereQuotaEqualZero

        java.lang.String incrementUsageByWhereQuotaEqualZero()
        used to increment usage field.

        Where condition: group_id = ? AND usage < ? AND quota = 0;

        Example: UPDATE group_capacity SET `usage` = `usage` + 1, gmt_modified = ? WHERE group_id = ? AND `usage` < ? AND quota = 0;

        返回:
      • incrementUsageByWhereQuotaNotEqualZero

        java.lang.String incrementUsageByWhereQuotaNotEqualZero()
        used to increment usage field.

        Where condition: group_id = ? AND usage < quota AND quota != 0

        Example: UPDATE group_capacity SET `usage` = `usage` + 1, gmt_modified = ? WHERE group_id = ? AND `usage` < quota AND quota != 0;

        返回:
      • incrementUsageByWhere

        java.lang.String incrementUsageByWhere()
        used to increment usage field.

        Where condition: group_id = ?

        Example: UPDATE group_capacity SET `usage` = `usage` + 1, gmt_modified = ? WHERE group_id = ?;

        返回:
      • decrementUsageByWhere

        java.lang.String decrementUsageByWhere()
        used to decrement usage field.

        Where condition: group_id = ? AND `usage` > 0

        Example: UPDATE group_capacity SET `usage` = `usage` - 1, gmt_modified = ? WHERE group_id = ? AND `usage` > 0;

        返回:
      • updateUsage

        java.lang.String updateUsage()
        used to update usage field.

        Example: UPDATE group_capacity SET `usage` = (SELECT count(*) FROM config_info), gmt_modified = ? WHERE group_id = ?;

        返回:
      • updateUsageByWhere

        java.lang.String updateUsageByWhere()
        used to update usage field.

        Where condition: group_id=? AND tenant_id = ''

        Example: UPDATE group_capacity SET `usage` = (SELECT count(*) FROM config_info WHERE group_id=? AND tenant_id = ''), gmt_modified = ? WHERE group_id= ?;

        返回:
      • selectGroupInfoBySize

        java.lang.String selectGroupInfoBySize()
        used to select group info.

        Example: SELECT id, group_id FROM group_capacity WHERE id>? LIMIT ?;

        返回: