Skip to content

Commit 02f9220

Browse files
authored
Merge pull request hs-web#8 from hs-web/2.2-SNAPSHOT
2.2 snapshot
2 parents 2da4b3b + a957d4d commit 02f9220

File tree

159 files changed

+4648
-1500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

159 files changed

+4648
-1500
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 后台管理基础框架
1+
## hsweb后台管理基础框架
22

33
[![Build Status](https://travis-ci.org/hs-web/hsweb-framework.svg?branch=master)](https://travis-ci.org/hs-web/hsweb-framework)
44
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html)
@@ -37,6 +37,7 @@
3737
7. 数据库支持 mysql,oracle,h2.
3838
8. websocket支持.
3939
9. 定时调度支持,可在页面配置定时任务,编写任务脚本执行。
40+
10. **强大的dsl查询方式,复杂条件一句生成**
4041

4142
### 演示
4243
1. 示例:[demo.hsweb.me](http://demo.hsweb.me)

doc/2.API.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# hsweb 常用api
2+
3+
## CRUD
4+
[如何创建通用crud](./create-crud.md)
5+
6+
查询:
7+
```java
8+
9+
import static MyBean.Property.*; //属性名
10+
myService.createQuery()
11+
.where(name,"admin")
12+
.or(name,"root")
13+
.list(); //list(), list(0,10), single(),total();
14+
//or
15+
myService.createQuery().fromBean(myBean)
16+
.where(name)
17+
.or(name)
18+
.list();
19+
20+
// 复杂查询条件
21+
// 等同sql where name is not null and (name like '李%' or name like '周%') and age >0
22+
// 参数全部预编译,不用担心注入
23+
myService.createQuery()
24+
.where().notNull(name)
25+
.nest().or().like$(name,"").or().like$(name,"").end()
26+
.and().gt(age,10).list();
27+
28+
//自定义sql条件
29+
30+
myService.createQuery()
31+
.where()
32+
.and().sql("name !=''")
33+
.or().sql("age < #{age}",{age:10})// 使用预编译方式
34+
.or().sql("age = #{[0]}",Arrays.asList(20))//获取集合参数
35+
.or().sql("age > ? and (age <?)",60,100)//使用参数列表方式
36+
.list();
37+
```
38+
39+
修改,支持和query一致的条件
40+
```java
41+
import static MyBean.Property.*;
42+
myService.createUpdate()
43+
.set(status,1)
44+
.where(id,"data-id").exec();
45+
// or
46+
myService.createUpdate(myBean).fromBean().where(id).exec();
47+
```
48+
49+
删除,支持和query一致的条件
50+
```java
51+
import static MyBean.Property.*;
52+
myService.createDelete().where(id,"data-id").exec();
53+
```

hsweb-web-bean/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>hsweb-framework</artifactId>
77
<groupId>org.hsweb</groupId>
8-
<version>2.1-SNAPSHOT</version>
8+
<version>2.2-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111
<artifactId>hsweb-web-bean</artifactId>
@@ -18,7 +18,7 @@
1818
</dependency>
1919
<dependency>
2020
<groupId>org.hsweb</groupId>
21-
<artifactId>hsweb-easy-orm</artifactId>
21+
<artifactId>hsweb-easy-orm-rdb</artifactId>
2222
</dependency>
2323
<dependency>
2424
<groupId>org.hsweb</groupId>

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/DeleteParam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Created by zhouhao on 16-4-19.
55
*/
6-
public class DeleteParam extends SqlParam<DeleteParam> {
6+
public class DeleteParam extends SqlParam {
77
public static DeleteParam build() {
88
return new DeleteParam();
99
}

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/InsertParam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Created by zhouhao on 16-4-19.
55
*/
6-
public class InsertParam<T> extends org.hsweb.ezorm.param.InsertParam<T> {
6+
public class InsertParam<T> extends org.hsweb.ezorm.core.param.InsertParam<T> {
77

88
public InsertParam() {
99
}

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/QueryParam.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
package org.hsweb.web.bean.common;
22

33

4-
import org.hsweb.ezorm.param.Term;
5-
import org.hsweb.ezorm.param.TermType;
4+
import org.hsweb.ezorm.core.param.Term;
5+
import org.hsweb.ezorm.core.param.TermType;
66

77
import java.io.Serializable;
88
import java.util.HashMap;
99
import java.util.List;
1010
import java.util.Map;
1111

12-
/**
13-
* Created by 浩 on 2016-01-16 0016.
14-
*/
15-
public class QueryParam extends org.hsweb.ezorm.param.QueryParam<QueryParam> implements Serializable {
16-
private static final long serialVersionUID = 7941767360194797891L;
17-
private Map<String, Object> param = new HashMap<>();
12+
public class QueryParam extends org.hsweb.ezorm.core.param.QueryParam implements Serializable {
13+
private static final long serialVersionUID = 7941767360194797891L;
14+
private Map<String, Object> param = new HashMap<>();
1815

1916
public QueryParam noPaging() {
2017
setPaging(false);

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/Sort.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/SqlParam.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Created by zhouhao on 16-4-19.
1010
*/
11-
public class SqlParam<R extends SqlParam> extends org.hsweb.ezorm.param.SqlParam<R> {
11+
public class SqlParam extends org.hsweb.ezorm.core.param.Param {
1212

1313
protected Map<String, Object> params = new HashMap<>();
1414

@@ -26,6 +26,6 @@ public String toString() {
2626
}
2727

2828
public static SqlParam build() {
29-
return new SqlParam<>();
29+
return new SqlParam();
3030
}
3131
}

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/UpdateMapParam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public UpdateMapParam(Map<String, Object> data) {
1616
}
1717

1818
public UpdateMapParam set(String key, Object value) {
19-
this.getData().put(key, value);
19+
((Map<String, Object>) this.getData()).put(key, value);
2020
return this;
2121
}
2222

hsweb-web-bean/src/main/java/org/hsweb/web/bean/common/UpdateParam.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Created by zhouhao on 16-4-19.
55
*/
6-
public class UpdateParam<T> extends org.hsweb.ezorm.param.UpdateParam<T,UpdateParam<T>> {
6+
public class UpdateParam<T> extends org.hsweb.ezorm.core.param.UpdateParam<T> {
77

88
public UpdateParam() {
99
}

0 commit comments

Comments
 (0)