yunkai 8 years ago
parent
commit
86f6631dd7

+ 26 - 0
src/main/java/com/ekexiu/console/system/dao/ViewAllcustomerDao.java

@ -0,0 +1,26 @@
1
package com.ekexiu.console.system.dao;
2

3
import com.ekexiu.console.system.po.ViewAllcustomer;
4

5
import org.jfw.apt.annotation.Nullable;
6
import org.jfw.apt.orm.annotation.dao.DAO;
7
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
8
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
9
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
10
import org.jfw.apt.orm.annotation.dao.param.Like;
11
import org.jfw.util.PageQueryResult;
12

13
import java.sql.Connection;
14
import java.sql.SQLException;
15

16
@DAO
17
public interface ViewAllcustomerDao {
18
	@Nullable
19
	@SelectOne
20
	ViewAllcustomer query(Connection con, String id) throws SQLException;
21
	
22
	@PageSelect
23
	@OrderBy(" ORDER BY create_time")
24
	PageQueryResult<ViewAllcustomer> query(Connection con, @Like String name, @Like String address, @Like String orgname, @Nullable Integer sendMailStatus, int pageSize, int pageNo) throws SQLException;
25

26
}

+ 200 - 0
src/main/java/com/ekexiu/console/system/po/ViewAllcustomer.java

@ -0,0 +1,200 @@
1
package com.ekexiu.console.system.po;
2

3
import com.ekexiu.console.basepo.CreateTimeSupported;
4
import org.jfw.apt.orm.annotation.entry.Column;
5
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
6
import org.jfw.apt.orm.annotation.entry.Table;
7
import org.jfw.apt.orm.core.enums.DE;
8

9
@PrimaryKey("id")
10
@Table("view_allcustomer")
11
public class ViewAllcustomer implements CreateTimeSupported {
12
	private String id;
13
	private String email;
14
	private String phone;
15
	private String mobilePhone;
16
	private String createTime;
17
	private String activeTime;
18
	private Integer sendMailStatus;//send_mail_status;数据库带下横线的要去掉然后用横线后的单词第一个字母大写,int类型代表不能为空,Integer类型是可以为空,下面都要设定这个类型,在查询条件那个地方还要设定可以为空
19
	private String inviteCode;
20
	private String inviterId;
21
	private String userType;
22
	private String industry;
23
	private String department;
24
	private String office;
25
	private String orgId;
26
	private String title;
27
	private String name;
28
	private String address;
29
	private Integer authentication;
30
	private String authType;
31
	private Integer authStatus;
32
	private Integer sortFirst;
33
	private Integer authStatusExpert;
34
	private String orgname;
35
//String_de大写的是允许为空,小写的是不允许为空
36
	@Column(DE.String_de)
37
	public String getId() {
38
		return id;
39
	}
40
	public void setId(String id) {
41
		this.id = id;
42
	}
43
	@Column(DE.String_de)
44
	public String getEmail() {
45
		return email;
46
	}
47

48
	public void setEmail(String email) {
49
		this.email = email;
50
	}
51
	@Column(DE.String_de)
52
	public String getPhone() {
53
		return phone;
54
	}
55

56
	public void setPhone(String phone) {
57
		this.phone = phone;
58
	}
59
	@Column(DE.String_de)
60
	public String getMobilePhone() {
61
		return mobilePhone;
62
	}
63

64
	public void setMobilePhone(String mobilePhone) {
65
		this.mobilePhone = mobilePhone;
66
	}
67
	@Column(DE.String_de)
68
	public String getCreateTime() {
69
		return createTime;
70
	}
71
	public void setCreateTime(String createTime) {
72
		this.createTime = createTime;
73
	}
74
	@Column(DE.String_de)
75
	public String getActiveTime() {
76
		return activeTime;
77
	}
78
	public void setActiveTime(String activeTime) {
79
		this.activeTime = activeTime;
80
	}
81
	@Column(DE.Int_de)
82
	public Integer getSendMailStatus() {
83
		return sendMailStatus;
84
	}
85
	public void setSendMailStatus(Integer sendMailStatus) {
86
		this.sendMailStatus = sendMailStatus;
87
	}
88
	@Column(DE.String_de)
89
	public String getInviteCode() {
90
		return inviteCode;
91
	}
92
	public void setInviteCode(String inviteCode) {
93
		this.inviteCode = inviteCode;
94
	}
95
	@Column(DE.String_de)
96
	public String getInviterId() {
97
		return inviterId;
98
	}
99
	public void setInviterId(String inviterId) {
100
		this.inviterId = inviterId;
101
	}
102
	@Column(DE.String_de)
103
	public String getUserType() {
104
		return userType;
105
	}
106
	public void setUserType(String userType) {
107
		this.userType = userType;
108
	}
109
	@Column(DE.String_de)
110
	public String getIndustry() {
111
		return industry;
112
	}
113
	public void setIndustry(String industry) {
114
		this.industry = industry;
115
	}
116
	@Column(DE.String_de)
117
	public String getDepartment() {
118
		return department;
119
	}
120
	public void setDepartment(String department) {
121
		this.department = department;
122
	}
123
	@Column(DE.String_de)
124
	public String getOffice() {
125
		return office;
126
	}
127
	public void setOffice(String office) {
128
		this.office = office;
129
	}
130
	@Column(DE.String_de)
131
	public String getOrgId() {
132
		return orgId;
133
	}
134
	public void setOrgId(String orgId) {
135
		this.orgId = orgId;
136
	}
137
	@Column(DE.String_de)
138
	public String getTitle() {
139
		return title;
140
	}
141
	public void setTitle(String title) {
142
		this.title = title;
143
	}
144
	@Column(DE.String_de)
145
	public String getName() {
146
		return name;
147
	}
148
	public void setName(String name) {
149
		this.name = name;
150
	}
151
	@Column(DE.String_de)
152
	public String getAddress() {
153
		return address;
154
	}
155
	public void setAddress(String address) {
156
		this.address = address;
157
	}
158
	@Column(DE.Int_de)
159
	public Integer getAuthentication() {
160
		return authentication;
161
	}
162
	public void setAuthentication(Integer authentication) {
163
		this.authentication = authentication;
164
	}
165
	@Column(DE.String_de)
166
	public String getAuthType() {
167
		return authType;
168
	}
169
	public void setAuthType(String authType) {
170
		this.authType = authType;
171
	}
172
	@Column(DE.Int_de)
173
	public Integer getAuthStatus() {
174
		return authStatus;
175
	}
176
	public void setAuthStatus(Integer authStatus) {
177
		this.authStatus = authStatus;
178
	}
179
	@Column(DE.Int_de)
180
	public Integer getSortFirst() {
181
		return sortFirst;
182
	}
183
	public void setSortFirst(Integer sortFirst) {
184
		this.sortFirst = sortFirst;
185
	}
186
	@Column(DE.Int_de)
187
	public Integer getAuthStatusExpert() {
188
		return authStatusExpert;
189
	}
190
	public void setAuthStatusExpert(Integer authStatusExpert) {
191
		this.authStatusExpert = authStatusExpert;
192
	}
193
	@Column(DE.String_de)
194
	public String getOrgname() {
195
		return orgname;
196
	}
197
	public void setOrgname(String orgname) {
198
		this.orgname = orgname;
199
	}
200
}

