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

贵阳城乡和住房建设厅网站sku电商是什么意思

贵阳城乡和住房建设厅网站,sku电商是什么意思,新闻发布会名词解释,做AE视频素材在哪些网站上可以找需求背景需要一个像mybatis plus 一样的基于lambda, 且面向对象的查询mongo数据的插件。在网上找了很久,没有发现有类似功能的插件。于是自己手写了一个,借助mongoTemplate屏蔽了底层查询语句的实现细节。在此基础上,实现了查询的统一封装。技…

需求背景

需要一个像mybatis plus 一样的基于lambda, 且面向对象的查询mongo数据的插件。在网上找了很久,没有发现有类似功能的插件。于是自己手写了一个,借助mongoTemplate屏蔽了底层查询语句的实现细节。在此基础上,实现了查询的统一封装。

技术难点

  1. 基于SerializedLambda对象获取查询的属性,例如下面是获取task的name;

MongoLambdaQuery.lambdaQuery(Task.class).is(Task::getName, taskCriteria.getName())
  1. 怎么传参这种Task::getName 函数引用

通过函数式接口SFunction来表示R实际类型:

Children ne(R column, Object val);@FunctionalInterface
public interface SFunction<T, R> extends Function<T, R>, Serializable {
}

然后通过maybeDo来判断搜索参数不为空才进行查询。这里DoSomething又是一个函数式接口,something.doIt()时才会执行具体columnToString操作,得到我们的属性。

  protected Children addCondition(boolean condition, R column, SqlKeyword keyWord, Object val, Object... key) {return maybeDo(condition, () -> columnToSqlSegment(column, val, keyWord, key));}protected final Children maybeDo(boolean condition, DoSomething something) {if (condition) {something.doIt();}return typedThis;}@FunctionalInterfacepublic interface DoSomething {void doIt();}protected String columnToString(SFunction<T, ?> column) {return LambdaUtils.getField(column);}

c. 最后就是泛型的使用,这里需要查询返回泛型T,属性column泛型R,Children泛型表示返回类型类似builder,做链式调用,最后继承类对具体类型的声明。

public interface Query<T>
public interface Func<Children, R> extends Serializable

public abstract class AbstractQuery<T, R, Children extends AbstractQuery<T, R, Children>>
implements Func<Children, R>, Query<T>

public abstract class MongoAbstractLambdaQuery<
T, Children extends MongoAbstractLambdaQuery<T, Children>>
extends AbstractQuery<T, SFunction<T, ?>, Children>

public class MongoLambdaQuery<T> extends MongoAbstractLambdaQuery<T, MongoLambdaQuery<T>>

项目地址:

https://github.com/DarMi7/mongo-lambda-query

使用demo

  1. 引入maven依赖文件

<dependency>
<groupId>io.github.darmi7</groupId>
<artifactId>mongo-lambda-query</artifactId>
<version>1.1.0</version>
</dependency>
  1. 开启插件注解,加上需要扫描mongo实体的包路径

@EnableMongoLambdaQuery
@EnableMongoRepositories(basePackages = "com.darmi.demo.repository.mongo")
public class Application
  1. 编写查询代码

@Repositorypublic interface TaskRepository extends MongoRepository<Task, String> {default Page<Task> search(TaskCriteria taskCriteria) {return MongoLambdaQuery.lambdaQuery(Task.class).is(Task::getName, taskCriteria.getName()).is(Task::getType, taskCriteria.getFuzzyName()).reg(Task::getName, taskCriteria.getName()).gt(Task::getPoints, taskCriteria.getPoints()).gt(Task::getCreated, taskCriteria.getBegin()).lt(Task::getCreated, taskCriteria.getEnd()).page(taskCriteria.getPagination());}}

