mybatis
zs_life
不积跬步无以至千里
展开
-
mabatis_foreach遍历
__matname__="%a%,%df%,%as%",是一个字符串,传到后台进行拆分成为数组遍历<foreach item="ite" collection="__matname__.split(',')"> and t5.matname not like #{ite} </foreach>...原创 2019-10-31 16:00:07 · 106 阅读 · 0 评论 -
mybatis_#与$
#{} : 占位,如果是字符串,则取出来的值,自动加上双引号,使用#可以很大程度上防止sql注入。(语句的拼接)${}:取值,如果是字符串,则取出来的值,不会加上双引号,但是如果使用在order by 中就需要使用 $...原创 2019-05-08 21:57:47 · 70 阅读 · 0 评论 -
mybatis_批量插入参数List_Map_String,Object
mybatis_批量插入参数List<Map<String,Object>>Dao int insertCoachMessageInfo(@Param("listInsert")List<Map<String,Object>> listInsert);xml insert into coach_message...原创 2019-05-22 00:02:33 · 7999 阅读 · 1 评论 -
mybatis_标签整理
<!-- 思想:把choose,when,otherwise,当做if-else来用 --><if test="dateType != null"> <choose> <when test="dateType == 123"> AND sh.holiday_type IN (1,2,3) ...原创 2019-06-13 22:17:38 · 46 阅读 · 0 评论