最近在使用mybatis查询数据库时,发现在pl/sql中单独执行sql时结果是有值的,但是在程序中拿到的却是null,相关配置如下:
(1)
<resultMap type="monitorTaskStatus" id="monitorTaskStatusMap">
<result column="BATCH_NUM" property="batchNum"/>
<result column="TASK_STATUS" property="taskStatus"/>
<result column="CALLED_PHONENUM" property="calledPhoneNum"/>
</resultMap>
(2)
<select id="queryStatusByProjectId" parameterType="java.lang.String" resultType="monitorTaskStatusMap">
select b.batch_num, c.called_phonenum,c.task_status
from cc_call_task c
left join cc_batch_calledperson b
on c.batch_id = b.batch_id
where b.batch_type in (2, 3)