求各路大神解答?小弟用resultMap返回数据,结果只返回了一条(实际上有SQL查有6条),附上代码,请各位大神解答!!
<!-- 在历史订单界面执行有条件的查询 --> <select id="getHisInfoList" parameterType="com.gdmu.hnrs.model.ComplexBean" resultMap="getHisInfoListMap"> <![CDATA[ select NUT_PRIINFO.p_id,NUT_PRIINFO.p_name,NUT_FDML.f_id,NUT_FDML.f_name,NUT_DIS.d_id,NUT_DIS.d_name,NUT_HISTFOD.l_time from NUT_PRIINFO,NUT_FDML,NUT_HISTFOD,NUT_DIS,NUT_DEPT where NUT_HISTFOD.P_ID=NUT_PRIINFO.P_ID and NUT_HISTFOD.D_ID=NUT_DIS.D_ID and NUT_HISTFOD.F_ID=NUT_FDML.F_ID and NUT_DIS.k_Id=NUT_DEPT.K_ID and NUT_DEPT.M_ID = #{managerBean.m_id} ]]> </select>
<resultMap id="getHisInfoListMap" type="com.gdmu.hnrs.model.ComplexBean" > <association property="patientBean" javaType="com.gdmu.hnrs.model.PatientBean"> <id property="p_id" column="p_id"/> <result property="p_name" column="p_name"/> </association> <association property="foodBean" javaType="com.gdmu.hnrs.model.FoodBean"> <id property="f_id" column="f_id"/> <result property="f_name" column="f_name"/> </association> <association property="diseaseBean" javaType="com.gdmu.hnrs.model.DiseaseBean"> <id property="d_id" column="d_id"/> <result property="d_name" column="d_name"/> </association> <association property="historyListBean" javaType="com.gdmu.hnrs.model.HistoryListBean"> <result property="l_time" column="l_time"/> </association> </resultMap>
dao层接口:
/** * 在历史订单界面执行有条件的查询 */ public List<ComplexBean> getHisInfoList(ComplexBean complexBean);
一般执行的时候会打印SQL,你把打印的SQL执行一下,看一下结果先