Selaa lähdekoodia

--add queryOne();add query();

zzy.zhiyuan.foxmail 8 vuotta sitten
vanhempi
commit
507683db71

+ 5 - 0
src/main/java/com/ekexiu/portal/dao/OrgRetrieveDao.java

@ -2,10 +2,12 @@ package com.ekexiu.portal.dao;
2 2

3 3
import java.sql.Connection;
4 4
import java.sql.SQLException;
5
import java.util.List;
5 6

6 7
import org.jfw.apt.annotation.Nullable;
7 8
import org.jfw.apt.orm.annotation.dao.DAO;
8 9
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
10
import org.jfw.apt.orm.annotation.dao.method.operator.SelectList;
9 11
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
10 12

11 13
import com.ekexiu.portal.po.OrgRetrieve;
@ -18,4 +20,7 @@ public abstract class OrgRetrieveDao {
18 20
	@SelectOne
19 21
	@Nullable
20 22
	public abstract OrgRetrieve queryOne(Connection con,String id)throws SQLException;
23
	
24
	@SelectList
25
	public abstract List<OrgRetrieve> query(Connection con)throws SQLException;
21 26
}

+ 14 - 0
src/main/java/com/ekexiu/portal/service/OrgRetrieveService.java

@ -3,9 +3,11 @@ package com.ekexiu.portal.service;
3 3
import java.io.IOException;
4 4
import java.sql.Connection;
5 5
import java.sql.SQLException;
6
import java.util.List;
6 7

7 8
import org.jfw.apt.annotation.Autowrie;
8 9
import org.jfw.apt.web.annotation.Path;
10
import org.jfw.apt.web.annotation.operate.Get;
9 11
import org.jfw.apt.web.annotation.operate.Post;
10 12
import org.jfw.apt.web.annotation.param.JdbcConn;
11 13
import org.jfw.util.StringUtil;
@ -58,4 +60,16 @@ public class OrgRetrieveService {
58 60
			this.orgRetrieveImgService.insertImg(con, id, fn);
59 61
		}
60 62
	}
63
	
64
	@Get
65
	@Path("/qa")
66
	public List<OrgRetrieve> query(@JdbcConn Connection con)throws SQLException{
67
		return this.orgRetrieveDao.query(con);
68
	}
69
	
70
	@Get
71
	@Path("/queryOne/{id}")
72
	public OrgRetrieve queryOne(@JdbcConn Connection con,String id)throws SQLException{
73
		return this.orgRetrieveDao.queryOne(con, id);
74
	}
61 75
}