choose-when

<choose>
		<when test="state == null">
			and type = 1
		</when>
		<when test="state != null">
			and type = 2
		</when>
		<otherwise>
			and type = 3
		</otherwise>
</choose>

加标签
<choose>
    <when test="param.moneyChargeDescList != null and param.moneyChargeDescList.size() > 0">
        AND(
        <trim prefixOverrides="or">
            <if test="param.moneyChargeDescList.contains('a')">
                (TEMP.process_type = 10 or TEMP.process_type is null)
            </if>
            <if test="param.moneyChargeDescList.contains('b')">
                or (TEMP.money_charge = 20 AND TEMP.process_type IN (20, 40))
            </if>
            <if test="param.moneyChargeDescList.contains('c')">
                or (TEMP.process_type = 30 or TEMP.process_type = 50)
            </if>
        </trim>
        )
    </when>
    <otherwise>
        AND NOT (TEMP.money_charge = 10 AND TEMP.process_type IN (20, 40))
    </otherwise>
</choose>
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