批量添加:
<insert id="名称" parameterType="java.util.List">
insert into 表名 (字段,字段, 字段) values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.字段,jdbcType=INTEGER},#{item.字段,jdbcType=VARCHAR}, #{item.字段,jdbcType=INTEGER})
</foreach>
</insert>
批量删除:
<delete id="名称">
delete from 表名
where sys_permission_id in
<foreach collection="list" item="item" index="index" open="(" close=")" separator=",">
#{item.sysPermissionId,jdbcType=VARCHAR}
</foreach>
</delete>
批量修改:
int zcsx(@Param(value = "list") List<hnyy_rtn_profit> list);
<update id="zcsx" parameterType="java.util.List">
<foreach collection="list" item="item" index="index" open="begin" close=";end;" separator=";">
UPDATE 表名 h
<set>
h.CANCER=#{item.cancer,jdbcType=VARCHAR}
</set>
where h.HNYY_RTN_PROFIT_LINES_ID = #{item.hnyyRtnProfitLinesId,jdbcType=DECIMAL}
</foreach>
</update>
分页查询(Oracle):
List<Goods> selectGoods(Map<String, Object> map);
<select id="selectGoods" parameterType="Map" resultMap="BaseResultgoods">
select vg.com_goods_id,vg.goods_opcode,vg.goods_name,vg.goods_desc,vg.unit_name,vg.product_location
from (select v.*,rownum rn from v_goods v where rownum<=(1*20)
)vg where rn>((1- 1) * 20) order by vg.com_goods_id
</select>