mybatis批量添加xml
<insert id="batchCreate"> INSERT INTO `roomer` (`order`,name,idCard,mobile,timePreCheckin,timePreCheckout,hotel) values <foreach collection="collection" item="item" index="index" separator=","> ( #{item.order,jdbcType=VARCHAR},#{item.name}, #{item.idCard},#{item.mobile},#{item.timePreCheckin}, #{item.timePreCheckout},#{item.hotel,jdbcType=INTEGER}) </foreach> </insert>
SELECT group_CONCAT(a.title) from jh_category a <where> <foreach collection="list" item="id" index="index" open="(" close=")" separator=","> #{id} </foreach> </where>
and a.title like CONCAT('%',#{query.title},'%')
and <![CDATA[ date_format(a.award_time,'%Y-%m-%d') >= date_format(#{startTime} ,'%Y-%m-%d') ]]>
全文完,感谢您的耐心阅读~
欢迎大家关注我的公众号