Skip to content

Commit

Permalink
孤独的走在路上450663584修正sql语法错误
Browse files Browse the repository at this point in the history
  • Loading branch information
think-gem committed Mar 14, 2016
1 parent cedd6b2 commit 8ddd562
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/resources/mappings/modules/cms/ArticleDao.xml
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
<if test="office.id != null and office.id != ''">
AND (c.office_id = #{office.id} OR o.parent_ids like
<if test="dbName == 'oracle'">'%'||#{office.id}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{office.id}+'%'</if>)
<if test="dbName == 'mssql'">'%'+#{office.id}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{office.id}, '%')</if>)
</if>
<if test="beginDate != null and beginDate != ''">
Expand All @@ -236,7 +236,7 @@
<if test="id != null and id != ''">
AND (c.id = #{id} OR c.parent_ids LIKE
<if test="dbName == 'oracle'">'%'||#{id}||'%'</if>
<if test="dbName == 'mssql'">'%'+#{id}+'%'</if>)
<if test="dbName == 'mssql'">'%'+#{id}+'%'</if>
<if test="dbName == 'mysql'">CONCAT('%', #{id}, '%')</if>)
</if>
group by cp.sort, cp.id, c.sort, c.id
Expand Down
11 changes: 7 additions & 4 deletions src/main/resources/mappings/modules/oa/OaNotifyRecordDao.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,18 @@
READ_DATE
)
<foreach collection="list" item="e" separator=" UNION ALL ">
SELECT
<!-- 多种数据库支持(判断问题解决,list中的对象才具有dbName的值) -->
(
<if test="e.dbName == 'oracle'"> SELECT </if>
#{e.id},
#{e.oaNotify.id},
#{e.user.id},
#{e.readFlag},
#{e.readDate}
<if test="dbName != 'mssql'">
FROM dual
</if>
<if test="e.dbName == 'oracle'">
FROM dual
</if>
)
</foreach>
</insert>

Expand Down

0 comments on commit 8ddd562

Please sign in to comment.