<?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.chinaweal.aiccs.crgs.moveinDetails.mapper.EAlterRecoderMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.chinaweal.aiccs.crgs.moveinDetails.entity.EAlterRecoder">
        <id column="ALTID" property="altid" />
        <result column="PRIPID" property="pripid" />
        <result column="ALTITEM" property="altitem" />
        <result column="ALTITEM_CN" property="altitemCn" />
        <result column="ALTBE" property="altbe" />
        <result column="ALTAF" property="altaf" />
        <result column="ALTDATE" property="altdate" />
        <result column="S_EXT_FROMNODE" property="sExtFromnode" />
        <result column="S_EXT_DATATIME" property="sExtDatatime" />
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        ALTID, PRIPID, ALTITEM, ALTITEM_CN, ALTBE, ALTAF, ALTDATE, S_EXT_FROMNODE, S_EXT_DATATIME
    </sql>

    <select id="queryEAlterByPripid" resultType="com.chinaweal.aiccs.crgs.moveinDetails.entity.EAlterRecoder">
        select <include refid="Base_Column_List"/> from E_ALTER_RECODER where pripid = #{pripid}
        union all
        select <include refid="Base_Column_List"/> from E_GT_ALTER_RECODER
        where pripid = #{pripid} ORDER by ALTDATE desc
    </select>
</mapper>
