| | |
| | | show TABLES like #{tableName} |
| | | </select> |
| | | |
| | | <select id="selectIdxByTableName" parameterType="java.lang.String" resultType="java.util.Map" statementType="STATEMENT"> |
| | | SELECT * FROM mysql.`innodb_index_stats` a WHERE a.table_name = ${tableName} |
| | | </select> |
| | | |
| | | <select id="getTableField" parameterType="String" resultType="com.highdatas.mdm.entity.TableSchemaResult"> |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType from information_schema.COLUMNS where table_name = #{tableName} and table_schema = (select database()) |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType, character_maximum_length as length from information_schema.COLUMNS where table_name = #{tableName} and table_schema = (select database()) |
| | | </select> |
| | | |
| | | <select id="getTableFieldFromDb" parameterType="com.highdatas.mdm.entity.TableSchema" resultType="com.highdatas.mdm.entity.TableSchemaResult"> |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType from information_schema.COLUMNS where table_name = #{tableName} and table_schema = #{dbName} |
| | | select COLUMN_NAME as fieldName,DATA_TYPE as dbType,character_maximum_length as length from information_schema.COLUMNS where table_name = #{tableName} and table_schema = #{dbName} |
| | | </select> |
| | | |
| | | <select id="selectByPage" resultType="java.util.Map" statementType="STATEMENT" > |
| | | select ${fields} from ${tableName} where ${where} ${limit} |
| | | </select> |
| | | |
| | | <select id="selectDistinct" resultType="java.util.Map" statementType="STATEMENT" > |
| | | select DISTINCT ${fields} from ${tableName} where ${where} |
| | | </select> |
| | | |
| | | <select id="selectByPageByVersion" resultType="java.util.Map" statementType="STATEMENT" > |
| | |
| | | INSERT INTO ${tableName} (${fields}) VALUES ${values} |
| | | </insert> |
| | | |
| | | <insert id="insertOneSelect" statementType="STATEMENT" > |
| | | INSERT INTO ${tableName} (${fields}) |
| | | select ${selectFields} from (${selectSql}) a |
| | | </insert> |
| | | |
| | | <update id="update"> |
| | | update ${tableName} set ${updateSegment} |
| | | where ${where} |
| | | </update> |
| | | |
| | | <update id="updateJoin"> |
| | | update ${tableName} |
| | | ${joinTableSegment} |
| | | set ${updateSegment} |
| | | where ${where} |
| | | </update> |
| | | |
| | | <delete id="delete"> |
| | | DELETE FROM ${tableName} where ${where} |
| | | </delete> |
| | | |
| | | <select id="createIdx"> |
| | | CREATE INDEX ${idxName} ON ${tableName} (${fields}) |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteTempByMaintainId"> |
| | | DELETE FROM ${tableTempName} where EXISTS ( |
| | |
| | | </delete> |
| | | |
| | | <select id="selectActMemberShip" parameterType="java.util.Map" resultType="java.util.Map"> |
| | | select * from act_id_membership where USER_ID_ = #{userId} and GROUP_ID_ = #{roleId} |
| | | select * from ACT_ID_MEMBERSHIP where USER_ID_ = #{userId} and GROUP_ID_ = #{roleId} |
| | | </select> |
| | | <select id="selectActMemberShipByRole" parameterType="java.util.Map" resultType="java.util.Map"> |
| | | select * from ACT_ID_MEMBERSHIP where GROUP_ID_ = #{roleId} |
| | | </select> |
| | | <select id="selectActMemberShipByUser" parameterType="java.util.Map" resultType="java.util.Map"> |
| | | select * from ACT_ID_MEMBERSHIP where USER_ID_ = #{userId} |
| | | </select> |
| | | |
| | | <select id="getOneTempFieldDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT DISTINCT ${field} FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getTempDataByMaintainExtent" statementType="STATEMENT" resultType="java.util.Map"> |
| | | <![CDATA[ |
| | | SELECT * FROM ${tempTableName} t WHERE EXISTS ( |
| | | SELECT pre_merge_id FROM ( SELECT pre_merge_id FROM maintain_detail WHERE EXISTS ( |
| | | SELECT id FROM ( SELECT id FROM `maintain` WHERE |
| | | table_name = ${tableName} |
| | | AND order_no >= ${fromOrderNo} |
| | | AND order_no < ${toOrderNo} |
| | | ) a |
| | | WHERE |
| | | a.id = maintain_detail.parent_id ) |
| | | ) a |
| | | WHERE t.id = a.pre_merge_id) |
| | | |
| | | ]]> |
| | | </select> |
| | | </mapper> |