Selaa lähdekoodia

--add column forShort;add queryAuthStatus();

zzy.zhiyuan.foxmail 8 vuotta sitten
vanhempi
commit
43a858d861

+ 9 - 2
src/main/java/com/ekexiu/portal/dao/OrgDao.java

19
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
19
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
20
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
20
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
21
import org.jfw.apt.orm.annotation.dao.param.Like;
21
import org.jfw.apt.orm.annotation.dao.param.Like;
22
import org.jfw.apt.orm.annotation.dao.param.Set;
22
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
23
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
23
import org.jfw.util.PageQueryResult;
24
import org.jfw.util.PageQueryResult;
24
25
33
	
34
	
34
	@UpdateWith
35
	@UpdateWith
35
	@From(Organization.class)
36
	@From(Organization.class)
36
	int updateIsJoin(Connection con,String id,String isJoin)throws SQLException;
37
	int updateIsJoin(Connection con,String id,@Set String isJoin)throws SQLException;
37
	
38
	
38
	@UpdateWith
39
	@UpdateWith
39
	@From(Organization.class)
40
	@From(Organization.class)
40
	int updateAuthStatus(Connection con,String id,String authStatus)throws SQLException;
41
	int updateAuthStatus(Connection con,String id,@Set String authStatus)throws SQLException;
41
	
42
	
42
	@Dynamic
43
	@Dynamic
43
	@Update
44
	@Update
59
	@From(Organization.class)
60
	@From(Organization.class)
60
	String queryByName(Connection con,String name)throws SQLException;
61
	String queryByName(Connection con,String name)throws SQLException;
61
	
62
	
63
	@Nullable
64
	@QueryVal
65
	@Column(handlerClass=StringHandler.class,value="auth_status")
66
	@From(Organization.class)
67
	String queryAuthStatus(Connection con,String id)throws SQLException;
68
	
62
	@PageSelect
69
	@PageSelect
63
	PageQueryResult<Organization> query(Connection con,@Nullable  @Like String name,@Nullable String orgType,int pageSize,int pageNo) throws SQLException;
70
	PageQueryResult<Organization> query(Connection con,@Nullable  @Like String name,@Nullable String orgType,int pageSize,int pageNo) throws SQLException;
64
71

+ 11 - 0
src/main/java/com/ekexiu/portal/po/Organization.java

18
@Table
18
@Table
19
public class Organization extends BaseOrganization implements CreateTimeSupported,ModifyTimeSupported,DescpSupported{
19
public class Organization extends BaseOrganization implements CreateTimeSupported,ModifyTimeSupported,DescpSupported{
20
20
21
	/**
22
	 * 企业简称
23
	 */
24
	private String forShort;
21
	/**
25
	/**
22
	 * 企业官网
26
	 * 企业官网
23
	 */
27
	 */
50
	private String createTime;
54
	private String createTime;
51
	private String modifyTime;
55
	private String modifyTime;
52
56
57
	@Column(value=DE.String_de,dbType="VARCHAR(20)")
58
	public String getForShort() {
59
		return forShort;
60
	}
61
	public void setForShort(String forShort) {
62
		this.forShort = forShort;
63
	}
53
	@Column(DE.String_de)
64
	@Column(DE.String_de)
54
	public String getOrgUrl() {
65
	public String getOrgUrl() {
55
		return orgUrl;
66
		return orgUrl;

+ 12 - 5
src/main/java/com/ekexiu/portal/service/OrgService.java

11
import org.jfw.apt.web.annotation.Path;
11
import org.jfw.apt.web.annotation.Path;
12
import org.jfw.apt.web.annotation.operate.Get;
12
import org.jfw.apt.web.annotation.operate.Get;
13
import org.jfw.apt.web.annotation.operate.Post;
13
import org.jfw.apt.web.annotation.operate.Post;
14
import org.jfw.apt.web.annotation.operate.Put;
15
import org.jfw.apt.web.annotation.param.JdbcConn;
14
import org.jfw.apt.web.annotation.param.JdbcConn;
16
import org.jfw.apt.web.annotation.param.PathVar;
15
import org.jfw.apt.web.annotation.param.PathVar;
17
import org.jfw.apt.web.annotation.param.RequestBody;
18
import org.jfw.util.StringUtil;
16
import org.jfw.util.StringUtil;
19
17
20
import com.ekexiu.portal.dao.OrgDao;
18
import com.ekexiu.portal.dao.OrgDao;
76
	}
74
	}
77
	
75
	
78
	
76
	
79
	@Put
80
	@Path
81
	public void update(@JdbcConn(true) Connection con,@RequestBody Organization organization) throws SQLException{
77
	@Post
78
	@Path("/update")
79
	public void update(@JdbcConn(true) Connection con,Organization organization,@Nullable String fn) throws SQLException, IOException{
80
		if(fn != null){
81
			this.imageService.saveOrgLogo(organization.getId(), fn);
82
		}
82
		this.orgDao.update(con, organization);
83
		this.orgDao.update(con, organization);
83
	}
84
	}
84
	
85
	
88
		return this.orgDao.query(con, id);
89
		return this.orgDao.query(con, id);
89
	}
90
	}
90
	
91
	
92
	@Get
93
	@Path("/authStatus")
94
	public String queryAuthStatus(@JdbcConn Connection con,String id)throws SQLException{
95
		return this.orgDao.queryAuthStatus(con, id);
96
	}
97
	
91
	@Get
98
	@Get
92
	@Path("/qa")
99
	@Path("/qa")
93
	public List<Organization> query(@JdbcConn(false) Connection con )throws SQLException{
100
	public List<Organization> query(@JdbcConn(false) Connection con )throws SQLException{