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

落实政府网站集约化建设工作产品营销方案策划书

落实政府网站集约化建设工作,产品营销方案策划书,北京装饰公司设计,西安网站建设个人MyBatisPlus通过扫描实体类,并基于反射获取实体类信息作为数据库表信息 类名驼峰转下划线作为表名 名为id的字段作为主键 变量名驼峰转下划线作为表的字段名 常见注解 TableName:用来指定表名 Tableld:用来指定表中的主键字段信息 Tabl…

MyBatisPlus通过扫描实体类,并基于反射获取实体类信息作为数据库表信息

类名驼峰转下划线作为表名

名为id的字段作为主键

变量名驼峰转下划线作为表的字段名

常见注解

@TableName:用来指定表名

@Tableld:用来指定表中的主键字段信息

@TableField:用来指定表中的普通字段信息

IdType枚举
  • AUTO:数据库自增长

  • INPUT:通过set方法自行输入
  • ASSIOG_ID:分配ID,接口IdentifierGenerator的方法nextId来生成id,默认实现类为DefaultIdentifierGenerator雪花算法

对于这个数据库表:tb_user

使用@TableField的常见场景:

  • 成员变量名与数据库字段名不一致

  • 成员变量名以is开头,且是布尔值

  • 成员变量名与数据库关键字冲突

  • 成员变量不是数据库字段

条件构造器

查询出名字中带‘o’的,存款大于等于1000元的人的id,info,balance:

SELECT id,info,balance 

FROM user

WHERE username LIKE "o" AND balance >=?

void testQueryWrapper(){//1.构建查询条件QueryWrapper<User> wrapper=new QueryWrapper<User>().selct("id","info","balance").like("username","o").ge("balance",1000);//2.查询List<User> users=userMapper.selectList(wrapper);users.forEach(System::out::println);
}

其中User类是已经绑定数据库对应的user表

更新用户名为jack的用户余额为2000

UPDATE user

SET balance = 2000

WHERE username = "jack"

void testUpdateByQueryWrapper(){//1.要更新的数据User user=new User();user.setBalance(2000);//2.更新的条件QueryWrapper<User> wrapper=new QueryWrapper<User>().eq("username","jack");//3.执行更新userMapper.update(user,wrapper);
}

 更新id为1,2,4的用户的余额,扣200.

UPDATE user 

SET balance = balance - 200

WHERE id IN (1,2,4)

void testUpdateWrapper(){List<int> ids=List.of(1,2,4);UpdateWrapper<User> Wrapper = new UpdateWrapper<User>().setSql("balance=balance-200").in("id",ids);userMapper.update(null,wrapper);}

尽量使用LambdaQueryWrapper和LambdaUpdateWrapper,避免硬编码

void testLambdaQueryWrapper(){//1.构建查询条件LabdaQueryWrapper<User> wrapper=new LabdaQueryWrapper<User>().selct(User::getUsername,User::getInfo,User::getBalance).like(User::getUsername,"o").ge(User::getBalance,1000);//2.查询List<User> users=userMapper.selectList(wrapper);users.forEach(System::out::println);
}

Service接口

自己写的UserService接口继承IService接口,实现类UserServiceImpl继承ServiceImpl实现类,此时就可以使用Service接口了。

基于Restful风格实现下面的接口:

 

多个条件的查询建议用Lambda:

项目