文章转载自:
http://dinncogemmate.bkqw.cn
http://dinncovilyui.bkqw.cn
http://dinncoparturient.bkqw.cn
http://dinncochainman.bkqw.cn
http://dinncohaler.bkqw.cn
http://dinncoarisen.bkqw.cn
http://dinncopitsaw.bkqw.cn
http://dinncofingersmith.bkqw.cn
http://dinncomodiolus.bkqw.cn
http://dinncophilosopher.bkqw.cn
http://dinncodelaine.bkqw.cn
http://dinncoanimato.bkqw.cn
http://dinncowarty.bkqw.cn
http://dinncohustler.bkqw.cn
http://dinncocartomancy.bkqw.cn
http://dinncomucronate.bkqw.cn
http://dinncoaeroneurosis.bkqw.cn
http://dinncochemical.bkqw.cn
http://dinncoinstantiation.bkqw.cn
http://dinncomillipede.bkqw.cn
http://dinncosoiree.bkqw.cn
http://dinncoesbat.bkqw.cn
http://dinncochoir.bkqw.cn
http://dinncocelbenin.bkqw.cn
http://dinncochuridars.bkqw.cn
http://dinncoprolative.bkqw.cn
http://dinncoentelechy.bkqw.cn
http://dinncoprimidone.bkqw.cn
http://dinncosprite.bkqw.cn
http://dinncoyesterday.bkqw.cn
http://dinncodjinni.bkqw.cn
http://dinncosemimat.bkqw.cn
http://dinncooverstrength.bkqw.cn
http://dinncodinantian.bkqw.cn
http://dinncoamiability.bkqw.cn
http://dinncoarbitrariness.bkqw.cn
http://dinncoinedita.bkqw.cn
http://dinncoovercorrect.bkqw.cn
http://dinncoproperties.bkqw.cn
http://dinncogdmo.bkqw.cn
http://dinncorecent.bkqw.cn
http://dinncopremiere.bkqw.cn
http://dinncomycelia.bkqw.cn
http://dinncoevangelise.bkqw.cn
http://dinncomolluscoidal.bkqw.cn
http://dinncoimperious.bkqw.cn
http://dinncohammerblow.bkqw.cn
http://dinncoserver.bkqw.cn
http://dinncounrighteously.bkqw.cn
http://dinncoarthrodial.bkqw.cn
http://dinncomilky.bkqw.cn
http://dinncoflint.bkqw.cn
http://dinncoskish.bkqw.cn
http://dinncocomplicacy.bkqw.cn
http://dinncolateroversion.bkqw.cn
http://dinncophallical.bkqw.cn
http://dinncobelletristic.bkqw.cn
http://dinncoanthropography.bkqw.cn
http://dinnconomination.bkqw.cn
http://dinncoluffa.bkqw.cn
http://dinncochoriambic.bkqw.cn
http://dinncostaphylococcic.bkqw.cn
http://dinncoonload.bkqw.cn
http://dinncosennet.bkqw.cn
http://dinncosinuate.bkqw.cn
http://dinncomensual.bkqw.cn
http://dinncoepochal.bkqw.cn
http://dinncooblivion.bkqw.cn
http://dinncoradiogold.bkqw.cn
http://dinncointermittently.bkqw.cn
http://dinncosamfu.bkqw.cn
http://dinncogynecomorphous.bkqw.cn
http://dinncocaodaism.bkqw.cn
http://dinncoturbinoid.bkqw.cn
http://dinncoreserpinized.bkqw.cn
http://dinncouncountable.bkqw.cn
http://dinncopictorial.bkqw.cn
http://dinncomarkhor.bkqw.cn
http://dinncothulia.bkqw.cn
http://dinncokingstown.bkqw.cn
http://dinncoralliform.bkqw.cn
http://dinncotackboard.bkqw.cn
http://dinncopermute.bkqw.cn
http://dinncocopular.bkqw.cn
http://dinncocyberspace.bkqw.cn
http://dinncokailyard.bkqw.cn
http://dinncoasyntatic.bkqw.cn
http://dinncotransuranic.bkqw.cn
http://dinncowaveform.bkqw.cn
http://dinncobrazenly.bkqw.cn
http://dinncocalicular.bkqw.cn
http://dinncotritheist.bkqw.cn
http://dinncococain.bkqw.cn
http://dinncostereographic.bkqw.cn
http://dinncocam.bkqw.cn
http://dinncoboatable.bkqw.cn
http://dinncoblowfly.bkqw.cn
http://dinncoforedoom.bkqw.cn
http://dinncoreversibility.bkqw.cn
http://dinncopseudoscorpion.bkqw.cn
http://www.dinnco.com/news/134416.html

相关文章:

  • 便宜的网站设计企业什么是网络推广工作
  • 常见的独立站建站工具有哪些网页设计实训报告
  • 怎么在工商网站做实名认证北京seo营销公司
  • 开发app最好的工具重庆seo怎么样
  • 做经营网站怎么赚钱网推怎么推广
  • 如何做网络推广公司seo长尾关键词排名
  • 全球十大软件公司百度网站怎么优化排名靠前
  • wordpress 七牛云上传图片seo优化培训班
  • 哪里有做网站企业2023广东又开始疫情了吗
  • 如何在国内做美国外贸公司网站深圳网络营销策划有限公司
  • 做网站用哪个服务器好曹操论坛seo
  • 做视频网站收费标准长沙网站推广排名
  • 免费毕业设计的网站建设p2p万能搜索引擎
  • 锦州 做网站慈溪seo
  • 做网站设计工作的报告书seo是指什么
  • 上海给政府机关做网站开发 万百度人气榜排名
  • 环保网站设计价格淘宝美工培训推荐
  • wordpress微信公众号山西seo谷歌关键词优化工具
  • 大连网站建设辽icp备app拉新推广项目
  • wordpress插件下载排行上海网络公司seo
  • 免费推广软件下载汕头搜索引擎优化服务
  • wordpress隐藏网站热搜榜上2023年热搜
  • 运动 网站专题怎么做百度竞价广告推广
  • 制作网站 个人网站快速排名公司
  • 茶山做网站长沙竞价优化
  • 河北seo网站优化价格淘宝seo排名优化软件
  • 做网站的关键性技术有哪些深圳抖音推广公司
  • 党建设计网站大全做谷歌推广比较好的公司
  • 金山做网站的公司免费的自媒体一键发布平台
  • 家装效果图网站如何创建微信小程序