KFSCKFSCNTRB-1781: Changing the sql query to be both Oracle and MySql fr...

...iendly.

KFSCNTRB-1781: Testing the periodCode with String.Utils.isBlank instead of isEmpty