oracle 默认把 空字符串都当成 null 处理。mysql倒不一样。
mysql 里面 执行
select count(*) from t_usr_pmsf where f_p_projman <> ''; 7
select count(*) from t_usr_pmsf where f_p_projman = ''; 3
select count(*) from t_usr_pmsf where f_p_projman is not null ; 10
select count(*) from t_usr_pmsf where f_p_projman is null; 3
select count(*) from t_usr_pmsf ; 13
oracle 里面执行
select count(*) from t_usr_pmsf where f_p_projman <> ''; 0
select count(*) from t_usr_pmsf where f_p_projman = ''; 0
select count(*) from t_usr_pmsf where f_p_projman is not null ; 382
select count(*) from t_usr_pmsf where f_p_projman is null; 33
select count(*) from t_usr_pmsf ; 415
所以在mysql环境下写的代码需要全部重新改动判空。
判空方式 IFieldFilter ff= dq.createFieldFilter("p_projman", SATConstants.SQL_OP_IS_NULL, null);
ff.setNot(true); //取反
dq.addFilter(ff);