123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /*
- SQLyog Ultimate v11.33 (64 bit)
- MySQL - 5.1.73-community : Database - auto_code
- *********************************************************************
- */
- /*!40101 SET NAMES utf8 */;
- /*!40101 SET SQL_MODE=''*/;
- /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
- /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
- /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
- /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
- CREATE DATABASE /*!32312 IF NOT EXISTS*/`auto_code` /*!40100 DEFAULT CHARACTER SET utf8 */;
- USE `auto_code`;
- /*Table structure for table `back_user` */
- DROP TABLE IF EXISTS `back_user`;
- CREATE TABLE `back_user` (
- `username` varchar(20) NOT NULL,
- `password` varchar(50) NOT NULL,
- `add_time` datetime NOT NULL,
- PRIMARY KEY (`username`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- /*Data for the table `back_user` */
- insert into `back_user`(`username`,`password`,`add_time`) values ('aaaa','123456','2015-01-05 11:52:26'),('admin','admin','2014-06-24 10:12:49');
- /*Table structure for table `datasource_config` */
- DROP TABLE IF EXISTS `datasource_config`;
- CREATE TABLE `datasource_config` (
- `dc_id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(20) DEFAULT NULL,
- `driver_class` varchar(50) DEFAULT NULL,
- `jdbc_url` varchar(100) DEFAULT NULL,
- `username` varchar(50) DEFAULT NULL,
- `password` varchar(50) DEFAULT NULL,
- `back_user` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`dc_id`),
- KEY `f_username_user` (`username`)
- ) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
- /*Data for the table `datasource_config` */
- insert into `datasource_config`(`dc_id`,`name`,`driver_class`,`jdbc_url`,`username`,`password`,`back_user`) values (4,'autoCode','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/auto_code','root','root','admin'),(5,'ISP','net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:sqlserver://192.168.9.31:1433;databaseName=isp','sa','isp#123','admin'),(6,'rms','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/rms','root','root','admin'),(7,'fire','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/fire','root','root','admin');
- /*Table structure for table `template_config` */
- DROP TABLE IF EXISTS `template_config`;
- CREATE TABLE `template_config` (
- `tc_id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(50) DEFAULT NULL,
- `save_path` varchar(100) DEFAULT NULL,
- `suffix` varchar(20) DEFAULT NULL,
- `file_name` varchar(50) DEFAULT NULL,
- `content` text,
- `back_user` varchar(20) DEFAULT NULL,
- PRIMARY KEY (`tc_id`),
- KEY `f_backuser` (`back_user`)
- ) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8;
- /*Data for the table `template_config` */
- insert into `template_config`(`tc_id`,`name`,`save_path`,`suffix`,`file_name`,`content`,`back_user`) values (8,'durc_Entity','entity','java','${context.javaBeanName}.java','package ${context.packageName}.entity;\n\npublic class ${context.javaBeanName} {\n#foreach($column in $columns) \n private ${column.javaType} ${column.javaFieldName};\n#end\n\n#foreach(${column} in ${columns}) \n public void set${column.javaFieldNameUF}(${column.javaType} ${column.javaFieldName}){\n this.${column.javaFieldName} = ${column.javaFieldName};\n }\n\n public ${column.javaType} get${column.javaFieldNameUF}(){\n return this.${column.javaFieldName};\n }\n\n#end\n}','admin'),(9,'durc_DAO','dao','java','${context.javaBeanName}Dao.java','package ${context.packageName}.dao;\n\nimport org.durcframework.core.dao.BaseDao;\nimport ${context.packageName}.entity.${context.javaBeanName};\n\npublic interface ${context.javaBeanName}Dao extends BaseDao<${context.javaBeanName}> {\n}','admin'),(10,'durc_Service','service','java','${context.javaBeanName}Service.java','package ${context.packageName}.service;\n\nimport org.durcframework.core.service.CrudService;\nimport ${context.packageName}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.entity.${context.javaBeanName};\nimport org.springframework.stereotype.Service;\n\n@Service\npublic class ${context.javaBeanName}Service extends CrudService<${context.javaBeanName}, ${context.javaBeanName}Dao> {\n\n}','admin'),(11,'durc_SearchEntity','entity','java','${context.javaBeanName}Sch.java','package ${context.packageName}.entity;\n\nimport org.durcframework.core.SearchEntity;\nimport org.durcframework.core.expression.annotation.ValueField;\n\npublic class ${context.javaBeanName}Sch extends SearchEntity{\n\n#foreach($column in $columns) \n private ${column.javaTypeBox} ${column.javaFieldName}Sch;\n#end\n\n#foreach(${column} in ${columns}) \n public void set${column.javaFieldNameUF}Sch(${column.javaTypeBox} ${column.javaFieldName}Sch){\n this.${column.javaFieldName}Sch = ${column.javaFieldName}Sch;\n }\n \n @ValueField(column = \"${column.columnName}\")\n public ${column.javaTypeBox} get${column.javaFieldNameUF}Sch(){\n return this.${column.javaFieldName}Sch;\n }\n\n#end\n\n}','admin'),(12,'durc_Mybatis','mapper','xml','${context.javaBeanNameLF}Mapper.xml','<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.dao.${context.javaBeanName}Dao\">\n <resultMap id=\"queryResultMap\" type=\"${context.packageName}.entity.${context.javaBeanName}\">\n #foreach($column in $columns)\n <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\" />\n #end\n </resultMap>\n\n <select id=\"find\" parameterType=\"org.durcframework.core.expression.ExpressionQuery\"\n resultMap=\"queryResultMap\">\n SELECT t.*\n FROM ${table.tableName} t\n <include refid=\"expressionBlock.where\" />\n <choose>\n <when test=\"sortname == null\">\n ORDER BY t.${context.pkName} desc\n </when>\n <otherwise>\n ORDER BY ${order}\n </otherwise>\n </choose>\n <if test=\"!isQueryAll\">\n LIMIT\n #{start,jdbcType=INTEGER},#{limit,jdbcType=INTEGER}\n </if>\n </select>\n\n\n <select id=\"findTotalCount\" parameterType=\"org.durcframework.core.expression.ExpressionQuery\"\n resultType=\"java.lang.Integer\">\n SELECT count(*) FROM ${table.tableName} t\n <include refid=\"expressionBlock.where\" />\n </select>\n\n <insert id=\"save\" parameterType=\"${context.packageName}.entity.${context.javaBeanName}\"\n#if(${pkColumn.isIdentity})\n keyProperty=\"${context.javaPkName}\" keyColumn=\"${context.pkName}\" useGeneratedKeys=\"true\"\n#end\n >\n INSERT INTO ${table.tableName}\n (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end `${column.columnName}`\n#set($i=$i +1)\n #end \n #end\n )\n VALUES (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n#set($i=$i +1)\n #end \n #end\n \n )\n </insert>\n\n\n <update id=\"update\" parameterType=\"${context.packageName}.entity.${context.javaBeanName}\">\n UPDATE ${table.tableName}\n SET \n#set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isPk}) \n #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n #set($i=$i+1) \n #end \n #end \n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </update>\n\n <select id=\"get\" resultMap=\"queryResultMap\" parameterType=\"${context.packageName}.entity.${context.javaBeanName}\">\n SELECT t.*\n FROM ${table.tableName} t\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </select>\n \n <delete id=\"del\" parameterType=\"${context.packageName}.entity.${context.javaBeanName}\">\n DELETE FROM ${table.tableName}\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </delete>\n\n</mapper>','admin'),(14,'durc_Controller','controller','java','${context.javaBeanName}Controller.java','package ${context.packageName}.controller;\n\nimport org.durcframework.core.GridResult;\nimport org.durcframework.core.MessageResult;\nimport org.durcframework.core.controller.CrudController;\nimport ${context.packageName}.entity.${context.javaBeanName};\nimport ${context.packageName}.entity.${context.javaBeanName}Sch;\nimport ${context.packageName}.service.${context.javaBeanName}Service;\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.bind.annotation.ResponseBody;\n\n@Controller\npublic class ${context.javaBeanName}Controller extends\n CrudController<${context.javaBeanName}, ${context.javaBeanName}Service> {\n\n @RequestMapping(\"/add${context.javaBeanName}.do\")\n public @ResponseBody\n MessageResult add${context.javaBeanName}(${context.javaBeanName} entity) {\n return this.save(entity);\n }\n\n @RequestMapping(\"/list${context.javaBeanName}.do\")\n public @ResponseBody\n GridResult list${context.javaBeanName}(${context.javaBeanName}Sch searchEntity) {\n return this.query(searchEntity);\n }\n\n @RequestMapping(\"/update${context.javaBeanName}.do\")\n public @ResponseBody\n MessageResult update${context.javaBeanName}(${context.javaBeanName} entity) {\n return this.update(entity);\n }\n\n @RequestMapping(\"/del${context.javaBeanName}.do\")\n public @ResponseBody\n MessageResult del${context.javaBeanName}(${context.javaBeanName} entity) {\n return this.delete(entity);\n }\n \n}','admin'),(15,'sw-mybatis-sqlserver','${context.javaBeanNameLF}/mapper','xml','${context.javaBeanNameLF}Mapper.xml','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao\">\n<resultMap id=\"BaseResultMap\" type=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n#foreach($column in $columns)\n <result column=\"${column.columnName}\" property=\"${column.javaFieldName}\" jdbcType=\"${column.mybatisJdbcType}\"/>\n#end \n</resultMap>\n <select id=\"query\" resultMap=\"BaseResultMap\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" >\n <if test=\"paramMap.rp>0\">\n SELECT t0.* FROM (\n </if>\n select row_number() over(order by\n <choose>\n <when test=\"paramMap.orderCol!=null\">\n ${paramMap.orderCol}\n </when>\n <otherwise>\n ${context.pkName} desc\n </otherwise>\n </choose>\n ) row\n #set ($i=0) \n #foreach($column in $columns) \n #if($i > 0),#end ${column.columnName}\n #set($i=$i +1) \n #end\n from ${table.tableName} t \n <include refid=\"conditionQuery.core\" />\n <if test=\"paramMap.rp > 0\">\n ) t0 WHERE t0.row BETWEEN (#{paramMap.firstResult} +1) AND\n (#{paramMap.firstResult} \n #{paramMap.rp})\n </if>\n </select>\n <select id=\"get\" resultMap=\"BaseResultMap\" parameterType=\"java.lang.Integer\" >\n SELECT \n#set ($i=0) \n #foreach($column in $columns) \n #if($i > 0),#end \n ${column.columnName}\n #set($i=$i +1) \n #end\n FROM ${table.tableName}\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </select>\n <delete id=\"delete\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" >\n DELETE FROM ${table.tableName}\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </delete>\n <insert id=\"save\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" useGeneratedKeys=\"true\" keyProperty=\"${context.javaPkName}\">\n INSERT INTO ${table.tableName}\n (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end ${column.columnName}\n #set($i=$i +1)\n #end \n #end\n )\n VALUES (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n #set($i=$i +1)\n #end \n #end\n \n )\n </insert>\n <select id=\"queryCnt\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" resultType=\"java.lang.Integer\" >\n select count(*) from ${table.tableName} t\n <include refid=\"conditionQuery.core\" />\n </select>\n\n <update id=\"update\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n UPDATE ${table.tableName}\n SET \n#set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isPk}) \n #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n #set($i=$i +1)\n #end \n #end \n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </update>\n</mapper>','admin'),(16,'sw-pojo','${context.javaBeanNameLF}/pojo','java','${context.javaBeanName}.java','package ${context.packageName}.${context.javaBeanNameLF}.pojo;\n\nimport com.shunwang.business.framework.pojo.BasePojo;\n\npublic class ${context.javaBeanName} extends BasePojo {\n#foreach($column in $columns) \n private ${column.javaType} ${column.javaFieldName};\n#end\n\n#foreach(${column} in ${columns}) \n public void set${column.javaFieldNameUF}(${column.javaType} ${column.javaFieldName}){\n this.${column.javaFieldName} = ${column.javaFieldName};\n }\n\n public ${column.javaType} get${column.javaFieldNameUF}(){\n return this.${column.javaFieldName};\n }\n\n#end\n}','admin'),(17,'sw-dao','${context.javaBeanNameLF}/dao','java','${context.javaBeanName}Dao.java','package ${context.packageName}.${context.javaBeanNameLF}.dao;\n\nimport com.shunwang.business.framework.dao.CrudDao;\nimport ${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName};\n\npublic interface ${context.javaBeanName}Dao extends CrudDao<${context.javaBeanName}> {\n}','admin'),(18,'sw-bo','${context.javaBeanNameLF}/bo','java','${context.javaBeanName}Bo.java','package ${context.packageName}.${context.javaBeanNameLF}.bo;\n\nimport org.springframework.stereotype.Service;\n\nimport com.shunwang.business.framework.bo.CrudBo;\nimport ${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao;\nimport ${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName};\n\n@Service\npublic class ${context.javaBeanName}Bo extends CrudBo<${context.javaBeanName}, ${context.javaBeanName}Dao> {\n\n}','admin'),(19,'durc_jspEasyUICRUD','jsp','jsp','${context.javaBeanNameLF}.jsp','<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\"\n pageEncoding=\"UTF-8\"%>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>增删改查列子</title>\n</head>\n<body>\n\n <div class=\"easyui-panel search-panel\">\n <form id=\"schForm\">\n <table>\n <tr>\n#foreach($column in $columns)\n #if(!${column.isIdentityPk})\n <td class=\"fm_lab\">${column.javaFieldName}:</td><td><input name=\"${column.javaFieldName}Sch\" type=\"text\"></td> \n #end\n#end\n<td><a id=\"schBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-search\">查询</a></td>\n </tr>\n </table>\n </form>\n </div>\n\n <div id=\"toolbar\">\n <a id=\"addBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-add\" plain=\"true\">添加</a>\n </div>\n \n <table id=\"dg\"></table>\n \n <div id=\"dlg\" class=\"easyui-dialog\" style=\"width:320px;height:280px;padding:10px 20px\"\n closed=\"true\" modal=\"true\" buttons=\"#dlg-buttons\">\n <form id=\"fm\" method=\"post\">\n <table>\n#foreach($column in $columns)\n #if(!${column.isIdentityPk})\n <tr>\n <td class=\"fm_lab\">${column.javaFieldName}:</td><td><input name=\"${column.javaFieldName}\" type=\"text\" class=\"easyui-validatebox\" required=\"true\"></td>\n </tr>\n #end\n#end\n </table>\n </form>\n </div>\n <div id=\"dlg-buttons\">\n <a id=\"saveBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-ok\">保存</a>\n <a id=\"cancelBtn\" class=\"easyui-linkbutton\" iconCls=\"icon-cancel\">取消</a>\n </div>\n \n<jsp:include page=\"../easyui_lib.jsp\"></jsp:include>\n<script type=\"text/javascript\">\n#set($jq=\"$\") \n(function(){\nvar that = this;\n\nvar pk = \'${context.javaPkName}\'; // java类中的主键字段\nvar listUrl = ctx + \'list${context.javaBeanName}.do\'; // 查询\nvar addUrl = ctx + \'add${context.javaBeanName}.do\'; // 添加\nvar updateUrl = ctx + \'update${context.javaBeanName}.do\'; // 修改\nvar delUrl = ctx + \'del${context.javaBeanName}.do\'; // 删除\nvar submitUrl = \'\'; // 提交URL\n\nvar toolbarId = \'toolbar\'; // 工具条ID\n\nvar ${jq}dialog = ${jq}(\'#dlg\'); // 窗口\nvar ${jq}form = ${jq}(\'#fm\'); // 表单\nvar ${jq}grid = ${jq}(\'#dg\'); // 表格\nvar ${jq}schForm = ${jq}(\'#schForm\'); // 查询表单\n\nvar ${jq}schBtn = ${jq}(\'#schBtn\'); // 查询按钮\nvar ${jq}saveBtn = ${jq}(\'#saveBtn\'); // 保存按钮\nvar ${jq}cancelBtn = ${jq}(\'#cancelBtn\'); // 取消按钮\nvar ${jq}addBtn = ${jq}(\'#addBtn\'); // 添加按钮\n\n// 初始化表格\n${jq}grid.datagrid({ \n url:listUrl\n ,columns:[[\n#set($i=0)\n#foreach($column in $columns)\n #if($i>0),#end\n #if(!${column.isIdentityPk})\n {field:\'${column.javaFieldName}\',title:\'${column.javaFieldName}\'}\n #set($i=$i+1)\n #end \n#end \n ,{field:\'_btn1\',title:\'操作\',align:\'center\',formatter:function(val,row){\n return \'<a onclick=\"\'+FunUtil.createFun(that,\'edit\',row)+\' return false;\">修改</a>\'\n + \'<span class=\"opt-split\">|</span>\'\n + \'<a onclick=\"\'+FunUtil.createFun(that,\'del\',row)+\' return false;\">删除</a>\'\n }}\n ]]\n ,toolbar:\'#\' + toolbarId\n ,pagination:true\n ,fitColumns:true\n ,singleSelect:true\n ,striped:true\n ,pageSize:20\n});\n\n// 初始化事件\n${jq}addBtn.click(function(){\n ${jq}dialog.dialog(\'open\').dialog(\'setTitle\',\'添加\');\n ${jq}form.form(\'reset\');\n submitUrl = addUrl;\n});\n\n${jq}schBtn.click(function(){\n var data = getFormData(${jq}schForm);\n ${jq}grid.datagrid(\'load\',data);\n});\n\n${jq}saveBtn.click(function(){\n save();\n});\n\n${jq}cancelBtn.click(function(){\n ${jq}dialog.dialog(\'close\');\n});\n\n\n// 编辑\nthis.edit = function(row){\n if (row){\n ${jq}dialog.dialog(\'open\').dialog(\'setTitle\',\'修改\');\n ${jq}form.form(\'clear\').form(\'load\',row);\n \n submitUrl = updateUrl + [\'?\',pk,\'=\',row[pk]].join(\'\');\n }\n}\n\n// 保存\nthis.save = function(){\n var self = this;\n ${jq}form.form(\'submit\',{\n url: submitUrl,\n onSubmit: function(){\n return ${jq}(this).form(\'validate\');\n },\n success: function(resultTxt){\n var result = ${jq}.parseJSON(resultTxt);\n Action.execResult(result,function(result){\n ${jq}dialog.dialog(\'close\');// close the dialog\n ${jq}grid.datagrid(\'reload\');\n });\n }\n });\n}\n\n// 删除\nthis.del = function(row){\n if(row){\n ${jq}.messager.confirm(\'确认\',\'确定要删除该数据吗?\',function(r){\n if (r){\n Action.post(delUrl,row,function(result){\n Action.execResult(result,function(result){\n ${jq}grid.datagrid(\'reload\');\n });\n });\n }\n });\n }\n}\n\n})();\n</script>\n</body>\n</html>','admin'),(20,'sw-mybatis-mysql','${context.javaBeanNameLF}/mapper','xml','${context.javaBeanNameLF}Mapper.xml','<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE mapper PUBLIC \"-//mybatis.org//DTD Mapper 3.0//EN\" \"http://mybatis.org/dtd/mybatis-3-mapper.dtd\" >\n<mapper namespace=\"${context.packageName}.${context.javaBeanNameLF}.dao.${context.javaBeanName}Dao\">\n<resultMap id=\"BaseResultMap\" type=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n#foreach($column in $columns)\n <result property=\"${column.javaFieldName}\" column=\"${column.columnName}\" jdbcType=\"${column.mybatisJdbcType}\"/>\n#end \n</resultMap>\n <select id=\"query\" resultMap=\"BaseResultMap\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" >\n SELECT *\n FROM ${table.tableName} t\n <include refid=\"conditionQuery.core\" />\n <choose>\n <when test=\"paramMap.orderCol!=null\">\n ORDER BY ${paramMap.orderCol}\n </when>\n <otherwise>\n ORDER BY ${context.pkName} desc\n </otherwise>\n </choose>\n <if test=\"paramMap.rp>0\">\n LIMIT #{paramMap.firstResult},#{paramMap.rp}\n </if>\n </select>\n\n <select id=\"get\" resultMap=\"BaseResultMap\" parameterType=\"java.lang.Integer\" >\n SELECT \n#set ($i=0) \n #foreach($column in $columns) \n #if($i > 0),#end \n ${column.columnName}\n #set($i=$i+ 1) \n #end\n FROM ${table.tableName}\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </select>\n <delete id=\"delete\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" >\n DELETE FROM ${table.tableName}\n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </delete>\n <insert id=\"save\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\" useGeneratedKeys=\"true\" keyProperty=\"${context.javaPkName}\">\n INSERT INTO ${table.tableName}\n (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end ${column.columnName}\n #set($i=$i +1)\n #end \n #end\n )\n VALUES (\n #set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isIdentityPk}) \n #if($i > 0),#end #{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n #set($i=$i +1)\n #end \n #end\n \n )\n </insert>\n <select id=\"queryCnt\" parameterType=\"com.shunwang.business.framework.mybatis.query.ConditionQuery\" resultType=\"java.lang.Integer\" >\n select count(*) from ${table.tableName} t\n <include refid=\"conditionQuery.core\" />\n </select>\n\n <update id=\"update\" parameterType=\"${context.packageName}.${context.javaBeanNameLF}.pojo.${context.javaBeanName}\">\n UPDATE ${table.tableName}\n SET \n#set ($i=0) \n #foreach($column in $columns) \n #if(!${column.isPk}) \n #if($i > 0),#end ${column.columnName}=#{${column.javaFieldName},jdbcType=${column.mybatisJdbcType}}\n #set($i=$i +1)\n #end \n #end \n WHERE ${context.pkName} = #{${context.javaPkName},jdbcType=${context.mybatisPkType}}\n </update>\n</mapper>','admin'),(23,'durc-jspFduiCRUD','jsp',NULL,'${context.javaBeanNameLF}.jsp','<%@ page language=\"java\" contentType=\"text/html; charset=UTF-8\"\n pageEncoding=\"UTF-8\"%>\n<%@ include file=\"../taglib.jsp\" %>\n<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n<title>增删改查</title>\n</head>\n<body>\n<div class=\"search-wrap\">\n <div class=\"search-content\">\n <table class=\"search-tab\">\n <tr>\n#foreach($column in $columns)\n #if(!${column.isIdentityPk})\n <th>${column.javaFieldName}:</th><td id=\"txt-${column.javaFieldName}Sch\"></td> \n #end\n#end\n <td>\n <div id=\"btnSch\"></div>\n </td>\n </tr>\n </table>\n </div>\n </div>\n <div class=\"result-wrap\">\n <div class=\"result-title\">\n <div class=\"result-list\">\n <a id=\"addNew\" href=\"javascript:void(0)\"><i class=\"icon-font\"></i>新增</a>\n </div>\n </div>\n <div class=\"result-content\">\n <div id=\"grid\"></div>\n </div>\n </div>\n \n <div id=\"crudWin\" style=\"display: none;\">\n <table class=\"insert-tab\" width=\"100%\">\n <caption id=\"formMsg\"></caption>\n <tbody>\n#foreach($column in $columns)\n #if(!${column.isIdentityPk})\n <tr>\n <th>${column.javaFieldName}:</th><td id=\"txt-${column.javaFieldName}\"></td>\n </tr>\n #end\n#end\n </tbody>\n </table>\n </div>\n\n<script type=\"text/javascript\">\n(function(){\n \nvar schPanel;\nvar grid;\nvar formPanel;\nvar crudWin;\n\nvar pk = \'${context.javaPkName}\'; // java类中的主键字段\nvar listUrl = ctx + \'list${context.javaBeanName}.do\'; // 查询\nvar addUrl = ctx + \'add${context.javaBeanName}.do\'; // 添加\nvar updateUrl = ctx + \'update${context.javaBeanName}.do\'; // 修改\nvar delUrl = ctx + \'del${context.javaBeanName}.do\'; // 删除\n \nschPanel = new FDFormPanel({\n controls:[\n#set($i=0)\n#foreach($column in $columns) \n #if(!${column.isIdentityPk})\n #if($i>0),#end new FDTextBox({domId:\'txt-${column.javaFieldName}Sch\',name:\'${column.javaFieldName}Sch\'}) \n #set($i=$i+1) \n #end\n#end\n ]\n});\n\nnew FDButton({domId:\'btnSch\',text:\'查询\',onclick:function(){\n search();\n}});\n\ngrid = new FDGrid({\n domId:\'grid\'\n ,url:listUrl\n ,columns:[\n#set($i=0)\n#foreach($column in $columns)\n #if(!${column.isIdentityPk}) \n #if($i>0),#end {text:\'${column.javaFieldName}\',name:\'${column.javaFieldName}\'}\n #set($i=$i+1)\n #end \n#end \n ]\n ,actionButtons:[\n {text:\'修改\',onclick:update}\n ,{text:\'删除\',onclick:del}\n ]\n});\n\ncrudWin = new FDWindow({\n contentId:\'crudWin\'\n ,buttons:[\n {text:\'保存\',onclick:function(){\n formPanel.save();\n }}\n ,{text:\'取消\',onclick:function(){\n crudWin.hide();\n }}\n ]\n});\n\nformPanel = new FDFormPanel({\n grid:grid\n ,win:crudWin\n // 服务器端的请求\n ,crudUrl:{\n add: addUrl\n ,update: updateUrl\n ,del: delUrl\n }\n ,controls:[\n new FDHidden({name:pk,defaultValue:0})\n#foreach($column in $columns)\n #if(!${column.isIdentityPk})\n ,new FDTextBox({domId:\'txt-${column.javaFieldName}\',name:\'${column.javaFieldName}\',msgId:\'formMsg\',width:200\n ,validates:[\n {rule:{notNull:true},successClass:\'green\',errorClass:\'require-red\',errorMsg:\'${column.javaFieldName}不能为空\'}\n ]\n })\n #end\n#end\n ]\n});\n\n$(\'#addNew\').click(function(){\n add();\n});\n\nfunction add() {\n formPanel.add();\n}\n\nfunction update(rowData,rowIndex) {\n formPanel.update(rowData);\n}\n\n\nfunction del(row,rowIndex) {\n formPanel.del(row);\n}\n\nfunction search() {\n grid.search(schPanel.getData());\n}\n \n})();\n</script>\n</body>\n</html>','admin');
- /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
- /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
- /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
- /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|