首页 > 其他 > 详细

<choose>标签和<when>标签和<otherwise>标签

时间:2020-07-02 13:30:10      阅读:46      评论:0      收藏:0      [点我收藏+]
SELECT * FROM t_dws_base_statistics
        <where>
            <choose>
                <when test="statisticsName != null and statisticsName != ‘‘">
                    name = #{statisticsName}
                </when>
                <otherwise>
                    name = SCJG-GLY-SCXFHJ-XFHFMYL
                </otherwise>
            </choose>
            <choose>
                <when test="statisticsPeriod != null and statisticsPeriod != ‘‘">
                    and year(date) = #{statisticsPeriod}
                </when>
                <otherwise>
                    and year(date) = DATE_FORMAT(NOW(),"%Y")
                </otherwise>
            </choose>
        </where>

<choose>标签和<when>标签和<otherwise>标签

<choose>标签和<when>标签和<otherwise>标签

原文:https://www.cnblogs.com/Objecting/p/13223829.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!