常用开发方式
一、xml方式
二、注解方式(常用方式)
开发过程中比较简单的操作,复杂的操作时候容易出现各种问题,如在sql中引入in时候必须按照下面方式才能引入。
@Select({
"<script>",
"select",
"*",
"from delivery_spot",
"where is_valid=1 and id in",
"<foreach collection='rangeIds' item='id' open='(' separator=',' close=')'>",
"#{id}",
"</foreach>",
"</script>"
})
List<DeliverySpotPo> deliverySpotsListByIds(@Param("rangeIds") List<Integer> rangeIds);
综上个人感觉还是xml方式更方便一点。