<mapper namespace="com.runtech.st.persistence.TradingContractMapper">
<resultMap type="com.runtech.st.domain.TradingContract" id="contract">
<id property="contractCode" column="CONTRACT_CODE" />
<result property="productID" column="FT_PRODUCT_ID" />
<result property="updown" column="UP_DOWN" />
<result property="commissionModel" column="COMMISSION_MODEL" />
<result property="commission" column="COMMISSION" />
<result property="earnestMoneyRate" column="EARNEST_MONEY_RATE" />
<result property="maxContractNumber" column="MAX_CONTRACT_NUMBER" />
<result property="minPriceChange" column="MIN_PRICE_CHANGE" />
<result property="tradeStatus" column="TRADE_STATUS" />
<result property="firstPrice" column="FIRST_PRICE" />
<result property="storageId" column="STORAGE_ID" />
<result property="deliveryDate" column="DELIVERY_DATE" />
<result property="moreOrLess" column="MOREORLESS" />
<result property="productionDate" column="PRODUCTION_DATE" />
<result property="expireDate" column="Expire_Date" />
<result property="takeProductType" column="TAKE_PRODUCT_TYPE" />
<result property="contractType" column="CONTRACT_TYPE" />
<result property="alternateUnits" column="Alternate_Units" />
<result property="deliveryFeeType" column="Delivery_Fee_Type"/>
<result property="deliveryFeeRate" column="Delivery_Fee_Rate"/>
</resultMap>
<resultMap type="java.util.HashMap" id="contractEx" extends="contract">
<result property="productName" column="PRODUCT_NAME"/>
<result property="manufacturer" column="MANUFACTURER"/>
<result property="productStandard" column="PRODUCT_STANDARD"/>
<result property="productSpecification" column="PRODUCT_SPECIFICATION"/>
<result property="productCode" column="PRODUCT_CODE"/>
<result property="shortName" column="SHORT_NAME"/>
<result property="storageName" column="STORAGE_NAME"/>
</resultMap>
这里面关联的表的字段<resultMap type="java.util.HashMap" id="contractEx" extends="contract">
type写的有问题,导致前台无法显示,dubug后后台返回的list是:[{minPriceChange=0, maxContractNumber=1, moreOrLess=1, updown=3, alternateUnits=1。。
type改成<resultMap type="com.runtech.st.domain.TradingContract" id="hashMap" extends="contract">后
问题没有了,list返回的是:[com.runtech.st.domain.TradingContract@465f62b6, com.runtech.st.domain.TradingContract@2049bed2。。
没注意到的一个细节,不明白以前怎么运行对了。。