class VerifycodeQueryService {

    /**
     * Logger.
     */
    private static final Logger LOGGER = LogManager.getLogger(VerifycodeQueryService.class);

    /**
     * Verifycode repository.
     */
    @Inject
    private VerifycodeRepository verifycodeRepository;

    /**
     * Gets a verifycode with the specified type, biz type and user id.
     *
     * @param type    the specified type
     * @param bizType the specified biz type
     * @param userId  the specified user id
     * @return verifycode, returns {@code null} if not found
     */
    public JSONObject getVerifycodeByUserId(final int type, final int bizType, final String userId) {<FILL_FUNCTION_BODY>}

    /**
     * Gets a verifycode with the specified code.
     *
     * @param code the specified code
     * @return verifycode, returns {@code null} if not found
     */
    public JSONObject getVerifycode(final String code) {
        final Query query = new Query().setFilter(new PropertyFilter(Verifycode.CODE, FilterOperator.EQUAL, code));
        try {
            return verifycodeRepository.getFirst(query);
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Gets verifycode failed", e);
            return null;
        }
    }
}

        final Query query = new Query().setFilter(CompositeFilterOperator.and(
                new PropertyFilter(Verifycode.TYPE, FilterOperator.EQUAL, type),
                new PropertyFilter(Verifycode.BIZ_TYPE, FilterOperator.EQUAL, bizType),
                new PropertyFilter(Verifycode.USER_ID, FilterOperator.EQUAL, userId))).
                addSort(Keys.OBJECT_ID, SortDirection.DESCENDING);
        try {
            return verifycodeRepository.getFirst(query);
        } catch (final Exception e) {
            LOGGER.log(Level.ERROR, "Gets verifycode failed", e);
            return null;
        }
    
<no_super_class>