Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
5.5 kB
1
Indexable
Never
   String GET_ALL_DEPARTMENT_BY_STATUS = """
                 SELECT
                     d.gym_department_id,
                     d.user_id,
                     d.name,
                     d.address,
                     d.contact_number,
                     d.logo_url,
                     d.wallpaper_url,
                     d.description,
                     d.latitude,
                     d.longitude,
                     d.rating,
                     d.capacity,
                     d.area,
                     d.gym_department_status_key,
                     kbn_department_status.mst_kbn_value AS gym_department_status_name                     
                 FROM gym_department d
                 LEFT JOIN mst_kbn kbn_department_status
                     ON d.gym_department_status_key = kbn_department_status.mst_kbn_key
                     AND kbn_department_status.mst_kbn_name = 'DEPARTMENT_STATUS'  
                     WHERE d.gym_department_status_key = ?
            """;
    String GET_ALL_DEPARTMENT_ORDER_BY_RATING = """
                 SELECT
                     d.gym_department_id,
                     d.user_id,
                     d.name,
                     d.address,
                     d.contact_number,
                     d.logo_url,
                     d.wallpaper_url,
                     d.description,
                     d.latitude,
                     d.longitude,
                     d.rating,
                     d.capacity,
                     d.area,
                     d.gym_department_status_key,
                     kbn_department_status.mst_kbn_value AS gym_department_status_name                     
                 FROM gym_department d
                 LEFT JOIN mst_kbn kbn_department_status
                     ON d.gym_department_status_key = kbn_department_status.mst_kbn_key
                     AND kbn_department_status.mst_kbn_name = 'DEPARTMENT_STATUS'  
                 WHERE d.gym_department_status_key = ?
                 ORDER BY d.rating DESC
            """;

    String GET_DEPARTMENT_BY_ID = """
            SELECT  
                     d.gym_department_id,
                     d.user_id,
                     d.name,
                     d.address,
                     d.contact_number,
                     d.logo_url,
                     d.wallpaper_url,
                     d.description,
                     d.latitude,
                     d.longitude,
                     d.rating,   
                     d.capacity,
                     d.area,                  
                d.gym_department_status_key,
                kbn_department_status.mst_kbn_value AS gym_department_status_name
                FROM gym_department d
                LEFT JOIN mst_kbn kbn_department_status
                ON d.gym_department_status_key = kbn_department_status.mst_kbn_key
                AND kbn_department_status.mst_kbn_name = 'DEPARTMENT_STATUS'
                WHERE d.gym_department_id =?
                """;

    String GET_DEPARTMENT_BY_USER = """
                 SELECT 
                     d.gym_department_id,
                     d.user_id,
                     d.name,
                     d.address,
                     d.contact_number,
                     d.logo_url,
                     d.wallpaper_url,
                     d.description,
                     d.latitude,
                     d.longitude,
                     d.rating,
                     d.capacity,
                     d.area,                     
                     d.gym_department_status_key,
                     kbn_department_status.mst_kbn_value AS gym_department_status_name
                 FROM gym_department d
                 LEFT JOIN mst_kbn kbn_department_status
                     ON d.gym_department_status_key = kbn_department_status.mst_kbn_key
                     AND kbn_department_status.mst_kbn_name = 'DEPARTMENT_STATUS'
                 INNER JOIN user u ON d.user_id = u.user_id
                 INNER JOIN user_role ur ON u.user_id = ur.user_id
                     WHERE u.user_id = ?        
            """;

    String UPDATE_DEPARTMENT = """
                    UPDATE gym_department
                    SET
                        user_id = ?,
                        name = ?,
                        address = ?,
                        contact_number = ?,
                        logo_url = ?,
                        image_url = ?,
                        description = ?,
                        gym_department_status_key = ?
                WHERE gym_department_id = ?
            """;

    String GET_DEPARTMENT_SCHEDULE_BY_ID_DEPARTMENT = """
            SELECT  
                     dc.id,
                     dc.gym_department_id,
                     dc.day,
                     dc.open_time,
                     dc.close_time
                FROM gym_department_schedule dc
                    WHERE dc.gym_department_id =?
                """;

    String GET_DEPARTMENT_ALBUMS_BY_ID_DEPARTMENT = """
            SELECT  
                     da.id,
                     da.gym_department_id,
                     da.photo_url,
                     da.description
                FROM gym_department_albums da
                    WHERE da.gym_department_id =?
                """;