mybatis接口的xml常用配置

来源:互联网 发布:免费erp软件 编辑:程序博客网 时间:2024/06/05 03:12

接口

List<String> selectStaffNumByKey(@Param("key") List<String> key, @Param("effDt") Date effDt,
@Param("expDt") Date expDt);

接口对应xml配置

<select id="selectStaffNumByKey" resultType="String" >

    select 
    STAFF_NUM 
from CREW_BASE_V
where BASE IN
<foreach collection="key" item="item" index="index" open="("
separator="," close=")">#{item}</foreach>
      and EFF_DT &lt; #{expDt,jdbcType=TIMESTAMP}
      and (EXP_DT IS NULL OR EXP_DT &gt; #{effDt,jdbcType=TIMESTAMP})

  </select>


时间比较操作符&lt; 小于,&gt;大于,和IN的集合表示

0 0
原创粉丝点击