古越剑箫

学习是一种习惯

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: :: 管理 ::

 

 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') ]]>


 

posted on 2016-10-17 11:53  古越剑箫  阅读(194)  评论(0编辑  收藏  举报