cpdretmapper.xml 2.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
<?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.brilliance.isc.mda.dao.CpdretMapper">
    <resultMap id="BaseResultMap" type="com.brilliance.isc.bo.Cpdret">
        <result column="INR" property="inr" jdbcType="CHAR"/>
        <result column="CHOWNREF" property="chownref" jdbcType="VARCHAR"/>
        <result column="OBJTYP" property="objtyp" jdbcType="VARCHAR"/>
        <result column="OBJINR" property="objinr" jdbcType="VARCHAR"/>
        <result column="BFTH" property="bfth" jdbcType="VARCHAR"/>
        <result column="REJCOD" property="rejcod" jdbcType="VARCHAR"/>
        <result column="REMARK" property="remark" jdbcType="VARCHAR"/>
        <result column="SMHINR" property="smhinr" jdbcType="VARCHAR"/>
        <result column="OBJREF" property="objref" jdbcType="VARCHAR"/>
        <result column="INIREF" property="iniref" jdbcType="VARCHAR"/>
        <result column="CREDAT" property="credat" jdbcType="DATE"/>
        <result column="RIGHTUNIT" property="rightunit" jdbcType="VARCHAR"/>
        <result column="INIUSR" property="iniusr" jdbcType="VARCHAR"/>
        <result column="INIFRM" property="inifrm" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        chownref,
        objtyp,
        objinr,
        bfth,
        rejcod,
        remark,
        smhinr,
        objref,
        iniref,
        credat,
        rightunit,
        iniusr,
        inifrm
    </sql>

    <select id="selectCpdretByChownref" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from cpdret
        where chownref = #{chownref,jdbcType=VARCHAR}
    </select>

    <select id="selectByObjtypAndObjinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from cpdret
        where objtyp = #{objtyp,jdbcType=VARCHAR} and objinr = #{objinr,jdbcType=VARCHAR}
        order by inr desc and rownum = 1
    </select>

    <select id="selectByObjinr" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from cpdret
        where objinr = #{objinr,jdbcType=VARCHAR}
    </select>

</mapper>