<if test="param.applicationStateInNumber != null and param.applicationStateInNumber != ''"> and #{param.applicationStateInNumber,jdbcType=INTEGER} like (case when (fa.whether_invoice is null and fa.whether_pay is null ) then "1" when (fa. whether_invoice=1 and fa.whether_pay is null ) then "2、3" when (fa.whether_invoice = 1 and fa.whether_pay = 1) then "4" end) </if>
這個是需要判斷傳入的參數不為空,且傳入的參數在一個case when 中,起初把
#{param.applicationStateInNumber,jdbcType=INTEGER}
寫成了
param.applicationStateInNumber
報錯:badsqlGrammer,未知的參數param.applicationStateInNumber
#{param.applicationStateInNumber,jdbcType=INTEGER}