choose用法
<choose>
<when test="showType == 1">
IFNULL(k.fname,'未知') as pro_name,
</when>
<when test="showType == 2">
IFNULL(e.fname,'未知') as business_name,
</when>
<when test="showType == 3">
IFNULL(f.fname,'未知') as area_name,
</when>
<when test="showType == 4">
IFNULL(h.fname,'未知') as sale_name,
</when>
<otherwise>
IFNULL(j.F_PJQD_XMDJ,'未知') as project_type,
</otherwise>
</choose>
if用法
<if test="businessName != null and businessName != ''">
and e.fname = #{businessName}
</if>
<if test="areaName != null and areaName != ''">
and f.fname = #{areaName}
</if>