日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

Mybatis if标签判断大小

發(fā)布時(shí)間:2025/3/15 编程问答 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Mybatis if标签判断大小 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

1、if標(biāo)簽語(yǔ)法

<select...>SQL語(yǔ)句1<if test="條件表達(dá)式">SQL語(yǔ)句2</if> </select>

注意:條件表達(dá)式中大于號(hào)小于號(hào)用?gt,lt

<if test="vane gt 0">...</if>

<if test="vane lt 0">...</if>

mapper xml代碼:

<select id="selectByUpdatedAt" resultMap="ResultMapWithBLOBs">select<include refid="Base_Column_List" />,<include refid="Blob_Column_List" />from products<where><if test="vane gt 0">updated_at &gt; #{date} AND status = #{status}ORDER BY is_top desc , updated_at desc</if><if test="vane == 0">updated_at = #{date} AND status != #{status}ORDER BY is_top desc , updated_at desc</if><if test="vane lt 0">updated_at &lt; #{date} AND status = #{status}ORDER BY is_top desc , updated_at desc</if></where></select>

mapper 接口代碼:

/*** vane大于0表示大于;0表示等于;小于0表示小于;* status 商品狀態(tài)。1:在售;2:下架;3:刪除;* @param vane vane* @param date 時(shí)間* @param status 商品狀態(tài)* @return List*/List<Product> selectByUpdatedAt(@Param("vane") Integer vane,@Param("date") Date date,@Param("status") Byte status);

?

總結(jié)

以上是生活随笔為你收集整理的Mybatis if标签判断大小的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。