Przeglądaj źródła

角色管理功能

git-svn-id: https://192.168.57.71/svn/jsgkj@859 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 lat temu
rodzic
commit
ded6c132a9
29 zmienionych plików z 510 dodań i 10 usunięć
  1. 8 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/CodeModelMapper.java
  2. 8 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/MenuModelMapper.java
  3. 8 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/OrgModelMapper.java
  4. 13 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleButtonModelMapper.java
  5. 13 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleMenuModelMapper.java
  6. 8 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleModelMapper.java
  7. 20 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/CodeModelDto.java
  8. 43 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleButtonModel.java
  9. 63 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleMenuModel.java
  10. 6 1
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleModel.java
  11. 9 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/CodeService.java
  12. 2 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/MenuService.java
  13. 2 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/OrgService.java
  14. 13 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/RoleButtonService.java
  15. 13 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/RoleMenuService.java
  16. 9 2
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/RoleService.java
  17. 5 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/CodeServiceImpl.java
  18. 4 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/MenuServiceImpl.java
  19. 4 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/OrgServiceImpl.java
  20. 48 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/RoleButtonServiceImpl.java
  21. 51 0
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/RoleMenuServiceImpl.java
  22. 6 2
      gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/RoleServiceImpl.java
  23. 23 3
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/CodeModelMapper.xml
  24. 5 0
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/MenuModelMapper.xml
  25. 8 1
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/OrgModelMapper.xml
  26. 45 0
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleButtonModelMapper.xml
  27. 51 0
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleMenuModelMapper.xml
  28. 13 0
      gkaqv2/trunk/modules/frame/src/main/resources/com/xt/js/gkaq/frame/mappers/RoleModelMapper.xml
  29. 9 1
      gkaqv2/trunk/modules/frame/src/main/resources/generatorConfig.xml

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

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.xt.js.gkaq.common.BaseMapper;
 import com.xt.js.gkaq.frame.model.CodeModel;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 
 public interface CodeModelMapper extends BaseMapper<CodeModel> {
@@ -31,4 +32,11 @@ public interface CodeModelMapper extends BaseMapper<CodeModel> {
      */
     List<ComboBoxDto> selectByPcode(String pcode);
 
+    /**
+     * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
+     * 
+     * @param model
+     * @return
+     */
+    List<CodeModelDto> selectAllByCond(CodeModelDto model);
 }

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

@@ -21,4 +21,12 @@ public interface MenuModelMapper extends BaseMapper<MenuModel> {
      * @return
      */
     int deleteByPid(String pid);
+
+    /**
+     * 根据父菜单ID查询下级菜单
+     * 
+     * @param pid
+     * @return
+     */
+    List<MenuModel> selectAllByPid(String pid);
 }

+ 8 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/OrgModelMapper.java

@@ -8,6 +8,14 @@ import com.xt.js.gkaq.frame.model.OrgModelDto;
 public interface OrgModelMapper extends BaseMapper<OrgModelDto> {
 
     /**
+     * 根据父记录ID删除关联的子记录
+     * 
+     * @param pid
+     * @return
+     */
+    int deleteByPid(String pid);
+
+    /**
      * 根据条件查询数据集合
      * 
      * @param model

+ 13 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleButtonModelMapper.java

@@ -0,0 +1,13 @@
+package com.xt.js.gkaq.frame.mappers;
+
+import java.util.List;
+
+import com.xt.js.gkaq.common.BaseMapper;
+import com.xt.js.gkaq.frame.model.RoleButtonModel;
+
+public interface RoleButtonModelMapper extends BaseMapper<RoleButtonModel> {
+
+    public List<RoleButtonModel> selectByRoleId(String roleId);
+    
+    public int deleteByRoleId(String roleId);
+}

+ 13 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleMenuModelMapper.java

@@ -0,0 +1,13 @@
+package com.xt.js.gkaq.frame.mappers;
+
+import java.util.List;
+
+import com.xt.js.gkaq.common.BaseMapper;
+import com.xt.js.gkaq.frame.model.RoleMenuModel;
+
+public interface RoleMenuModelMapper extends BaseMapper<RoleMenuModel> {
+
+    public List<RoleMenuModel> selectByRoleId(String roleId);
+    
+    public int deleteByRoleId(String roleId);
+}

+ 8 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/mappers/RoleModelMapper.java

@@ -13,4 +13,12 @@ public interface RoleModelMapper extends BaseMapper<RoleModel> {
 	 * @return
 	 */
 	public List<RoleModel> selectByUserId(String userId);
+
+	/**
+     * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
+     * 
+     * @param model
+     * @return
+     */
+    List<RoleModel> selectAllByCond(RoleModel model);
 }

+ 20 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/CodeModelDto.java

@@ -0,0 +1,20 @@
+package com.xt.js.gkaq.frame.model;
+
+public class CodeModelDto extends CodeModel {
+
+    /**
+     * serialVersionUID
+     */
+    private static final long serialVersionUID = -3328751775050000278L;
+
+    private String ptext;
+
+    public String getPtext() {
+        return ptext;
+    }
+
+    public void setPtext(String ptext) {
+        this.ptext = ptext;
+    }
+
+}

+ 43 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleButtonModel.java

@@ -0,0 +1,43 @@
+package com.xt.js.gkaq.frame.model;
+
+public class RoleButtonModel {
+    private String id;
+
+    private String roleId;
+
+    private String buttonId;
+
+    private String state;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public String getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(String roleId) {
+        this.roleId = roleId == null ? null : roleId.trim();
+    }
+
+    public String getButtonId() {
+        return buttonId;
+    }
+
+    public void setButtonId(String buttonId) {
+        this.buttonId = buttonId == null ? null : buttonId.trim();
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state == null ? null : state.trim();
+    }
+}

+ 63 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleMenuModel.java

@@ -0,0 +1,63 @@
+package com.xt.js.gkaq.frame.model;
+
+public class RoleMenuModel {
+    private String id;
+
+    private String roleId;
+
+    private String menuId;
+
+    private String state;
+
+    private Object createTime;
+
+    private Object updateTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public String getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(String roleId) {
+        this.roleId = roleId == null ? null : roleId.trim();
+    }
+
+    public String getMenuId() {
+        return menuId;
+    }
+
+    public void setMenuId(String menuId) {
+        this.menuId = menuId == null ? null : menuId.trim();
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state == null ? null : state.trim();
+    }
+
+    public Object getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Object createTime) {
+        this.createTime = createTime;
+    }
+
+    public Object getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Object updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 6 - 1
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/model/RoleModel.java

@@ -4,7 +4,12 @@ import com.xt.js.gkaq.common.BaseUUIDModel;
 
 public class RoleModel extends BaseUUIDModel {
 
-	private String name;
+	/**
+     * serialVersionUID
+     */
+    private static final long serialVersionUID = 921533818922552604L;
+
+    private String name;
 
 	private String code;
 

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

@@ -4,6 +4,7 @@ import java.util.List;
 
 import com.xt.js.gkaq.common.BaseUUIDModelService;
 import com.xt.js.gkaq.frame.model.CodeModel;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 
 /**
@@ -22,4 +23,12 @@ public interface CodeService extends BaseUUIDModelService<CodeModel> {
      * @return
      */
     public List<ComboBoxDto> findByPcode(String pcode);
+
+    /**
+     * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
+     * 
+     * @param model
+     * @return
+     */
+    public List<CodeModelDto> findAllByCond(CodeModelDto model);
 }

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

@@ -13,4 +13,6 @@ public interface MenuService extends BaseUUIDModelService<MenuModel> {
     public List<MenuModel> initMenu();
 
     public int deleteByPid(String pid);
+
+    public List<MenuModel> findAllByPid(String pid);
 }

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

@@ -13,6 +13,8 @@ import com.xt.js.gkaq.frame.model.OrgModelDto;
  */
 public interface OrgService extends BaseUUIDModelService<OrgModelDto> {
 
+    public int deleteByPid(String pid);
+
     /**
      * ¸ù¾ÝÌõ¼þ²éѯÊý¾Ý¼¯ºÏ
      * 

+ 13 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/RoleButtonService.java

@@ -0,0 +1,13 @@
+package com.xt.js.gkaq.frame.service;
+
+import java.util.List;
+
+import com.xt.js.gkaq.common.BaseService;
+import com.xt.js.gkaq.frame.model.RoleButtonModel;
+
+public interface RoleButtonService extends BaseService<RoleButtonModel> {
+
+    public List<RoleButtonModel> findByRoleId(String roleId);
+    
+    public int deleteByRoleId(String roleId);
+}

+ 13 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/RoleMenuService.java

@@ -0,0 +1,13 @@
+package com.xt.js.gkaq.frame.service;
+
+import java.util.List;
+
+import com.xt.js.gkaq.common.BaseService;
+import com.xt.js.gkaq.frame.model.RoleMenuModel;
+
+public interface RoleMenuService extends BaseService<RoleMenuModel> {
+
+    public List<RoleMenuModel> findByRoleId(String roleId);
+    
+    public int deleteByRoleId(String roleId);
+}

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

@@ -2,7 +2,7 @@ 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.RoleModel;
 
 /**
@@ -11,7 +11,7 @@ import com.xt.js.gkaq.frame.model.RoleModel;
  * @author yuanxd
  *
  */
-public interface RoleService extends BaseService<RoleModel> {
+public interface RoleService extends BaseUUIDModelService<RoleModel> {
 	/**
 	 * 根据用户ID查角色
 	 * 
@@ -20,4 +20,11 @@ public interface RoleService extends BaseService<RoleModel> {
 	 */
 	List<RoleModel> findByUserId(String userid);
 
+    /**
+     * 根据条件查询数据集合
+     * 
+     * @param model
+     * @return
+     */
+    public List<RoleModel> findAllByCond(RoleModel model);
 }

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

@@ -9,6 +9,7 @@ import com.xt.js.gkaq.common.BaseMapper;
 import com.xt.js.gkaq.common.BaseUUIDModelServiceImpl;
 import com.xt.js.gkaq.frame.mappers.CodeModelMapper;
 import com.xt.js.gkaq.frame.model.CodeModel;
+import com.xt.js.gkaq.frame.model.CodeModelDto;
 import com.xt.js.gkaq.frame.model.ComboBoxDto;
 import com.xt.js.gkaq.frame.service.CodeService;
 
@@ -34,4 +35,8 @@ public class CodeServiceImpl extends BaseUUIDModelServiceImpl<CodeModel> impleme
         return mapper.selectByPcode(pcode);
     }
 
+    public List<CodeModelDto> findAllByCond(CodeModelDto model) {
+        return mapper.selectAllByCond(model);
+    }
+
 }

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

@@ -29,4 +29,8 @@ public class MenuServiceImpl extends BaseUUIDModelServiceImpl<MenuModel> impleme
         return mapper.deleteByPid(pid);
     }
 
