SELECT IFNULL(SUM((IFNULL(a.DebitNet,0)-IFNULL(a.CreditNet,0))*#{direction,,jdbcType=INTEGER}),0) FROM Balance a WHERE a.AcctCode=#{acctCode,jdbcType=VARCHAR}
SELECT IFNULL(((IFNULL(a.DebitNet,0)-IFNULL(a.CreditNet,0))*#{direction,,jdbcType=INTEGER}),0) FROM Balance a WHERE a.AcctCode=#{acctCode,jdbcType=VARCHAR} LIMIT 1