MaxKey 4 роки тому
батько
коміт
6cbe9e6837

+ 9 - 0
maxkey-core/src/main/java/org/maxkey/domain/Resources.java

@@ -38,6 +38,7 @@ public class Resources  extends JpaBaseDomain implements Serializable {
     int sortIndex;
     @Column
     String appId;
+    String appName;
     @Column
     String parentId;
     @Column
@@ -94,6 +95,14 @@ public class Resources  extends JpaBaseDomain implements Serializable {
         this.appId = appId;
     }
 
+    public String getAppName() {
+        return appName;
+    }
+
+    public void setAppName(String appName) {
+        this.appName = appName;
+    }
+
     public String getParentId() {
         return parentId;
     }

+ 8 - 8
maxkey-persistence/src/main/resources/org/maxkey/persistence/mapper/xml/mysql/ResourcesMapper.xml

@@ -4,16 +4,16 @@
 
 	<sql id="where_statement">
     	<if test="id != null and id != ''">
-			AND	ID	=	#{id}
+			AND	RES.ID	=	#{id}
 		</if> 
 		<if test="appId != null and appId != ''">
-            AND APPID  =   #{appId}
+            AND RES.APPID  =   #{appId}
         </if> 
         <if test="parentId != null and parentId != ''">
-            AND PARENTID  =   #{parentId}
+            AND RES.PARENTID  =   #{parentId}
         </if> 
 		<if test="name != null and name != ''">
-			AND NAME LIKE '%${name}%'
+			AND RES.NAME LIKE '%${name}%'
 		</if>
     </sql>
     
@@ -21,13 +21,13 @@
 	
 	<select id="queryPageResults" parameterType="Resources" resultType="Resources">
 		SELECT
-			*
+			RES.*,APP.NAME APPNAME
 		FROM
-			RESOURCES
+			RESOURCES RES, APPS APP
 		WHERE
-			 (1=1)	
+			 (1=1)	AND RES.APPID=APP.ID
 		<include refid="where_statement"/>
-		ORDER BY SORTINDEX 
+		ORDER BY RES.SORTINDEX 
 	</select>
 	
 	

+ 1 - 2
maxkey-web-manage/src/main/resources/templates/views/resources/resourcesList.ftl

@@ -239,13 +239,12 @@ $(function () {
 			<tr>
 				<th data-checkbox="true"></th>
 				<th data-sortable="true" data-field="id"   data-visible="false">Id</th>
+				<th data-field="appName"><@locale code="apps.name"/></th>
 				<th data-field="name"><@locale code="resource.name"/></th>
 				<th data-field="resourceType"><@locale code="resource.resourceType"/></th>
 				<th data-field="sortIndex"><@locale code="common.text.sortindex"/></th>
-				<th data-field="resourceUrl"><@locale code="resource.resourceUrl"/></th>
 				<th data-field="resourceAction"><@locale code="resource.resourceAction"/></th>
 				<th data-field="description"><@locale code="common.text.description"/></th>
-	
 			</tr>
 		</thead>
 	</table>