欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mapped Statements collection already contains value for

程序员文章站 2022-07-15 12:05:28
...

前言

启动报错

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.picc.dao.HolidayArrayMapper.findHolidayByDate. please check com/picc/dao/HolidayArrayMapper.java (best guess) and com/picc/dao/HolidayArrayMapper.java (best guess)
 

原因

报错说的很明确
出现了两个相同方法 findHolidayByDate复制忘记改了 以为不同参数不影响

 //区间查询
    @Select("select count(1) form holiday_array where holiday_date between #{start}  and #{end} ")
    int findHolidayByDate(@Param("start") String start,@Param("end") String end);
    //单日查询
    @Select("select count(1) form holiday_array where holiday_date =#{date} ")
    int findHolidayByDate(@Param("date") String date);
相关标签: SQL mysql