I have two tables, named tms_driver(primary table) and tms_account_resource_binding.
And SQL is here:
<select id="getDriverByLoginAccountId" resultType="org.jeecg.modules.driver.entity.Driver">
SELECT
td.*
FROM
tms_account_resource_binding tarb
LEFT JOIN tms_driver td ON tarb.resource_id = td.id
WHERE
tarb.type = 1
AND tarb.account_id = #{loginAccountId}
</select>And I deleted the tms_driver's data.
I got a row of data with only tarb. But I need the data of td to complete the mapping
The mapper interface is defined as follows
List<Driver> getDriverByLoginAccountId(@Param("loginAccountId") String loginAccountId) ; So I got a list has one item, like this:
List<Driver> driverList = loginAccountMapper.getDriverByLoginAccountId(loginAccountId);
driverList.size();// 1
driverList.get(0).getCode();// NPE
Should we consider returning a null object at this time? rather than a List containing null objects