【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成
Jeecg-Mybatis版本代码生成器演示视频
http://pan.baidu.com/share/link?shareid=243717&uk=2668473880
简要说明
JEECG[J2EE Code Generation]
代码生成:根据表生成对应的Bean,Service,Dao,Action,XML,JSP等,增删改查功能直接使用,实现了快速开发
jeecg-mybatis-framework,采用SpringMVC+Mybatis等主流框架
支持数据库: Mysql,Oracle10g
前端:使用Jquery和Easyui技术.JS封装简洁,操作简单.
权限:对菜单,按钮控制.根据登陆用户权限展示拥有的菜单和按钮.
拦截:对所有无权限URL进行拦截,防止手动发送HTTP请求,确保系统全性.
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="scott.dao.demo.JeecgNoteDao" >
- <!-- Result Map-->
- <resultMap id="BaseResultMap" type="scott.entity.demo.JeecgNote" >
- <result column="id" property="id"/>
- <result column="title" property="title"/>
- <result column="content" property="content"/>
- <result column="crtuser" property="crtuser"/>
- <result column="crtuser_name" property="crtuser_name"/>
- <result column="create_dt" property="create_dt"/>
- <result column="deleted" property="deleted"/>
- </resultMap>
- <!-- jeecg_note table all fields -->
- <sql id="Base_Column_List" >
- id,title,content,crtuser,crtuser_name,create_dt,deleted
- </sql>
- <!-- 查询条件 -->
- <sql id="Example_Where_Clause">
- =1
- <trim suffixOverrides="," >
- <if test="id != null and id != ''" >
- and id = #{id}
- </if>
- <if test="title != null and title != ''" >
- and title = #{title}
- </if>
- <if test="content != null and content != ''" >
- and content = #{content}
- </if>
- <if test="crtuser != null and crtuser != ''" >
- and crtuser = #{crtuser}
- </if>
- <if test="crtuser_name != null and crtuser_name != ''" >
- and crtuser_name = #{crtuser_name}
- </if>
- <if test="create_dt != null and create_dt != ''" >
- and create_dt = #{create_dt}
- </if>
- <if test="deleted != null and deleted != ''" >
- and deleted = #{deleted}
- </if>
- </trim>
- </sql>
- <!-- 插入记录 -->
- <insert id="add" parameterType="Object" >
- <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into jeecg_note(id,title,content,crtuser,crtuser_name,create_dt,deleted)
- values(#{id},#{title},#{content},#{crtuser},#{crtuser_name},#{create_dt},#{deleted})
- </insert>
- <!-- 根据id,修改记录-->
- <update id="update" parameterType="Object" >
- update jeecg_note set title=#{title},content=#{content},crtuser=#{crtuser},crtuser_name=#{crtuser_name},create_dt=#{create_dt},deleted=#{deleted} where id=#{id}
- </update>
- <!-- 修改记录,只修改只不为空的字段 -->
- <update id="updateBySelective" parameterType="Object" >
- update jeecg_note set
- <trim suffixOverrides="," >
- <if test="title != null ">
- title=#{title},
- </if>
- <if test="content != null ">
- content=#{content},
- </if>
- <if test="crtuser != null ">
- crtuser=#{crtuser},
- </if>
- <if test="crtuser_name != null ">
- crtuser_name=#{crtuser_name},
- </if>
- <if test="create_dt != null ">
- create_dt=#{create_dt},
- </if>
- <if test="deleted != null ">
- deleted=#{deleted},
- </if>
- </trim> where id=#{id}
- </update>
- <!-- 删除记录 -->
- <delete id="delete" parameterType="Object">
- delete from jeecg_note where id = #{id}
- </delete>
- <!-- 根据id查询 公告 -->
- <select id="queryById" resultMap="BaseResultMap" parameterType="Object">
- select <include refid="Base_Column_List" />
- from jeecg_note where id = #{id}
- </select>
- <!-- 公告 列表总数-->
- <select id="queryByCount" resultType="java.lang.Integer" parameterType="Object">
- ) from jeecg_note
- <include refid="Example_Where_Clause"/>
- </select>
- <!-- 查询公告列表 -->
- <select id="queryByList" resultMap="BaseResultMap" parameterType="Object">
- select
- <include refid="Base_Column_List"/>
- from jeecg_note
- <include refid="Example_Where_Clause"/>
- <if test="pager.orderCondition != null and pager.orderCondition != ''" >
- ${pager.orderCondition}
- </if>
- <if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''" >
- ${pager.mysqlQueryCondition}
- </if>
- </select>
- </mapper>
【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成的更多相关文章
- MyBatis 与 Spring 的完美整合方法
MyBaits 整合 Spring MyBatis-Spring 项目 第一步:创建测试工程 第二步:引入依赖 jar 包 第三步:编写 Spring 配置文件 第四步:编写 MyBatis 配置文件 ...
- Thymeleaf 3与Spring MVC 4 整合配置
Thymeleaf 3与Spring MVC 4 整合配置 Maven 依赖配置 Spring 相关依赖就不说了 <dependency> <groupId>org.thyme ...
- 玩转spring mvc(四)---在spring MVC中整合JPA
关于在Spring MVC中整合JPA是在我的上一篇关于spring mvc基本配置基础上进行的,所以大家先参考一下我的上一篇文章:http://blog.csdn.net/u012116457/ar ...
- 返璞归真 asp.net mvc (1) - 添加、查询、更新和删除的 Demo
原文:返璞归真 asp.net mvc (1) - 添加.查询.更新和删除的 Demo [索引页] [源码下载] 返璞归真 asp.net mvc (1) - 添加.查询.更新和删除的 Demo 作者 ...
- MyBatis原理,Spring、SpringBoot整合MyBatis
1. MyBatis概述 MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis 可 ...
- mongoDB数据库和Spring MVC的整合
之前一直用到的项目是Spring MVC+maven+mysql的,最近有些数据需要用到mongoDB数据库,现在做一些总结. 第一步:加载jar.maven配置 <!-- mongodb开始 ...
- 6.Spring MVC SSM整合问题总结
1.Cannot find class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] for ...
- spring mvc + freemarker 整合
<?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.s ...
- Spring mvc shiro 整合
参考 : http://www.360doc.com/content/14/0722/10/18637323_396209195.shtml http://www.360doc.com/content ...
随机推荐
- Unity动画知识之二:Animator动画状态机
上次我们讲过Unity游戏动画从入门到住院,今天我们来讲一下动画状态机. 好了,现在我们已经成功的导入了动画.接下来要玩的东西就很装13啦.因为大部分动画师是用不到这家伙的,需要掌握这个技能的,至少也 ...
- MySql错误处理(三)- 错误处理的例子
有几种错误处理的声明形式: § 如果任何错误(不是 NOT FOUND ) , 设置 l_error 为 1 后继续执行: DECLARE CONTINUE HANDLER FOR SQLEXCEPT ...
- 详细解读Android中的搜索框(一)—— 简单小例子
这次开的是一个讲解SearchView的栏目,第一篇主要是给一个小例子,让大家对这个搜索视图有一个了解,之后再分布细化来说. 目标: 我们先来定个目标,我们通过搜索框来输入要搜索的联系人名字,输入的时 ...
- 在自己建立的Thread中设置Handler,并接收消息
这里主要讲的是Android中线程的概念,自己的线程不能更新UI线程中的视图.如果把Handler设置在自己的线程中,那么必须建立一个Looper.至于为什么在Activity中建立Handler就不 ...
- 层次聚类 Hierarchical Clustering
-------------------------------- 不管是GMM,还是k-means,都面临一个问题,就是k的个数如何选取?比如在bag-of-words模型中,用k-means训练码书 ...
- HTTPS安全证书介绍
IIS配置web SSL 安全证书Https访问 From : http://cao416451347ming.blog.163.com/blog/static/1154556162010217441 ...
- ss简单使用
ss简单使用 ss即socket state. 1.常用语句 ss -l 显示所有处于监听的网络接口连接 ss -pl 显示所有处于监听的网络接口连接,及相应的进程名称.进号等 ss -t -a 显示 ...
- CodeReview工具Gerrit的python库pygerrit2
源代码: https://github.com/dpursehouse/pygerrit2
- apache+jetty 配置web jsp服务器负载均衡
首先,查找中文资料,貌似很少,有一个网友写了点,但是1版本过老,2有些地方有错误. 经过我自己摸索,记录一下.这个图很简洁明了 第一阶段 ,配置jetty 首先从 http://download.ec ...
- Log Shipping搭建
1. 概述 SQL Server 使用日志传送,您可以自动将“主服务器”实例上“主数据库”内的事务日志备份发送到单独“辅助服务器”实例上的一个或多个“辅助数据库”.事务日志备份分别应用于每个辅助 ...