+    public List<MenuModel> findAllByPid(String pid) {
+        return mapper.selectAllByPid(pid);
+    }
+
 }

+ 4 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/OrgServiceImpl.java

@@ -24,4 +24,8 @@ public class OrgServiceImpl extends BaseUUIDModelServiceImpl<OrgModelDto> implem
     public List<OrgModelDto> findAllByCond(OrgModelDto model) {
         return mapper.selectAllByCond(model);
     }
+
+    public int deleteByPid(String pid) {
+        return mapper.deleteByPid(pid);
+    }
 }

+ 48 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/RoleButtonServiceImpl.java

@@ -0,0 +1,48 @@
+package com.xt.js.gkaq.frame.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.xt.js.gkaq.common.BaseMapper;
+import com.xt.js.gkaq.common.BaseServiceImpl;
+import com.xt.js.gkaq.common.BaseUUIDModel;
+import com.xt.js.gkaq.common.IdGenerator;
+import com.xt.js.gkaq.common.UUIDGenerator;
+import com.xt.js.gkaq.frame.mappers.RoleButtonModelMapper;
+import com.xt.js.gkaq.frame.model.RoleButtonModel;
+import com.xt.js.gkaq.frame.service.RoleButtonService;
+
+@Service
+public class RoleButtonServiceImpl extends BaseServiceImpl<RoleButtonModel> implements RoleButtonService {
+    /** IDÖ÷¼üÉú³ÉÆ÷ */
+    private IdGenerator idGenerator = new UUIDGenerator();
+
+    @Autowired
+	private RoleButtonModelMapper mapper;
+
+	@Override
+	protected BaseMapper<RoleButtonModel> getMapper() {
+		return mapper;
+	}
+
+    @Transactional
+    @Override
+    public int add(RoleButtonModel record) {
+        record.setId(idGenerator.generateStringId());
+        record.setState(BaseUUIDModel.STATE_ADD);
+        return mapper.insert(record);
+    }
+
+    public List<RoleButtonModel> findByRoleId(String roleId) {
+        return mapper.selectByRoleId(roleId);
+    }
+
+    public int deleteByRoleId(String roleId) {
+        // TODO Auto-generated method stub
+        return mapper.deleteByRoleId(roleId);
+    }
+
+}

