mybatis常用xml语法
@Select("<script> " +
"select " +
"vga.plate_type as plateType," +
"count(plate_info) as counts " +
" from" +
" vehicle_gangqu_all vga" +
"<where>" +
"<if test='crossCode != null and crossCode.size >0'>" +
" and vga.cross_code in " +
" <foreach collection=\"crossCode\" item=\"item\" open=\"(\" separator=\",\" close=\")\">\n" +
" #{item} \n" +
" </foreach>" +
"</if>" +
"<if test='searchCarParamDTO.startTime != null and searchCarParamDTO.startTime.length >0 '>" +
" and toStartOfDay(vga.pass_time) BETWEEN #{searchCarParamDTO.startTime} AND #{searchCarParamDTO.startTime} " +
"</if>" +
"</where>" +
"group by " +
" vga.plate_type </script>")
L