日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

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

發(fā)布時(shí)間:2025/3/17 c/c++ 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

? Jeecg-mybatis-framework 版本

簡(jiǎn)要說明

  • JEECG[J2EE Code Generation]是一款基于代碼生成器的J2EE智能開發(fā)框架,借助該框架可以節(jié)省50%的工作量,實(shí)現(xiàn)代碼生成+手工merge的半智能開發(fā)
  • 代碼生成:根據(jù)表生成對(duì)應(yīng)的Bean,Service,Dao,Action,XML,JSP等,增刪改查功能直接使用,實(shí)現(xiàn)了快速開發(fā)
  • jeecg-mybatis-framework,采用SpringMVC+Mybatis等主流框架
  • 支持?jǐn)?shù)據(jù)庫: Mysql,Oracle10g
  • 前端:使用Jquery和Easyui技術(shù).JS封裝簡(jiǎn)潔,操作簡(jiǎn)單.
  • 權(quán)限:對(duì)菜單,按鈕控制.根據(jù)登陸用戶權(quán)限展示擁有的菜單和按鈕.
  • 攔截:對(duì)所有無權(quán)限URL進(jìn)行攔截,防止手動(dòng)發(fā)送HTTP請(qǐng)求,確保系統(tǒng)全性.


源碼下載:

? ? ? 鏈接:?http://pan.baidu.com/s/1pJMkprt?密碼: k3u8



入門視頻:

? ? ??鏈接:?http://pan.baidu.com/s/1ntD0O1z?密碼: 66gi



環(huán)境搭建:

? ? ??1.創(chuàng)建一個(gè)utf-8的數(shù)據(jù)庫,數(shù)據(jù)庫名jeecgmybatis
? ? ??2.執(zhí)行腳本jeecgmybatis.sql,初始化數(shù)據(jù)庫
? ? ??3.項(xiàng)目導(dǎo)入myeclipse工程
? ? ??4.啟動(dòng)項(xiàng)目
? ?? ?? ? ? ? ?訪問:http://localhost:8080/jeecg-mybatis-framework
? ? ??5.代碼生成器路徑
??? ? ??? ? ??/jeecg-mybatis-framework/src/com/code/CodeUtil.java??


技術(shù)交流

??本系統(tǒng)由JEECG社區(qū)提供,如需個(gè)性化定制,可與官方(www.jeecg.org)聯(lián)系.

  • 交流QQ群:106259349, 106838471, 289782002
  • 開發(fā)者:JEECG社區(qū)
  • 官網(wǎng):http://www.jeecg.org


Java代碼??
  • <?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">??
  • where?1=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>??
  • ??
  • <!--?根據(jù)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>??
  • ???
  • <!--?根據(jù)id查詢?公告?-->??
  • <select?id="queryById"??resultMap="BaseResultMap"?parameterType="Object">??
  • ????select?<include?refid="Base_Column_List"?/>???
  • ?????from?jeecg_note?where?id?=?#{id}??
  • </select>??
  • ??
  • <!--?公告?列表總數(shù)-->??
  • <select?id="queryByCount"?resultType="java.lang.Integer"??parameterType="Object">??
  • ????select?count(1)?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> ? ??
  • 總結(jié)

    以上是生活随笔為你收集整理的【jeecg-mybatis版本】 mybatis+spring mvc 完美整合方案 查询,保存,更新,删除自动生成的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。