+ 51 - 0
gkaqv2/trunk/modules/frame/src/main/java/com/xt/js/gkaq/frame/service/impl/RoleMenuServiceImpl.java

@@ -0,0 +1,51 @@
+package com.xt.js.gkaq.frame.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.xt.js.gkaq.common.BaseMapper;
+import com.xt.js.gkaq.common.BaseServiceImpl;
+import com.xt.js.gkaq.common.BaseUUIDModel;
+import com.xt.js.gkaq.common.IdGenerator;
+import com.xt.js.gkaq.common.UUIDGenerator;
+import com.xt.js.gkaq.frame.mappers.RoleMenuModelMapper;
+import com.xt.js.gkaq.frame.model.RoleMenuModel;
+import com.xt.js.gkaq.frame.service.RoleMenuService;
+
+@Service
+public class RoleMenuServiceImpl extends BaseServiceImpl<RoleMenuModel> implements RoleMenuService {
+    /** IDÖ÷¼üÉú³ÉÆ÷ */
+    private IdGenerator idGenerator = new UUIDGenerator();
+
+    @Autowired
+	private RoleMenuModelMapper mapper;
+
+	@Override
+	protected BaseMapper<RoleMenuModel> getMapper() {
+		return mapper;
+	}
+
+    @Transactional
+    @Override
+    public int add(RoleMenuModel record) {
+        record.setId(idGenerator.generateStringId());
+        Date now = new Date();
+        record.setCreateTime(now);
+        record.setUpdateTime(now);
+        record.setState(BaseUUIDModel.STATE_ADD);
+        return mapper.insert(record);
+    }
+
+    public List<RoleMenuModel> findByRoleId(String roleId) {
+        return mapper.selectByRoleId(roleId);
+    }
+
+    public int deleteByRoleId(String roleId) {
+        return mapper.deleteByRoleId(roleId);
+    }
+
+}

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

