当前位置: 首页 > news >正文

苏州市住房和城乡建设局网站首页app设计网站模板

苏州市住房和城乡建设局网站首页,app设计网站模板,做网站什么配置够用,新能源电动汽车目录 1. 批量操作:通过标签支持批量插入 2. 批量操作:通过标签支持批量更新 3. 批量操作#xff1a;通过标签支持批量删除 4. 动态SQL 3. 多条件分支查询 4. SQL语句优化#xff1a;使用标签避免多余的AND或OR关键字。 5. 注解方式使用MyBatis 6. 一对多 7. 多对一通过标签支持批量删除 4. 动态SQL 3. 多条件分支查询 4. SQL语句优化使用标签避免多余的AND或OR关键字。 5. 注解方式使用MyBatis 6. 一对多 7. 多对一每个评论Comment都属于一篇文章Article并且每篇文章可以有多个评论。 8. MyBatis-Plus集成 1. 批量操作:通过foreach标签支持批量插入 insert idbatchInsert parameterTypejava.util.ListINSERT INTO user (username, email,phone, create_time) VALUESforeach collectionlist itemitem separator,(#{item.username}, #{item.email},#{item.phone}, #{item.createTime})/foreach /insert 2. 批量操作:通过foreach标签支持批量更新 update idbatchUpdate parameterTypejava.util.Listforeach collectionlist itemitem separator;UPDATE userSET username #{item.username}, email #{item.email}WHERE id #{item.id}/foreach /update 3. 批量操作通过foreach标签支持批量删除 delete idbatchDelete parameterTypejava.util.ListDELETE FROM user WHERE id INforeach collectionlist itemid open( separator, close)#{id}/foreach /delete 4. 动态SQL select idfindUsers resultTypeUserSELECT * FROM userWHERE 11if testusername ! null and username ! AND username LIKE CONCAT(%, #{username}, %)/ifif testemail ! null and email ! AND email #{email}/ifif teststatus ! nullAND status #{status}/if /select 3. 多条件分支查询 select idfindUsersByCondition resultTypeUserSELECT * FROM userwherechoosewhen testsearchType usernameusername LIKE CONCAT(%, #{keyword}, %)/whenwhen testsearchType emailemail LIKE CONCAT(%, #{keyword}, %)/whenotherwise(username LIKE CONCAT(%, #{keyword}, %) OR email LIKE CONCAT(%, #{keyword}, %))/otherwise/choose/where /select 4. SQL语句优化使用trim标签避免多余的AND或OR关键字。 select idfindUsers resultTypeUserSELECT * FROM usertrim prefixWHERE prefixOverridesAND |OR if testusername ! null and username ! AND username LIKE CONCAT(%, #{username}, %)/ifif testemail ! null and email ! AND email #{email}/ifif teststatus ! nullAND status #{status}/if/trim /select 5. 注解方式使用MyBatis public interface UserMapper {Select(SELECT * FROM user WHERE id #{id})User getUserById(Long id);Insert(INSERT INTO user (username, email, create_time) VALUES (#{username}, #{email}, #{createTime}))Options(useGeneratedKeys true, keyProperty id)int insertUser(User user);Update(UPDATE user SET username #{username}, email #{email} WHERE id #{id})int updateUser(User user);Delete(DELETE FROM user WHERE id #{id})int deleteUser(Long id); } 6. 一对多 resultMap iduserWithOrdersMap typeUserid propertyid columnuser_id/result propertyusername columnusername/collection propertyorders ofTypeOrderid propertyid columnorder_id/result propertyorderNumber columnorder_number/result propertycreateTime columnorder_create_time//collection /resultMapselect idgetUserWithOrders resultMapuserWithOrdersMapSELECT u.id as user_id, u.username, o.id as order_id, o.order_number, o.create_time as order_create_timeFROM user uLEFT JOIN orders o ON u.id o.user_idWHERE u.id #{userId} /select 7. 多对一每个评论Comment都属于一篇文章Article并且每篇文章可以有多个评论。 ?xml version1.0 encodingUTF-8 ? !DOCTYPE mapper PUBLIC -//mybatis.org//DTD Mapper 3.0//EN http://mybatis.org/dtd/mybatis-3-mapper.dtdmapper namespacecom.example.mapper.ArticleMapper!-- 定义 Comment 的 resultMap --resultMap idcommentWithArticleMap typeCommentid propertyid columncomment_id/result propertycontent columncomment_content/result propertycreateTime columncomment_create_time/association propertyarticle javaTypeArticleid propertyid columnarticle_id/result propertytitle columnarticle_title/result propertycontent columnarticle_content//association/resultMap!-- 定义 Article 的 resultMap --resultMap idarticleWithCommentsMap typeArticleid propertyid columnarticle_id/result propertytitle columnarticle_title/result propertycontent columnarticle_content/collection propertycomments ofTypeComment resultMapcommentWithArticleMap//resultMap!-- 查询文章及其评论列表 --select idgetArticleWithComments resultMaparticleWithCommentsMapSELECT a.id as article_id,a.title as article_title,a.content as article_content,c.id as comment_id,c.content as comment_content,c.create_time as comment_create_timeFROM article aLEFT JOIN comment c ON a.id c.article_idWHERE a.id #{articleId}/select/mapper 8. MyBatis-Plus集成 Service public class UserServiceImpl extends ServiceImplUserMapper, User implements UserService {public ListUser findUsersByCondition(String username, String email) {return this.list(new QueryWrapperUser().like(StringUtils.isNotBlank(username), username, username).eq(StringUtils.isNotBlank(email), email, email));} }
http://www.hkea.cn/news/14572086/

相关文章:

  • 广东网站设计公司建网站怎么选择服务器
  • 网站搭建策略与方法有哪些方面电子商务网站建设人才调研
  • 大图做网站背景加载慢舞阳网站建设
  • 西安网站建设服务三亚网站建设哪家好
  • 旅游网站规划说明市场调研报告内容
  • 广西响应式网站建设金融建设网站
  • 龙游住房和城乡建设局网站如何建立自己网站平台
  • 建设工程项目管理信息门户网站wordpress官方源文件结构
  • 营销型网站哪家做的好莆田企业制作网站
  • 蜘蛛云建站网站做网站哪些方面会侵权
  • 西安门户网站建设开网店货源从哪里找最好
  • 中国最好的网站建设公司1天学会搭建营销网站
  • 男男做暧暧视频网站ftp地址格式怎么写
  • 网站建设企划书个人开投资公司条件
  • 王璞网站开发实战一元抢宝网站开发
  • 个人网站建设技术网站建设带支付源码
  • 微商分销如何搭建分销模式做seo优化产品网站
  • 外贸网站源码哪个好电子商务网站建设策划说
  • 山东网站建设公司排名wordpress销售和会员
  • 大型网站建设价格广东全屋定制十大名牌
  • 网站模板文件下载网站建设策划书5000字
  • 社团网站建设的功能定位wordpress dux搜索无法使用
  • 酷炫网站推荐wordpress 汉化版主题
  • 宿州网站开发公司建设网站能解决什么问题
  • 校园二手物品交易网站怎么做上饶做网站哪家好
  • 做平台的网站做智慧教室的网站
  • 襄阳定制型网站开发如何做网页广告
  • 网站修改title成都网络营销学校
  • cms建站系统免费六安网站制作公司价格
  • 毕业设计做网站好的想法网络虚拟号