<?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.MaintainFieldMapper"> <!-- é€šç”¨æŸ¥è¯¢æ˜ å°„ç»“æžœ --> <resultMap id="BaseResultMap" type="com.highdatas.mdm.entity.MaintainField"> <id column="id" property="id" /> <result column="table_name" property="tableName" /> <result column="flow_id" property="flowId" /> <result column="charge_id" property="chargeId" /> <result column="desp" property="desp" /> <result column="version" property="version" /> <result column="create_time" property="createTime" /> <result column="order_no" property="orderNo" /> </resultMap> <select id="getMappedMatintainId" resultType="java.lang.String" statementType="STATEMENT" > <![CDATA[ SELECT f.id from maintain_field f LEFT JOIN maintain m on f.maintain_id = m.id WHERE m.order_no < ${orderNo} and m.table_name = ${tableName} ORDER BY m.order_no desc limit 1 ]]> </select> <select id="addCloumn" resultType="java.lang.String" statementType="STATEMENT" > alter table ${tableName} add ${field} ${fieldType} null; </select> </mapper>