Git Product home page Git Product logo

smartxmlsql's Introduction

SmartXmlSql

XML配置SQL


使用
SqlGenerator.Instance.Builder();传入参数值


SmartXmlSqlMaper.xsd 提示xml关键字


关键字说明

关键字 含义 使用 说明 样例
Statement 一个SQL语句节点 Id属性对应调用方法;DB属性对应数据库名称;Acess对应SQL语句类型(select,update,bath);Key对应实体关系 Key="Entity",用实体全部属性生成SQL,需要配置替换SQL;Key="Array",生成in的部分,方法传入数组,需要配置替换SQL;Key = "List",生成批量SQL语句,需要配置插入SQL的字段和参数,这样可以取实体的部分属性;Key ="Batch"生成批量语句,此时会用实体的全部属性生成,需要配置替换SQL。Key不是以上关键字,则按照参数匹配。 需要配置的替换SQL形如:insert into kk (<$p>) values(@p)
Where 生成条件语句 该关键字下有sql部分语句返回 则会增加where同时移除or,and开头部分
Choose 选择部分 子节点必须是When,Othersize,并且要同时存在,可以有default节点 子节点相当于IF ...else
When 选择 属性可以是IsNotEmpty或者Dynamic,IsNotEmpty判断实体属性是否为空;Dynamic为一般判断 为真则使用SQL部分,否则使用Othersize节点的SQL
Othersize 选择 When为假则用它的SQL部分
Switch 多项选择 使用子节点为真的部分SQL,子节点只能是Case,Default
Case 多项中的一项 为真则使用它的SQL部分
Set 更新语句的设置 将节点下的SQL加入SQL
Default 直接使用该节点 SQL语句直接拼接加入
Page 使用分页 该节点必须包含pagesize,pagenum这2个变量表达式 (pagenum-1)*pageSize

smartxmlsql's People

Contributors

jinyuttt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.