XMTT 6 years ago
parent
commit
4e44e0ff87

+ 10 - 5
src/main/java/com/ekexiu/portal/platform/Console.java

@ -1,11 +1,14 @@
1 1
package com.ekexiu.portal.platform;
2 2
3 3
import org.jfw.apt.annotation.Autowrie;
4
import org.jfw.apt.annotation.DefaultValue;
5
import org.jfw.apt.annotation.Nullable;
4 6
import org.jfw.apt.web.annotation.Path;
5 7
import org.jfw.apt.web.annotation.operate.Get;
6 8
import org.jfw.apt.web.annotation.operate.Post;
7 9
import org.jfw.apt.web.annotation.param.JdbcConn;
8 10
import org.jfw.apt.web.annotation.param.PathVar;
11
import org.jfw.util.PageQueryResult;
9 12
import org.jfw.util.StringUtil;
10 13
11 14
import java.sql.Connection;
@ -72,7 +75,7 @@ public class Console {
72 75
    }
73 76
74 77
    @Path("/editCheck")
75
    @Get
78
    @Post
76 79
    public int editCheck(@JdbcConn Connection con, String id, String name, String email) throws SQLException {
77 80
        PlatformUser platformUser = this.platformDao.queryUser(con, email);
78 81
        if ((platformUser != null)&&(!Objects.equals(platformUser.getId(), id))) {
@ -94,11 +97,13 @@ public class Console {
94 97
        map.put("id", id);
95 98
        map.put("email", platformUser.getEmail());
96 99
        map.put("name", platformInfo.getName());
100
        map.put("state", platformUser.getState());
97 101
        return map;
98 102
    }
99 103
100
101
102
103
104
    @Get
105
    @Path("/pq")
106
    public PageQueryResult<PlatformInfo> query(@JdbcConn Connection con, @Nullable String name, @Nullable String bt, @Nullable String et, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize) throws SQLException {
107
        return this.platformDao.query(con, name == null ? null : "%" + name + "%", bt == null ? null : bt + "000000", et == null ? null : et + "235959", pageSize, pageNo);
108
    }
104 109
}

+ 7 - 0
src/main/java/com/ekexiu/portal/platform/PlatformDao.java

@ -18,7 +18,10 @@ import org.jfw.apt.orm.annotation.dao.method.operator.Update;
18 18
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
19 19
import org.jfw.apt.orm.annotation.dao.param.Alias;
20 20
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
21
import org.jfw.apt.orm.annotation.dao.param.GtEq;
21 22
import org.jfw.apt.orm.annotation.dao.param.In;
23
import org.jfw.apt.orm.annotation.dao.param.Like;
24
import org.jfw.apt.orm.annotation.dao.param.LtEq;
22 25
import org.jfw.apt.orm.annotation.dao.param.Set;
23 26
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
24 27
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
@ -192,4 +195,8 @@ public interface PlatformDao {
192 195
	@Nullable
193 196
	@SelectOne
194 197
	PlatformInfo queryInfoByName(Connection con, String name) throws SQLException;
198

199
	@PageQuery
200
	@OrderBy(" ORDER BY create_time DESC NULLS LAST")
201
	PageQueryResult<PlatformInfo> query(Connection con, @Nullable @Like String name, @Nullable @GtEq @Alias("createTime") String bt, @Nullable @Alias("createTime") @LtEq String et, int pageSize, int pageNo) throws SQLException;
195 202
}