<?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.house365.ws.dao.mapper.CustomerApproximateMapper">

    <resultMap id="infoMap" type="com.house365.beans.entity.CustomerProjectEntity">
        <result property="id" column="id"/>
        <result property="consultantName" column="consultant_name"/>
        <result property="status" column="status"/>
        <result property="consultantPhone" column="consultant_phone"/>
        <result property="isRepeat" column="is_repeat"/>
        <result property="recordedStatus" column="recorded_status"/>
        <result property="recordedTime" column="recorded_time"/>
        <result property="visitTime" column="visit_time"/>
        <result property="loanStatus" column="loan_status"/>
        <result property="createTime" column="create_time"/>
        <result property="projectId" column="project_id"/>
        <result property="remark" column="remark"/>
        <result property="customerId" column="customer_id"/>
        <result property="requireArea" column="require_area"/>
        <result property="requireHouse" column="require_house"/>
        <result property="requireHouseType" column="require_house_type"/>
        <result property="requirePrice" column="require_price"/>
        <result property="updateTime" column="update_time"/>
        <result property="updater" column="updater"/>
        <result property="customerPhone" column="customer_phone"/>
        <result property="contract" column="contract"/>
        <result property="houseName" column="house_name"/>
        <result property="creater" column="creater"/>
        <result property="projectName" column="project_name"/>
        <result property="lastChangeStatusTime" column="last_change_status_time"/>
    </resultMap>

    <select id="getCustomerProjectList" parameterType="map" resultMap="infoMap">
        select id,consultant_name,status,consultant_phone,is_repeat,recorded_status,recorded_time,visit_time,
        loan_status,create_time,project_id,remark,customer_id,require_area,require_house,require_house_type,require_price,update_time,updater,customer_phone,contract,
        house_name,creater,project_name,last_change_status_time
        FROM customer_project
        where customer_id in
        <foreach item="item" index="index" collection="ids" open="(" separator="," close=")">
            #{item,jdbcType=VARCHAR}
        </foreach>
        order by create_time desc
    </select>

</mapper>