Mybatis中@Param的使用

.

QuerySupplierComparisonBillResult querySupplierComparisonBill(@Param("supplierId") Long supplierId, @Param("dateType") int dateType, @Param("firstDate") String firstDate, @Param("lastDate") String lastDate,@Param("stationId") Long stationId);

在方法参数的前面写上@Param("参数名"),表示给参数命名,名称就是括号中的内容

总结:在xml中只有一处传入这个参数,可以不用@param;如果传入多个的参数,如果不用@param就要#{序号}按传入的顺序,开发过程建议传参数的加@Paran可以规避这些问题,如果是传入Map的集合,那么key就对应着参数的别名,可以不用加@param

猜你喜欢

转载自blog.csdn.net/linlinlinfeng/article/details/83143316
今日推荐