<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,target-densitydpi=high-dpi,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		<title>SQL优化-思洋互动</title>
		<meta name="keywords" content="SQL优化">
	    <meta name="description" content="　在项目前期目标是确保功能能够正常运行，但是随着时间的推移，数据的增加，逻辑的复杂，导致数据查询会越来越慢，这个时候我们首先想到的应该就是尽量优化sql。sql优化常见注...">
		<meta name="renderer" content="webkit" />
		<link href="/css/main.css?v=39" rel="stylesheet">
		<link href="/css/base.css?v=39" rel="stylesheet">
        <link href="/css/swiper-3.4.2.min.css" rel="stylesheet">
		<script type="text/javascript" src="/js/jquery.min.js"></script>
        <script type="text/javascript" src="/js/swiper-3.4.2.min.js"></script>
		<!--[if lt IE 9]>
            <script src="/js/html5shiv.min.js"></script>
            <script src="/js/respond.min.js"></script>
            <link href="/css/ie.css" rel="stylesheet">
        <![endif]-->
		<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?8914d517c927d8e794148d05e387fb17";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<link rel="canonical" href="https://www.ciya.cn/article/886.html">
		</head>
	<body class="no-banner">
		<div class="container">
			<div class="header">
	<div class="header-top">
		<div class="w1700">
			<a href="https://www.ciya.cn/"><img src="/images/logo.png?v=2"></a>
		</div>
	</div>
	<div class="header_b">
		<header class="slide">
			<div id="navToggle" class="menu-handler">
				<span class="burger burger-1 trans"></span>
				<span class="burger burger-2 trans-fast"></span>
				<span class="burger burger-3 trans"></span>
			</div>
		</header>
	</div>
	<nav class="slide">
		<div class="w1700">
			<a class="index" href="/"></a>
			<ul>
								<li><a href="https://www.ciya.cn/case/12.html">项目案例</a></li>
								<li><a href="https://www.ciya.cn/website/9.html">网站建设</a></li>
								<li><a href="https://www.ciya.cn/marketing/10.html">网络营销</a></li>
								<li><a href="https://www.ciya.cn/media/11.html">新媒体</a></li>
								<li class="active"><a href="https://www.ciya.cn/news/16.html">动态</a></li>
								<li><a href="https://www.ciya.cn/about/8.html">关于</a></li>
								<li><a href="https://www.ciya.cn/contact/13.html">联系</a></li>
							</ul>
		</div>
	</nav>
