国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

公司網(wǎng)站制作公司排名網(wǎng)絡(luò)營銷推廣策略有哪些

公司網(wǎng)站制作公司排名,網(wǎng)絡(luò)營銷推廣策略有哪些,收費(fèi) WordPress,深圳布吉做網(wǎng)站if標(biāo)簽與where標(biāo)簽 if標(biāo)簽 test如果為true就會(huì)拼接查詢條件&#xff0c;否則不會(huì) 當(dāng)沒有使用Param&#xff0c;test出現(xiàn)arg0/param1當(dāng)使用Param&#xff0c;test為Param指定的值當(dāng)使用Pojo&#xff0c;test為對(duì)象的屬性名 select * from car where <if test"name!n…

if標(biāo)簽與where標(biāo)簽

if標(biāo)簽

test如果為true就會(huì)拼接查詢條件,否則不會(huì)

  • 當(dāng)沒有使用@Param,test出現(xiàn)arg0/param1
  • 當(dāng)使用@Param,test為@Param指定的值
  • 當(dāng)使用Pojo,test為對(duì)象的屬性名
select * from car where
<if test="name!=null || name!='' ">name like concat('%',${name},'%')
</if>
<if test="price!=null || price!='' ">and price=#{price}
</if>
...

注意日期不能判斷為空字符串

如何所有條件都不滿足上述代碼會(huì)報(bào)錯(cuò)

解決

如果用 where 1=1 后面判斷必須加and

select * from car where 1=1
<if test="name!=null || name!='' ">and name like concat('%',${name},'%')
</if>
<if test="price!=null || price!='' ">and price=#{price}
</if>
...

where標(biāo)簽

  • 所有條件都為空時(shí),where子句不會(huì)生成
  • 自動(dòng)去掉前面多余的and,or
select * from car 
<where><if test="name!=null || name!='' ">name like concat('%',${name},'%')</if><if test="price!=null || price!='' ">and price=#{price}</if>
</where>
...

trim標(biāo)簽

  • prefix在標(biāo)簽前面動(dòng)態(tài)的添加屬性值
  • suffix在標(biāo)簽后面動(dòng)態(tài)的添加屬性值
  • suffixOverrides去除標(biāo)簽內(nèi)容后面中指定的屬性值
  • prefixOverrides去除標(biāo)簽內(nèi)容前面中指定的屬性值
select * from car 
<trim prefix="where" suffixOverrides="and | or" prefixOverrides="" suffix=""><if test="name!=null || name!='' ">name like concat('%',${name},'%')</if><if test="price!=null || price!='' ">and price=#{price}</if>
</trim>

set標(biāo)簽

  • 主要用在update標(biāo)簽中,只會(huì)提交不為空的條件
  • 可以動(dòng)態(tài)去除語句中多余的,
update  car 
<set><if test="name!=null || name!='' ">name=#{name} , </if><if test="price!=null || price!='' ">price=#{price} ,</if>
</set>
where id=#{id}

choose when otherwise標(biāo)簽

一般在多條件中只執(zhí)行某一個(gè)條件查詢

用法類似與 if else if else

selecr * from car
<where><choose><when test="name!=null || name!='' ">name=#{name} </when><when test="price!=null || price!='' ">price=#{price} </when><otherwise>id=#{id} <otherwise></choose>
<where>

因?yàn)橹粫?huì)滿足一種查詢條件所有不需要加and


forEach標(biāo)簽

  • collection為循環(huán)列表
  • item為循環(huán)元素
  • separator為循環(huán)元素之間的分隔符
  • open為標(biāo)簽前面加屬性值
  • close為標(biāo)簽后面加屬性值

批量刪除

delete  from car where  id in(<foreach collection="ids" item="item" separator=",">#{item}</foreach>
)delete  from car where  id in<foreach collection="ids" item="item" open="(" separator=","  close=")">#{item}</foreach>delete  from car where  <foreach collection="ids" item="item" separator="or"  >id=#{item}</foreach>

批量插入

insert into  car( name, price)
values<foreach collection="list" item="item" separator=",">(#{item.name},#{item.price})</foreach>

sql與include標(biāo)簽

主要用于字段的封裝和復(fù)用

<sql id="CarSql">id,car_num as  carNum,brand,guide_price as guidePrice,produce_time as produceTime,car_type as carType
</sql><select id="selectAll" resultType="com.example.webapplication.pojo.Car">select<include refid="CarSql"></include>from car
</select>
http://aloenet.com.cn/news/32074.html

相關(guān)文章:

  • 有關(guān)師德建設(shè)的網(wǎng)站網(wǎng)站建設(shè)需要多少錢?
  • 做網(wǎng)站用的hu軟件網(wǎng)站維護(hù)費(fèi)一年多少錢
  • 企業(yè)管理網(wǎng)站開發(fā)論文可以營銷的十大產(chǎn)品
  • 唐山seo快速排名seo全稱是什么
  • 汕頭百度網(wǎng)站建設(shè)成都網(wǎng)絡(luò)營銷品牌代理機(jī)構(gòu)
  • 織夢修改網(wǎng)站后備份網(wǎng)絡(luò)軟文
  • 搭建平臺(tái)暢通渠道網(wǎng)站seo推廣
  • 自己做網(wǎng)絡(luò)棋牌網(wǎng)站流程泉州seo報(bào)價(jià)
  • 商城網(wǎng)站建設(shè)招聘百度搜索風(fēng)云榜總榜
  • 網(wǎng)站app開發(fā)平臺(tái)網(wǎng)站搭建谷歌seo
  • wordpress插件裝多了卡seo代碼優(yōu)化包括哪些
  • 巴中網(wǎng)站建設(shè)免費(fèi)自助建站網(wǎng)站
  • 煙臺(tái)seo網(wǎng)站診斷短視頻營銷推廣方式
  • 南寧美容網(wǎng)站建設(shè)seo智能優(yōu)化公司
  • php動(dòng)態(tài)網(wǎng)站怎么做商旅100網(wǎng)頁版
  • 做地方門戶網(wǎng)站如何做可靠的網(wǎng)站優(yōu)化
  • 怎么自己做網(wǎng)站發(fā)優(yōu)惠券seo搜索引擎優(yōu)化業(yè)務(wù)
  • 佛山電商網(wǎng)站制作seo自學(xué)教程
  • 租網(wǎng)站服務(wù)器價(jià)格seo霸屏
  • 網(wǎng)頁與網(wǎng)站設(shè)計(jì)nbsp的意思合肥做網(wǎng)站哪家好
  • 做家庭影院的有哪些網(wǎng)站防城港網(wǎng)站seo
  • 環(huán)保企業(yè)的網(wǎng)站怎么做指數(shù)基金是什么意思
  • seo外包 靠譜長沙seo咨詢
  • 網(wǎng)站二維碼鏈接怎么做的遼陽網(wǎng)站seo
  • 筑巢網(wǎng)站百度地圖廣告投放
  • 網(wǎng)站建設(shè)需要域名嗎鄭州seo網(wǎng)站有優(yōu)化
  • 外賣網(wǎng)站制作seo 關(guān)鍵詞優(yōu)化
  • 想做一個(gè)部門的網(wǎng)站怎么做頭條熱點(diǎn)新聞
  • 公司手機(jī)網(wǎng)站模板優(yōu)化大師win10下載
  • 手機(jī)如果做網(wǎng)站市場調(diào)研方案怎么寫