NutzCN Logo
问答 过滤为空字段失败,update 语句中还是有NULL
发布于 1962天前 作者 loveexception 1622 次浏览 复制 上一个帖子 下一个帖子
标签: nutzwk

public int updateGateway(Gateway gateway) {
gateway.setUpdateBy(ShiroUtils.getSysUserId());
gateway.setUpdateTime(new Date());
Dao forup = Daos.ext(this.dao(), FieldFilter.create(Location.class,null,"^create_by|create_time$", true));
return forup.update(gateway);
// FieldFilter.create(Location.class, true).run(new Atom(){
// public void run(){
// dao().update(gateway);
// }
// });
// return 1;

}
[DEBUG] 01:14:03.241 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [5l9oogbl7ijakrqrn5jupu6b4q]
[DEBUG] 01:14:03.250 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [POST] path=/iot/gateway/editDo : GatewayController.editDo(GatewayController.java:176)
[DEBUG] 01:14:03.252 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) - Get 'gatewayController'<class cn.tico.iot.configmanger.module.iot.controller.GatewayController>
[DEBUG] 01:14:03.296 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - UPDATE t_iot_gateways SET sno=?,ext_ip=?,git_path=?,desription=?,subgateway_id=?,kind_id=?,kind_map=?,ip=?,cycle=?,unit=?,username=?,password=?,dept_id=?,location_id=?,location_country=?,location_state=?,location_city=?,location_company=?,location_room=?,location_map=?,cn_name=?,en_name=?,status=?,delflag=?,create_by=?,create_time=?,update_by=?,update_time=?  WHERE id=?
    |      1 |       2 | 3 |    4 |   5 |    6 |    7 |       8 |    9 | 10 | 11 | 12 |  13 |     14 |   15 |   16 |   17 |   18 |   19 |   20 | 21 |   22 |   23 |    24 |   25 |   26 | 27 |                  28 |                               29 |
    |--------|---------|--|------|-----|------|------|---------|------|----|--|--|-----|--------|------|------|------|------|------|------|----|------|------|-------|------|------|---|---------------------|----------------------------------|
    | 123456 | 2.2.2.2 |  | 3211 | 200 | NULL | NULL | 3.3.3.3 | 1000 | ms |  |  | 100 | 100000 | NULL | NULL | NULL | NULL | NULL | NULL | 天津 | NULL | true | false | NULL | NULL | 1 | 2019-07-03 01:14:03 | 9dfd2d7b0de9410785f0aee391c7036d |
  For example:> "UPDATE t_iot_gateways SET sno='123456',ext_ip='2.2.2.2',git_path='',desription='3211',subgateway_id='200',kind_id=NULL,kind_map=NULL,ip='3.3.3.3',cycle=1000,unit='ms',username='',password='',dept_id='100',location_id='100000',location_country=NULL,location_state=NULL,location_city=NULL,location_company=NULL,location_room=NULL,location_map=NULL,cn_name='天津',en_name=NULL,status='true',delflag='false',create_by=NULL,create_time=NULL,update_by='1',update_time='2019-07-03 01:14:03'  WHERE id='9dfd2d7b0de9410785f0aee391c7036d'"
