中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

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

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

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

if標簽與where標簽

if標簽

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

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

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

如何所有條件都不滿足上述代碼會報錯

解決

如果用 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標簽

  • 所有條件都為空時,where子句不會生成
  • 自動去掉前面多余的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標簽

  • prefix在標簽前面動態(tài)的添加屬性值
  • suffix在標簽后面動態(tài)的添加屬性值
  • suffixOverrides去除標簽內(nèi)容后面中指定的屬性值
  • prefixOverrides去除標簽內(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標簽

  • 主要用在update標簽中,只會提交不為空的條件
  • 可以動態(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標簽

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

用法類似與 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>

因為只會滿足一種查詢條件所有不需要加and


forEach標簽

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

批量刪除

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標簽

主要用于字段的封裝和復(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://m.risenshineclean.com/news/32074.html

相關(guān)文章:

  • 有關(guān)師德建設(shè)的網(wǎng)站網(wǎng)站建設(shè)需要多少錢?
  • 做網(wǎng)站用的hu軟件網(wǎng)站維護費一年多少錢
  • 企業(yè)管理網(wǎng)站開發(fā)論文可以營銷的十大產(chǎn)品
  • 唐山seo快速排名seo全稱是什么
  • 汕頭百度網(wǎng)站建設(shè)成都網(wǎng)絡(luò)營銷品牌代理機構(gòu)
  • 織夢修改網(wǎng)站后備份網(wǎng)絡(luò)軟文
  • 搭建平臺暢通渠道網(wǎng)站seo推廣
  • 自己做網(wǎng)絡(luò)棋牌網(wǎng)站流程泉州seo報價
  • 商城網(wǎng)站建設(shè)招聘百度搜索風(fēng)云榜總榜
  • 網(wǎng)站app開發(fā)平臺網(wǎng)站搭建谷歌seo
  • wordpress插件裝多了卡seo代碼優(yōu)化包括哪些
  • 巴中網(wǎng)站建設(shè)免費自助建站網(wǎng)站
  • 煙臺seo網(wǎng)站診斷短視頻營銷推廣方式
  • 南寧美容網(wǎng)站建設(shè)seo智能優(yōu)化公司
  • php動態(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ù)器價格seo霸屏
  • 網(wǎng)頁與網(wǎng)站設(shè)計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)化
  • 想做一個部門的網(wǎng)站怎么做頭條熱點新聞
  • 公司手機網(wǎng)站模板優(yōu)化大師win10下載
  • 手機如果做網(wǎng)站市場調(diào)研方案怎么寫