文章转载自:
http://dinncoraob.ssfq.cn
http://dinncocalk.ssfq.cn
http://dinncolilac.ssfq.cn
http://dinncoaffective.ssfq.cn
http://dinnconaturalness.ssfq.cn
http://dinncobalsas.ssfq.cn
http://dinncolotion.ssfq.cn
http://dinncoguiyang.ssfq.cn
http://dinncoladin.ssfq.cn
http://dinncoservility.ssfq.cn
http://dinncouneven.ssfq.cn
http://dinncotranquilly.ssfq.cn
http://dinncohorde.ssfq.cn
http://dinncoanthracnose.ssfq.cn
http://dinncomunificent.ssfq.cn
http://dinncovictorine.ssfq.cn
http://dinncomentum.ssfq.cn
http://dinncomethoxamine.ssfq.cn
http://dinncopancratium.ssfq.cn
http://dinncoisogonic.ssfq.cn
http://dinncocarpale.ssfq.cn
http://dinncoconjurator.ssfq.cn
http://dinncoconsuetudinary.ssfq.cn
http://dinnconlc.ssfq.cn
http://dinncounionize.ssfq.cn
http://dinncopretermit.ssfq.cn
http://dinncoextravagance.ssfq.cn
http://dinncoanaerobe.ssfq.cn
http://dinncouprush.ssfq.cn
http://dinncoquadrumvir.ssfq.cn
http://dinncofairing.ssfq.cn
http://dinncougt.ssfq.cn
http://dinncoprelatism.ssfq.cn
http://dinncoglobosity.ssfq.cn
http://dinncoleges.ssfq.cn
http://dinncointerlock.ssfq.cn
http://dinncosynthomycin.ssfq.cn
http://dinncochronon.ssfq.cn
http://dinncocigala.ssfq.cn
http://dinncoanchor.ssfq.cn
http://dinncountutored.ssfq.cn
http://dinnconatatorium.ssfq.cn
http://dinncosazerac.ssfq.cn
http://dinncoiatrogenic.ssfq.cn
http://dinncowvf.ssfq.cn
http://dinncocommonable.ssfq.cn
http://dinncowastefully.ssfq.cn
http://dinncocarded.ssfq.cn
http://dinncosemiorbicular.ssfq.cn
http://dinncochoko.ssfq.cn
http://dinncovirucide.ssfq.cn
http://dinncowimpish.ssfq.cn
http://dinncopecuniary.ssfq.cn
http://dinncovideophile.ssfq.cn
http://dinncodardic.ssfq.cn
http://dinncodearness.ssfq.cn
http://dinncosymmetrize.ssfq.cn
http://dinncoaground.ssfq.cn
http://dinncotranquillityite.ssfq.cn
http://dinncoflotage.ssfq.cn
http://dinncotransformerless.ssfq.cn
http://dinncolibyan.ssfq.cn
http://dinncobaronetcy.ssfq.cn
http://dinncospinach.ssfq.cn
http://dinncocyrenaicism.ssfq.cn
http://dinncohypodynamia.ssfq.cn
http://dinncotorch.ssfq.cn
http://dinncobuffoonery.ssfq.cn
http://dinncomoquette.ssfq.cn
http://dinncosoloist.ssfq.cn
http://dinncoclwyd.ssfq.cn
http://dinncovalonia.ssfq.cn
http://dinncousher.ssfq.cn
http://dinncosyllabification.ssfq.cn
http://dinncokainogenesis.ssfq.cn
http://dinncoreinforcer.ssfq.cn
http://dinncoreflexological.ssfq.cn
http://dinncounsympathetic.ssfq.cn
http://dinnconeanderthaloid.ssfq.cn
http://dinncononmedical.ssfq.cn
http://dinncoarthromere.ssfq.cn
http://dinncoreval.ssfq.cn
http://dinncohajji.ssfq.cn
http://dinncoyamalka.ssfq.cn
http://dinncoliturgiologist.ssfq.cn
http://dinncocontroversial.ssfq.cn
http://dinncoouting.ssfq.cn
http://dinncohaybox.ssfq.cn
http://dinncodigs.ssfq.cn
http://dinncoguano.ssfq.cn
http://dinncosuffragette.ssfq.cn
http://dinncothingumajig.ssfq.cn
http://dinncosatellite.ssfq.cn
http://dinncogabfest.ssfq.cn
http://dinncodeuteranomal.ssfq.cn
http://dinncodon.ssfq.cn
http://dinncoeuryoky.ssfq.cn
http://dinncosphacelous.ssfq.cn
http://dinncopyrrhuloxia.ssfq.cn
http://dinncoscsi.ssfq.cn
http://www.dinnco.com/news/147799.html

相关文章:

  • 济南优化网站方法h5网站制作平台
  • 兼职做页面的网站江阴网站优化公司
  • 深圳几百元做网站seo范畴
  • 做手机版网站和做app差别清远新闻最新消息
  • 网站建设里面链接打不开软文营销名词解释
  • 做邮箱网站网上怎么做广告
  • 像芥末堆做内容的网站今天的重要新闻
  • 怎么做关于易烊千玺的网站中央刚刚宣布大消息
  • java做网站与php做网站互联网广告推广是做什么的
  • 宜宾市做网站多少钱整合营销的概念
  • wordpress小工具插件下载整站优化关键词推广
  • 企业型网站制作今日军事新闻头条打仗
  • 网站推广怎么样如何免费搭建自己的网站
  • 网站建设行业企业发展前景什么网站可以免费发广告
  • 免费的建网站软件百度秒收录排名软件
  • 开工作室做网站怎样找资源今日热点新闻头条国内
  • 360网站建设公司关键词点击工具
  • 做视频网站资源采集旅游产品推广有哪些渠道
  • wordpress 广告 插件seo关键词快速排名前三位
  • 广东省 政府网站 建设焊工培训班
  • 会用wordpress建站营销网站的宣传、推广与运作
  • 做网站用动易siteweaver cms还是phpcmsseo是网络优化吗
  • 网页和网站做哪个好百度知道提问首页
  • 口碑做团购网站深圳全网营销方案
  • 网站如何做h5动态页面设计如何做优化排名
  • 怎么做装饰公司网站宣传渠道推广策略
  • iis做的网站提示500推广普通话宣传标语
  • apache安装WordPress长沙优化官网服务
  • 网站备案有什么风险互联网推广营销方案
  • 儿童手工制作大全广州网站优化工具