Просмотр исходного кода

组织、角色、分组管理功能添加组织树

git-svn-id: https://192.168.57.71/svn/jsgkj@1016 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 лет назад
Родитель
Сommit
62a6efafdb
15 измененных файлов с 75 добавлено и 29 удалено
  1. 1 1
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/CodeModelMapper.java
  2. 1 1
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/CodeService.java
  3. 2 2
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/GroupService.java
  4. 2 2
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/CodeServiceImpl.java
  5. 16 7
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/CodeModelMapper.xml
  6. 5 2
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/GroupButtonModelMapper.xml
  7. 5 2
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/GroupMenuModelMapper.xml
  8. 5 0
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/GroupModelMapper.xml
  9. 2 2
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/MenuModelMapper.xml
  10. 13 3
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/OrgModelMapper.xml
  11. 3 1
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/ParamModelMapper.xml
  12. 5 2
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleButtonModelMapper.xml
  13. 5 2
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleMenuModelMapper.xml
  14. 5 1
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleModelMapper.xml
  15. 5 1
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/XzqhModelMapper.xml

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

@@ -14,7 +14,7 @@ public interface CodeModelMapper extends BaseMapper<CodeModel> {
      * 
      * @return
      */
-    List<CodeModel> selectInitDict();
+    List<CodeModel> selectDictTree();
 
     /**
      * 根据父记录ID删除关联的子记录

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

@@ -12,7 +12,7 @@ import com.xt.js.gkaq.frame.model.ComboBoxDto;
  */
 public interface CodeService extends BaseUUIDModelService<CodeModel> {
 
-    public List<CodeModel> initDict();
+    public List<CodeModel> initDictTree();
 
     public int deleteByPid(String pid);
 

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

@@ -2,12 +2,12 @@ package com.xt.js.gkaq.frame.service;
 
 import java.util.List;
 
-import com.xt.js.gkaq.common.BaseService;
+import com.xt.js.gkaq.common.BaseUUIDModelService;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.model.GroupModel;
 import com.xt.js.gkaq.frame.model.GroupModelDto;
 
-public interface GroupService extends BaseService<GroupModel> {
+public interface GroupService extends BaseUUIDModelService<GroupModel> {
 
     /**
      * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ

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

@@ -23,8 +23,8 @@ public class CodeServiceImpl extends BaseUUIDModelServiceImpl<CodeModel> impleme
         return mapper;
     }
 
-    public List<CodeModel> initDict() {
-        return mapper.selectInitDict();
+    public List<CodeModel> initDictTree() {
+        return mapper.selectDictTree();
     }
 
     public int deleteByPid(String pid) {

+ 16 - 7
gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/CodeModelMapper.xml

@@ -61,36 +61,45 @@
     from AQ_BASIC_FRAME_CODE
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.OrgModelDto" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select C.ID, P.ID PID, P.CODE PCODE, P.TEXT PTEXT, C.TEXT, C.CODE, C.VAL, C.LEAF, C.SORTNO, C.REMARK
     from AQ_BASIC_FRAME_CODE C left join AQ_BASIC_FRAME_CODE P on C.PID = P.ID
     <where>
+		C.STATE != #{STATE_DEL}
+		<if test="pid == null or pid == ''">
+	        and C.PID is null
+	    </if>
 	    <if test="pid != null and pid != ''">
-	        P.ID = #{pid,jdbcType=VARCHAR}
+	        and P.ID = #{pid,jdbcType=VARCHAR}
 	    </if>
 	    <if test="pcode != null and pcode != ''">
-	        P.CODE = #{pcode,jdbcType=VARCHAR}
+	        and P.CODE = #{pcode,jdbcType=VARCHAR}
 	    </if>
 	    <if test="code != null and code != ''">
-	        and C.CODE = #{code,jdbcType=VARCHAR}
+	        and C.CODE like #{code,jdbcType=VARCHAR}
 	    </if>
 	    <if test="text != null and text != ''">
 	        and C.TEXT like #{text,jdbcType=VARCHAR}
 	    </if>
     </where>
-    order by P.CODE desc, C.SORTNO
+    order by C.PCODE desc, C.SORTNO
   </select>
-  <select id="selectInitDict" resultMap="BaseResultMap" >
+  <select id="selectDictTree" resultMap="BaseResultMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, PID, TEXT, CODE, LEAF, SORTNO
     from AQ_BASIC_FRAME_CODE
-    order by SORTNO
+    where STATE != #{STATE_DEL}
+    order by PCODE desc, SORTNO
   </select>
   <delete id="deleteByPid" parameterType="java.lang.String" >
     delete from AQ_BASIC_FRAME_CODE
     where PID = #{pid,jdbcType=VARCHAR}
   </delete>
   <select id="selectByPcode" resultMap="ComboBoxMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
 	select TEXT, VAL from AQ_BASIC_FRAME_CODE 
-	where pcode = #{pcode,jdbcType=VARCHAR}
+	where PCODE = #{pcode,jdbcType=VARCHAR}
+    and STATE != #{STATE_DEL}
 	order by SORTNO
   </select>
 </mapper>

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

@@ -40,12 +40,15 @@
     from AQ_BASIC_FRAME_GROUP_BUTTON
   </select>
   <select id="selectByGroupId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, GROUP_ID, BUTTON_ID
     from AQ_BASIC_FRAME_GROUP_BUTTON
-    where GROUP_ID = #{groupId,jdbcType=VARCHAR}
+    where GROUP_ID = #{groupId,jdbcType=VARCHAR} and STATE != #{STATE_DEL}
   </select>
   <delete id="deleteByGroupId" parameterType="java.lang.String" >
-    delete from AQ_BASIC_FRAME_GROUP_BUTTON
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    update AQ_BASIC_FRAME_GROUP_BUTTON
+    set STATE = #{STATE_DEL}
     where GROUP_ID = #{groupId,jdbcType=VARCHAR}
   </delete>
 </mapper>

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

@@ -40,12 +40,15 @@
     from AQ_BASIC_FRAME_GROUP_MENU
   </select>
   <select id="selectByGroupId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, GROUP_ID, MENU_ID
     from AQ_BASIC_FRAME_GROUP_MENU
-    where GROUP_ID = #{groupId,jdbcType=VARCHAR}
+    where GROUP_ID = #{groupId,jdbcType=VARCHAR} and STATE != #{STATE_DEL}
   </select>
   <delete id="deleteByGroupId" parameterType="java.lang.String" >
-    delete from AQ_BASIC_FRAME_GROUP_MENU
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    update AQ_BASIC_FRAME_GROUP_MENU
+    set STATE = #{STATE_DEL}
     where GROUP_ID = #{groupId,jdbcType=VARCHAR}
   </delete>
 </mapper>

+ 5 - 0
gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/GroupModelMapper.xml

@@ -54,11 +54,13 @@
     from AQ_BASIC_FRAME_GROUP
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.GroupModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select G.ID, G.ORG_ID, O.CODE ORG_CODE, O.NAME ORG_NAME, G.ROLE_ID, R.CODE ROLE_CODE, R.NAME ROLE_NAME, G.REMARK
     from AQ_BASIC_FRAME_GROUP G
     left join AQ_BASIC_FRAME_ORG O on G.ORG_ID = O.ID
     left join AQ_BASIC_FRAME_ROLE R on G.ROLE_ID = R.ID
     <where>
+    	G.STATE != #{STATE_DEL}
 	    <if test="org != null and org != ''">
 	        and G.ORG_ID = #{org,jdbcType=VARCHAR}
 	    </if>
@@ -69,7 +71,10 @@
     order by O.CODE, R.CODE
   </select>
   <select id="selectByCombo" resultMap="ComboBoxMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, REMARK
     from AQ_BASIC_FRAME_GROUP
+    where STATE != #{STATE_DEL}
+    order by ORG_ID
   </select>
 </mapper>

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

@@ -97,10 +97,10 @@
 	        and PID = #{pid,jdbcType=VARCHAR}
 	    </if>
 	    <if test="name != null and name != ''">
-	        and NAME like #{loginName,jdbcType=VARCHAR}
+	        and NAME like #{name,jdbcType=VARCHAR}
 	    </if>
 	    <if test="code != null and code != ''">
-	        and CODE like #{orgid,jdbcType=VARCHAR}
+	        and CODE like #{code,jdbcType=VARCHAR}
 	    </if>
    	</where>
    	order by PID, SORTNO

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

@@ -72,13 +72,21 @@
     from AQ_BASIC_FRAME_ORG
   </select>
   <select id="selectOrgTree" resultMap="BaseResultMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, PID, NAME, CODE, ORG_TYPE, SORTNO
     from AQ_BASIC_FRAME_ORG
+    where STATE != #{STATE_DEL}
+    order by PID desc, SORTNO
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.OrgModelDto" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select C.ID, C.CODE, C.NAME, P.ID PID, P.CODE PCODE, P.NAME PNAME, C.ORG_TYPE, C.SZD, C.SZD_NAME, C.XZQH, C."LEVEL", C.REMARK, C.SORTNO
     from AQ_BASIC_FRAME_ORG C left join AQ_BASIC_FRAME_ORG P on C.PID = P.ID
     <where>
+		C.STATE != #{STATE_DEL}
+		<if test="pid == null or pid == ''">
+	        and C.PID is null
+	    </if>
 	    <if test="pid != null and pid != ''">
 	        and P.ID = #{pid,jdbcType=VARCHAR}
 	    </if>
@@ -86,21 +94,23 @@
 	        and P.CODE = #{pcode,jdbcType=VARCHAR}
 	    </if>
 	    <if test="code != null and code != ''">
-	        and C.CODE = #{code,jdbcType=VARCHAR}
+	        and C.CODE like #{code,jdbcType=VARCHAR}
 	    </if>
 	    <if test="name != null and name != ''">
 	        and C.NAME like #{name,jdbcType=VARCHAR}
 	    </if>
     </where>
-    order by P.CODE, C.SORTNO
+    order by C.PID desc, C.SORTNO
   </select>
   <delete id="deleteByPid" parameterType="java.lang.String" >
     delete from AQ_BASIC_FRAME_ORG
     where PID = #{pid,jdbcType=VARCHAR}
   </delete>
   <select id="selectByCombo" resultMap="ComboBoxMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, NAME, CODE
     from AQ_BASIC_FRAME_ORG
-    order by PID, SORTNO
+    where STATE != #{STATE_DEL}
+    order by PID desc, SORTNO
   </select>
 </mapper>

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

@@ -48,10 +48,12 @@
     from AQ_BASIC_FRAME_PARAM
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.ParamModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, KEY, VALUE, CLAZZ, DISP
     from AQ_BASIC_FRAME_PARAM
+    where STATE != #{STATE_DEL}
     <if test="key != null and key != ''">
-        where KEY = #{key,jdbcType=VARCHAR}
+        and KEY = #{key,jdbcType=VARCHAR}
     </if>
   </select>
 </mapper>

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

@@ -34,12 +34,15 @@
     from AQ_BASIC_FRAME_ROLE_BUTTON
   </select>
   <select id="selectByRoleId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, ROLE_ID, BUTTON_ID
     from AQ_BASIC_FRAME_ROLE_BUTTON
-    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR} and STATE != #{STATE_DEL}
   </select>
   <delete id="deleteByRoleId" parameterType="java.lang.String" >
-    delete from AQ_BASIC_FRAME_ROLE_BUTTON
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    update AQ_BASIC_FRAME_ROLE_BUTTON
+    set STATE = #{STATE_DEL}
     where ROLE_ID = #{roleId,jdbcType=VARCHAR}
   </delete>
 </mapper>

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

@@ -40,12 +40,15 @@
     from AQ_BASIC_FRAME_ROLE_MENU
   </select>
   <select id="selectByRoleId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, ROLE_ID, MENU_ID
     from AQ_BASIC_FRAME_ROLE_MENU
-    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR} and STATE != #{STATE_DEL}
   </select>
   <delete id="deleteByRoleId" parameterType="java.lang.String" >
-    delete from AQ_BASIC_FRAME_ROLE_MENU
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
+    update AQ_BASIC_FRAME_ROLE_MENU
+    set STATE = #{STATE_DEL}
     where ROLE_ID = #{roleId,jdbcType=VARCHAR}
   </delete>
 </mapper>

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

@@ -61,11 +61,13 @@
 	)
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.RoleModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, NAME, CODE, REMARK, SORTNO
     from AQ_BASIC_FRAME_ROLE
     <where>
+    	STATE != #{STATE_DEL}
 	    <if test="code != null and code != ''">
-	        and CODE = #{code,jdbcType=VARCHAR}
+	        and CODE like #{code,jdbcType=VARCHAR}
 	    </if>
 	    <if test="name != null and name != ''">
 	        and NAME like #{name,jdbcType=VARCHAR}
@@ -74,8 +76,10 @@
     order by SORTNO
   </select>
   <select id="selectByCombo" resultMap="ComboBoxMap" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, NAME, CODE
     from AQ_BASIC_FRAME_ROLE
+    where STATE != #{STATE_DEL}
     order by SORTNO
   </select>
 </mapper>

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

@@ -52,11 +52,13 @@
     from AQ_BASIC_FRAME_XZQHDM
   </select>
   <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.XzqhModel" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
     select ID, CODE, NAME, XH
     from AQ_BASIC_FRAME_XZQHDM
     <where>
+    	STATE != #{STATE_DEL}
 	    <if test="code != null and code != ''">
-	        CODE like #{code,jdbcType=VARCHAR}
+	        and CODE like #{code,jdbcType=VARCHAR}
 	    </if>
 	    <if test="name != null and name != ''">
 	        and NAME like #{name,jdbcType=VARCHAR}
@@ -65,7 +67,9 @@
     order by XH
   </select>
   <select id="selectByCombo" resultMap="ComboBoxMap" parameterType="java.lang.String" >
+  	<bind name="STATE_DEL" value="@com.xt.js.gkaq.common.BaseUUIDModel@STATE_DELETE"/>
 	select CODE, NAME from AQ_BASIC_FRAME_XZQHDM
+	where STATE != #{STATE_DEL}
 	order by XH
   </select>
 </mapper>