[DEBUG] 01:14:03.353 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=55ms, sql=UPDATE t_iot_gateways SET sno='123456',ext_ip='2.2.2.2',git_path='',desription='3211',subgateway_id='200',kind_id=NULL,kind_map=NULL,ip='3.3.3.3',cycle=1000,unit='ms',username='',password='',dept_id='100',location_id='100000',location_country=NULL,location_state=NULL,location_city=NULL,location_company=NULL,location_room=NULL,location_map=NULL,cn_name='天津',en_name=NULL,status='true',delflag='false',create_by=NULL,create_time=NULL,update_by='1',update_time='2019-07-03 01:14:03'  WHERE id='9dfd2d7b0de9410785f0aee391c7036d'
[DEBUG] 01:14:03.407 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - // NOT SQL // ElFieldMacro=uuid()
[DEBUG] 01:14:03.409 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=1ms, sql=RUN
[DEBUG] 01:14:03.411 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - INSERT INTO sys_log(uu32,t,tg,url,src,msg,u_id,u_name,param,os,browser,ip,location,ct) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?) 
    |                                1 |         2 |    3 |                   4 |                                                                       5 |        6 | 7 |     8 |                                                                                                                                                                                                                                                               9 |       10 |     11 |        12 |   13 |                  14 |
    |----------------------------------|-----------|------|---------------------|-------------------------------------------------------------------------|----------|---|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|--------|-----------|------|---------------------|
    | 4e1f66dbcae849f4998e3414a908af5c | aop.after | 业务类型 | /iot/gateway/editDo | cn.tico.iot.configmanger.module.iot.controller.GatewayController#editDo | 修改保存业务类型 | 1 | admin | {"gitPath":[""],"ip":["3.3.3.3"],"deptid":["100"],"cycle":["1000"],"extIP":["2.2.2.2"],"subid":["200"],"desription":["3211"],"cnName":["天津"],"sno":["123456"],"locationid":["100000"],"extSno":["654321"],"id":["9dfd2d7b0de9410785f0aee391c7036d"],"status":[" | Mac OS X | Chrome | 127.0.0.1 | 内网IP | 2019-07-03 01:14:03 |
  For example:> "INSERT INTO sys_log(uu32,t,tg,url,src,msg,u_id,u_name,param,os,browser,ip,location,ct) VALUES('4e1f66dbcae849f4998e3414a908af5c','aop.after','业务类型','/iot/gateway/editDo','cn.tico.iot.configmanger.module.iot.controller.GatewayController#editDo','修改保存业务类型','1','admin','{"gitPath":[""],"ip":["3.3.3.3"],"deptid":["100"],"cycle":["1000"],"extIP":["2.2.2.2"],"subid":["200"],"desription":["3211"],"cnName":["天津"],"sno":["123456"],"locationid":["100000"],"extSno":["654321"],"id":["9dfd2d7b0de9410785f0aee391c7036d"],"status":["','Mac OS X','Chrome','127.0.0.1','内网IP','2019-07-03 01:14:03') "
[DEBUG] 01:14:03.445 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=33ms, sql=INSERT INTO sys_log(uu32,t,tg,url,src,msg,u_id,u_name,param,os,browser,ip,location,ct) VALUES('4e1f66dbcae849f4998e3414a908af5c','aop.after','业务类型','/iot/gateway/editDo','cn.tico.iot.configmanger.module.iot.controller.GatewayController#editDo','修改保存业务类型','1','admin','{"gitPath":[""],"ip":["3.3.3.3"],"deptid":["100"],"cycle":["1000"],"extIP":["2.2.2.2"],"subid":["200"],"desription":["3211"],"cnName":["天津"],"sno":["123456"],"locationid":["100000"],"extSno":["654321"],"id":["9dfd2d7b0de9410785f0aee391c7036d"],"status":["','Mac OS X','Chrome','127.0.0.1','内网IP','2019-07-03 01:14:03') 
[DEBUG] 01:14:03.465 org.apache.shiro.web.servlet.SimpleCookie.readValue(SimpleCookie.java:389) - Found 'sid' cookie value [5l9oogbl7ijakrqrn5jupu6b4q]
[DEBUG] 01:14:03.468 org.nutz.mvc.impl.UrlMappingImpl.get(UrlMappingImpl.java:101) - Found mapping for [POST] path=/iot/gateway/list : GatewayController.list(GatewayController.java:81)
[DEBUG] 01:14:03.471 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:166) - Get 'gatewayController'<class cn.tico.iot.configmanger.module.iot.controller.GatewayController>
[DEBUG] 01:14:03.488 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM sys_role  WHERE id IN (SELECT role_id FROM sys_user_role WHERE user_id='1')
[DEBUG] 01:14:03.505 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=16ms, sql=SELECT * FROM sys_role  WHERE id IN (SELECT role_id FROM sys_user_role WHERE user_id='1')
[DEBUG] 01:14:03.506 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_gateways  WHERE delflag=? LIMIT 0, 10 
    |     1 |
    |-------|
    | false |
  For example:> "SELECT * FROM t_iot_gateways  WHERE delflag='false' LIMIT 0, 10 "
[DEBUG] 01:14:03.523 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=16ms, sql=SELECT * FROM t_iot_gateways  WHERE delflag='false' LIMIT 0, 10 
[DEBUG] 01:14:03.524 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_sub_gateways  WHERE id=?
    |   1 |
    |-----|
    | 200 |
  For example:> "SELECT * FROM t_iot_sub_gateways  WHERE id='200'"
