57 lines
2.0 KiB
XML
57 lines
2.0 KiB
XML
<?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.project.joggle.mapper.ReplaceRelationshipMapper">
|
|
|
|
<resultMap id="BaseResultMap" type="com.project.joggle.domain.ReplaceRelationship">
|
|
<result property="id" column="ID" jdbcType="VARCHAR"/>
|
|
<result property="oldTraceCode" column="OLD_TRACE_CODE" jdbcType="VARCHAR"/>
|
|
<result property="newTraceCode" column="NEW_TRACE_CODE" jdbcType="VARCHAR"/>
|
|
<result property="status" column="STATUS" jdbcType="VARCHAR"/>
|
|
<result property="errorcount" column="ERRORCOUNT" jdbcType="INTEGER"/>
|
|
</resultMap>
|
|
|
|
<sql id="Base_Column_List">
|
|
ID,OLD_TRACE_CODE,NEW_TRACE_CODE,
|
|
STATUS,ERRORCOUNT
|
|
</sql>
|
|
|
|
<select id="selectReplaceRelationshipList" parameterType="ReplaceRelationship" resultMap="BaseResultMap">
|
|
SELECT
|
|
<include refid="Base_Column_List"/>
|
|
FROM REPLACE_RELATIONSHIP
|
|
<where>
|
|
STATUS in (0,2)
|
|
and (ERRORCOUNT is null or ERRORCOUNT <3)
|
|
|
|
<if test="id != null and id != ''">
|
|
AND ID = #{id}
|
|
</if>
|
|
<if test="oldTraceCode != null and oldTraceCode != ''">
|
|
AND OLD_TRACE_CODE = #{oldTraceCode}
|
|
</if>
|
|
<if test="newTraceCode != null and newTraceCode != ''">
|
|
AND NEW_TRACE_CODE = #{newTraceCode}
|
|
</if>
|
|
|
|
|
|
|
|
</where>
|
|
</select>
|
|
|
|
<update id="updateRelationshipRestructur" parameterType="ReplaceRelationship">
|
|
UPDATE REPLACE_RELATIONSHIP
|
|
<set>
|
|
<if test="status != null and status != ''">
|
|
STATUS = #{status},
|
|
</if>
|
|
<if test="errorcount !=null and errorcount != ''">
|
|
ERRORCOUNT= #{errorcount}
|
|
</if>
|
|
</set>
|
|
WHERE id = #{id}
|
|
</update>
|
|
|
|
</mapper>
|