init
This commit is contained in:
@@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<select id="selectDbTableColumnsByName" parameterType="String" resultMap="GenTableColumnResult">
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isMySql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isMySql()">
|
||||
select column_name,
|
||||
(case when (is_nullable = 'no' <![CDATA[ && ]]> column_key != 'PRI') then '1' else '0' end) as is_required,
|
||||
(case when column_key = 'PRI' then '1' else '0' end) as is_pk,
|
||||
@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from information_schema.columns where table_schema = (select database()) and table_name = (#{tableName})
|
||||
order by ordinal_position
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isOracle()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isOracle()">
|
||||
select lower(temp.column_name) as column_name,
|
||||
(case when (temp.nullable = 'N' and temp.constraint_type != 'P') then '1' else '0' end) as is_required,
|
||||
(case when temp.constraint_type = 'P' then '1' else '0' end) as is_pk,
|
||||
@@ -61,7 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE temp.row_flg = 1
|
||||
ORDER BY temp.column_id
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isPostgerSql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isPostgerSql()">
|
||||
SELECT column_name, is_required, is_pk, sort, column_comment, is_increment, column_type
|
||||
FROM (
|
||||
SELECT c.relname AS table_name,
|
||||
@@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
WHERE table_name = (#{tableName})
|
||||
AND column_type <![CDATA[ <> ]]> '-'
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isSqlServer()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isSqlServer()">
|
||||
SELECT
|
||||
cast(A.NAME as nvarchar) as column_name,
|
||||
cast(B.NAME as nvarchar) + (case when B.NAME = 'numeric' then '(' + cast(A.prec as nvarchar) + ',' + cast(A.scale as nvarchar) + ')' else '' end) as column_type,
|
||||
|
||||
@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<select id="selectPageDbTableList" resultMap="GenTableResult">
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isMySql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isMySql()">
|
||||
select table_name, table_comment, create_time, update_time
|
||||
from information_schema.tables
|
||||
where table_schema = (select database())
|
||||
@@ -68,7 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
order by create_time desc
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isOracle()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isOracle()">
|
||||
select lower(dt.table_name) as table_name, dtc.comments as table_comment, uo.created as create_time, uo.last_ddl_time as update_time
|
||||
from user_tables dt, user_tab_comments dtc, user_objects uo
|
||||
where dt.table_name = dtc.table_name
|
||||
@@ -84,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
order by create_time desc
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isPostgerSql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isPostgerSql()">
|
||||
select table_name, table_comment, create_time, update_time
|
||||
from (
|
||||
SELECT c.relname AS table_name,
|
||||
@@ -108,7 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
order by create_time desc
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isSqlServer()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isSqlServer()">
|
||||
SELECT cast(D.NAME as nvarchar) as table_name,
|
||||
cast(F.VALUE as nvarchar) as table_comment,
|
||||
crdate as create_time,
|
||||
@@ -129,7 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectDbTableListByNames" resultMap="GenTableResult">
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isMySql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isMySql()">
|
||||
select table_name, table_comment, create_time, update_time from information_schema.tables
|
||||
where table_name NOT LIKE 'xxl_job_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
|
||||
and table_name in
|
||||
@@ -137,7 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isOracle()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isOracle()">
|
||||
select lower(dt.table_name) as table_name, dtc.comments as table_comment, uo.created as create_time, uo.last_ddl_time as update_time
|
||||
from user_tables dt, user_tab_comments dtc, user_objects uo
|
||||
where dt.table_name = dtc.table_name
|
||||
@@ -150,7 +150,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isPostgerSql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isPostgerSql()">
|
||||
select table_name, table_comment, create_time, update_time
|
||||
from (
|
||||
SELECT c.relname AS table_name,
|
||||
@@ -170,7 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{name}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isSqlServer()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isSqlServer()">
|
||||
SELECT cast(D.NAME as nvarchar) as table_name,
|
||||
cast(F.VALUE as nvarchar) as table_comment,
|
||||
crdate as create_time,
|
||||
@@ -187,12 +187,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectTableByName" parameterType="String" resultMap="GenTableResult">
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isMySql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isMySql()">
|
||||
select table_name, table_comment, create_time, update_time from information_schema.tables
|
||||
where table_name NOT LIKE 'xxl_job_%' and table_name NOT LIKE 'gen_%' and table_schema = (select database())
|
||||
and table_name = #{tableName}
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isOracle()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isOracle()">
|
||||
select lower(dt.table_name) as table_name, dtc.comments as table_comment, uo.created as create_time, uo.last_ddl_time as update_time
|
||||
from user_tables dt, user_tab_comments dtc, user_objects uo
|
||||
where dt.table_name = dtc.table_name
|
||||
@@ -202,7 +202,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
AND dt.table_name NOT IN (select table_name from gen_table)
|
||||
and lower(dt.table_name) = #{tableName}
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isPostgerSql()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isPostgerSql()">
|
||||
select table_name, table_comment, create_time, update_time
|
||||
from (
|
||||
SELECT c.relname AS table_name,
|
||||
@@ -219,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where table_name NOT LIKE 'xxl_job_%' and table_name NOT LIKE 'gen_%'
|
||||
and table_name = #{tableName}
|
||||
</if>
|
||||
<if test="@com.ruoyi.common.helper.DataBaseHelper@isSqlServer()">
|
||||
<if test="@com.ruoyi.component.mybatis.helper.DataBaseHelper@isSqlServer()">
|
||||
SELECT cast(D.NAME as nvarchar) as table_name,
|
||||
cast(F.VALUE as nvarchar) as table_comment,
|
||||
crdate as create_time,
|
||||
|
||||
Reference in New Issue
Block a user