Selaa lähdekoodia

菜单管理功能

git-svn-id: https://192.168.57.71/svn/jsgkj@815 931142cf-59ea-a443-aa0e-51397b428577
ld_zhouk 8 vuotta sitten
vanhempi
commit
43bfb4cc7a

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

@@ -0,0 +1,16 @@
+package com.xt.js.gkaq.frame.mappers;
+
+import com.xt.js.gkaq.frame.model.ButtonModel;
+import java.util.List;
+
+public interface ButtonModelMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(ButtonModel record);
+
+    ButtonModel selectByPrimaryKey(String id);
+
+    List<ButtonModel> selectAll();
+
+    int updateByPrimaryKey(ButtonModel record);
+}

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

@@ -0,0 +1,23 @@
+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.MenuModel;
+
+public interface MenuModelMapper extends BaseMapper<MenuModel> {
+
+    /**
+     * 꿴璂놓迦뺏꽉데
+     * 
+     * @return
+     */
+    List<MenuModel> selectInitMenu();
+
+    /**
+     * 몽앴만꽉데ID�뇜밑젬돨綾꽉데
+     * @param pid
+     * @return
+     */
+	int deleteByPid(String pid);
+}

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

@@ -0,0 +1,103 @@
+package com.xt.js.gkaq.frame.model;
+
+public class ButtonModel {
+    private String id;
+
+    private String name;
+
+    private String code;
+
+    private String menu;
+
+    private String icon;
+
+    private String remark;
+
+    private Long sortno;
+
+    private Object createTime;
+
+    private Object updateTime;
+
+    private String state;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id == null ? null : id.trim();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name == null ? null : name.trim();
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code == null ? null : code.trim();
+    }
+
+    public String getMenu() {
+        return menu;
+    }
+
+    public void setMenu(String menu) {
+        this.menu = menu == null ? null : menu.trim();
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon == null ? null : icon.trim();
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark == null ? null : remark.trim();
+    }
+
+    public Long getSortno() {
+        return sortno;
+    }
+
+    public void setSortno(Long sortno) {
+        this.sortno = sortno;
+    }
+
+    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;
+    }
+
+    public String getState() {
+        return state;
+    }
+
+    public void setState(String state) {
+        this.state = state == null ? null : state.trim();
+    }
+}

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

@@ -0,0 +1,101 @@
+package com.xt.js.gkaq.frame.model;
+
+import com.xt.js.gkaq.common.BaseUUIDModel;
+
+public class MenuModel extends BaseUUIDModel {
+    /**
+	 * serialVersionUID
+	 */
+	private static final long serialVersionUID = -27198057540373269L;
+
+    private String pid;
+
+    private String name;
+
+    private String code;
+
+    private String icon;
+
+    private String url;
+
+    private String leaf;
+
+    private String outLink;
+
+    private String remark;
+
+    private Long sortno;
+
+    public String getPid() {
+        return pid;
+    }
+
+    public void setPid(String pid) {
+        this.pid = pid == null ? null : pid.trim();
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name == null ? null : name.trim();
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code == null ? null : code.trim();
+    }
+
+    public String getIcon() {
+        return icon;
+    }
+
+    public void setIcon(String icon) {
+        this.icon = icon == null ? null : icon.trim();
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url == null ? null : url.trim();
+    }
+
+    public String getLeaf() {
+        return leaf;
+    }
+
+    public void setLeaf(String leaf) {
+        this.leaf = leaf == null ? null : leaf.trim();
+    }
+
+    public String getOutLink() {
+        return outLink;
+    }
+
+    public void setOutLink(String outLink) {
+        this.outLink = outLink == null ? null : outLink.trim();
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark == null ? null : remark.trim();
+    }
+
+    public Long getSortno() {
+        return sortno;
+    }
+
+    public void setSortno(Long sortno) {
+        this.sortno = sortno;
+    }
+
+}

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

@@ -0,0 +1,16 @@
+package com.xt.js.gkaq.frame.service;
+
+import java.util.List;
+
+import com.xt.js.gkaq.common.BaseUUIDModelService;
+import com.xt.js.gkaq.frame.model.MenuModel;
+
+/**
+ * ²Ëµ¥·þÎñ½Ó¿Ú
+ */
+public interface MenuService extends BaseUUIDModelService<MenuModel> {
+
+	public List<MenuModel> selectInitMenu();
+
+	public int deleteByPid(String pid);
+}

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

