org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dishController': Unsatisfied dependency expressed through field 'dishService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dishServiceImpl': Unsatisfied dependency expressed through field 'dishMapper'; nested exception is 。。。
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dishController': Unsatisfied dependency expressed through field 'dishService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'dishServiceImpl': Unsatisfied dependency expressed through field 'dishMapper'; nested exception is 。。。
mapper.xml 写了两遍该查询
<insert id="insertBatch" parameterType="list"> insert into shopping_cart (name, image, user_id, dish_id, setmeal_id, dish_flavor, number, amount, create_time) values <foreach collection="shoppingCartList" item="sc" separator=","> (#{sc.name},#{sc.image},#{sc.userId},#{sc.dishId},#{sc.setmealId},#{sc.dishFlavor},#{sc.number},#{sc.amount},#{sc.createTime}) </foreach> </insert> <insert id="insertBatch" parameterType="list"> insert into shopping_cart (name, image, user_id, dish_id, setmeal_id, dish_flavor, number, amount, create_time) values <foreach collection="shoppingCartList" item="sc" separator=","> (#{sc.name},#{sc.image},#{sc.userId},#{sc.dishId},#{sc.setmealId},#{sc.dishFlavor},#{sc.number},#{sc.amount},#{sc.createTime}) </foreach> </insert> 一个方法MAPPER的配置多写了一次,删掉就好了。