<?xml version="1.0" encoding="UTF-8"?>
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<mapper namespace="com.highdatas.mdm.mapper.SysFieldMapper">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.highdatas.mdm.entity.SysField">
|
<id column="id" property="id" />
|
<result column="code" property="code" />
|
<result column="table_name" property="tableName" />
|
<result column="field" property="field" />
|
<result column="alias" property="alias" />
|
<result column="format" property="format" />
|
<result column="width" property="width" />
|
<result column="visible" property="visible" />
|
<result column="editble" property="editble" />
|
<result column="align" property="align" />
|
<result column="order" property="order" />
|
<result column="field_type" property="fieldType" />
|
<result column="desp" property="desp" />
|
<result column="operate" property="operate" />
|
<result column="create_time" property="createTime" />
|
<result column="update_time" property="updateTime" />
|
</resultMap>
|
|
<select id="fromTable" resultType="com.highdatas.mdm.entity.SysField" statementType="STATEMENT" >
|
select * from sys_field where table_name = #{tableName} and field in (${fields})
|
</select>
|
|
<select id="fromTableAndIds" resultType="com.highdatas.mdm.entity.SysField" statementType="STATEMENT" >
|
select * from sys_field where table_name = #{tableName} and field in (${fields})
|
</select>
|
|
|
<select id="getMappedMatintainId" resultType="java.lang.String" statementType="STATEMENT" >
|
<![CDATA[
|
SELECT maintain_field_id from sys_field f
|
LEFT JOIN maintain_field m on f.maintain_field_id = m.id
|
WHERE m.order_no < ${orderNo} and m.table_name = ${tableName} ORDER BY m.order_no desc limit 1
|
]]>
|
</select>
|
|
<select id="updateOrderNoFront" resultType="java.lang.Integer" statementType="STATEMENT" >
|
<![CDATA[
|
update sys_field
|
set order_no = order_no + 1
|
where ${maintainParams} and order_no < ${orderNo} and order_no >= ${preOrderNo}
|
|
]]>
|
</select>
|
|
<select id="updateOrderNoBack" resultType="java.lang.Integer" statementType="STATEMENT" >
|
<![CDATA[
|
update sys_field
|
set order_no = order_no - 1
|
where ${maintainParams} and order_no <= ${orderNo} and order_no > ${preOrderNo}
|
|
]]>
|
</select>
|
|
|
<select id="tansNewVersion" resultType="java.lang.Integer" statementType="STATEMENT" >
|
<![CDATA[
|
insert into sys_field
|
(id,maintain_field_id, code,table_name,field,alias,format,width,visible,editble,align,order_no,field_type,desp, create_time)
|
select UUID_SHORT() as id, ${maintainFieldId} as maintain_field_id, code,table_name,field,alias,format,width,visible,editble,align,order_no,field_type,desp, NOW() as create_time from sys_field
|
where ${maintainParams}
|
|
]]>
|
</select>
|
</mapper>
|