+ 57 - 0
src/main/java/com/ekexiu/console/system/service/ViewAllcustomerService.java

@ -0,0 +1,57 @@
1
package com.ekexiu.console.system.service;
2

3
import com.ekexiu.console.system.dao.ViewAllcustomerDao;
4
import com.ekexiu.console.system.po.ViewAllcustomer;
5

6
import org.jfw.apt.annotation.Autowrie;
7
import org.jfw.apt.annotation.DefaultValue;
8
import org.jfw.apt.annotation.Nullable;
9
import org.jfw.apt.orm.annotation.dao.param.Like;
10
import org.jfw.apt.web.annotation.Path;
11
import org.jfw.apt.web.annotation.operate.Get;
12
import org.jfw.apt.web.annotation.param.JdbcConn;
13
import org.jfw.apt.web.annotation.param.PathVar;
14
import org.jfw.util.PageQueryResult;
15

16
import java.sql.Connection;
17
import java.sql.SQLException;
18

19
@Path("/sys/viewallcustomer")
20
public class ViewAllcustomerService {
21
	@Autowrie
22
	private ViewAllcustomerDao viewAllcustomerDao;
23

24
	public ViewAllcustomerDao getViewAllcustomerDao() {
25
		return viewAllcustomerDao;
26
	}
27

28
	public void setViewAllcustomerDao(ViewAllcustomerDao viewAllcustomerDao) {
29
		this.viewAllcustomerDao = viewAllcustomerDao;
30
	}
31
	@Get
32
	@Path("/pq")
33
	public PageQueryResult<ViewAllcustomer> pageQuery(@JdbcConn Connection con, @Nullable @Like String name, @Nullable @Like String address, @Nullable @Like String orgname, @Nullable Integer sendMailStatus, @DefaultValue("1") int pageNo, @DefaultValue("10") int pageSize)throws SQLException{
34
		String Cname ="%";
35
		if(name!=null)
36
		{
37
			Cname="%"+name+"%";
38
		}
39
		String Caddress ="%";
40
		if(address!=null)
41
		{
42
			Caddress="%"+address+"%";
43
		}
44
		String Corgname ="%";
45
		if(orgname!=null)
46
		{
47
			Corgname="%"+orgname+"%";
48
		}
49
		return this.viewAllcustomerDao.query(con, Cname, Caddress, Corgname, sendMailStatus, pageSize, pageNo);
50
	}
51

52
	@Get
53
	@Path("/id/{id}")
54
	public ViewAllcustomer query(@JdbcConn Connection con, @PathVar String id)throws SQLException{
55
		return this.viewAllcustomerDao.query(con, id);
56
	}	
57
}