sql server if else

case when   aa  IS NULL then '未确认' else '已确认' end status

 

 

SELECT
CASE 1
WHEN 1 THEN '字段的值是1'
WHEN 2 THEN '字段的值是2'
ELSE '字段的值3'
END
FROM
Table

 

mabatis

<choose>
<when test="params.**!=null">
and a.**in
<foreach collection="params.***" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</when>
<when test="params.**!=null and params.**!='' ">
and a.**= #{params.**}
</when>
<otherwise>
and a.**&lt;&gt; 0
</otherwise>
</choose>

 

<choose>
<when test="**.**!=null and **.**!='' and **.**=='1'.**()">
***********************
</when>
<when test="**.***!=null and **.**!='' and **.**=='0'.**">
    ***********************

</when>
</choose>

 

posted @ 2020-11-24 10:14  喜欢22度的晴天  阅读(158)  评论(0编辑  收藏  举报