为什么加上if会报错(数据接口请求异常)

为什么加< if test='monthOfExpense != "" and monthOfExpense!=null' >


```会报错


```java

left join jbs_personnal_employee e3 on e3.ROW_ID=t.ORIGINATOR_EMP_ID
        left join (select   DISTINCT c.UNION_BILL_ID ,pp.ATTRIBUTION_DEPARTMENT_ID ATTRIBUTION_ID from  JBS_PROJECT pp 
                   join jbs_reimb_expense_bill_item c on c.project_id=pp.ROW_ID 
                ) as pb on pb.UNION_BILL_ID=t.ROW_ID
        where t.APPROVAL_FLAG in ('2','3','4')
        
        <if test='monthOfExpense != "" and monthOfExpense!=null'>
            and t.row_id in (select  UNION_BILL_ID from jbs_reimb_expense_bill_item where Month_Of_Expense = #{monthOfExpense}  )
        </if>
        <if test='approvalFlag != "" and approvalFlag!=null'>
                and t.APPROVAL_FLAG = #{approvalFlag}  
        </if>
        <if test='unionBillNo != "" and unionBillNo!=null'>
                and t.union_Bill_No  like '%${unionBillNo}%'  
        </if>

img

把sql单独拿出来执行看看有没有错误,没有错误的话,接口请求的日志报错贴出来。tomcat日志或者其他

错误信息是什么?
monthOfExpense!=null and test='monthOfExpense != ""
反过来试试?