@@ -6,13 +6,13 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.xt.js.gkaq.common.BaseMapper;
-import com.xt.js.gkaq.common.BaseServiceImpl;
+import com.xt.js.gkaq.common.BaseUUIDModelServiceImpl;
 import com.xt.js.gkaq.frame.mappers.RoleModelMapper;
 import com.xt.js.gkaq.frame.model.RoleModel;
 import com.xt.js.gkaq.frame.service.RoleService;
 
 @Service
-public class RoleServiceImpl extends BaseServiceImpl<RoleModel> implements RoleService {
+public class RoleServiceImpl extends BaseUUIDModelServiceImpl<RoleModel> implements RoleService {
 	@Autowired
 	private RoleModelMapper mapper;
 
@@ -24,4 +24,8 @@ public class RoleServiceImpl extends BaseServiceImpl<RoleModel> implements RoleS
 	public List<RoleModel> findByUserId(String userId) {
 		return mapper.selectByUserId(userId);
 	}
+
+    public List<RoleModel> findAllByCond(RoleModel model) {
+        return mapper.selectAllByCond(model);
+    }
 }

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

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
 <mapper namespace="com.xt.js.gkaq.frame.mappers.CodeModelMapper" >
-  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.CodeModel" >
+  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.CodeModelDto" >
     <id column="ID" property="id" jdbcType="VARCHAR" />
     <result column="PID" property="pid" jdbcType="VARCHAR" />
     <result column="PCODE" property="pcode" jdbcType="VARCHAR" />
@@ -14,6 +14,7 @@
     <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
     <result column="UPDATE_TIME" property="updateTime" jdbcType="TIMESTAMP" />
     <result column="STATE" property="state" jdbcType="CHAR" />
+    <result column="PTEXT" property="ptext" jdbcType="VARCHAR" />
   </resultMap>
   <resultMap id="ComboBoxMap" type="com.xt.js.gkaq.frame.model.ComboBoxDto" >
     <result column="VAL" property="optVal" jdbcType="VARCHAR" />
@@ -23,7 +24,7 @@
     delete from AQ_BASIC_FRAME_CODE
     where ID = #{id,jdbcType=VARCHAR}
   </delete>
-  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.CodeModel" >
+  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.CodeModelDto" >
     insert into AQ_BASIC_FRAME_CODE (ID, PID, PCODE, 
       TEXT, CODE, VAL, LEAF, 
       SORTNO, REMARK, CREATE_TIME, 
@@ -33,7 +34,7 @@
       #{sortno,jdbcType=DECIMAL}, #{remark,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{state,jdbcType=CHAR})
   </insert>
-  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.CodeModel" >
+  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.CodeModelDto" >
     update AQ_BASIC_FRAME_CODE
     set PID = #{pid,jdbcType=VARCHAR},
       PCODE = #{pcode,jdbcType=VARCHAR},
@@ -59,6 +60,25 @@
     STATE
     from AQ_BASIC_FRAME_CODE
   </select>
+  <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.OrgModelDto" >
+    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>
+	    <if test="pid != null and pid != ''">
+	        P.ID = #{pid,jdbcType=VARCHAR}
+	    </if>
+	    <if test="pcode != null and pcode != ''">
+	        P.CODE = #{pcode,jdbcType=VARCHAR}
+	    </if>
+	    <if test="code != null and code != ''">
+	        and C.CODE = #{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
+  </select>
   <select id="selectInitDict" resultMap="BaseResultMap" >
     select ID, PID, TEXT, CODE, LEAF, SORTNO
     from AQ_BASIC_FRAME_CODE

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

@@ -75,4 +75,9 @@
     delete from AQ_BASIC_FRAME_MENU
     where PID = #{pid,jdbcType=VARCHAR}
   </delete>
+  <select id="selectAllByPid" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, PID, NAME, CODE, ICON, URL, LEAF, OUT_LINK, REMARK, SORTNO
+    from AQ_BASIC_FRAME_MENU
+    where PID = #{pid,jdbcType=VARCHAR}
+  </select>
 </mapper>

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

@@ -71,6 +71,9 @@
     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>
+	    <if test="pid != null and pid != ''">
+	        P.ID = #{pid,jdbcType=VARCHAR}
+	    </if>
 	    <if test="pcode != null and pcode != ''">
 	        P.CODE = #{pcode,jdbcType=VARCHAR}
 	    </if>
@@ -81,6 +84,10 @@
 	        and C.NAME like #{name,jdbcType=VARCHAR}
 	    </if>
     </where>
-    order by P.CODE, C.CODE, C.SORTNO
+    order by P.CODE, C.SORTNO
   </select>
+  <delete id="deleteByPid" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_ORG
+    where PID = #{pid,jdbcType=VARCHAR}
+  </delete>
 </mapper>

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

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.xt.js.gkaq.frame.mappers.RoleButtonModelMapper" >
+  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.RoleButtonModel" >
+    <id column="ID" property="id" jdbcType="VARCHAR" />
+    <result column="ROLE_ID" property="roleId" jdbcType="VARCHAR" />
+    <result column="BUTTON_ID" property="buttonId" jdbcType="VARCHAR" />
+    <result column="STATE" property="state" jdbcType="CHAR" />
+  </resultMap>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_ROLE_BUTTON
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.RoleButtonModel" >
+    insert into AQ_BASIC_FRAME_ROLE_BUTTON (ID, ROLE_ID, BUTTON_ID, 
+      STATE)
+    values (#{id,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR}, #{buttonId,jdbcType=VARCHAR}, 
+      #{state,jdbcType=CHAR})
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.RoleButtonModel" >
+    update AQ_BASIC_FRAME_ROLE_BUTTON
+    set ROLE_ID = #{roleId,jdbcType=VARCHAR},
+      BUTTON_ID = #{buttonId,jdbcType=VARCHAR},
+      STATE = #{state,jdbcType=CHAR}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, ROLE_ID, BUTTON_ID, STATE
+    from AQ_BASIC_FRAME_ROLE_BUTTON
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectAll" resultMap="BaseResultMap" >
+    select ID, ROLE_ID, BUTTON_ID, STATE
+    from AQ_BASIC_FRAME_ROLE_BUTTON
+  </select>
+  <select id="selectByRoleId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, ROLE_ID, BUTTON_ID
+    from AQ_BASIC_FRAME_ROLE_BUTTON
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByRoleId" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_ROLE_BUTTON
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+  </delete>
+</mapper>

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

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.xt.js.gkaq.frame.mappers.RoleMenuModelMapper" >
+  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.RoleMenuModel" >
+    <id column="ID" property="id" jdbcType="VARCHAR" />
+    <result column="ROLE_ID" property="roleId" jdbcType="VARCHAR" />
+    <result column="MENU_ID" property="menuId" jdbcType="VARCHAR" />
+    <result column="STATE" property="state" jdbcType="CHAR" />
+    <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="UPDATE_TIME" property="updateTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_ROLE_MENU
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.RoleMenuModel" >
+    insert into AQ_BASIC_FRAME_ROLE_MENU (ID, ROLE_ID, MENU_ID, 
+      STATE, CREATE_TIME, UPDATE_TIME
+      )
+    values (#{id,jdbcType=VARCHAR}, #{roleId,jdbcType=VARCHAR}, #{menuId,jdbcType=VARCHAR}, 
+      #{state,jdbcType=CHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.RoleMenuModel" >
+    update AQ_BASIC_FRAME_ROLE_MENU
+    set ROLE_ID = #{roleId,jdbcType=VARCHAR},
+      MENU_ID = #{menuId,jdbcType=VARCHAR},
+      STATE = #{state,jdbcType=CHAR},
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, ROLE_ID, MENU_ID, STATE, CREATE_TIME, UPDATE_TIME
+    from AQ_BASIC_FRAME_ROLE_MENU
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectAll" resultMap="BaseResultMap" >
+    select ID, ROLE_ID, MENU_ID, STATE, CREATE_TIME, UPDATE_TIME
+    from AQ_BASIC_FRAME_ROLE_MENU
+  </select>
+  <select id="selectByRoleId" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, ROLE_ID, MENU_ID
+    from AQ_BASIC_FRAME_ROLE_MENU
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByRoleId" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_ROLE_MENU
+    where ROLE_ID = #{roleId,jdbcType=VARCHAR}
+  </delete>
+</mapper>

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

@@ -56,4 +56,17 @@
     WHERE UG.USER_ID=#{userId,jdbcType=VARCHAR} AND G.ROLE_ID=R.ID AND UG.STATE='1' AND G.STATE='1'
 	)
   </select>
+  <select id="selectAllByCond" resultMap="BaseResultMap" parameterType="com.xt.js.gkaq.frame.model.RoleModel" >
+    select ID, NAME, CODE, REMARK, SORTNO
+    from AQ_BASIC_FRAME_ROLE
+    <where>
+	    <if test="code != null and code != ''">
+	        and CODE = #{code,jdbcType=VARCHAR}
+	    </if>
+	    <if test="name != null and name != ''">
+	        and NAME like #{name,jdbcType=VARCHAR}
+	    </if>
+    </where>
+    order by SORTNO
+  </select>
 </mapper>

+ 9 - 1
gkaqv2/trunk/modules/frame/src/main/resources/generatorConfig.xml

@@ -58,10 +58,18 @@
 			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
 			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
 		</table>
-		  -->
 		<table tableName="AQ_BASIC_FRAME_XZQHDM" domainObjectName="XzqhModel">
 			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
 			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
 		</table>
+		  -->
+		<table tableName="AQ_BASIC_FRAME_ROLE_MENU" domainObjectName="RoleMenuModel">
+			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
+			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
+		</table>
+		<table tableName="AQ_BASIC_FRAME_ROLE_BUTTON" domainObjectName="RoleButtonModel">
+			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
+			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
+		</table>
 	</context>
 </generatorConfiguration>