最近在ORM上使用了ibatis,感受挺繁瑣的,沒有jpa來的直接,但項目非要用也沒有辦法,最近在進行開發過程當中出現了一個問題Invalid bound statement (not found)
意思是說,你的xml映射和你的mapper方法不一致,這種不一致大叔總結幾點,若是你出現了這種問題能夠按着下面幾後進行排查。java
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代碼:sql
<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>