<select id="getLinkTypeListByCondition" parameterType="java.util.Map" resultMap="linkType">
SELECT * FROM OD_LINK_TYPE
<where>
LINK_URI != BASE_TYPE_URI
<if test="linkUri != null">
AND LINK_URI LIKE '%${linkUri}%'
</if>
<if test="linkLabel != null">
AND LINK_LABEL LIKE '%${linkLabel}%'
</if>
<if test="baseTypeUri != null">
AND BASE_TYPE_URI=#{baseTypeUri}
</if>
</where>
<if test="orderfield != null" >
ORDER BY
<choose>
<when test="orderfield == 'linkUri'">
LINK_URI ${orderdir}
</when>
<when test="orderfield == 'linkLabel'">
LINK_LABEL ${orderdir}
</when>
<otherwise>
BASE_TYPE_URI ${orderdir}
</otherwise>
</choose>
</if>
</select>
mybatis动态排序
最新推荐文章于 2024-08-26 16:23:25 发布