<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jeeplus.test.rank.mapper.RankRsOfficeMapper">
  <resultMap id="BaseResultMap" type="com.jeeplus.test.rank.domain.RankRsOffice">
    <id column="id" jdbcType="VARCHAR" property="id" />
    <result column="create_by" jdbcType="VARCHAR" property="createBy" />
    <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
    <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
    <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
    <result column="del_flag" jdbcType="INTEGER" property="delFlag" />
    <result column="rs_id" jdbcType="VARCHAR" property="rsId" />
    <result column="office_id" jdbcType="VARCHAR" property="officeId" />
  </resultMap>
  <sql id="Base_Column_List">
    id, create_by, create_date, update_by, update_date, remarks, del_flag, rs_id, office_id
  </sql>

  <insert id="insertListById">
    <foreach collection="rankSequenceDTO.officeIdList" item="item" separator=";">
      insert into rank_rs_office(id,create_by,create_date,del_flag,rs_id,office_id) values(uuid(),#{createBy},DATE_FORMAT(now(), '%Y-%m-%d %H:%i:%S'),'0',#{rsId},#{item})
    </foreach>
  </insert>

</mapper>