Преглед изворни кода

1、适配oracle
2、更改高级搜索的时间空间,格式化时间日期值

xierz пре 4 година
родитељ
комит
193d144a04
1 измењених фајлова са 20 додато и 3 уклоњено
  1. 20 3
      src/main/java/net/mingsoft/cms/dao/IContentDao.xml

+ 20 - 3
src/main/java/net/mingsoft/cms/dao/IContentDao.xml

@@ -235,6 +235,7 @@
 			<if test="createDate != null"> and ct.create_date=#{createDate} </if>
 			<if test="updateBy &gt; 0"> and ct.update_by=#{updateBy} </if>
 			<if test="updateDate != null"> and update_date=#{updateDate} </if>
+			<include refid="net.mingsoft.base.dao.IBaseDao.sqlWhere"></include>
 		</where>
 		)ct ORDER BY ct.content_datetime desc,content_sort desc
 	</select>
@@ -253,10 +254,20 @@
 				(select id FROM cms_category where find_in_set('${categoryId}',CATEGORY_PARENT_IDS)>0))
 			</if>
 			<if test="beginTime!=null and beginTime!=''">
-				and content_datetime &gt;= #{beginTime}
+				<if test="_databaseId == 'mysql'">
+					and content_datetime &gt;= #{beginTime}
+				</if>
+				<if test="_databaseId == 'oracle'">
+					and content_datetime &gt;= to_date(#{beginTime}, 'yyyy-mm-dd hh24:mi:ss')
+				</if>
 			</if>
 			<if test="endTime!=null and endTime!=''">
-				and content_datetime &gt;= #{endTime}
+				<if test="_databaseId == 'mysql'">
+					and content_datetime &gt;= #{endTime}
+				</if>
+				<if test="_databaseId == 'oracle'">
+					and content_datetime &gt;= to_date(#{endTime}, 'yyyy-mm-dd hh24:mi:ss')
+				</if>
 			</if>
 			<if test="flag!=null and flag!=''">
 			and ct.content_type in ( #{flag})
@@ -319,7 +330,13 @@
 			and a.content_details like CONCAT(CONCAT("%",#{map.content_details}),"%")
 			</if>
 			<if test="map.content_datetime_start!=null and map.content_datetime_end!=null">
-				and a.content_datetime between #{map.content_datetime_start} and #{map.content_datetime_end}
+				<if test="_databaseId == 'mysql'">
+					and a.content_datetime between #{map.content_datetime_start} and #{map.content_datetime_end}
+				</if>
+				<if test="_databaseId == 'oracle'">
+					and a.content_datetime &gt; to_date(#{map.content_datetime_start}, 'yyyy-mm-dd hh24:mi:ss')
+					and a.content_datetime &lt; to_date(#{map.content_datetime_end}, 'yyyy-mm-dd hh24:mi:ss')
+				</if>
 			</if>
 			<if test="tableName!=null and tableName!='' and diyMap!=null">
 				<foreach item="item" index="index" collection="diyList" open=""