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请求,确保系统全性.

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="scott.dao.demo.JeecgNoteDao" >
  6. <!-- Result Map-->
  7. <resultMap id="BaseResultMap" type="scott.entity.demo.JeecgNote" >
  8. <result column="id" property="id"/>
  9. <result column="title" property="title"/>
  10. <result column="content" property="content"/>
  11. <result column="crtuser" property="crtuser"/>
  12. <result column="crtuser_name" property="crtuser_name"/>
  13. <result column="create_dt" property="create_dt"/>
  14. <result column="deleted" property="deleted"/>
  15. </resultMap>
  16. <!-- jeecg_note table all fields -->
  17. <sql id="Base_Column_List" >
  18. id,title,content,crtuser,crtuser_name,create_dt,deleted
  19. </sql>
  20. <!-- 查询条件 -->
  21. <sql id="Example_Where_Clause">
  22. =1
  23. <trim  suffixOverrides="," >
  24. <if test="id != null and id != ''" >
  25. and id =  #{id}
  26. </if>
  27. <if test="title != null and title != ''" >
  28. and title =  #{title}
  29. </if>
  30. <if test="content != null and content != ''" >
  31. and content =  #{content}
  32. </if>
  33. <if test="crtuser != null and crtuser != ''" >
  34. and crtuser =  #{crtuser}
  35. </if>
  36. <if test="crtuser_name != null and crtuser_name != ''" >
  37. and crtuser_name =  #{crtuser_name}
  38. </if>
  39. <if test="create_dt != null and create_dt != ''" >
  40. and create_dt =  #{create_dt}
  41. </if>
  42. <if test="deleted != null and deleted != ''" >
  43. and deleted =  #{deleted}
  44. </if>
  45. </trim>
  46. </sql>
  47. <!-- 插入记录 -->
  48. <insert id="add" parameterType="Object" >
  49. <selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="id">
  50. SELECT LAST_INSERT_ID()
  51. </selectKey>
  52. insert into jeecg_note(id,title,content,crtuser,crtuser_name,create_dt,deleted)
  53. values(#{id},#{title},#{content},#{crtuser},#{crtuser_name},#{create_dt},#{deleted})
  54. </insert>
  55. <!-- 根据id,修改记录-->
  56. <update id="update" parameterType="Object" >
  57. update jeecg_note set title=#{title},content=#{content},crtuser=#{crtuser},crtuser_name=#{crtuser_name},create_dt=#{create_dt},deleted=#{deleted} where id=#{id}
  58. </update>
  59. <!-- 修改记录,只修改只不为空的字段 -->
  60. <update id="updateBySelective" parameterType="Object" >
  61. update jeecg_note set
  62. <trim  suffixOverrides="," >
  63. <if test="title != null  ">
  64. title=#{title},
  65. </if>
  66. <if test="content != null  ">
  67. content=#{content},
  68. </if>
  69. <if test="crtuser != null  ">
  70. crtuser=#{crtuser},
  71. </if>
  72. <if test="crtuser_name != null  ">
  73. crtuser_name=#{crtuser_name},
  74. </if>
  75. <if test="create_dt != null  ">
  76. create_dt=#{create_dt},
  77. </if>
  78. <if test="deleted != null  ">
  79. deleted=#{deleted},
  80. </if>
  81. </trim> where id=#{id}
  82. </update>
  83. <!-- 删除记录 -->
  84. <delete id="delete" parameterType="Object">
  85. delete   from jeecg_note where id = #{id}
  86. </delete>
  87. <!-- 根据id查询 公告 -->
  88. <select id="queryById"  resultMap="BaseResultMap" parameterType="Object">
  89. select <include refid="Base_Column_List" />
  90. from jeecg_note where id = #{id}
  91. </select>
  92. <!-- 公告 列表总数-->
  93. <select id="queryByCount" resultType="java.lang.Integer"  parameterType="Object">
  94. ) from jeecg_note
  95. <include refid="Example_Where_Clause"/>
  96. </select>
  97. <!-- 查询公告列表 -->
  98. <select id="queryByList" resultMap="BaseResultMap"  parameterType="Object">
  99. select
  100. <include refid="Base_Column_List"/>
  101. from jeecg_note
  102. <include refid="Example_Where_Clause"/>
  103. <if test="pager.orderCondition != null and pager.orderCondition != ''" >
  104. ${pager.orderCondition}
  105. </if>
  106. <if test="pager.mysqlQueryCondition != null and pager.mysqlQueryCondition != ''" >
  107. ${pager.mysqlQueryCondition}
  108. </if>
  109. </select>
  110. </mapper>

【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成的更多相关文章

  1. MyBatis 与 Spring 的完美整合方法

    MyBaits 整合 Spring MyBatis-Spring 项目 第一步:创建测试工程 第二步:引入依赖 jar 包 第三步:编写 Spring 配置文件 第四步:编写 MyBatis 配置文件 ...

  2. Thymeleaf 3与Spring MVC 4 整合配置

    Thymeleaf 3与Spring MVC 4 整合配置 Maven 依赖配置 Spring 相关依赖就不说了 <dependency> <groupId>org.thyme ...

  3. 玩转spring mvc(四)---在spring MVC中整合JPA

    关于在Spring MVC中整合JPA是在我的上一篇关于spring mvc基本配置基础上进行的,所以大家先参考一下我的上一篇文章:http://blog.csdn.net/u012116457/ar ...

  4. 返璞归真 asp.net mvc (1) - 添加、查询、更新和删除的 Demo

    原文:返璞归真 asp.net mvc (1) - 添加.查询.更新和删除的 Demo [索引页] [源码下载] 返璞归真 asp.net mvc (1) - 添加.查询.更新和删除的 Demo 作者 ...

  5. MyBatis原理,Spring、SpringBoot整合MyBatis

    1. MyBatis概述 MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获取结果集.MyBatis 可 ...

  6. mongoDB数据库和Spring MVC的整合

    之前一直用到的项目是Spring MVC+maven+mysql的,最近有些数据需要用到mongoDB数据库,现在做一些总结. 第一步:加载jar.maven配置 <!-- mongodb开始 ...

  7. 6.Spring MVC SSM整合问题总结

    1.Cannot find class [org.springframework.http.converter.json.MappingJacksonHttpMessageConverter] for ...

  8. spring mvc + freemarker 整合

    <?xml version="1.0" encoding="UTF-8" ?> <beans xmlns="http://www.s ...

  9. Spring mvc shiro 整合

    参考 : http://www.360doc.com/content/14/0722/10/18637323_396209195.shtml http://www.360doc.com/content ...

随机推荐

  1. python测试开发django-29.发送html格式邮件

    前言 上一篇已经通过send_mail()函数发送纯文本的邮件,发送成功了,如果我们想发送一个html格式的邮件,如何实现呢? 发送html格式的邮件实际上还是调用send_mail()函数 ,只需多 ...

  2. JAVA设计模式-设计原则

    6大原则: 单一职责原则 里氏替换原则 依赖倒置原则 接口隔离原则 迪米特法则 开闭原则 一.单一职责原则 定义:应该有且仅有一个原因引起类的变更 带来的好处: 类的复杂性降低,实现什么职责有清晰明确 ...

  3. .Net Excel操作之NPOI(一)简介

    一.NPOI简介 NPOI是一个开源项目,可以读/写xls,doc,ppt文件,有着广泛的应用. 使用NPOI能够帮助开发者在没有安装微软Office的情况下读写Office 97-2003的文件,支 ...

  4. [转]MySQL导入.sql文件及常用命令

    From : http://blog.csdn.net/muziduoxi/article/details/6091202 在MySQL Qurey   Brower中直接导入*.sql脚本,是不能一 ...

  5. IIS7增加mine类型,以便可以访问apk

    1.打开IIS 2.找到mine类型,单击右边的添加 3.输入apk的配置 application/vnd.android-package-archive .这样,用户就可以直接访问apk了

  6. django错误:Connection reset by peer

    django使用自身的web服务器时,处理并发的能力很弱,如果客户端并发连接数超过了其承载量,服务器会将其中一些连接关闭,从而导致这个问题 https://blog.csdn.net/xc_zhou/ ...

  7. Unit Testing of Spring MVC Controllers: Configuration

    Original Link: http://www.petrikainulainen.net/programming/spring-framework/unit-testing-of-spring-m ...

  8. Java NIO Pipe

    A Java NIO Pipe is a one-way data connection between two threads. A Pipe has a source channel and a ...

  9. go语言之进阶篇通过if实现类型断言

    1.通过if实现类型断言 示例: package main import "fmt" type Student struct { name string id int } func ...

  10. 检索(retrieval && search )-单目标-多目标跟踪-MTMC Tracking和 ReID

    跨摄像头多目标跟踪(Multi-Target Multi-Camera Tracking, MTMC Tracking) 跨摄像头多目标跟踪(Multi-Target Multi-Camera Tra ...