| 1234567891011121314151617181920212223242526272829 |
- import java.sql.*;
- public class QueryAdminMenus13 {
- public static void main(String[] args) throws Exception {
- String url = "jdbc:mysql://cq-cdb-8fjmemkb.sql.tencentcdb.com:27220/ylrz_saas?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8";
- try (Connection c = DriverManager.getConnection(url, "root", "Ylrz_1q2w3e4r5t6y");
- Statement st = c.createStatement()) {
- try (ResultSet rs = st.executeQuery(
- "SELECT menu_id, menu_name, parent_id, path, component FROM sys_menu "
- + "WHERE parent_id=2800 AND visible='0' AND status='0' AND menu_type='M' ORDER BY order_num")) {
- System.out.println("=== direct children of admin 2800 ===");
- while (rs.next()) {
- System.out.printf("%s | %s | path=%s | comp=%s%n",
- rs.getString(1), rs.getString(2), rs.getString(4), rs.getString(5));
- }
- }
- try (ResultSet rs = st.executeQuery(
- "SELECT menu_id, menu_name, parent_id, path, component FROM sys_menu "
- + "WHERE path='shezhi' OR menu_name LIKE '%\\u7cfb\\u7edf\\u914d\\u7f6e%'")) {
- System.out.println("=== shezhi path or name ===");
- while (rs.next()) {
- System.out.printf("%s | %s | parent=%s | path=%s | comp=%s%n",
- rs.getString(1), rs.getString(2), rs.getString(3),
- rs.getString(4), rs.getString(5));
- }
- }
- }
- }
- }
|