Mybatis传入多个参数问题记录:
dao层接口,多个参数使用注解@Param:
/** * 更新为待上传的 */ void createWaitingUploadOrders (@Param("warehouseType") String warehouseType,@Param("siteEn") List<String> siteEn,@Param("platformEn") List<String> platformEn);
xml代码:
<!--更新--> <update id="createWaitingUploadOrders" > update Student as a inner join Student1 as b on a.warehouse_code=b.warehouse_en set a.parcel_status=9 where b.warehouse_company=#{warehouseType} <if test="siteEn != null and siteEn.size != 0"> and a.site_en in <foreach item="item" index="index" collection="siteEn" open="(" separator="," close=")"> #{item} </foreach> </if> <if test="platformEn != null and platformEn.size != 0"> and a.platform_en in <foreach item="platform" index="index" collection="platformEn" open="(" separator="," close=")"> #{platform} </foreach> </if> limit 1000 </update>