XMTT 6 gadi atpakaļ
vecāks
revīzija
ab27f4db15

+ 1 - 2
src/main/java/com/ekexiu/project/bridge/resource/dao/BridgeDao.java

@ -15,7 +15,6 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
15 15
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
16 16
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
17 17
import org.jfw.apt.orm.annotation.dao.param.GroupSqlColumn;
18
import org.jfw.apt.orm.annotation.dao.param.Like;
19 18
import org.jfw.apt.orm.annotation.dao.param.Set;
20 19
import org.jfw.apt.orm.annotation.dao.param.SqlColumn;
21 20
import org.jfw.apt.orm.annotation.dao.param.UnEquals;
@ -56,7 +55,7 @@ public interface BridgeDao {
56 55
57 56
    @PageSelect
58 57
    @OrderBy("ORDER BY CODE")
59
    PageQueryResult<Bridge> pageQuery(Connection con, @Nullable Boolean active, @Nullable @Like String name, @Nullable String code, int pageSize, int pageNo) throws SQLException;
58
    PageQueryResult<Bridge> pageQuery(Connection con, @Nullable Boolean active, @Nullable @GroupSqlColumn(handlerClass = StringHandler.class, value = {"NAME LIKE ?", "SHORT_NAME LIKE ?"}, isAnd = false) String name, @Nullable String code, int pageSize, int pageNo) throws SQLException;
60 59
61 60
    @PageSelect
62 61
    @OrderBy("ORDER BY CODE")

+ 1 - 1
src/main/java/com/ekexiu/project/bridge/resource/dao/BridgeServerDao.java

@ -69,7 +69,7 @@ public interface BridgeServerDao {
69 69
70 70
    @PageSelect
71 71
    @OrderBy("ORDER BY CODE")
72
    PageQueryResult<BridgeServer> pageQuery(Connection con, @Nullable Boolean active, @Nullable @SqlColumn(handlerClass = StringHandler.class, value = {"BRIDGE_ID IN (SELECT ID FROM BRIDGE WHERE CODE = ?)"}) String bridgeCode, @Nullable String code, int pageSize, int pageNo) throws SQLException;
72
    PageQueryResult<BridgeServer> pageQuery(Connection con, @Nullable Boolean active, @Nullable @SqlColumn(handlerClass = StringHandler.class, value = {"BRIDGE_ID IN (SELECT ID FROM BRIDGE WHERE SHORT_NAME LIKE ?)"}) String key, @Nullable String code, int pageSize, int pageNo) throws SQLException;
73 73
74 74
    @SelectList
75 75
    List<BridgeServer> queryByBridge(Connection con,@Nullable Boolean active, String bridgeId) throws SQLException;

+ 4 - 2
src/main/java/com/ekexiu/project/bridge/resource/dao/CollectDeviceDao.java

@ -2,6 +2,7 @@ package com.ekexiu.project.bridge.resource.dao;
2 2
3 3
import com.ekexiu.project.bridge.resource.po.CollectDevice;
4 4
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.Batch;
5 6
import org.jfw.apt.orm.annotation.dao.DAO;
6 7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
7 8
import org.jfw.apt.orm.annotation.dao.method.From;
@ -42,10 +43,11 @@ public interface CollectDeviceDao {
42 43
    int logicDelete(Connection con, @Set String modifier, String id) throws SQLException;
43 44
44 45
    @UpdateWith
46
    @Batch
45 47
    @From(CollectDevice.class)
46 48
    @SetSentence("active = '0'")
47 49
    @IncludeFixSet("modifyTime")
48
    int logicDeleteByServers(Connection con, @Set String modifier,@In String[] serverId) throws SQLException;
50
    int[] logicDeleteByServers(Connection con, @Set String modifier,@Batch String[] serverId) throws SQLException;
49 51
50 52
    @Update
51 53
    @Exclude("active")
@ -61,7 +63,7 @@ public interface CollectDeviceDao {
61 63
62 64
    @SelectOne
63 65
    @Nullable
64
    CollectDevice queryBySeqAndServer(Connection con, @SqlColumn(handlerClass = StringHandler.class,value = "SERVER_ID IN (SELECT ID FROM BRIDGE_SERVER WHERE CODE = ?)")String serverId, int seq, @Nullable @UnEquals String id,@Nullable Boolean active) throws SQLException;
66
    CollectDevice queryBySeqAndServer(Connection con,String serverId, int seq, @Nullable @UnEquals String id,@Nullable Boolean active) throws SQLException;
65 67
66 68
    @SelectOne
67 69
    @Nullable

+ 3 - 1
src/main/java/com/ekexiu/project/bridge/resource/dao/TransducerDao.java

@ -2,6 +2,7 @@ package com.ekexiu.project.bridge.resource.dao;
2 2
3 3
import com.ekexiu.project.bridge.resource.po.Transducer;
4 4
import org.jfw.apt.annotation.Nullable;
5
import org.jfw.apt.orm.annotation.dao.Batch;
5 6
import org.jfw.apt.orm.annotation.dao.DAO;
6 7
import org.jfw.apt.orm.annotation.dao.method.Exclude;
7 8
import org.jfw.apt.orm.annotation.dao.method.From;
@ -41,10 +42,11 @@ public interface TransducerDao {
41 42
    int logicDelete(Connection con, @Set String modifier, String id) throws SQLException;
42 43
43 44
    @UpdateWith
45
    @Batch
44 46
    @From(Transducer.class)
45 47
    @SetSentence("active = '0'")
46 48
    @IncludeFixSet("modifyTime")
47
    int logicDeleteByDevices(Connection con, @Set String modifier,@In String[] deviceId) throws SQLException;
49
    int[] logicDeleteByDevices(Connection con, @Set String modifier,@Batch String[] deviceId) throws SQLException;
48 50
49 51
    @Update
50 52
    @Exclude("active")

+ 5 - 5
src/main/java/com/ekexiu/project/bridge/resource/service/BridgeService.java

@ -205,7 +205,7 @@ public class BridgeService {
205 205
                for (int i = 0; i < collectDevices.size(); ++i) {
206 206
                    deviceId[i] = collectDevices.get(i).getId();
207 207
                }
208
                this.transducerDao.logicDeleteByDevices(con, null, deviceId);
208
                this.transducerDao.logicDeleteByDevices(con, sessionUser.getId(), deviceId);
209 209
            }
210 210
        }
211 211
    }
@ -267,8 +267,8 @@ public class BridgeService {
267 267
268 268
    @Get
269 269
    @Path("/server/pq")
270
    public PageQueryResult<BridgeServer> pageQueryServer(@JdbcConn Connection con, @Nullable Boolean active, @Nullable String bcode, @Nullable String code, int pageSize, int pageNo) throws SQLException {
271
        return this.bridgeServerDao.pageQuery(con, active, bcode, code, pageSize, pageNo);
270
    public PageQueryResult<BridgeServer> pageQueryServer(@JdbcConn Connection con, @Nullable Boolean active, @Nullable String key, @Nullable String code, int pageSize, int pageNo) throws SQLException {
271
        return this.bridgeServerDao.pageQuery(con, active, key == null ? null : "%" + key + "%", code, pageSize, pageNo);
272 272
    }
273 273
274 274
    @Post
@ -298,7 +298,7 @@ public class BridgeService {
298 298
            for (int i = 0; i < collectDevices.size(); ++i) {
299 299
                deviceId[i] = collectDevices.get(i).getId();
300 300
            }
301
            this.transducerDao.logicDeleteByDevices(con, null, deviceId);
301
            this.transducerDao.logicDeleteByDevices(con, sessionUser.getId(), deviceId);
302 302
        }
303 303
    }
304 304
@ -358,7 +358,7 @@ public class BridgeService {
358 358
        this.collectDeviceDao.logicDelete(con, sessionUser.getId(), id);
359 359
        String[] deviceId = new String[1];
360 360
        deviceId[0] = id;
361
        this.transducerDao.logicDeleteByDevices(con, null, deviceId);
361
        this.transducerDao.logicDeleteByDevices(con, sessionUser.getId(), deviceId);
362 362
    }
363 363
364 364
    @Get

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

@ -47,7 +47,7 @@ public interface UserDao {
47 47
	int insert(Connection con, User user) throws SQLException;
48 48
49 49
	@Update
50
	@Exclude({"passwd","type","active"})
50
	@Exclude({"passwd","active"})
51 51
	@Dynamic
52 52
	int update(Connection con, User user) throws SQLException;
53 53