@@ -0,0 +1,32 @@
+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 com.xt.js.gkaq.common.BaseMapper;
+import com.xt.js.gkaq.common.BaseUUIDModelServiceImpl;
+import com.xt.js.gkaq.frame.mappers.MenuModelMapper;
+import com.xt.js.gkaq.frame.model.MenuModel;
+import com.xt.js.gkaq.frame.service.MenuService;
+
+@Service
+public class MenuServiceImpl extends BaseUUIDModelServiceImpl<MenuModel> implements MenuService {
+    @Autowired
+    private MenuModelMapper mapper;
+
+    @Override
+    protected BaseMapper<MenuModel> getMapper() {
+        return mapper;
+    }
+
+    public List<MenuModel> selectInitMenu() {
+        return mapper.selectInitMenu();
+    }
+
+	public int deleteByPid(String pid) {
+		return mapper.deleteByPid(pid);
+	}
+
+}

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

@@ -0,0 +1,52 @@
+<?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.ButtonModelMapper" >
+  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.ButtonModel" >
+    <id column="ID" property="id" jdbcType="VARCHAR" />
+    <result column="NAME" property="name" jdbcType="VARCHAR" />
+    <result column="CODE" property="code" jdbcType="VARCHAR" />
+    <result column="MENU" property="menu" jdbcType="VARCHAR" />
+    <result column="ICON" property="icon" jdbcType="VARCHAR" />
+    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
+    <result column="SORTNO" property="sortno" jdbcType="DECIMAL" />
+    <result column="CREATE_TIME" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="UPDATE_TIME" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="STATE" property="state" jdbcType="CHAR" />
+  </resultMap>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_BUTTON
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.ButtonModel" >
+    insert into AQ_BASIC_FRAME_BUTTON (ID, NAME, CODE, 
+      MENU, ICON, REMARK, 
+      SORTNO, CREATE_TIME, UPDATE_TIME, 
+      STATE)
+    values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, 
+      #{menu,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, 
+      #{sortno,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, 
+      #{state,jdbcType=CHAR})
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.ButtonModel" >
+    update AQ_BASIC_FRAME_BUTTON
+    set NAME = #{name,jdbcType=VARCHAR},
+      CODE = #{code,jdbcType=VARCHAR},
+      MENU = #{menu,jdbcType=VARCHAR},
+      ICON = #{icon,jdbcType=VARCHAR},
+      REMARK = #{remark,jdbcType=VARCHAR},
+      SORTNO = #{sortno,jdbcType=DECIMAL},
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      STATE = #{state,jdbcType=CHAR}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, NAME, CODE, MENU, ICON, REMARK, SORTNO, CREATE_TIME, UPDATE_TIME, STATE
+    from AQ_BASIC_FRAME_BUTTON
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectAll" resultMap="BaseResultMap" >
+    select ID, NAME, CODE, MENU, ICON, REMARK, SORTNO, CREATE_TIME, UPDATE_TIME, STATE
+    from AQ_BASIC_FRAME_BUTTON
+  </select>
+</mapper>

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

