mybatis中if else

复制代码
    <choose>
            <when test="bic.duedateQueryStart != null or bic.duedateQueryEnd != null">
                <if test="bic.duedateQueryStart != null and bic.duedateQueryStart !=''">
                    AND a.duedate &gt;= #{bic.duedateQueryStart}
                </if>
                <if test="bic.duedateQueryEnd != null and bic.duedateQueryEnd !=''">
                    AND a.duedate &lt;= #{bic.duedateQueryEnd}
                </if>
            </when>
            <otherwise>
                and DUEDATE &lt; (select DATE(CURDATE()) as '年月日')
            </otherwise>
        </choose>
复制代码

 

posted @   花田007  阅读(62)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· .NET Core 中如何实现缓存的预热?
· 三行代码完成国际化适配,妙~啊~
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
点击右上角即可分享
微信分享提示