XMTT 6 ans auparavant
Parent
commit
898edf9e82

+ 5 - 5
src/main/java/com/ekexiu/project/bridge/collect/CollectDao.java

1
package com.ekexiu.project.bridge.collect;
1
package com.ekexiu.project.bridge.collect;
2

2

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

7
import org.jfw.apt.orm.annotation.dao.Batch;
3
import org.jfw.apt.orm.annotation.dao.Batch;
8
import org.jfw.apt.orm.annotation.dao.DAO;
4
import org.jfw.apt.orm.annotation.dao.DAO;
9
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
5
import org.jfw.apt.orm.annotation.dao.method.OrderBy;
14
import org.jfw.apt.orm.annotation.dao.param.In;
10
import org.jfw.apt.orm.annotation.dao.param.In;
15
import org.jfw.apt.orm.annotation.dao.param.LtEq;
11
import org.jfw.apt.orm.annotation.dao.param.LtEq;
16

12

13
import java.sql.Connection;
14
import java.sql.SQLException;
15
import java.util.List;
16

17
@DAO
17
@DAO
18
public interface CollectDao {
18
public interface CollectDao {
19

19

25
	int[] insertWaveDataItems(Connection con,List<WaveDataItem> items)throws SQLException;
25
	int[] insertWaveDataItems(Connection con,List<WaveDataItem> items)throws SQLException;
26
	
26
	
27
	@SelectList
27
	@SelectList
28
	@OrderBy("ORDER BY SEQ,CTIME,DIC,CID")
28
	@OrderBy("ORDER BY SEQ,CTIME,DID,CID")
29
	List<WaveDataItem> query(Connection con,@In String[] seq,@Alias("ctime") @GtEq String btime,@Alias("ctime") @LtEq String etime)throws SQLException;
29
	List<WaveDataItem> query(Connection con,@In String[] seq,@Alias("ctime") @GtEq String btime,@Alias("ctime") @LtEq String etime)throws SQLException;
30
	
30
	
31
	@SelectList
31
	@SelectList

+ 3 - 4
src/main/java/com/ekexiu/project/bridge/system/dao/UserDao.java

11
import org.jfw.apt.orm.annotation.dao.method.From;
11
import org.jfw.apt.orm.annotation.dao.method.From;
12
import org.jfw.apt.orm.annotation.dao.method.IncludeFixSet;
12
import org.jfw.apt.orm.annotation.dao.method.IncludeFixSet;
13
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
13
import org.jfw.apt.orm.annotation.dao.method.SetSentence;
14
import org.jfw.apt.orm.annotation.dao.method.Where;
15
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
14
import org.jfw.apt.orm.annotation.dao.method.operator.DeleteWith;
16
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
15
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
17
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
16
import org.jfw.apt.orm.annotation.dao.method.operator.PageSelect;
22
import org.jfw.apt.orm.annotation.dao.param.Like;
21
import org.jfw.apt.orm.annotation.dao.param.Like;
23
import org.jfw.apt.orm.annotation.dao.param.Set;
22
import org.jfw.apt.orm.annotation.dao.param.Set;
24
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
23
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
24
import org.jfw.apt.orm.annotation.dao.param.UnEquals;
25
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
25
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
26
import org.jfw.util.PageQueryResult;
26
import org.jfw.util.PageQueryResult;
27
27
61
	int ban(Connection con, @Set String modifier, String id) throws SQLException;
61
	int ban(Connection con, @Set String modifier, String id) throws SQLException;
62
62
63
	@PageSelect
63
	@PageSelect
64
	@Where("active = '1'")
65
	PageQueryResult<User> pageQuery(Connection con, @Nullable String account, @Nullable @Like String name, @Nullable @Like String comp, int pageSize,
64
	PageQueryResult<User> pageQuery(Connection con,@Nullable Boolean active, @Nullable String account, @Nullable @Like String name, @Nullable @Like String comp, int pageSize,
66
			int pageNo) throws SQLException;
65
			int pageNo) throws SQLException;
67
66
68
	@UpdateWith
67
	@UpdateWith
76
75
77
	@Nullable
76
	@Nullable
78
	@SelectOne
77
	@SelectOne
79
	User queryByAccount(Connection con, String account) throws SQLException;
78
	User queryByAccount(Connection con, String account, @Nullable @UnEquals String id) throws SQLException;
80
79
81
	@Insert
80
	@Insert
82
	@Batch
81
	@Batch

+ 5 - 5
src/main/java/com/ekexiu/project/bridge/system/service/SysService.java

128
128
129
	@Get
129
	@Get
130
	@Path("/check")
130
	@Path("/check")
131
	public Boolean check(@JdbcConn Connection con,String account)throws SQLException {
132
		return this.userDao.queryByAccount(con, accountid) == null;
131
	public Boolean check(@JdbcConn Connection con,String account,@Nullable String id)throws SQLException {
132
		return this.userDao.queryByAccount(con, account,idid)==null;
133
	}
133
	}
134
134
135
	@Get
135
	@Get
153
153
154
	@Get
154
	@Get
155
	@Path("/pq")
155
	@Path("/pq")
156
	public PageQueryResult<SessionUser> pageQuery(@JdbcConn Connection con, @Nullable String account, @Nullable String name, @Nullable String comp,
156
	public PageQueryResult<SessionUser> pageQuery(@JdbcConn Connection con,@Nullable Boolean active, @Nullable String account, @Nullable String name, @Nullable String comp,
157
			int pageSize, int pageNo) throws SQLException {
157
			int pageSize, int pageNo) throws SQLException {
158
		PageQueryResult<User> pageQueryResult = this.userDao.pageQuery(con, account, name == null ? null : "%" + name + "%",
158
		PageQueryResult<User> pageQueryResult = this.userDao.pageQuery(con,active, account, name == null ? null : "%" + name + "%",
159
				comp == null ? null : "%" + comp + "%", pageSize, pageNo);
159
				comp == null ? null : "%" + comp + "%", pageSize, pageNo);
160
		List<User> users = pageQueryResult.getData();
160
		List<User> users = pageQueryResult.getData();
161
		List<SessionUser> sessionUsers = new ArrayList<>();
161
		List<SessionUser> sessionUsers = new ArrayList<>();
197
    @Path("/resetPwMobile")
197
    @Path("/resetPwMobile")
198
    public Object[] resetpwMobile(@JdbcConn(false) Connection con, String account, @DefaultValue("false") boolean checkExists) throws Exception {
198
    public Object[] resetpwMobile(@JdbcConn(false) Connection con, String account, @DefaultValue("false") boolean checkExists) throws Exception {
199
		if (checkExists) {
199
		if (checkExists) {
200
			User user = this.userDao.queryByAccount(con, account);
200
			User user = this.userDao.queryByAccount(con, account,null);
201
			if (null == user) {
201
			if (null == user) {
202
				throw new JfwBaseException(-60000, "not found account");
202
				throw new JfwBaseException(-60000, "not found account");
203
			}
203
			}