[DEBUG] 01:14:03.542 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=17ms, sql=SELECT * FROM t_iot_sub_gateways  WHERE id='200'
[DEBUG] 01:14:03.544 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.560 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=14ms, sql=SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.561 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM sys_dept  WHERE id=?
    |   1 |
    |-----|
    | 100 |
  For example:> "SELECT * FROM sys_dept  WHERE id='100'"
[DEBUG] 01:14:03.583 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=22ms, sql=SELECT * FROM sys_dept  WHERE id='100'
[DEBUG] 01:14:03.585 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_locations  WHERE id=?
    |                                1 |
    |----------------------------------|
    | d182ca3c62e84ce6806250f9b56dc3c4 |
  For example:> "SELECT * FROM t_iot_locations  WHERE id='d182ca3c62e84ce6806250f9b56dc3c4'"
[DEBUG] 01:14:03.594 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=9ms, sql=SELECT * FROM t_iot_locations  WHERE id='d182ca3c62e84ce6806250f9b56dc3c4'
[DEBUG] 01:14:03.596 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_sub_gateways  WHERE id=?
    |   1 |
    |-----|
    | 200 |
  For example:> "SELECT * FROM t_iot_sub_gateways  WHERE id='200'"
[DEBUG] 01:14:03.600 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=3ms, sql=SELECT * FROM t_iot_sub_gateways  WHERE id='200'
[DEBUG] 01:14:03.600 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.604 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=3ms, sql=SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.606 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM sys_dept  WHERE id=?
    |   1 |
    |-----|
    | 102 |
  For example:> "SELECT * FROM sys_dept  WHERE id='102'"
[DEBUG] 01:14:03.613 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=6ms, sql=SELECT * FROM sys_dept  WHERE id='102'
[DEBUG] 01:14:03.614 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_locations  WHERE id=?
    |      1 |
    |--------|
    | 100000 |
  For example:> "SELECT * FROM t_iot_locations  WHERE id='100000'"
[DEBUG] 01:14:03.647 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=33ms, sql=SELECT * FROM t_iot_locations  WHERE id='100000'
[DEBUG] 01:14:03.648 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_sub_gateways  WHERE id=?
    |   1 |
    |-----|
    | 200 |
  For example:> "SELECT * FROM t_iot_sub_gateways  WHERE id='200'"
[DEBUG] 01:14:03.664 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=16ms, sql=SELECT * FROM t_iot_sub_gateways  WHERE id='200'
[DEBUG] 01:14:03.665 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.673 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=8ms, sql=SELECT * FROM t_iot_kinds  WHERE id IS NULL 
[DEBUG] 01:14:03.674 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM sys_dept  WHERE id=?
    |   1 |
    |-----|
    | 100 |
  For example:> "SELECT * FROM sys_dept  WHERE id='100'"
[DEBUG] 01:14:03.693 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=18ms, sql=SELECT * FROM sys_dept  WHERE id='100'
[DEBUG] 01:14:03.694 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT * FROM t_iot_locations  WHERE id=?
    |      1 |
    |--------|
    | 100000 |
  For example:> "SELECT * FROM t_iot_locations  WHERE id='100000'"
[DEBUG] 01:14:03.701 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=6ms, sql=SELECT * FROM t_iot_locations  WHERE id='100000'
[DEBUG] 01:14:03.703 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:391) - SELECT COUNT(*) FROM t_iot_gateways  WHERE delflag=?
    |     1 |
    |-------|
    | false |
  For example:> "SELECT COUNT(*) FROM t_iot_gateways  WHERE delflag='false'"
[DEBUG] 01:14:03.714 org.nutz.dao.impl.interceptor.DaoTimeInterceptor.filter(DaoTimeInterceptor.java:28) - time=10ms, sql=SELECT COUNT(*) FROM t_iot_gateways  WHERE delflag='false'

2 回复
FieldFilter.create(Location.class,null,"^create_by|create_time$", true));
return forup.update(gateway);

Location.class? 应该是Gateway.class吧

OK了
是眼瞎。问题

添加回复
请先登陆
回到顶部