最近在ORM上使用了ibatis,感觉挺繁琐的,没有jpa来的直接,但项目非要用也没有办法,最近在进行开发过程中出现了一个问题 Invalid bound statement (not found)
意思是说,你的xml映射和你的mapper方法不一致,这种不一致大叔总结几点,如果你出现了这种问题可以按着下面几后进行排查。
parameterType="map"
试试 @Getter @Setter public class BusinessCustomerDTO { private Long id; private String customerName; private String contactPerson; private Integer freeDays; private String city; private String province; private String source; private LocalDateTime enterDays; private String leadingPerson; }
对应的mapper代码:
<select id="getBusinessCustomers" parameterType="java.util.Map" resultType="cn.pilipa.customer.management.dto.BusinessCustomerDTO"> select a.id, a.customer_name as customerName, a.city_code as city, a.province_code as province, a.customer_source as source, b.enter_storage_time as enterDays, b.current_salesperson as leadingPerson, c.contact_person as contactPerson from customer_base_info a inner join customer_business_info b on a.id=b.customer_id left join customer_contact_person c on c.customer_id=a.id where c.is_main_contact=1 </select>