|
|
@ -70,7 +70,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
|
|
|
|
throws GroupManagementDAOException {
|
|
|
|
throws GroupManagementDAOException {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP "
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH, PARENT_GROUP_ID FROM DM_GROUP "
|
|
|
|
+ "WHERE TENANT_ID = ?";
|
|
|
|
+ "WHERE TENANT_ID = ?";
|
|
|
|
if (StringUtils.isNotBlank(request.getGroupName())) {
|
|
|
|
if (StringUtils.isNotBlank(request.getGroupName())) {
|
|
|
|
sql += " AND GROUP_NAME LIKE ?";
|
|
|
|
sql += " AND GROUP_NAME LIKE ?";
|
|
|
@ -132,7 +132,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP WHERE TENANT_ID = ?";
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH, PARENT_GROUP_ID FROM DM_GROUP WHERE TENANT_ID = ?";
|
|
|
|
if (StringUtils.isNotBlank(request.getGroupName())) {
|
|
|
|
if (StringUtils.isNotBlank(request.getGroupName())) {
|
|
|
|
sql += " AND GROUP_NAME LIKE ?";
|
|
|
|
sql += " AND GROUP_NAME LIKE ?";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -513,7 +513,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
ResultSet resultSet = null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP WHERE ID = ? "
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH, PARENT_GROUP_ID FROM DM_GROUP WHERE ID = ? "
|
|
|
|
+ "AND TENANT_ID = ?";
|
|
|
|
+ "AND TENANT_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(sql);
|
|
|
|
stmt = conn.prepareStatement(sql);
|
|
|
|
stmt.setInt(1, groupId);
|
|
|
|
stmt.setInt(1, groupId);
|
|
|
@ -536,7 +536,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
|
|
|
|
public List<DeviceGroup> getChildrenGroups(String parentPath, int tenantId) throws GroupManagementDAOException {
|
|
|
|
public List<DeviceGroup> getChildrenGroups(String parentPath, int tenantId) throws GroupManagementDAOException {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP "
|
|
|
|
String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH, PARENT_GROUP_ID FROM DM_GROUP "
|
|
|
|
+ "WHERE PARENT_PATH LIKE ? AND TENANT_ID = ?";
|
|
|
|
+ "WHERE PARENT_PATH LIKE ? AND TENANT_ID = ?";
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
try (PreparedStatement stmt = conn.prepareStatement(sql)) {
|
|
|
|
stmt.setString(1, parentPath + "%");
|
|
|
|
stmt.setString(1, parentPath + "%");
|
|
|
@ -727,7 +727,7 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
Connection conn = GroupManagementDAOFactory.getConnection();
|
|
|
|
String sql =
|
|
|
|
String sql =
|
|
|
|
"SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP "
|
|
|
|
"SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH, PARENT_GROUP_ID FROM DM_GROUP "
|
|
|
|
+ "WHERE LOWER(GROUP_NAME) = LOWER(?) AND TENANT_ID = ?";
|
|
|
|
+ "WHERE LOWER(GROUP_NAME) = LOWER(?) AND TENANT_ID = ?";
|
|
|
|
stmt = conn.prepareStatement(sql);
|
|
|
|
stmt = conn.prepareStatement(sql);
|
|
|
|
stmt.setString(1, groupName);
|
|
|
|
stmt.setString(1, groupName);
|
|
|
|