不是字符串不要这样判断
<if test="dailyReportTicketParam.dailyReportType != null and dailyReportTicketParam.dailyReportType != ''">
DAILY_REPORT_TYPE,
</if>
而 dailyReportType=0 是 int 类型,但您的条件检查了 != ''(空字符串),这可能导致 MyBatis 认为 0 不满足条件(因为 0 不是字符串)。
<if test="dailyReportTicketParam.dailyReportType != null and dailyReportTicketParam.dailyReportType != ''">
DAILY_REPORT_TYPE,
</if>
而 dailyReportType=0 是 int 类型,但您的条件检查了 != ''(空字符串),这可能导致 MyBatis 认为 0 不满足条件(因为 0 不是字符串)。
相关推荐