<?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.ylx.massage.mapper.BusinessDevelopmentMapper">

    <resultMap type="com.ylx.massage.domain.BusinessDevelopment" id="BusinessDevelopmentMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="city" column="city" jdbcType="VARCHAR"/>
        <result property="resource" column="resource" jdbcType="VARCHAR"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="phoneNum" column="phone_num" jdbcType="VARCHAR"/>
        <result property="company" column="company" jdbcType="VARCHAR"/>
        <result property="isMassage" column="is_massage" jdbcType="INTEGER"/>
        <result property="years" column="years" jdbcType="VARCHAR"/>
        <result property="isEntity" column="is_entity" jdbcType="INTEGER"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="openId" column="open_id" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into
        ry-vue.business_development(cityresourcenamephone_numcompanyis_massageyearsis_entityremarkcreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.city}#{entity.resource}#{entity.name}#{entity.phoneNum}#{entity.company}#{entity.isMassage}#{entity.years}#{entity.isEntity}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into
        ry-vue.business_development(cityresourcenamephone_numcompanyis_massageyearsis_entityremarkcreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.city}#{entity.resource}#{entity.name}#{entity.phoneNum}#{entity.company}#{entity.isMassage}#{entity.years}#{entity.isEntity}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
        on duplicate key update
        city = values(city) resource = values(resource) name = values(name) phone_num = values(phone_num) company =
        values(company) is_massage = values(is_massage) years = values(years) is_entity = values(is_entity) remark =
        values(remark) create_time = values(create_time) update_time = values(update_time) is_delete = values(is_delete)
    </insert>

</mapper>