@@ -0,0 +1,77 @@
+<?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.MenuModelMapper" >
+  <resultMap id="BaseResultMap" type="com.xt.js.gkaq.frame.model.MenuModel" >
+    <id column="ID" property="id" jdbcType="VARCHAR" />
+    <result column="PID" property="pid" jdbcType="VARCHAR" />
+    <result column="NAME" property="name" jdbcType="VARCHAR" />
+    <result column="CODE" property="code" jdbcType="VARCHAR" />
+    <result column="ICON" property="icon" jdbcType="VARCHAR" />
+    <result column="URL" property="url" jdbcType="VARCHAR" />
+    <result column="LEAF" property="leaf" jdbcType="CHAR" />
+    <result column="OUT_LINK" property="outLink" jdbcType="CHAR" />
+    <result column="REMARK" property="remark" jdbcType="VARCHAR" />
+    <result column="SORTNO" property="sortno" jdbcType="DECIMAL" />
+    <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="CREATE_USER" property="createUser" jdbcType="VARCHAR" />
+    <result column="UPDATE_USER" property="updateUser" jdbcType="VARCHAR" />
+  </resultMap>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_MENU
+    where ID = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.xt.js.gkaq.frame.model.MenuModel" >
+    insert into AQ_BASIC_FRAME_MENU (ID, PID, NAME, 
+      CODE, ICON, URL, LEAF, 
+      OUT_LINK, REMARK, SORTNO, 
+      CREATE_TIME, UPDATE_TIME, STATE, 
+      CREATE_USER, UPDATE_USER)
+    values (#{id,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, 
+      #{code,jdbcType=VARCHAR}, #{icon,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{leaf,jdbcType=CHAR}, 
+      #{outLink,jdbcType=CHAR}, #{remark,jdbcType=VARCHAR}, #{sortno,jdbcType=DECIMAL}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{state,jdbcType=CHAR}, 
+      #{createUser,jdbcType=VARCHAR}, #{updateUser,jdbcType=VARCHAR})
+  </insert>
+  <update id="updateByPrimaryKey" parameterType="com.xt.js.gkaq.frame.model.MenuModel" >
+    update AQ_BASIC_FRAME_MENU
+    set PID = #{pid,jdbcType=VARCHAR},
+      NAME = #{name,jdbcType=VARCHAR},
+      CODE = #{code,jdbcType=VARCHAR},
+      ICON = #{icon,jdbcType=VARCHAR},
+      URL = #{url,jdbcType=VARCHAR},
+      LEAF = #{leaf,jdbcType=CHAR},
+      OUT_LINK = #{outLink,jdbcType=CHAR},
+      REMARK = #{remark,jdbcType=VARCHAR},
+      SORTNO = #{sortno,jdbcType=DECIMAL},
+      CREATE_TIME = #{createTime,jdbcType=TIMESTAMP},
+      UPDATE_TIME = #{updateTime,jdbcType=TIMESTAMP},
+      STATE = #{state,jdbcType=CHAR},
+      CREATE_USER = #{createUser,jdbcType=VARCHAR},
+      UPDATE_USER = #{updateUser,jdbcType=VARCHAR}
+    where ID = #{id,jdbcType=VARCHAR}
+  </update>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select ID, PID, NAME, CODE, ICON, URL, LEAF, OUT_LINK, REMARK, SORTNO, CREATE_TIME, 
+    UPDATE_TIME, STATE, CREATE_USER, UPDATE_USER
+    from AQ_BASIC_FRAME_MENU
+    where ID = #{id,jdbcType=VARCHAR}
+  </select>
+  <select id="selectAll" resultMap="BaseResultMap" >
+    select ID, PID, NAME, CODE, ICON, URL, LEAF, OUT_LINK, REMARK, SORTNO, CREATE_TIME, 
+    UPDATE_TIME, STATE, CREATE_USER, UPDATE_USER
+    from AQ_BASIC_FRAME_MENU
+  </select>
+  <select id="selectInitMenu" resultMap="BaseResultMap" >
+    select ID, PID, NAME, CODE, LEAF, SORTNO
+    from AQ_BASIC_FRAME_MENU
+    union all
+    select ID, MENU PID, NAME, CODE, 'B' LEAF, SORTNO
+    from AQ_BASIC_FRAME_BUTTON order by SORTNO
+  </select>
+  <delete id="deleteByPid" parameterType="java.lang.String" >
+    delete from AQ_BASIC_FRAME_MENU
+    where PID = #{pid,jdbcType=VARCHAR}
+  </delete>
+</mapper>

+ 10 - 2
gkaqv2/trunk/modules/frame/src/main/resources/generatorConfig.xml

@@ -25,10 +25,10 @@
 		</javaClientGenerator>
 		<!-- <table tableName="AQ_BASIC_FRAME_USER" domainObjectName="UserModel"></table> -->
 		<!-- <table tableName="AQ_BASIC_FRAME_ROLE" domainObjectName="RoleModel"></table> -->
-		<table tableName="AQ_BASIC_FRAME_ORG" domainObjectName="OrgModel">
+		<!-- <table tableName="AQ_BASIC_FRAME_ORG" domainObjectName="OrgModel">
 			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
 			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
-		</table>
+		</table> -->
 		
 		<!-- 
 		<table tableName="AQ_BASIC_FRAME_GROUP" domainObjectName="GroupModel">
@@ -46,6 +46,14 @@
 			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
 			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/> 
 		</table>
+		<table tableName="AQ_BASIC_FRAME_MENU" domainObjectName="MenuModel">
+			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
+			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
+		</table>
 		  -->
+		<table tableName="AQ_BASIC_FRAME_BUTTON" domainObjectName="ButtonModel">
+			<columnOverride column="CREATE_TIME" jdbcType="TIMESTAMP"/>  
+			<columnOverride column="UPDATE_TIME" jdbcType="TIMESTAMP"/>  
+		</table>
 	</context>
 </generatorConfiguration>