Browse Source

菜单管理功能添加组织树

git-svn-id: https://192.168.57.71/svn/jsgkj@991 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 năm trước cách đây
mục cha
commit
5cec1daca3

+ 5 - 1
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/MenuModelMapper.java

@@ -12,7 +12,7 @@ public interface MenuModelMapper extends BaseMapper<MenuModel> {
      * 
      * @return
      */
-    List<MenuModel> selectInitMenu();
+    List<MenuModel> selectMenuTree();
 
     /**
      * 몽앴만꽉데ID�뇜밑젬돨綾꽉데
@@ -29,4 +29,8 @@ public interface MenuModelMapper extends BaseMapper<MenuModel> {
      * @return
      */
     List<MenuModel> selectAllByPid(String pid);
+
+    List<MenuModel> selectAllByCond(MenuModel model);
+
+    List<MenuModel> selectAllBtnByCond(MenuModel model);
 }

+ 5 - 1
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/MenuService.java

@@ -10,9 +10,13 @@ import com.xt.js.gkaq.frame.model.MenuModel;
  */
 public interface MenuService extends BaseUUIDModelService<MenuModel> {
 
-    public List<MenuModel> initMenu();
+    public List<MenuModel> initMenuTree();
 
     public int deleteByPid(String pid);
 
     public List<MenuModel> findAllByPid(String pid);
+
+    public List<MenuModel> findAllByCond(MenuModel model);
+
+    public List<MenuModel> findAllBtnByCond(MenuModel model);
 }

+ 12 - 2
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/MenuServiceImpl.java

@@ -21,8 +21,8 @@ public class MenuServiceImpl extends BaseUUIDModelServiceImpl<MenuModel> impleme
         return mapper;
     }
 
-    public List<MenuModel> initMenu() {
-        return mapper.selectInitMenu();
+    public List<MenuModel> initMenuTree() {
+        return mapper.selectMenuTree();
     }
 
     public int deleteByPid(String pid) {
@@ -33,4 +33,14 @@ public class MenuServiceImpl extends BaseUUIDModelServiceImpl<MenuModel> impleme
         return mapper.selectAllByPid(pid);
     }
 
+    @Override
+    public List<MenuModel> findAllByCond(MenuModel model) {
+        return mapper.selectAllByCond(model);
+    }
+
+    @Override
+    public List<MenuModel> findAllBtnByCond(MenuModel model) {
+        return mapper.selectAllBtnByCond(model);
+    }
+
 }

+ 3 - 1
gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/ButtonModelMapper.xml

@@ -50,7 +50,9 @@
     from AQ_BASIC_FRAME_BUTTON
   </select>
   <delete id="deleteByMenu" parameterType="java.lang.String" >
-    delete from AQ_BASIC_FRAME_BUTTON
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    update AQ_BASIC_FRAME_BUTTON
+    set STATE = #{STATE_DEL}
     where MENU = #{menu,jdbcType=VARCHAR}
   </delete>
 </mapper>

+ 45 - 2
gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/MenuModelMapper.xml

@@ -63,12 +63,15 @@
     UPDATE_TIME, STATE, CREATE_USER, UPDATE_USER
     from AQ_BASIC_FRAME_MENU
   </select>
-  <select id="selectInitMenu" resultMap="BaseResultMap" >
+  <select id="selectMenuTree" resultMap="BaseResultMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, PID, NAME, CODE, LEAF, SORTNO
     from AQ_BASIC_FRAME_MENU
+    where STATE != #{STATE_DEL}
     union all
     select ID, MENU PID, NAME, CODE, 'B' LEAF, SORTNO
     from AQ_BASIC_FRAME_BUTTON
+    where STATE != #{STATE_DEL}
     order by SORTNO
   </select>
   <delete id="deleteByPid" parameterType="java.lang.String" >
@@ -76,8 +79,48 @@
     where PID = #{pid,jdbcType=VARCHAR}
   </delete>
   <select id="selectAllByPid" resultMap="BaseResultMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, PID, NAME, CODE, ICON, URL, LEAF, OUT_LINK, REMARK, SORTNO
     from AQ_BASIC_FRAME_MENU
-    where PID = #{pid,jdbcType=VARCHAR}
+    where PID = #{pid,jdbcType=VARCHAR} and STATE != #{STATE_DEL}
+  </select>
+  <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.MenuModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    select ID, PID, NAME, CODE, LEAF, REMARK, SORTNO
+    from AQ_BASIC_FRAME_MENU
+   	<where>
+		STATE != #{STATE_DEL}
+		<if test="pid == null or pid == ''">
+	        and PID is null
+	    </if>
+	    <if test="pid != null and pid != ''">
+	        and PID = #{pid,jdbcType=VARCHAR}
+	    </if>
+	    <if test="name != null and name != ''">
+	        and NAME like #{loginName,jdbcType=VARCHAR}
+	    </if>
+	    <if test="code != null and code != ''">
+	        and CODE like #{orgid,jdbcType=VARCHAR}
+	    </if>
+   	</where>
+   	order by PID, SORTNO
+  </select>
+  <select id="selectAllBtnByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.MenuModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    select ID, MENU PID, NAME, CODE, 'B' LEAF, SORTNO
+    from AQ_BASIC_FRAME_BUTTON
+   	<where>
+		STATE != #{STATE_DEL}
+	    <if test="pid != null and pid != ''">
+	        and MENU = #{pid,jdbcType=VARCHAR}
+	    </if>
+	    <if test="name != null and name != ''">
+	        and NAME like #{loginName,jdbcType=VARCHAR}
+	    </if>
+	    <if test="code != null and code != ''">
+	        and CODE like #{orgid,jdbcType=VARCHAR}
+	    </if>
+   	</where>
+   	order by SORTNO
   </select>
 </mapper>