周浩 9 vuotta sitten
vanhempi
commit
a7a3a3d04f
33 muutettua tiedostoa jossa 1791 lisäystä ja 85 poistoa
  1. 13 0
      hsweb-web-core/src/main/java/org/hsweb/web/message/Jsonp.java
  2. 34 29
      hsweb-web-core/src/main/java/org/hsweb/web/message/ResponseMessage.java
  3. 1 1
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/basic/BasicMapper.xml
  4. 2 2
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/config/ConfigMapper.xml
  5. 18 26
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/form/FormMapper.xml
  6. 4 4
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/module/ModuleMapper.xml
  7. 4 4
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/resource/ResourcesMapper.xml
  8. 4 4
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/RoleMapper.xml
  9. 4 4
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/RoleModuleMapper.xml
  10. 2 2
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/UserRoleMapper.xml
  11. 4 4
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/script/DynamicScriptMapper.xml
  12. 2 2
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/user/UserMapper.xml
  13. 95 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/basic/BasicMapper.xml
  14. 72 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/config/ConfigMapper.xml
  15. 91 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/form/FormMapper.xml
  16. 89 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/module/ModuleMapper.xml
  17. 85 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/resource/ResourcesMapper.xml
  18. 70 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/RoleMapper.xml
  19. 80 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/RoleModuleMapper.xml
  20. 74 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/UserRoleMapper.xml
  21. 81 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/script/DynamicScriptMapper.xml
  22. 90 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/user/UserMapper.xml
  23. 133 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/basic/BasicMapper.xml
  24. 73 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/config/ConfigMapper.xml
  25. 91 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/form/FormMapper.xml
  26. 89 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/module/ModuleMapper.xml
  27. 85 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/resource/ResourcesMapper.xml
  28. 70 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/RoleMapper.xml
  29. 80 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/RoleModuleMapper.xml
  30. 74 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/UserRoleMapper.xml
  31. 81 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/script/DynamicScriptMapper.xml
  32. 90 0
      hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/user/UserMapper.xml
  33. 6 3
      pom.xml

+ 13 - 0
hsweb-web-core/src/main/java/org/hsweb/web/message/Jsonp.java

