Quellcode durchsuchen

默认模块

tags/正式3.10.0
王宁 vor 1 Jahr
Ursprung
Commit
31f12ac249

+ 2
- 1
sapi/src/main/java/com/xhkjedu/sapi/controller/system/ModuledefaultController.java Datei anzeigen

@@ -27,7 +27,7 @@ public class ModuledefaultController {
27 27
 
28 28
     @PostMapping("/add")
29 29
     public ResultVo add(@RequestBody TModuledefault tModuledefault) {
30
-        N_Utils.validation(new Object[]{tModuledefault.getBelong(),"模块归属",1,tModuledefault.getBelongcode(),"模块归属类型",1});
30
+        N_Utils.validation(new Object[]{tModuledefault.getBelong(),"模块归属",1});
31 31
         return moduledefaultService.save(tModuledefault);
32 32
     }
33 33
 
@@ -51,6 +51,7 @@ public class ModuledefaultController {
51 51
         return new ResultVo(0,"获取详情成功",moduledefault);
52 52
     }
53 53
 
54
+    //列表
54 55
     @PostMapping("/list")
55 56
     public ResultVo list(@RequestBody TModuledefault tModuledefault) {
56 57
         Integer belong = tModuledefault.getBelong();

+ 4
- 3
sapi/src/main/resources/mapper/system/ModuledefaultMapper.xml Datei anzeigen

@@ -5,10 +5,11 @@
5 5
     <select id="listModulesByBelong" resultType="com.xhkjedu.sapi.model.system.TModule">
6 6
         SELECT m.moduleid,m.modulename,m.moduleurl,m.moduleico,m.modulepid,m.morder,m.minout
7 7
         ,m.comm,m.mclass,m.level,m.mabbrevname,m.mdefault,m.belong,m.belongcode,m.display
8
-        FROM t_moduledefault m where m.belong=#{belong}
8
+        FROM t_moduledefault m where ((m.belong=#{belong}
9
+        <if test="belongcode!=null and belongcode!=0">and m.belongcode=#{belongcode}</if>)
10
+        or (m.belong=#{belong} and m.level=1))
9 11
         <if test="display!=null">and m.display=#{display}</if>
10
-        <if test="belongcode!=null and belongcode!=0">and m.belongcode=#{belongcode}</if>
11
-        ORDER BY m.morder
12
+        group by m.moduleid ORDER BY m.morder
12 13
     </select>
13 14
 
14 15
     <!--获取所有模块-->

Laden…
Abbrechen
Speichern