日期:2014-05-17  浏览次数:20801 次

mybatis嵌套查询多值传参问题 -急!!!
<select id="selectProcessInfo" parameterType="CaseQB" resultMap="processInfoList">
SELECT T2.TASK_ORDER_ID,
T3.TEMPLATE_ID,
T3.TEMPLATE_NAME,
T5.STAFF_NAME
FROM DEAL_ORDER T1,
TASK_ORDER T2,
TASK_TEMPLATE T3,
USER_OWNER_RELA T4,
STAFF T5
WHERE T1.CASE_ID = 285
AND T1.DEAL_TYPE = 1
AND T2.DEAL_ORDER_ID = T1.DEAL_ORDER_ID
AND T2.STATUS !=0
AND T2.TEMPLATE_ID = T3.TEMPLATE_ID
AND T3.STATUS = 'A'
AND T2.DEAL_STAFF = T4.USER_ID
AND T4.OWNER_TYPE = 'S'
AND T4.STS = 'A'
AND T4.OWNER_ID = T5.STAFF_ID
AND T5.STS = 'A'
</select>
<resultMap type="CaseVO" id="processInfoList">
<id column="TEMPLATE_ID" property="taskTemplate.templateId" />
<result column="TEMPLATE_NAME" property="taskTemplate.templateName" />
<result column="STAFF_NAME" property="dealMan" />
<result column="TASK_ORDER_ID" property="taskOrder.taskOrderId" />
<collection property="complexProps" javaType="ArrayList" column="{????????}" 
ofType="ComplexProp" select="selectPropsForProcess"></collection>
</resultMap>
<select id="selectPropsForProcess" parameterType="long" resultMap="complexPropList">
SELECT T8.DEAL_PROP_ID,
T7.PROP_NAME, 
T8.PROP_VALUE, 
T8.PROP_VALUE_NAME
FROM TASK_PROP T6, PROPERTY T7, DEAL_ORDER_PROP T8
WHERE T6.PROP_ID = T7.PROP_ID
AND T6.PROP_ID = T8.PROP_ID
AND T6.TEMPLATE_ID = #{taskTemplate.templateId}
AND T8.DEAL_ORDER_ID = 396
AND T6.STATUS = 'A'
AND T7.STATUS = 'A'
AND T8.TASK_ORDER_ID = 645
ORDER BY T8.STATUS_DATE
</select>
<resultMap type="ComplexProp" id="complexPropList">
<id column="DEAL_PROP_ID" property="dealOrderProp.dealPropId" />
<result column="PROP_NAME" property="property.propName" />
<result column="PROP_VALUE" property="dealOrderProp.propValue" />
<result column="PROP_VALUE_NAME" property="dealOrderProp.propValueName" />
</resultMap>

查询返回CaseVO对象,对象内包含List<ComplexProp>,嵌入的sql怎么给它传一个以上的参数,传一个参数我知道,就不用
说了!!
查了一下资料,{prop=col1,prop2=col2}这种方法,但是报错
求高手指点!!!!

------解决方案--------------------
传递Map类型进去 应该可以的吧

本人三年JAVA开发,寻求牛人加入Q群53141769
------解决方案--------------------
看上去怎么这么复杂哦 这个list里面返回list 
在bean里面配好就是了撒 
<select id="selectProcessInfo" parameterType="CaseQB" resultMap="processInfoList">
SELECT T2.TASK_ORDER_ID,
T3.TEMPLATE_ID,
T3.TEMPLATE_NAME,
T5.STAFF_NAME
FROM DEAL_ORDER T1,
TASK_ORDER T2,
TASK_TEMPLATE T3,
USER_OWNER_RELA T4,
STAFF T5
WHERE T1.CASE_ID = 285
AND T1.DEAL_TYPE = 1
AND T2.DEAL_ORDER_ID = T1.DEAL_ORDER_ID
AND T2.STATUS !=0
AND T2.TEMPLATE_ID = T3.TEMPLATE_ID
AND T3.STATUS = 'A'
AND T2.DEAL_STAFF = T4.USER_ID
AND T4.OWNER_TYPE = 'S'
AND T4.STS = 'A'
AND T4.OWNER_ID = T5.STAFF_ID
AND T5.STS = 'A'
</select>
<resultMap type="CaseVO" id="processInfoList">
<id column="TEMPLATE_ID" property="taskTemplate.templateId" />
<result column="TEMPLATE_NAME&