@@ -0,0 +1,13 @@
+package org.hsweb.web.message;
+
+import java.lang.annotation.*;
+
+/**
+ * Created by zhouhao on 16-4-14.
+ */
+@Target({ElementType.TYPE, ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Jsonp {
+    String callback() default "param.callback";
+}

+ 34 - 29
hsweb-web-core/src/main/java/org/hsweb/web/message/ResponseMessage.java

@@ -15,6 +15,7 @@ import java.util.*;
  */
 public class ResponseMessage implements Serializable {
     private static final long serialVersionUID = 8992436576262574064L;
+    private transient static final Logger LOGGER = LoggerFactory.getLogger(ResponseMessage.class);
 
     /**
      * message处理类,可以自定义message处理方案
@@ -46,44 +47,29 @@ public class ResponseMessage implements Serializable {
      * 注册默认的消息处理
      */
     static {
-        registerMessageHandler(Object.class, new MessageHandler<Object>() {
-            @Override
-            public Object handle(ResponseMessage message, Object msg) {
-                return msg;
-            }
-        });
+        registerMessageHandler(Object.class, (message, msg) -> msg);
         //默认异常信息处理
-        registerMessageHandler(Throwable.class, new MessageHandler<Throwable>() {
-            @Override
-            public Object handle(ResponseMessage message, Throwable e) {
-                LOGGER.error(e.getMessage(), e);
-                return e.getMessage();
-            }
+        registerMessageHandler(Throwable.class, (message, msg) -> {
+            LOGGER.error("", msg);
+            return msg.getMessage();
         });
         //默认业务异常信息处理
-        registerMessageHandler(BusinessException.class, new MessageHandler<BusinessException>() {
-            @Override
-            public Object handle(ResponseMessage message, BusinessException e) {
-                LOGGER.error(e.getMessage());
-                return e.getMessage();
-            }
+        registerMessageHandler(BusinessException.class, (message, msg) -> {
+            LOGGER.error(msg.getMessage());
+            return msg.getMessage();
         });
         //权限验证异常
-        registerMessageHandler(AuthorizeException.class, new MessageHandler<AuthorizeException>() {
-            @Override
-            public Object handle(ResponseMessage message, AuthorizeException e) {
-                message.setCode("502");
-                return e.getMessage();
-            }
+        registerMessageHandler(AuthorizeException.class, (message, msg) -> {
+            message.setCode("502");
+            return msg.getMessage();
         });
+
     }
 
     private static final <T> MessageHandler<T> getMessageHandler(Class<T> type) {
         return handlers.get(type);
     }
 
-    private transient static final Logger LOGGER = LoggerFactory.getLogger(ResponseMessage.class);
-
     /**
      * 是否成功
      */
@@ -116,6 +102,8 @@ public class ResponseMessage implements Serializable {
 
     private transient boolean onlyData;
 
+    private transient String callback;
+
     public ResponseMessage(boolean success, Object data) {
         this.code = success ? "200" : "500";
         if (data == null)
@@ -146,19 +134,27 @@ public class ResponseMessage implements Serializable {
 
 
     public ResponseMessage include(Class<?> type, String... fileds) {
+        return include(type, Arrays.asList(fileds));
+    }
+
+    public ResponseMessage include(Class<?> type, Collection<String> fileds) {
         if (includes == null)
             includes = new HashMap<>();
-        getStringListFormMap(includes, type).addAll(Arrays.asList(fileds));
+        getStringListFormMap(includes, type).addAll(fileds);
         return this;
     }
 
-    public ResponseMessage exclude(Class type, String... fileds) {
+    public ResponseMessage exclude(Class type, Collection<String> fileds) {
         if (excludes == null)
             excludes = new HashMap<>();
-        getStringListFormMap(excludes, type).addAll(Arrays.asList(fileds));
+        getStringListFormMap(excludes, type).addAll(fileds);
         return this;
     }
 
+    public ResponseMessage exclude(Class type, String... fileds) {
+        return exclude(type, Arrays.asList(fileds));
+    }
+
     protected Set<String> getStringListFormMap(Map<Class<?>, Set<String>> map, Class type) {
         Set<String> list = map.get(type);
         if (list == null) {
@@ -229,4 +225,13 @@ public class ResponseMessage implements Serializable {
     public boolean isOnlyData() {
         return onlyData;
     }
+
+    public ResponseMessage callback(String callback) {
+        this.callback = callback;
+        return this;
+    }
+
+    public String getCallback() {
+        return callback;
+    }
 }

+ 1 - 1
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/basic/BasicMapper.xml

@@ -76,7 +76,7 @@
     </sql>
 
     <!--生成查询sql-->
-    <sql id="selectSql">
+    <sql id="buildSelectSql">
         SELECT
         <include refid="BasicMapper.selectField"/>
         FROM ${$tableName}

+ 2 - 2
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/config/ConfigMapper.xml

@@ -61,12 +61,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ConfigResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 18 - 26
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/form/FormMapper.xml

@@ -8,23 +8,21 @@
         <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
         <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
         <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="content" column="content" javaType="String" jdbcType="VARCHAR"/>
-        <result property="table_name" column="table_name" javaType="String" jdbcType="VARCHAR"/>
-        <result property="foreigns" column="foreigns" javaType="String" jdbcType="VARCHAR"/>
+        <result property="html" column="html" javaType="String" jdbcType="VARCHAR"/>
+        <result property="config" column="config" javaType="String" jdbcType="VARCHAR"/>
+        <result property="meta" column="meta" javaType="String" jdbcType="VARCHAR"/>
         <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
-        <result property="auto_alter" column="auto_alter" javaType="boolean" jdbcType="INTEGER"/>
         <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
         <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
-        <result property="db_name" column="db_name" javaType="String" jdbcType="VARCHAR"/>
     </resultMap>
 
     <!--字段信息绑定-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType"
-              value="#{'u_id':'string','name':'string','content':'string','table_name':'string'
-                        ,'foreigns':'string','remark':'string','auto_alter':'string','create_date':'string'
-                       ,'update_date':'string','db_name':'string'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','html':'string','meta':'string'
+                        ,'config':'string','remark':'string','create_date':'string'
+                       ,'update_date':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
     <!--表名-->
     <sql id="tableName">
@@ -33,9 +31,9 @@
 
     <insert id="insert" parameterType="Form" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
         INSERT INTO S_FORM
-        (u_id,name,content,table_name,foreigns,remark,auto_alter,create_date,update_date,db_name)
+        (u_id,name,html,meta,config,remark,create_date,update_date)
         VALUES
-        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{table_name,jdbcType=VARCHAR},#{foreigns,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{auto_alter,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP},#{db_name,jdbcType=VARCHAR})
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{html,jdbcType=VARCHAR},#{meta,jdbcType=VARCHAR},#{config,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
     </insert>
 
     <delete id="delete" parameterType="Form">
@@ -48,27 +46,21 @@
             <if test="name != null">
                 name=#{name,jdbcType=VARCHAR},
             </if>
-            <if test="content != null">
-                content=#{content,jdbcType=VARCHAR},
+            <if test="html != null">
+                html=#{html,jdbcType=VARCHAR},
             </if>
-            <if test="table_name != null">
-                table_name=#{table_name,jdbcType=VARCHAR},
+            <if test="meta != null">
+                meta=#{meta,jdbcType=VARCHAR},
             </if>
-            <if test="foreigns != null">
-                foreigns=#{foreigns,jdbcType=VARCHAR},
+            <if test="config != null">
+                config=#{config,jdbcType=VARCHAR},
             </if>
             <if test="remark != null">
                 remark=#{remark,jdbcType=VARCHAR},
             </if>
-            <if test="auto_alter != null">
-                auto_alter=#{auto_alter,jdbcType=INTEGER},
-            </if>
             <if test="update_date != null">
                 update_date=#{update_date,jdbcType=TIMESTAMP},
             </if>
-            <if test="db_name != null">
-                db_name=#{db_name,jdbcType=VARCHAR},
-            </if>
         </set>
         WHERE u_id=#{u_id}
     </update>
@@ -80,12 +72,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="FormResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 4 - 4
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/module/ModuleMapper.xml

@@ -19,9 +19,9 @@
 
     <!--字段信息绑定-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType"
+        <bind name="$fieldsInfo"
               value="#{'u_id':'string','name':'string','uri':'string','icon':'string','p_id':'string','sort_index':'number','m_option':'string','remark':'string','type':'string','status':'number'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
     <!--表名-->
     <sql id="tableName">
@@ -78,12 +78,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ModuleResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 4 - 4
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/resource/ResourcesMapper.xml

@@ -18,10 +18,10 @@
 
     <!--字段信息绑定-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType"
+        <bind name="$fieldsInfo"
               value="#{'u_id':'string','name':'string','path':'string','create_date':'date'
                     ,'creator_id':'string','md5':'string','type':'string','status':'number'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
     <!--表名-->
     <sql id="tableName">
@@ -74,12 +74,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ResourcesResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 4 - 4
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/RoleMapper.xml

@@ -15,9 +15,9 @@
 
     <!--字段信息绑定-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType"
+        <bind name="$fieldsInfo"
               value="#{'u_id':'string','name':'string','remark':'string','type':'string'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
 
     <!--表名-->
@@ -59,12 +59,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 4 - 4
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/RoleModuleMapper.xml

@@ -15,8 +15,8 @@
 
     <!--字段信息绑定-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType" value="#{'u_id':'string','module_id':'string','role_id':'string','o_level':'string'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fieldsInfo" value="#{'u_id':'string','module_id':'string','role_id':'string','o_level':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
     <!--表名-->
     <sql id="tableName">
@@ -69,12 +69,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleModuleResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 2 - 2
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/role/UserRoleMapper.xml

@@ -63,12 +63,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserRoleResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 4 - 4
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/script/DynamicScriptMapper.xml

@@ -17,9 +17,9 @@
 
     <!--字段配置-->
     <sql id="fieldConfig">
-        <bind name="$fieldsType"
+        <bind name="$fieldsInfo"
               value="#{'u_id':'string','name':'string','type':'string','content':'string','remark':'string','path':'string','status':'number'}"/>
-        <bind name="$fields" value="$fieldsType.keySet()"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
     </sql>
 
     <!--表名-->
@@ -70,12 +70,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="DynamicScriptResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 2 - 2
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/dao/impl/mybatis/mapper/mysql/user/UserMapper.xml

@@ -79,12 +79,12 @@
     <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserResultMap">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.selectSql"/>
+        <include refid="BasicMapper.buildSelectSql"/>
     </select>
 
     <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
         <include refid="fieldConfig"/>
         <include refid="tableName"/>
-        <include refid="BasicMapper.totalSql"/>
+        <include refid="BasicMapper.buildTotalSql"/>
     </select>
 </mapper>

+ 95 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/basic/BasicMapper.xml

@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="BasicMapper">
+    <!--通用查询条件-->
+    <sql id="selectCondition">
+            <!--动态生成查询条件-->
+            <foreach item="item" index="index" collection="$fields">
+                <if test="#this['term.'+item]!=null">
+                    AND ${$tableName}.${item}=#{term.${item}}
+                </if>
+                <if test="#this['term.'+item+'$NOT']!=null">
+                    AND ${$tableName}.${item}!=#{term.${item+'$NOT'}}
+                </if>
+                <if test="#this['term.'+item+'$LIKE']!=null">
+                    AND INSTR(${$tableName}.${item},#{term.${item+'$LIKE'}})>0
+                </if>
+                <if test="#this['term.'+item+'$NOTLIKE']!=null">
+                    AND INSTR(${$tableName}.${item},#{term.${item+'$NOTLIKE'}})&lt;=0
+                </if>
+                <if test="#this['term.'+item+'$START']!=null">
+                    AND ${$tableName}.${item} LIKE CONCAT(#{term.${item+'$START'}},'%')
+                </if>
+                <if test="#this['term.'+item+'$END']!=null">
+                    AND ${$tableName}.${item} LIKE CONCAT('%',#{term.${item+'$END'})
+                </if>
+                <if test="#this['term.'+item+'$IN']!=null">
+                    AND ${$tableName}.${item} IN
+                    <foreach item="it" index="i" collection="#this['term.'+item+'$IN']" open="(" separator="," close=")">
+                        #{it}
+                    </foreach>
+                </if>
+                <if test="#this['term.'+item+'$NOTIN']!=null">
+                    AND ${$tableName}.${item} NOT IN
+                    <foreach item="it" index="i" collection="#this['term.'+item+'$NOTIN']" open="(" separator="," close=")">
+                        #{it}
+                    </foreach>
+                </if>
+                <if test="#this['term.'+item+'$ISNULL']!=null">
+                    AND ${$tableName}.${item} IS NULL
+                </if>
+                <if test="#this['term.'+item+'$NOTNULL']!=null">
+                    AND ${$tableName}.${item} IS NOT NULL
+                </if>
+                <if test="#this['term.'+item+'$GT']!=null">
+                    AND ${$tableName}.${item} &gt;=#{term.${item+'$GT'}}
+                </if>
+                <if test="#this['term.'+item+'$LT']!=null">
+                    AND ${$tableName}.${item} &lt;=#{term.${item+'$LT'}}
+                </if>
+            </foreach>
+        <!--动态生成查询条件结束-->
+    </sql>
+    <!--生成查询字段-->
+    <sql id="selectField">
+            <choose>
+                <!--指定查询的字段 -->
+                <when test="#this['includes']!=null and #this['includes'].size()>0">
+                    <foreach item="item" index="index" collection="#this['includes']" open="" separator="," close="">
+                        <if test="item in $fields">
+                            ${$tableName}.${item} as `${item}`
+                        </if>
+                    </foreach>
+                </when>
+                <!--指定不查询的字段-->
+                <when test="(#this['includes']==null or #this['includes'].size()==0) and #this['excludes']!=null and #this['excludes'].size()>0">
+                    <foreach item="item" index="index" collection="$fields" open=" " separator="," close="">
+                        <if test="!(item in #this['excludes'])">
+                            ${$tableName}.${item} as `${item}`
+                        </if>
+                    </foreach>
+                </when>
+                <otherwise>*</otherwise>
+            </choose>
+    </sql>
+
+    <!--生成查询sql-->
+    <sql id="selectSql">
+        SELECT
+        <include refid="BasicMapper.selectField"/>
+        FROM ${$tableName}
+        <where>
+            <include refid="BasicMapper.selectCondition"/>
+        </where>
+    </sql>
+
+    <!--生成查询数量sql-->
+    <sql id="totalSql">
+        SELECT count(0) AS total FROM ${$tableName}
+        <where>
+            <include refid="BasicMapper.selectCondition"/>
+        </where>
+    </sql>
+</mapper>

+ 72 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/config/ConfigMapper.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.config.ConfigMapper">
+    <resultMap id="ConfigResultMap" type="Config" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR" />
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR" />
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+    </resultMap>
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','remark':'string','content':'string'
+                    ,'create_date':'date','update_date':'date'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_CONFIG'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Config" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_CONFIG
+        (u_id,remark,content,create_date,update_date)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
+    </insert>
+
+    <delete id="delete" parameterType="Config" >
+        DELETE FROM S_CONFIG WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Config" >
+        UPDATE S_CONFIG
+        <set>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="create_date != null">
+                create_date=#{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ConfigResultMap">
+        SELECT * FROM S_CONFIG WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ConfigResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 91 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/form/FormMapper.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.form.FormMapper">
+    <resultMap id="FormResultMap" type="Form">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR"/>
+        <result property="table_name" column="table_name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="foreigns" column="foreigns" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="auto_alter" column="auto_alter" javaType="boolean" jdbcType="INTEGER"/>
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="db_name" column="db_name" javaType="String" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','content':'string','table_name':'string'
+                        ,'foreigns':'string','remark':'string','auto_alter':'string','create_date':'string'
+                       ,'update_date':'string','db_name':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_FORM'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Form" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_FORM
+        (u_id,name,content,table_name,foreigns,remark,auto_alter,create_date,update_date,db_name)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{table_name,jdbcType=VARCHAR},#{foreigns,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{auto_alter,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP},#{db_name,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="Form">
+        DELETE FROM S_FORM WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Form">
+        UPDATE S_FORM
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="table_name != null">
+                table_name=#{table_name,jdbcType=VARCHAR},
+            </if>
+            <if test="foreigns != null">
+                foreigns=#{foreigns,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="auto_alter != null">
+                auto_alter=#{auto_alter,jdbcType=INTEGER},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="db_name != null">
+                db_name=#{db_name,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="FormResultMap">
+        SELECT * FROM S_FORM WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="FormResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 89 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/module/ModuleMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.module.ModuleMapper">
+    <resultMap id="ModuleResultMap" type="Module">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="uri" column="uri" javaType="String" jdbcType="VARCHAR"/>
+        <result property="icon" column="icon" javaType="String" jdbcType="VARCHAR"/>
+        <result property="p_id" column="p_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER"/>
+        <result property="m_option" column="m_option" javaType="String" jdbcType="VARCHAR"/>
+        <result property="sort_index" column="sort_index" javaType="int" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','uri':'string','icon':'string','p_id':'string','sort_index':'number','m_option':'string','remark':'string','type':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_MODULES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Module" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_MODULES
+        (u_id,name,uri,icon,p_id,remark,status,m_option,sort_index)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{uri,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{p_id,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{m_option,jdbcType=VARCHAR},#{sort_index,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="Module">
+        DELETE FROM S_MODULES WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Module">
+        UPDATE S_MODULES
+        <set>
+            <if test="u_id != null">
+                u_id=#{u_id,jdbcType=VARCHAR},
+            </if>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="uri != null">
+                uri=#{uri,jdbcType=VARCHAR},
+            </if>
+            <if test="icon != null">
+                icon=#{icon,jdbcType=VARCHAR},
+            </if>
+            <if test="p_id != null">
+                p_id=#{p_id,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+            <if test="m_option != null">
+                m_option=#{m_option,jdbcType=VARCHAR},
+            </if>
+            sort_index=#{sort_index,jdbcType=INTEGER}
+        </set>
+        WHERE u_id=#{old_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ModuleResultMap">
+        SELECT * FROM S_MODULES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ModuleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 85 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/resource/ResourcesMapper.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.resource.ResourcesMapper">
+    <resultMap id="ResourcesResultMap" type="Resources" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR" />
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR" />
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+        <result property="creator_id" column="creator_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="md5" column="md5" javaType="String" jdbcType="VARCHAR" />
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR" />
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','path':'string','create_date':'date'
+                    ,'creator_id':'string','md5':'string','type':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_RESOURCES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Resources" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_RESOURCES
+        (u_id,name,path,create_date,creator_id,md5,type,status)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{path,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{creator_id,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{status,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="Resources" >
+        DELETE FROM S_RESOURCES WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Resources" >
+        UPDATE S_RESOURCES
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="path != null">
+                path=#{path,jdbcType=VARCHAR},
+            </if>
+            <if test="create_date != null">
+                create_date=#{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creator_id != null">
+                creator_id=#{creator_id,jdbcType=VARCHAR},
+            </if>
+            <if test="md5 != null">
+                md5=#{md5,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ResourcesResultMap">
+        SELECT * FROM S_RESOURCES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ResourcesResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 70 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/RoleMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hsweb.web.dao.role.RoleMapper">
+    <resultMap id="RoleResultMap" type="Role">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR"/>
+        <collection property="modules" column="u_id" ofType="RoleModule"
+                    select="org.hsweb.web.dao.role.RoleModuleMapper.selectByRoleId"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','remark':'string','type':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_ROLE'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Role" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_ROLE
+        (u_id,name,remark,type)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="Role">
+        DELETE FROM S_ROLE WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Role">
+        UPDATE S_ROLE
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="RoleResultMap">
+        SELECT * FROM S_ROLE WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 80 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/RoleModuleMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.role.RoleModuleMapper">
+    <resultMap id="RoleModuleResultMap" type="RoleModule" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="module_id" column="module_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="role_id" column="role_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="o_level" column="o_level" javaType="String" jdbcType="VARCHAR" />
+        <collection property="module" column="module_id" ofType="Module" select="org.hsweb.web.dao.module.ModuleMapper.selectByPk"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo" value="#{'u_id':'string','module_id':'string','role_id':'string','o_level':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_ROLE_MODULES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="RoleModule" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_ROLE_MODULES
+        (u_id,module_id,role_id,o_level)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{module_id,jdbcType=VARCHAR},#{role_id,jdbcType=VARCHAR},#{o_level,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="RoleModule" >
+        DELETE FROM S_ROLE_MODULES WHERE u_id=#{u_id}
+    </delete>
+
+    <delete id="deleteByRoleId" parameterType="string" >
+        DELETE FROM S_ROLE_MODULES WHERE role_id=#{role_id}
+    </delete>
+
+    <delete id="deleteByModuleId" parameterType="string" >
+        DELETE FROM S_ROLE_MODULES WHERE module_id=#{module_id}
+    </delete>
+
+    <update id="update" parameterType="RoleModule" >
+        UPDATE S_ROLE_MODULES
+        <set>
+            <if test="module_id != null">
+                module_id=#{module_id,jdbcType=VARCHAR},
+            </if>
+            <if test="role_id != null">
+                role_id=#{role_id,jdbcType=VARCHAR},
+            </if>
+            <if test="o_level != null">
+                o_level=#{o_level,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByRoleId" parameterType="string" resultMap="RoleModuleResultMap">
+        SELECT * FROM S_ROLE_MODULES WHERE role_id=#{role_id}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="RoleModuleResultMap">
+        SELECT * FROM S_ROLE_MODULES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleModuleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 74 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/role/UserRoleMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.role.UserRoleMapper">
+    <resultMap id="UserRoleResultMap" type="UserRole">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="user_id" column="user_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="role_id" column="role_id" javaType="String" jdbcType="VARCHAR"/>
+        <collection property="role" column="role_id" jdbcType="VARCHAR" ofType="Role"
+                    select="org.hsweb.web.dao.role.RoleMapper.selectByPk"></collection>
+    </resultMap>
+
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo" value="#{'u_id':'string','user_id':'string','role_id':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_USER_ROLE'"/>
+    </sql>
+
+    <insert id="insert" parameterType="UserRole" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_USER_ROLE
+        (u_id,user_id,role_id)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{user_id,jdbcType=VARCHAR},#{role_id,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="UserRole">
+        DELETE FROM S_USER_ROLE WHERE u_id=#{u_id}
+    </delete>
+
+    <delete id="deleteByUserId" parameterType="string">
+        DELETE FROM S_USER_ROLE WHERE user_id=#{user_id}
+    </delete>
+
+    <update id="update" parameterType="UserRole">
+        UPDATE S_USER_ROLE
+        <set>
+            <if test="user_id != null">
+                user_id=#{user_id,jdbcType=VARCHAR},
+            </if>
+            <if test="role_id != null">
+                role_id=#{role_id,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByUserId" parameterType="string" resultMap="UserRoleResultMap">
+        SELECT * FROM S_USER_ROLE WHERE user_id=#{user_id}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="UserRoleResultMap">
+        SELECT * FROM S_USER_ROLE WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserRoleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 81 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/script/DynamicScriptMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.script.DynamicScriptMapper">
+    <resultMap id="DynamicScriptResultMap" type="DynamicScript" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR" />
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR" />
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR" />
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR" />
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR" />
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--字段配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','type':'string','content':'string','remark':'string','path':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_SCRIPT'"/>
+    </sql>
+
+    <insert id="insert" parameterType="DynamicScript" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_SCRIPT
+        (u_id,name,type,content,remark,path,status)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{path,jdbcType=VARCHAR},#{status,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="DynamicScript" >
+        DELETE FROM S_SCRIPT WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="DynamicScript" >
+        UPDATE S_SCRIPT
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="path != null">
+                path=#{path,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="DynamicScriptResultMap">
+        SELECT * FROM S_SCRIPT WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="DynamicScriptResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 90 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/mysql/user/UserMapper.xml

@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.user.UserMapper">
+    <resultMap id="UserResultMap" type="User">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="username" column="username" javaType="String" jdbcType="VARCHAR"/>
+        <result property="password" column="password" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="email" column="email" javaType="String" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER"/>
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <collection property="userRoles" column="u_id" ofType="UserRole"
+                    select="org.hsweb.web.dao.role.UserRoleMapper.selectByUserId"/>
+    </resultMap>
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','username':'string','name':'string'
+                    ,'email':'string','phone':'string','status':'number'
+                    ,'create_date':'date','update_date':'date'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_USER'"/>
+    </sql>
+
+    <insert id="insert" parameterType="User" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_USER
+        (u_id,username,password,name,email,phone,status,create_date,update_date)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{username,jdbcType=VARCHAR},#{password,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{email,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
+    </insert>
+
+    <delete id="delete" parameterType="User">
+        DELETE FROM S_USER WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="updatePassword" parameterType="User">
+        UPDATE S_USER set password=#{password,jdbcType=VARCHAR} where u_id = #{u_id}
+    </update>
+
+    <update id="update" parameterType="User">
+        UPDATE S_USER
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="email != null">
+                email=#{email,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null">
+                phone=#{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByUserName" parameterType="string" resultMap="UserResultMap">
+        SELECT * FROM S_USER WHERE username=#{username}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="UserResultMap">
+        SELECT * FROM S_USER WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 133 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/basic/BasicMapper.xml

@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="BasicMapper">
+    <!--通用查询条件-->
+    <sql id="selectCondition">
+            <!--动态生成查询条件-->
+            <foreach item="item" index="index" collection="$fields">
+                <if test="#this['term.'+item]!=null">
+                    <choose>
+                        <when test="$fieldsInfo[item] == 'date' ">
+                            AND ${$tableName}.${item}=to_date(#{term.${item}},'YYYY-MM-DD HH24:MI:SS')
+                        </when>
+                        <otherwise>AND ${$tableName}.${item}=#{term.${item}}</otherwise>
+                    </choose>
+                </if>
+                <if test="#this['term.'+item+'$NOT']!=null">
+                    <choose>
+                        <when test="$fieldsInfo[item] == 'date' ">
+                            AND ${$tableName}.${item}!=to_date(#{term.${item+'$NOT'}},'YYYY-MM-DD HH24:MI:SS')
+                        </when>
+                        <otherwise>AND ${$tableName}.${item}!=#{term.${item+'$NOT'}}</otherwise>
+                    </choose>
+                </if>
+                <if test="#this['term.'+item+'$LIKE']!=null">
+                    AND INSTR(${$tableName}.${item},#{term.${item+'$LIKE'}})>0
+                </if>
+                <if test="#this['term.'+item+'$NOTLIKE']!=null">
+                    AND INSTR(${$tableName}.${item},#{term.${item+'$NOTLIKE'}})&lt;=0
+                </if>
+                <if test="#this['term.'+item+'$START']!=null">
+                    AND ${$tableName}.${item} LIKE #{term.${item+'$START'}}||'%'
+                </if>
+                <if test="#this['term.'+item+'$END']!=null">
+                    AND ${$tableName}.${item} LIKE '%'||#{term.${item+'$END'}}
+                </if>
+                <if test="#this['term.'+item+'$IN']!=null">
+                    AND ${$tableName}.${item} IN
+                    <foreach item="it" index="i" collection="#this['term.'+item+'$IN']" open="(" separator="," close=")">
+                        #{it}
+                    </foreach>
+                </if>
+                <if test="#this['term.'+item+'$NOTIN']!=null">
+                    AND ${$tableName}.${item} NOT IN
+                    <foreach item="it" index="i" collection="#this['term.'+item+'$NOTIN']" open="(" separator="," close=")">
+                        #{it}
+                    </foreach>
+                </if>
+                <if test="#this['term.'+item+'$ISNULL']!=null">
+                    AND ${$tableName}.${item} IS NULL
+                </if>
+                <if test="#this['term.'+item+'$NOTNULL']!=null">
+                    AND ${$tableName}.${item} IS NOT NULL
+                </if>
+                <if test="#this['term.'+item+'$GT']!=null">
+                    <choose>
+                        <when test="$fieldsInfo[item] == 'date' ">
+                            AND ${$tableName}.${item} &gt;=to_date(#{term.${item+'$GT'}},'YYYY-MM-DD HH24:MI:SS')
+                        </when>
+                        <when test="$fieldsInfo[item] == 'number' ">
+                            AND ${$tableName}.${item} &gt;=#{term.${item+'$GT'}}
+                        </when>
+                        <otherwise></otherwise>
+                    </choose>
+                </if>
+                <if test="#this['term.'+item+'$LT']!=null">
+                    <choose>
+                        <when test="$fieldsInfo[item] == 'date' ">
+                            AND ${$tableName}.${item} &lt;=to_date(#{term.${item+'$LT'}},'YYYY-MM-DD HH24:MI:SS')
+                        </when>
+                        <when test="$fieldsInfo[item] == 'number' ">
+                            AND ${$tableName}.${item} &lt;=#{term.${item+'$LT'}}
+                        </when>
+                        <otherwise></otherwise>
+                    </choose>
+                </if>
+            </foreach>
+        <!--动态生成查询条件结束-->
+    </sql>
+    <!--生成查询字段-->
+    <sql id="selectField">
+            <choose>
+                <!--指定查询的字段-->
+                <when test="includes!=null and includes.size()>0">
+                    <foreach item="item" index="index" collection="$includes" open="" separator="," close="">
+                        <if test="item in $fields">
+                            ${$tableName}.${item} as "${item}"
+                        </if>
+                    </foreach>
+                </when>
+                <!--指定不查询的字段-->
+                <when test="(includes==null or includes.size()==0) and excludes!=null and excludes.size()>0">
+                    <foreach item="item" index="index" collection="$fields" open=" " separator="," close="">
+                        <if test="!(item in excludes)">
+                            ${$tableName}.${item} as "${item}"
+                        </if>
+                    </foreach>
+                </when>
+                <otherwise>*</otherwise>
+            </choose>
+    </sql>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="map">
+        <include refid="selectSql"></include>
+    </select>
+
+    <select id="selectSql" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="map">
+        ${$sql}
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="totalSql"></include>
+    </select>
+
+    <!--生成查询sql-->
+    <sql id="selectSql">
+        SELECT
+        <include refid="BasicMapper.selectField"/>
+        FROM ${$tableName}
+        <where>
+            <include refid="BasicMapper.selectCondition"/>
+        </where>
+    </sql>
+
+    <!--生成查询数量sql-->
+    <sql id="totalSql">
+        SELECT count(0) AS total FROM ${$tableName}
+        <where>
+            <include refid="BasicMapper.selectCondition"/>
+        </where>
+    </sql>
+</mapper>

+ 73 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/config/ConfigMapper.xml

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.config.ConfigMapper">
+    <resultMap id="ConfigResultMap" type="Config" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR" />
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR" />
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+    </resultMap>
+
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','remark':'string','content':'string'
+                    ,'create_date':'date','update_date':'date'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_CONFIG'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Config" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_CONFIG
+        (u_id,remark,content,create_date,update_date)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
+    </insert>
+
+    <delete id="delete" parameterType="Config" >
+        DELETE FROM S_CONFIG WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Config" >
+        UPDATE S_CONFIG
+        <set>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="create_date != null">
+                create_date=#{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ConfigResultMap">
+        SELECT * FROM S_CONFIG WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ConfigResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 91 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/form/FormMapper.xml

@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.form.FormMapper">
+    <resultMap id="FormResultMap" type="Form">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR"/>
+        <result property="table_name" column="table_name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="foreigns" column="foreigns" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="auto_alter" column="auto_alter" javaType="boolean" jdbcType="INTEGER"/>
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="db_name" column="db_name" javaType="String" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','content':'string','table_name':'string'
+                        ,'foreigns':'string','remark':'string','auto_alter':'string','create_date':'string'
+                       ,'update_date':'string','db_name':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_FORM'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Form" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_FORM
+        (u_id,name,content,table_name,foreigns,remark,auto_alter,create_date,update_date,db_name)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{table_name,jdbcType=VARCHAR},#{foreigns,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{auto_alter,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP},#{db_name,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="Form">
+        DELETE FROM S_FORM WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Form">
+        UPDATE S_FORM
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="table_name != null">
+                table_name=#{table_name,jdbcType=VARCHAR},
+            </if>
+            <if test="foreigns != null">
+                foreigns=#{foreigns,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="auto_alter != null">
+                auto_alter=#{auto_alter,jdbcType=INTEGER},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="db_name != null">
+                db_name=#{db_name,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="FormResultMap">
+        SELECT * FROM S_FORM WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="FormResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 89 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/module/ModuleMapper.xml

@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.module.ModuleMapper">
+    <resultMap id="ModuleResultMap" type="Module">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="uri" column="uri" javaType="String" jdbcType="VARCHAR"/>
+        <result property="icon" column="icon" javaType="String" jdbcType="VARCHAR"/>
+        <result property="p_id" column="p_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER"/>
+        <result property="m_option" column="m_option" javaType="String" jdbcType="VARCHAR"/>
+        <result property="sort_index" column="sort_index" javaType="int" jdbcType="INTEGER"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','uri':'string','icon':'string','p_id':'string','sort_index':'number','m_option':'string','remark':'string','type':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_MODULES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Module" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_MODULES
+        (u_id,name,uri,icon,p_id,remark,status,m_option,sort_index)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{uri,jdbcType=VARCHAR},#{icon,jdbcType=VARCHAR},#{p_id,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{m_option,jdbcType=VARCHAR},#{sort_index,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="Module">
+        DELETE FROM S_MODULES WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Module">
+        UPDATE S_MODULES
+        <set>
+            <if test="u_id != null">
+                u_id=#{u_id,jdbcType=VARCHAR},
+            </if>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="uri != null">
+                uri=#{uri,jdbcType=VARCHAR},
+            </if>
+            <if test="icon != null">
+                icon=#{icon,jdbcType=VARCHAR},
+            </if>
+            <if test="p_id != null">
+                p_id=#{p_id,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+            <if test="m_option != null">
+                m_option=#{m_option,jdbcType=VARCHAR},
+            </if>
+            sort_index=#{sort_index,jdbcType=INTEGER}
+        </set>
+        WHERE u_id=#{old_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ModuleResultMap">
+        SELECT * FROM S_MODULES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ModuleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 85 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/resource/ResourcesMapper.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.resource.ResourcesMapper">
+    <resultMap id="ResourcesResultMap" type="Resources" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR" />
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR" />
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP" />
+        <result property="creator_id" column="creator_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="md5" column="md5" javaType="String" jdbcType="VARCHAR" />
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR" />
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','path':'string','create_date':'date'
+                    ,'creator_id':'string','md5':'string','type':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_RESOURCES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Resources" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_RESOURCES
+        (u_id,name,path,create_date,creator_id,md5,type,status)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{path,jdbcType=VARCHAR},#{create_date,jdbcType=TIMESTAMP},#{creator_id,jdbcType=VARCHAR},#{md5,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{status,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="Resources" >
+        DELETE FROM S_RESOURCES WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Resources" >
+        UPDATE S_RESOURCES
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="path != null">
+                path=#{path,jdbcType=VARCHAR},
+            </if>
+            <if test="create_date != null">
+                create_date=#{create_date,jdbcType=TIMESTAMP},
+            </if>
+            <if test="creator_id != null">
+                creator_id=#{creator_id,jdbcType=VARCHAR},
+            </if>
+            <if test="md5 != null">
+                md5=#{md5,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="ResourcesResultMap">
+        SELECT * FROM S_RESOURCES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="ResourcesResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 70 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/RoleMapper.xml

@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.hsweb.web.dao.role.RoleMapper">
+    <resultMap id="RoleResultMap" type="Role">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR"/>
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR"/>
+        <collection property="modules" column="u_id" ofType="RoleModule"
+                    select="org.hsweb.web.dao.role.RoleModuleMapper.selectByRoleId"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','remark':'string','type':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_ROLE'"/>
+    </sql>
+
+    <insert id="insert" parameterType="Role" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_ROLE
+        (u_id,name,remark,type)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="Role">
+        DELETE FROM S_ROLE WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="Role">
+        UPDATE S_ROLE
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="RoleResultMap">
+        SELECT * FROM S_ROLE WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 80 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/RoleModuleMapper.xml

@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.role.RoleModuleMapper">
+    <resultMap id="RoleModuleResultMap" type="RoleModule" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="module_id" column="module_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="role_id" column="role_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="o_level" column="o_level" javaType="String" jdbcType="VARCHAR" />
+        <collection property="module" column="module_id" ofType="Module" select="org.hsweb.web.dao.module.ModuleMapper.selectByPk"/>
+    </resultMap>
+
+    <!--字段信息绑定-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo" value="#{'u_id':'string','module_id':'string','role_id':'string','o_level':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_ROLE_MODULES'"/>
+    </sql>
+
+    <insert id="insert" parameterType="RoleModule" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_ROLE_MODULES
+        (u_id,module_id,role_id,o_level)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{module_id,jdbcType=VARCHAR},#{role_id,jdbcType=VARCHAR},#{o_level,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="RoleModule" >
+        DELETE FROM S_ROLE_MODULES WHERE u_id=#{u_id}
+    </delete>
+
+    <delete id="deleteByRoleId" parameterType="string" >
+        DELETE FROM S_ROLE_MODULES WHERE role_id=#{role_id}
+    </delete>
+
+    <delete id="deleteByModuleId" parameterType="string" >
+        DELETE FROM S_ROLE_MODULES WHERE module_id=#{module_id}
+    </delete>
+
+    <update id="update" parameterType="RoleModule" >
+        UPDATE S_ROLE_MODULES
+        <set>
+            <if test="module_id != null">
+                module_id=#{module_id,jdbcType=VARCHAR},
+            </if>
+            <if test="role_id != null">
+                role_id=#{role_id,jdbcType=VARCHAR},
+            </if>
+            <if test="o_level != null">
+                o_level=#{o_level,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByRoleId" parameterType="string" resultMap="RoleModuleResultMap">
+        SELECT * FROM S_ROLE_MODULES WHERE role_id=#{role_id}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="RoleModuleResultMap">
+        SELECT * FROM S_ROLE_MODULES WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="RoleModuleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 74 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/role/UserRoleMapper.xml

@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.role.UserRoleMapper">
+    <resultMap id="UserRoleResultMap" type="UserRole">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="user_id" column="user_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="role_id" column="role_id" javaType="String" jdbcType="VARCHAR"/>
+        <collection property="role" column="role_id" jdbcType="VARCHAR" ofType="Role"
+                    select="org.hsweb.web.dao.role.RoleMapper.selectByPk"></collection>
+    </resultMap>
+
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo" value="#{'u_id':'string','user_id':'string','role_id':'string'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_USER_ROLE'"/>
+    </sql>
+
+    <insert id="insert" parameterType="UserRole" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_USER_ROLE
+        (u_id,user_id,role_id)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{user_id,jdbcType=VARCHAR},#{role_id,jdbcType=VARCHAR})
+    </insert>
+
+    <delete id="delete" parameterType="UserRole">
+        DELETE FROM S_USER_ROLE WHERE u_id=#{u_id}
+    </delete>
+
+    <delete id="deleteByUserId" parameterType="string">
+        DELETE FROM S_USER_ROLE WHERE user_id=#{user_id}
+    </delete>
+
+    <update id="update" parameterType="UserRole">
+        UPDATE S_USER_ROLE
+        <set>
+            <if test="user_id != null">
+                user_id=#{user_id,jdbcType=VARCHAR},
+            </if>
+            <if test="role_id != null">
+                role_id=#{role_id,jdbcType=VARCHAR},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByUserId" parameterType="string" resultMap="UserRoleResultMap">
+        SELECT * FROM S_USER_ROLE WHERE user_id=#{user_id}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="UserRoleResultMap">
+        SELECT * FROM S_USER_ROLE WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserRoleResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 81 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/script/DynamicScriptMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.script.DynamicScriptMapper">
+    <resultMap id="DynamicScriptResultMap" type="DynamicScript" >
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR" />
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR" />
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR" />
+        <result property="type" column="type" javaType="String" jdbcType="VARCHAR" />
+        <result property="content" column="content" javaType="String" jdbcType="VARCHAR" />
+        <result property="remark" column="remark" javaType="String" jdbcType="VARCHAR" />
+        <result property="path" column="path" javaType="String" jdbcType="VARCHAR" />
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER" />
+    </resultMap>
+
+    <!--字段配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','name':'string','type':'string','content':'string','remark':'string','path':'string','status':'number'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_SCRIPT'"/>
+    </sql>
+
+    <insert id="insert" parameterType="DynamicScript" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_SCRIPT
+        (u_id,name,type,content,remark,path,status)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{path,jdbcType=VARCHAR},#{status,jdbcType=INTEGER})
+    </insert>
+
+    <delete id="delete" parameterType="DynamicScript" >
+        DELETE FROM S_SCRIPT WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="update" parameterType="DynamicScript" >
+        UPDATE S_SCRIPT
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                type=#{type,jdbcType=VARCHAR},
+            </if>
+            <if test="content != null">
+                content=#{content,jdbcType=VARCHAR},
+            </if>
+            <if test="remark != null">
+                remark=#{remark,jdbcType=VARCHAR},
+            </if>
+            <if test="path != null">
+                path=#{path,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByPk" parameterType="string" resultMap="DynamicScriptResultMap">
+        SELECT * FROM S_SCRIPT WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="DynamicScriptResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 90 - 0
hsweb-web-dao-impl-mybatis/src/main/resources/org/hsweb/web/mybatis/plgins/mapper/oracle/user/UserMapper.xml

@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://www.mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="org.hsweb.web.dao.user.UserMapper">
+    <resultMap id="UserResultMap" type="User">
+        <id property="u_id" column="u_id" javaType="string" jdbcType="VARCHAR"/>
+        <result property="u_id" column="u_id" javaType="String" jdbcType="VARCHAR"/>
+        <result property="username" column="username" javaType="String" jdbcType="VARCHAR"/>
+        <result property="password" column="password" javaType="String" jdbcType="VARCHAR"/>
+        <result property="name" column="name" javaType="String" jdbcType="VARCHAR"/>
+        <result property="email" column="email" javaType="String" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" javaType="String" jdbcType="VARCHAR"/>
+        <result property="status" column="status" javaType="int" jdbcType="INTEGER"/>
+        <result property="create_date" column="create_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <result property="update_date" column="update_date" javaType="java.util.Date" jdbcType="TIMESTAMP"/>
+        <collection property="userRoles" column="u_id" ofType="UserRole"
+                    select="org.hsweb.web.dao.role.UserRoleMapper.selectByUserId"/>
+    </resultMap>
+    <!--字段信息配置-->
+    <sql id="fieldConfig">
+        <bind name="$fieldsInfo"
+              value="#{'u_id':'string','username':'string','name':'string'
+                    ,'email':'string','phone':'string','status':'number'
+                    ,'create_date':'date','update_date':'date'}"/>
+        <bind name="$fields" value="$fieldsInfo.keySet()"/>
+    </sql>
+    <!--表名-->
+    <sql id="tableName">
+        <bind name="$tableName" value="'S_USER'"/>
+    </sql>
+
+    <insert id="insert" parameterType="User" useGeneratedKeys="true" keyProperty="u_id" keyColumn="U_ID">
+        INSERT INTO S_USER
+        (u_id,username,password,name,email,phone,status,create_date,update_date)
+        VALUES
+        (#{u_id,jdbcType=VARCHAR},#{username,jdbcType=VARCHAR},#{password,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{email,jdbcType=VARCHAR},#{phone,jdbcType=VARCHAR},#{status,jdbcType=INTEGER},#{create_date,jdbcType=TIMESTAMP},#{update_date,jdbcType=TIMESTAMP})
+    </insert>
+
+    <delete id="delete" parameterType="User">
+        DELETE FROM S_USER WHERE u_id=#{u_id}
+    </delete>
+
+    <update id="updatePassword" parameterType="User">
+        UPDATE S_USER set password=#{password,jdbcType=VARCHAR} where u_id = #{u_id}
+    </update>
+
+    <update id="update" parameterType="User">
+        UPDATE S_USER
+        <set>
+            <if test="name != null">
+                name=#{name,jdbcType=VARCHAR},
+            </if>
+            <if test="email != null">
+                email=#{email,jdbcType=VARCHAR},
+            </if>
+            <if test="phone != null">
+                phone=#{phone,jdbcType=VARCHAR},
+            </if>
+            <if test="status != null">
+                status=#{status,jdbcType=INTEGER},
+            </if>
+            <if test="update_date != null">
+                update_date=#{update_date,jdbcType=TIMESTAMP},
+            </if>
+        </set>
+        WHERE u_id=#{u_id}
+    </update>
+
+    <select id="selectByUserName" parameterType="string" resultMap="UserResultMap">
+        SELECT * FROM S_USER WHERE username=#{username}
+    </select>
+
+    <select id="selectByPk" parameterType="string" resultMap="UserResultMap">
+        SELECT * FROM S_USER WHERE u_id=#{u_id}
+    </select>
+
+    <select id="select" parameterType="org.hsweb.web.bean.common.QueryParam" resultMap="UserResultMap">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.selectSql"/>
+    </select>
+
+    <select id="total" parameterType="org.hsweb.web.bean.common.QueryParam" resultType="int">
+        <include refid="fieldConfig"/>
+        <include refid="tableName"/>
+        <include refid="BasicMapper.totalSql"/>
+    </select>
+</mapper>

+ 6 - 3
pom.xml

@@ -16,19 +16,22 @@
         <module>hsweb-web-bean</module>
         <module>hsweb-web-core</module>
         <module>hsweb-web-websocket</module>
+        <module>hsweb-web-workflow</module>
     </modules>
 
     <properties>
         <!-- base setting -->
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.build.locales>zh_CN</project.build.locales>
-        <project.build.jdk>1.7</project.build.jdk>
 
-        <junit.version>4.11</junit.version>
+        <java.version>1.8</java.version>
+        <javassist.version>3.20.0-GA</javassist.version>
+        <project.build.jdk>${java.version}</project.build.jdk>
+
         <spring.boot.version>1.3.1.RELEASE</spring.boot.version>
         <fastjson.version>1.2.6</fastjson.version>
 
-        <cglib.version>3.1</cglib.version>
+        <cglib.version>3.2.2</cglib.version>
         <aspectj.version>1.6.12</aspectj.version>
         <hibernate.validator.version>5.1.1.Final</hibernate.validator.version>
         <webbuilder.version>1.0-SNAPSHOT</webbuilder.version>