Commit 73f74526 authored by 他是超人他会飞's avatar 他是超人他会飞 Committed by 铭飞

!136 SQLServer适配

Merge pull request !136 from 他是超人他会飞/4.7.0
parents 584168ba 5f113163
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -305,7 +305,15 @@ ...@@ -305,7 +305,15 @@
<if test="order == true">desc</if> <if test="order == true">desc</if>
<if test="order == false">asc</if> <if test="order == false">asc</if>
</select> </select>
<sql id="queryWhereCategoryId" databaseId="mysql">
find_in_set('${categoryId}',CATEGORY_PARENT_ID)
</sql>
<sql id="queryWhereCategoryId" databaseId="oracle" >
instr(','||'${categoryId}'||',', ','||CATEGORY_PARENT_ID||',')>0
</sql>
<sql id="queryWhereCategoryId" databaseId="sqlServer">
CHARINDEX(','+'${categoryId}'+',' , ','+CATEGORY_PARENT_ID +',')>0
</sql>
<!-- 根据站点编号、开始、结束时间和栏目编号查询文章编号集合 --> <!-- 根据站点编号、开始、结束时间和栏目编号查询文章编号集合 -->
<select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" > <select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" >
select select
...@@ -320,7 +328,7 @@ ...@@ -320,7 +328,7 @@
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId &gt; 0"> <if test="categoryId &gt; 0">
and (b.basic_categoryid=#{categoryId} or b.basic_categoryid in and (b.basic_categoryid=#{categoryId} or b.basic_categoryid in
(select category_id FROM category where find_in_set(#{categoryId},CATEGORY_PARENT_ID))) (select category_id FROM category where <include refid="queryWhereCategoryId"></include>))
</if> </if>
<if test="beginTime!=null and beginTime!=''"> <if test="beginTime!=null and beginTime!=''">
and b.basic_updatetime &gt;= #{beginTime} and b.basic_updatetime &gt;= #{beginTime}
...@@ -358,14 +366,14 @@ ...@@ -358,14 +366,14 @@
<foreach item="val" index="index" collection="item[3]"> <foreach item="val" index="index" collection="item[3]">
<if test="index==0">#{val}</if> <if test="index==0">#{val}</if>
</foreach> </foreach>
||'%') ||'%'
</sql> </sql>
<sql id="queryLike" databaseId="sqlServer"> <sql id="queryLike" databaseId="sqlServer">
like '%'+ like '%'+
<foreach item="val" index="index" collection="item[3]"> <foreach item="val" index="index" collection="item[3]">
<if test="index==0">#{val}</if> <if test="index==0">#{val}</if>
</foreach> </foreach>
+'%') +'%'
</sql> </sql>
<!-- 已过期 --> <!-- 已过期 -->
<select id="queryListForSearch" resultMap="resultMap"> <select id="queryListForSearch" resultMap="resultMap">
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
$(function(){ $(function(){
var URL="${managerPath}/template/queryTemplateFileForColumn.do"; var URL="${managerPath}/template/queryTemplateFileForColumn.do";
var DATA = ""; var DATA = "";
$(this).request({url:URL,data:DATA,type:"json",method:"get",func:function(msg) { $(this).request({url:URL,data:DATA,type:"json",method:"post",func:function(msg) {
if(msg.length==0){ if(msg.length==0){
$("#select_id").append("<option value='' >暂无文件</option>") $("#select_id").append("<option value='' >暂无文件</option>")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment