Skip to content

Commit

Permalink
Merge branch 'master' of http://git.oschina.net/thinkgem/jeesite
Browse files Browse the repository at this point in the history
Conflicts:
	pom.xml
  • Loading branch information
think-gem committed Feb 28, 2015
2 parents 615f422 + 79f9e98 commit 14d88cf
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ Hibernate性能上定不是问题。但对于大多数情况下,真正掌握Hi

## 如何交流、反馈、参与贡献?

* QQ Group:127515876   209330483
* QQ Group:127515876   209330483   223507718
* E-mail:[email protected]
* GitHub:<https://github.com/thinkgem/jeesite>
* 开源中国:<http://git.oschina.net/thinkgem/jeesite>
* 官方网址:<http://jeesite.com> 论坛:<http://bbs.jeesite.com>
Expand Down
25 changes: 25 additions & 0 deletions src/main/resources/mappings/modules/gen/GenDataBaseDictDao.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
</if>
ORDER BY t.TABLE_NAME
</if>
<if test="dbName == 'mysql'">
SELECT t.table_name AS name,t.TABLE_COMMENT AS comments
FROM information_schema.`TABLES` t
WHERE t.TABLE_SCHEMA = (select database())
<if test="name != null and name != ''">
AND t.TABLE_NAME = upper(#{name})
</if>
ORDER BY t.TABLE_NAME
</if>
</select>

<select id="findTableColumnList" resultType="GenTableColumn">
Expand Down Expand Up @@ -43,6 +52,16 @@
</if>
ORDER BY t.COLUMN_ID
</if>
<if test="dbName == 'mysql'">
SELECT t.COLUMN_NAME AS name, (CASE WHEN t.IS_NULLABLE = 'YES' THEN '1' ELSE '0' END) AS isNull,
(t.ORDINAL_POSITION * 10) AS sort,t.COLUMN_COMMENT AS comments,t.COLUMN_TYPE AS jdbcType
FROM information_schema.`COLUMNS` t
WHERE t.TABLE_SCHEMA = (select database())
<if test="name != null and name != ''">
AND t.TABLE_NAME = upper(#{name})
</if>
ORDER BY t.ORDINAL_POSITION
</if>
</select>

<select id="findTablePK" resultType="string">
Expand All @@ -53,6 +72,12 @@
AND au.constraint_type = 'P'
AND au.table_name = upper(#{name})
</if>
<if test="dbName == 'mysql'">
SELECT lower(au.COLUMN_NAME) AS columnName
FROM information_schema.`COLUMNS` au
WHERE au.TABLE_SCHEMA = (select database())
AND au.COLUMN_KEY='PRI' AND au.TABLE_NAME = upper(#{name})
</if>
</select>

</mapper>

0 comments on commit 14d88cf

Please sign in to comment.