</div>            <div class="content slide">
                <div class="position bgf1">
                    <div class="w1700">
                        <a href="https://www.ciya.cn/">首页 ></a>
                        <a href="https://www.ciya.cn/news/16.html">动态 ></a>
                        <a href="https://www.ciya.cn/news/35.html">网站知识</a>
                    </div>
                </div>
                <div class="case-type">
                    <div class="w1700">
                                                <a href="https://www.ciya.cn/news/32.html" >品牌合作</a>
                                                <a href="https://www.ciya.cn/news/31.html" >新闻动态</a>
                                                <a href="https://www.ciya.cn/news/38.html" >网站建设</a>
                                                <a href="https://www.ciya.cn/news/41.html" >网站制作</a>
                                                <a href="https://www.ciya.cn/news/40.html" >网站设计</a>
                                                <a href="https://www.ciya.cn/news/42.html" >运营推广</a>
                                                <a href="https://www.ciya.cn/news/35.html"  class="active">网站知识</a>
                                            </div>
                </div>
                <div class="padding-tb80">
                    <div class="w1700 clear">
                        <div class="fl xwxq-l">
                            <div class="noselettext">
                                <div class="xwxq-title mg-bt60 wow slideUp">
                                    <h1 class="mg-bt35">SQL优化</h1>
                                    <span>时间：2022-07-12</span>
                                </div>
                                <div class="edit2 mg-bt60 wow slideUp">
                                                                        <p>　 在项目前期目标是确保功能能够正常运行，但是随着时间的推移，数据的增加，逻辑的复杂，导致数据查询会越来越慢，这个时候我们首先想到的应该就是尽量优化sql。</p><p><br/></p><p><span style="font-size: 18px;"><strong>sql优化常见注意点：</strong></span></p><p>   1.对查询进行优化，应尽量避免全表扫描，首先应考虑在 where 及 order by 涉及的列上建立索引。（order by优化看这篇：MySQL如何利用索引优化ORDER BY排序语句）</p><p>   2.应尽量避免在 where 子句中使用!=或&lt;&gt;操作符，否则将引擎放弃使用索引而进行全表扫描。如果where a=xx and b=xx and c&gt;xx and c&lt;xx，根据索引的最左前缀匹配原则，应该建立联合索引（a,b,c），而不是（c,a,b）或（a,c,b），创建联合索引（a,b,c）其实相当于创建了（a,b,c）、（a,b）、（a）三个索引，也就是说在这里，联合索引c应该始终在最后，a和b位置随意。</p><p>   3.应尽量避免在 where 子句中对字段进行 null 值判断，因为索引不存储null值，否则将导致引擎放弃使用索引而进行全表扫描，如：<br/></p><p>　　　　select id from t where num is null<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　可以在num上设置默认值0，确保表中num列没有null值，然后这样查询：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=0</p><p>　　</p><p>4.应尽量避免在 where 子句中使用 or 来连接条件，否则将导致引擎放弃使用索引而进行全表扫描，如：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=10 or num=20<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　可以这样查询：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=10<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　union all<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=20</p><p><br/></p><p style="text-align: center;"><img src="/upload/image/20220712/1657593469685882.png" title="1657593469685882.png" alt="image.png"/></p><p><br/></p><p>5.应尽量避免在where子句中使用模糊查询，否则将导致全表扫描(注意：“%cc%”和&quot;%cc&quot;不会使用索引，但是“cc%”会用到索引，https://www.cnblogs.com/lnas01/p/5918558.html)：</p><p>　　　　select id from t where name like &#39;%abc%&#39;</p><p>　　　　下面3个语句有类似like的功能，但是用explain可以看到她们的type都是all,也就是它们也都没有用到索引</p><p>　　　　select id from t where locate(abc,name) &gt; 0</p><p>　　　　select id from t wherePOSITION(abc IN name)</p><p>　　　　select id from t whereINSTR(name,abc)</p><p>　　　　替换%like的方法，在某些情况下，可以新增一列，存储该字段的反转。比如原字段是abcd，取反存储为dcba，查询%bcd改成查dcb%。</p><p>　　</p><p>   6.in 和 not in 也要慎用，正常情况下在有索引的情况且查询条件使用到索引列的话，in和not in会使用索引，但是有些特殊情况，具体稍微有些复杂，看这里http://blog.itpub.net/28912557/viewspace-1255568/</p><p>　　7.如果在 where 子句中使用参数，也会导致全表扫描。因为SQL只有在运行时才会解析局部变量，但优化程序不能将访问计划的选择推迟到运行时;它必须在编译时进行选择。然而，如果在编译时建立访问计划，变量的值还是未知的，因而无法作为索引选择的输入项。如下面语句将进行全表扫描：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=@num<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　可以改为强制查询使用索引：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t with(index(索引名)) where num=@num</p><p>　　8.应尽量避免在 where 子句中对字段进行表达式操作，这将导致引擎放弃使用索引而进行全表扫描。如：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num/2=100<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　应改为:<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where num=100*2</p><p><br/></p><p>　　9.应尽量避免在where子句中对字段进行函数操作，这将导致引擎放弃使用索引而进行全表扫描。如：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where substring(name,1,3)=&#39;abc&#39;--name以abc开头的id<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where datediff(day,createdate,&#39;2005-11-30&#39;)=0--&#39;2005-11-30&#39;生成的id<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　应改为:<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where name like &#39;abc%&#39;<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select id from t where createdate&gt;=&#39;2005-11-30&#39; and createdate&lt;&#39;2005-12-1&#39;</p><p>　　10.不要在 where 子句中的“=”左边进行函数、算术运算或其他表达式运算，否则系统将可能无法正确使用索引。</p><p>　　11.在使用索引字段作为条件时，如果该索引是复合索引，那么必须使用到该索引中的第一个字段作为条件时才能保证系统使用该索引，否则该索引将不会被使用，并且应尽可能的让字段顺序与索引顺序相一致。</p><p>　　12.不要写一些没有意义的查询，如需要生成一个空表结构：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select col1,col2 into #t from t where 1=0<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　这类代码不会返回任何结果集，但是会消耗系统资源的，应改成这样：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　create table #t(...)<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/></p><p><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　13.很多时候用 exists 代替 in是一个好的选择：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select num from a where num in(select num from b)<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　用下面的语句替换：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　　　select num from a where exists(select 1 from b where num=a.num)</p><p>　　14.并不是所有索引对查询都有效，SQL是根据表中数据来进行查询优化的，当索引列有大量数据重复时，SQL查询可能不会去利用索引，如一表中有字段sex，male、female几乎各一半，那么即使在sex上建了索引也对查询效率起不了作用。</p><p>　　15.索引并不是越多越好，索引固然可以提高相应的 select 的效率，但同时也降低了 insert 及 update 的效率，因为 insert 或 update 时有可能会重建索引，所以怎样建索引需要慎重考虑，视具体情况而定。一个表的索引数最好不要超过6个，若太多则应考虑一些不常使用到的列上建的索引是否有必要。</p><p><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　16.应尽可能的避免更新 （clustered） 聚合索引数据列，因为 clustered 索引数据列的顺序就是表记录的物理存储顺序，一旦该列值改变将导致整个表记录的顺序的调整，会耗费相当大的资源。若应用系统需要频繁更新 clustered 索引数据列，那么需要考虑是否应将该索引建为 clustered 索引。</p><p>　　17.尽量使用数字型字段，若只含数值信息的字段尽量不要设计为字符型，这会降低查询和连接的性能，并会增加存储开销。这是因为引擎在处理查询和连接时会逐个比较字符串中每一个字符，而对于数字型而言只需要比较一次就够了。</p><p>　　18.尽可能的使用 varchar/nvarchar 代替 char/nchar ，因为首先变长字段存储空间小，可以节省存储空间，其次对于查询来说，在一个相对较小的字段内搜索效率显然要高些，设置字段长度有利于提高查询效率，不要所有的都用默认长度。</p><p>　　19.任何地方都不要使用 select * from t ，用具体的字段列表代替“*”，不要返回用不到的任何字段。</p><p>　　20.尽量使用表变量来代替临时表。如果表变量包含大量数据，请注意索引非常有限(只有主键索引)。</p><p>　　21.避免频繁创建和删除临时表，以减少系统表资源的消耗。</p><p><br/></p><p>　　22.临时表并不是不可使用，适当地使用它们可以使某些例程更有效，例如，当需要重复引用大型表或常用表中的某个数据集时。但是，对于一次性事件，最好使用导出表。</p><p>　　23.在新建临时表时，如果一次性插入数据量很大，那么可以使用 select into 代替 create table，避免造成大量 log ，以提高速度;如果数据量不大，为了缓和系统表的资源，应先create table，然后insert。</p><p>　　24.如果使用到了临时表，在存储过程的最后务必将所有的临时表显式删除，先 truncate table ，然后 drop table ，这样可以避免系统表的较长时间锁定。</p><p>　　25.尽量避免使用游标，因为游标的效率较差，如果游标操作的数据超过1万行，那么就应该考虑改写。</p><p>　　26.使用基于游标的方法或临时表方法之前，应先寻找基于集的解决方案来解决问题，基于集的方法通常更有效。</p><p>　　27.与临时表一样，游标并不是不可使用。对小型数据集使用 FAST_FORWARD 游标通常要优于其他逐行处理方法，尤其是在必须引用几个表才能获得所需的数据时。在结果集中包括“合计”的例程通常要比使用游标执行的速度快。如果开发时间允许，基于游标的方法和基于集的方法都可以尝试一下，看哪一种方法的效果更好。</p><p><br/></p><p>　　28.在所有的存储过程和触发器的开始处设置 SET NOCOUNT ON ，在结束时设置 SET NOCOUNT OFF 。无需在执行存储过程和触发器的每个语句后向客户端发送 DONE_IN_PROC 消息。</p><p>　　29.尽量避免向客户端返回大数据量，若数据量过大，应该考虑相应需求是否合理。</p><p>　　30.尽量避免大事务操作，提高系统并发能力。</p><p>　　31.insert的时候可以把合并插入，例如insert into tab_no_index values(1,&#39;1&#39;),(2,&#39;2&#39;),(3,&#39;3&#39;),(4,&#39;4&#39;); 这样写比一个插效率高。</p><p>上面有几句写的有问题。</p><p>　　32.尽量使用连接查询代替子查询。<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>　　33.选用较低级别的事务隔离机制<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/><br/></p><p>第二方面：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>select Count (*)和Select Count(1)以及Select Count(column)区别<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>一般情况下，Select Count (*)和Select Count(1)两着返回结果是一样的<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>假如表沒有主键(Primary key), 那么count(1)比count(*)快，<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>如果有主键的話，那主键作为count的条件时候count(主键)最快<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>如果你的表只有一个字段的话那count(*)就是最快的<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>count(*) 跟 count(1) 的结果一样，都包括对NULL的统计，而count(column) 是不包括NULL的统计<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>第三方面：<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>索引列上计算引起的索引失效及优化措施以及注意事项<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>    创建索引、优化查询以便达到更好的查询优化效果。但实际上，MySQL有时并不按我们设计的那样执行查询。MySQL是根据统计信息来生成执行计划的，这就涉及索引及索引的刷选率，表数据量，还有一些额外的因素。<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>Each table index is queried, and the best index is used unless the optimizer believes that it is more efficient to use a table scan. At one time, a scan was used based on whether the best index spanned more than 30% of the table, but a fixed percentage no longer determines the choice between using an index or a scan. The optimizer now is more complex and bases its estimate on additional factors such as table size, number of rows, and I/O block size.<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>简而言之，当MYSQL认为符合条件的记录在30%以上，它就不会再使用索引，因为mysql认为走索引的代价比不用索引代价大，所以优化器选择了自己认为代价最小的方式。事实也的确如此<br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/><br style="box-sizing: border-box; outline: 0px; overflow-wrap: break-word;"/>   是MYSQL认为记录是30%以上，而不是实际MYSQL去查完再决定的。都查完了，还用什么索引啊？！MYSQL会先估算，然后决定是否使用索引。</p><p><br/></p>                                </div>
                            </div>
                                                        <div class="xwxq-bot bgf1 wow slideUp">
                                <div class="xwxq-fy clear">
                                    <a class="fl" href="/article/887.html"><i></i>CSRF/XSRF概述</a>
                                    <a class="fr" href="/article/885.html"><i></i>如何为项目选择合适的RTOS?</a>
                                </div>
                                <a class="fhlb" href="#"></a>
                            </div>
                        </div>
                        <div class="fr xwxq-r">
                            <div class="xwxq-tj-page bgf1 mg-bt40 wow slideUp">
                                <div class="xwxq-tj-warp bgfff">
                                    <div class="tjxw-title mg-bt30">
                                        <h3>最新案例</h3><span>LATEST CASES</span>
                                    </div>
                                    <div class="zxal">
                                        <div class="swiper-container">
                                            <div class="swiper-wrapper">
                                                                                                        <div class="imgscale li swiper-slide">
                                                        <a href="https://www.ciya.cn/article/409.html">
                                                            <div class="img100 mg-bt20"><img src="/upload/20211214/20211214103120.jpg" alt="广州呼吸研究院"/></div>
                                                            <p>广州呼吸研究院</p>
                                                        </a>
                                                    </div>
                                                                                                        <div class="imgscale li swiper-slide">
                                                        <a href="https://www.ciya.cn/article/433.html">
                                                            <div class="img100 mg-bt20"><img src="/upload/20211214/20211214102846.jpg" alt="融创集团"/></div>
                                                            <p>融创集团</p>
                                                        </a>
                                                    </div>
                                                                                                        <div class="imgscale li swiper-slide">
                                                        <a href="https://www.ciya.cn/article/268.html">
                                                            <div class="img100 mg-bt20"><img src="/upload/20211214/20211214102923.jpg" alt="粤海集团"/></div>
                                                            <p>粤海集团</p>
                                                        </a>
                                                    </div>
                                                                                                        <div class="imgscale li swiper-slide">
                                                        <a href="https://www.ciya.cn/article/414.html">
                                                            <div class="img100 mg-bt20"><img src="/upload/20211216/20211216115258.jpg" alt="恒大足球学校"/></div>
                                                            <p>恒大足球学校</p>
                                                        </a>
                                                    </div>
                                                                                                        <div class="imgscale li swiper-slide">
                                                        <a href="https://www.ciya.cn/article/477.html">
                                                            <div class="img100 mg-bt20"><img src="/upload/20211214/20211214102958.jpg" alt="侨鑫集团"/></div>
                                                            <p>侨鑫集团</p>
                                                        </a>
                                                    </div>
                                                                                                </div>
                                        </div>
                                        <div class="zxalDot text-center swiperDot"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="xwxq-tj-page bgf1 mg-bt40 wow slideUp">
                                <div class="xwxq-tj-warp bgfff">
                                    <div class="tjxw-title tjxw-title-line mg-bt20">
                                        <h3>热点新闻</h3><span>TOP NEWS</span>
                                    </div>
                                    <ul class="rdxw">
                                                                                <li><a href="https://www.ciya.cn/article/3559.html">1  java heap space(解决方法)</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/1222.html">2  如何在网站后台上传附件</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/1643.html">3  如何在网站后台上传PDF文件</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/1142.html">4  什么是流？</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/3543.html">5  java swing还有人用吗(swing为什么会被淘汰)</a></li>
                                                                            </ul>
                                </div>
                            </div>
                            <div class="xwxq-tj-page bgf1 wow slideUp">
                                <div class="xwxq-tj-warp bgfff">
                                    <div class="tjxw-title tjxw-title-line mg-bt20">
                                        <h3>最新动态</h3><span>NEWS</span>
                                    </div>
                                    <ul class="rdxw">
                                                                                <li><a href="https://www.ciya.cn/article/7318.html">1  商务网站的维护与更新：持续优化，保持竞争力</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7317.html">2  商务网站的社交媒体营销：扩大品牌影响力，吸引更多潜在客户</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7316.html">3  商务网站的广告投放：增加收益，提高知名度</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7315.html">4  商务网站的在线客户服务：提供优质客服，提升用户满意度</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7314.html">5  商务网站的支付系统集成：安全、便捷的交易方式</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7313.html">6  商务网站搜索引擎优化（SEO）：提升排名，增加流量</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7312.html">7  商务网站响应式设计：实现多设备兼容，提升用户体验</a></li>
                                                                                <li><a href="https://www.ciya.cn/article/7311.html">8  商务网站开发：选择合适的编程语言和技术栈</a></li>
                                                                            </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="footerbox">
	<div class="footer">
		<div class="w1700">
			<ul>
				<li>
					<span class="fttitle">思洋 · 广州总部</span>
					<div>
						<p>广州天河区珠江新城富力盈力大厦北塔2706</p>
						<p>020-38013166（网站咨询专线）</p>
					</div>
					<p>400-001-5281 （售后服务热线）</p>
				</li>
				<li>
					<span class="fttitle">思洋 · 深圳</span>
					<div>
						<p>深圳市坂田十二橡树庄园F1-7栋</p>
						<p>Site/ http://www.szciya.com </p>
						<p>E-mail/ itciya@vip.163.com</p>
					</div>
					<p>品牌服务专线：400-001-5281 </p>
				</li>
				<li>
					<span class="fttitle">思洋 · 湖南</span>
					<div>
						<p>长沙市天心区芙蓉中路三段398号新时空大厦5楼</p>
						<p>联系电话/ (+86 0731)88282200</p>
					</div>
					<p>品牌服务专线/ 400-966-8830</p>
				</li>
				<li class="lastli">
					<p class="mt10">旗下运营网站：</p>
					<div class="mt10">
						<img src="/images/ftlogo2.png">
						<img src="/images/gogo.png">
						<img src="/images/ftlogo3.png">
						<img src="/images/ftlogo4.png">
						<img src="/images/ftlogo11.png">
					</div>
				</li>
			</ul>
		</div>
	</div>
	<div class="ft_bottom">
		<div class="w1700">
			<p class="cop">Copyright © 2016 广州思洋文化传播有限公司，保留所有权利。 <a href="https://beian.miit.gov.cn/" target="_blank">粤ICP备09033321号</a>
			</p>
		</div>
	</div>
</div>
<div class="le-box active">
	<div class="t show780">
		<a href="tel:13570966600">
			<img src="/images/ml9-1.png?v=1" alt="" class="sow i">
			<img src="/images/ml9-1.png?v=1" alt="" class="iove i">
		</a>
	</div>
	<div class="t">
		<img src="/images/ml1-1.png?v=1" alt="" class="sow i">
		<img src="/images/ml1-1.png?v=1" alt="" class="iove i">
		<div class="iov">
			<div class="img">
				<img src="/images/qr.jpg" alt="与项目经理交流">
			</div>
			<div class="h">扫描二维码<br>与项目经理交流</div>
		</div>
	</div>
	<div class="t">
		<img src="/images/ml2-1.png?v=1" alt="" class="sow i">
		<img src="/images/ml2-1.png?v=1" alt="" class="iove i">
		<div class="iov">
			<div class="img">
				<img src="/images/qq001.jpg" alt="">
			</div>
			<div class="h">扫描二维码<br>与项目经理交流</div>
		</div>
	</div>
	<!--<div class="t">-->
		<!--<a href="http://wpa.qq.com/msgrd?v=3&amp;uin=1607245872&amp;site=ciya.cn&amp;menu=yes" target="_blank">-->
			<!--<img src="/images/ml2-1.png?v=1" alt="" class="sow i">-->
			<!--<img src="/images/ml2-1.png?v=1" alt="" class="iove i">-->
		<!--</a>-->
	<!--</div>-->
	<div class="t hide780">
		<a href="https://affim.baidu.com/unique_510425/chat?siteId=19536215&userId=510425&siteToken=8914d517c927d8e794148d05e387fb17" target="_blank">
			<img src="/images/ml3-1.png?v=1" alt="" class="sow i">
			<img src="/images/ml3-1.png?v=1" alt="" class="iove i">
		</a>
	</div>
</div>
<script>
	$(window).scroll(function(){
//		if($(window).scrollTop()>200){
//			$(".le-box").addClass("active");
//		}else{
//			$(".le-box").removeClass("active");
//		}
	})
</script>
<div class="wap_fx">
	<a href="tel:13570966600" class="phone"></a>
	<a href="mqqwpa://im/chat?chat_type=wpa&uin=1607245872&version=1&src_type=web&web_src=ciya.cn" target="_blank" class="qq"></a>
	<a href="javascript:;" class="wx2"></a>
	<a class="kef986" style="background:rgba(0,0,0,.6) url(/images/ml3-1.png?v=1) no-repeat center;background-size: cover;border-radius: 4px;" href="https://p.qiao.baidu.com/cps/chat?siteId=18513940&userId=510425&siteToken=e5e1bde478969b43bf99b7703a694c0b" target="_blank"></a>
</div>
<div class="wap-wxcode">
	<div class="middle-box">
		<div class="middle-inner">
			<div class="wap-wxcode-con">
				<img src="/images/ff_ewm.jpg" alt=""/>
				<div class="wap-wxcode-bot"><span class="wxname">ciya68</span><button class="copy-btn" data-clipboard-text="ciya68">点击复制</button></div>
				<div class="gb1002"></div>
			</div>
		</div>
	</div>
</div>
<input id="hide" type="hidden">
<script src="/js/clipboard.min.js"></script>
<script>
	$(function(){
		$(".wx2").click(function(){
			$(".wap-wxcode").show();
		});
		$(".gb1002").click(function(){
			$(".wap-wxcode").hide();
		});
		var copyBtn=new ClipboardJS('.copy-btn');
		copyBtn.on("success",function(e){
			// 复制成功
			// alert(e.text);
			showMessage('已成功复制微信号','success',2000)
			e.clearSelection();
		});
		copyBtn.on("error",function(e){
			//复制失败；
			showMessage('复制微信号失败','error',2000)
			console.log( e.action )
		});
		function showMessage(message,type,time) {
			let str = ''
			switch (type) {
				case 'success':
					str = '<div class="success-message" style="width: 100%;height: 50px;background-color: #030026;font-size:17px;text-align: center;color:#fff;position: fixed;left: 0%;bottom: 0%;line-height: 50px;z-index: 9999">\n' +
							'    <span class="mes-text">'+message+'</span></div>'
					break;
				case 'error':
					str = '<div class="error-message" style="width: 100%;height: 50px;background-color: #030026;font-size:17px;text-align: center;color: #fff;position: fixed;left: 0%;bottom: 0%;line-height: 50px;z-index: 9999">\n' +
							'    <span class="mes-text">'+message+'</span></div>'
			}
			$('body').append(str)
			setTimeout(function () {
				$('.'+type+'-message').remove()
			},time)
		}


		var ua = navigator.userAgent.toLowerCase();
		var isWeixin = ua.indexOf('micromessenger')!= -1;
		if(isWeixin){
			$(".kef986").hide();
		}

	})
</script>
            </div>
        </div>
		<script type="text/javascript" src="/js/trunk.js?v=2"></script>
        <script>
            var zxal=null;
            var len=$(".zxal .swiper-slide").length;
            if(len>1){
                zxal = new Swiper('.zxal .swiper-container',{
                    speed:600,
                    loop:true,
                    autoplay : 5000,
                    autoplayDisableOnInteraction : false,
                    pagination : '.zxalDot',
                    paginationClickable :true,
                })
            }else{
                $(".zxalDot").hide();
            }
        </script>
	</body>
</html>

