<?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="cn.com.countrygarden.bi.main.dao.phoenix.PhoenixSalesOnSaleProjectMapper">
  <resultMap id="BaseResultMap" type="cn.com.countrygarden.bi.main.model.phoenix.PhoenixSalesOnSaleProject">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="areaname" jdbcType="VARCHAR" property="areaname" />
    <result column="room_num" jdbcType="INTEGER" property="roomNum" />
    <result column="build_area" jdbcType="DECIMAL" property="buildArea" />
    <result column="in_area" jdbcType="DECIMAL" property="inArea" />
    <result column="zd_area" jdbcType="DECIMAL" property="zdArea" />
    <result column="saled_room" jdbcType="INTEGER" property="saledRoom" />
    <result column="saled_build_area" jdbcType="DECIMAL" property="saledBuildArea" />
    <result column="saled_in_area" jdbcType="DECIMAL" property="saledInArea" />
    <result column="saled_zd_area" jdbcType="DECIMAL" property="saledZdArea" />
    <result column="ht_yszdate" jdbcType="DATE" property="htYszdate" />
    <result column="yjsldate" jdbcType="DATE" property="yjsldate" />
  </resultMap>


  <insert id="persistence" useGeneratedKeys="true">
    INSERT INTO phoenix_sales_on_sale_project
    (areaname, room_num, build_area, in_area, zd_area, saled_room, saled_build_area, saled_in_area, saled_zd_area, ht_yszdate, yjsldate)
    VALUES
    <foreach collection="projects" index="index" item="item"
             separator=",">
      (#{item.areaname}, #{item.roomNum}, #{item.buildArea}, #{item.inArea}, #{item.zdArea}, #{item.saledRoom}, #{item.saledBuildArea}, #{item.saledInArea}, #{item.saledZdArea}, #{item.htYszdate}, #{item.yjsldate})
    </foreach>
  </insert>

  <delete id="truncate">
    TRUNCATE phoenix_sales_on_sale_project
  </delete>
</mapper>