@RequestMapping(value = "/getTicketInfo", method = RequestMethod.POST)
    public @ResponseBody ResponseModel getTicketInfo(@RequestParam(value = "id", required = true) int id){
        String sql = "SELECT * FROM ticket where id='"+id+"'";
        Connection connection = null;
        TicketModel ticketModel = null;
        PaymentModel paymentModel = null;
        ResponseModel responseModel = new ResponseModel();
        try {
            connection = dataSource.getConnection();

            PreparedStatement ps = connection.prepareStatement(sql);
            ResultSet resultSet = ps.executeQuery();
            if (resultSet.next()) {
                ticketModel = new TicketModel(resultSet.getInt(1), resultSet.getDouble(2), resultSet.getString(4), resultSet.getInt(5), resultSet.getInt(6));
                String sqlDurationSeconds = "select time_to_sec(duration) from ticket where id =" + id;
                PreparedStatement psDurationSeconds = connection.prepareStatement(sqlDurationSeconds);
                ResultSet resultSetDurationSeconds = psDurationSeconds.executeQuery();
                if (resultSetDurationSeconds.next()) {
                    ticketModel.setDurationSeconds(resultSetDurationSeconds.getLong(1));
                }
                resultSetDurationSeconds.close();
                psDurationSeconds.close();
            }
            resultSet.close();
            ps.close();

            String sqlPayment = "SELECT * FROM payment where ticket_id ="+id+"";
            PreparedStatement psPayment = connection.prepareStatement(sqlPayment);
            ResultSet resultSetPayment = psPayment.executeQuery();
            if (resultSetPayment.next()){
                Calendar date = new GregorianCalendar();
                Timestamp timestamp = resultSetPayment.getTimestamp(4);
                date.setTimeInMillis(timestamp.getTime());
                paymentModel = new PaymentModel(resultSetPayment.getInt(1), resultSetPayment.getString(2), resultSetPayment.getString(3), date, resultSetPayment.getString(5), resultSetPayment.getString(6));

                double a = resultSetPayment.getDouble(2);
                if (a != 0){
                    a = a*(-1);
                }
                responseModel.setMessage2(a+"");
            }
            resultSetPayment.close();
            psPayment.close();

        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            if (connection != null) {
                try {
                    connection.close();
                } catch (SQLException e) {
                }
            }
        }
        responseModel.setTicketModel(ticketModel);
        responseModel.setPaymentModel(paymentModel);

        if (ticketModel.getState().equals("E")){
            responseModel.setMessage("archive");
        }else if (ticketModel.getState().equals("A")){
            responseModel.setMessage("active");
        }

        return responseModel;
    }