public static ResultSet getPerformance(Connection conn, Map<String, String> params, Logger logger, DateFormat df) throws SQLException, InvalidParameterException {
        PreparedStatement sp = null;
        try {
            sp = conn.prepareStatement("exec dbo.Wga_GetPerformance ?, ?, ?, ?, ?, ?, ?, ?, ?, ?");
            // @IdBuilding int, @IdHall int, @IdShow int, @IdShowType varchar(2), @IdGenre int, 
            // @BeginTime datetime, @EndTime datetime, @AllFields tinyint, @AsId bit
            if (params.get(IDBUILDING) != null) {
                sp.setInt(1, Integer.parseInt(params.get(IDBUILDING)));
            } else {
                sp.setNull(1, java.sql.Types.INTEGER);
            }
            if (params.get(IDHALL) != null) {
                sp.setInt(2, Integer.parseInt(params.get(IDHALL)));
            } else {
                sp.setNull(2, java.sql.Types.INTEGER);
            }
            if (params.get(IDSHOW) != null) {
                sp.setInt(3, Integer.parseInt(params.get(IDSHOW)));
            } else {
                sp.setNull(3, java.sql.Types.INTEGER);
            }
            if (params.get(IDSHOWTYPE) != null) {
                sp.setString(4, params.get(IDSHOWTYPE));
            } else {
                sp.setNull(4, java.sql.Types.VARCHAR);
            }
            if (params.get(IDGENRE) != null) {
                sp.setInt(5, Integer.parseInt(params.get(IDGENRE)));
            } else {
                sp.setNull(5, java.sql.Types.INTEGER);
            }
            setBeginTimeParameter(params, sp, df, logger, 6);
            setEndTimeParameter(params, sp, df, logger, 7);
            if (params.get(ALLFIELDS) != null) {
                sp.setInt(8, Integer.parseInt(params.get(ALLFIELDS)));
            } else {
                sp.setInt(8, 1);
            }
            if (params.get(ASID) != null) {
                sp.setInt(9, Integer.parseInt(params.get(ASID)));
            } else {
                sp.setInt(9, 1);
            }
            if (params.get(IDPERFORMANCE) != null) {
                sp.setInt(10, Integer.parseInt(params.get(IDPERFORMANCE)));
            } else {
                sp.setNull(10, java.sql.Types.INTEGER);
            }
            return sp.executeQuery();
        } finally {
            if (sp != null) {
                sp.close();
            }
        }
    }