Browse Source

team index search

XMTT 5 years ago
parent
commit
d187befbdd

+ 8 - 0
src/main/java/com/ekexiu/portal/team/TeamDao.java

6
import org.jfw.apt.orm.annotation.dao.DAO;
6
import org.jfw.apt.orm.annotation.dao.DAO;
7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
8
import org.jfw.apt.orm.annotation.dao.method.From;
8
import org.jfw.apt.orm.annotation.dao.method.From;
9
import org.jfw.apt.orm.annotation.dao.method.LimitColumn;
9
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
10
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
10
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
11
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
11
import org.jfw.apt.orm.annotation.dao.method.Where;
12
import org.jfw.apt.orm.annotation.dao.method.Where;
12
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
13
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
13
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
14
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
15
import org.jfw.apt.orm.annotation.dao.method.operator.LimitSelect;
14
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
16
import org.jfw.apt.orm.annotation.dao.method.operator.PageQuery;
15
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
17
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
16
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
18
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
150
    @Column(value = "COUNT(1)", handlerClass = LongHandler.class)
152
    @Column(value = "COUNT(1)", handlerClass = LongHandler.class)
151
    @From(TeamPro.class)
153
    @From(TeamPro.class)
152
    long countPro(Connection con, String id) throws SQLException;
154
    long countPro(Connection con, String id) throws SQLException;
155
156
    @LimitSelect
157
    @Where("STATE='3'")
158
    @OrderBy(cols = { @LimitColumn(value = "createTime", asc = false),
159
            @LimitColumn(value = "id", asc = false) }, value = "")
160
    List<Team> indexSearch(Connection con, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"name like ?", "org_name like ?", "subject like ?", "industry like ?"},isAnd = false) String key, String createTime, String id, int rows) throws SQLException;
153
}
161
}

+ 11 - 0
src/main/java/com/ekexiu/portal/team/TeamService.java

251
        return teamDao.pageQuery(con, status, key == null ? null : "%" + key + "%", subject == null ? null : "%" + subject + "%", industry == null ? null : "%" + industry + "%", city == null ? null : "%" + city + "%", pageSize, pageNo);
251
        return teamDao.pageQuery(con, status, key == null ? null : "%" + key + "%", subject == null ? null : "%" + subject + "%", industry == null ? null : "%" + industry + "%", city == null ? null : "%" + city + "%", pageSize, pageNo);
252
    }
252
    }
253
253
254
    @Get
255
    @Path("/index/search")
256
    public List<Team> indexSeach(@JdbcConn Connection con, @Nullable String key,
257
                                 @DefaultValue("\"9\"") String time, @DefaultValue("\"G\"") String id, int rows) throws SQLException {
258
        if (key != null) {
259
            key = "%" + key + "%";
260
        }
261
        return teamDao.indexSearch(con, key, time, id, rows);
262
    }
263
264
254
    @Get
265
    @Get
255
    @Path("/myTeam")
266
    @Path("/myTeam")
256
    public PageQueryResult<Team> pageQuery(@JdbcConn Connection con,@Nullable String[] status, String professor, int pageSize, int pageNo) throws SQLException {
267
    public PageQueryResult<Team> pageQuery(@JdbcConn Connection con,@Nullable String[] status, String professor, int pageSize, int pageNo) throws SQLException {