<?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.ComplaintMapper">

    <resultMap type="com.ylx.massage.domain.Complaint" id="ComplaintMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="complaintType" column="complaint_type" jdbcType="VARCHAR"/>
        <result property="description" column="description" jdbcType="VARCHAR"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="photograph" column="photograph" jdbcType="VARCHAR"/>
        <result property="deptName" column="dept_name" jdbcType="VARCHAR"/>
        <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
        <result property="phone" column="phone" jdbcType="VARCHAR"/>
        <result property="openId" column="open_id" jdbcType="VARCHAR"/>
        <result property="remark" column="remark" 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.complaint(complaint_typedescriptionnamephotographdept_namedept_idphoneopen_idremarkcreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.complaintType}#{entity.description}#{entity.name}#{entity.photograph}#{entity.deptName}#{entity.deptId}#{entity.phone}#{entity.openId}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into
        ry-vue.complaint(complaint_typedescriptionnamephotographdept_namedept_idphoneopen_idremarkcreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.complaintType}#{entity.description}#{entity.name}#{entity.photograph}#{entity.deptName}#{entity.deptId}#{entity.phone}#{entity.openId}#{entity.remark}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
        on duplicate key update
        complaint_type = values(complaint_type) description = values(description) name = values(name) photograph =
        values(photograph) dept_name = values(dept_name) dept_id = values(dept_id) phone = values(phone) open_id =
        values(open_id) remark = values(remark) create_time = values(create_time) update_time = values(update_time)
        is_delete = values(is_delete)
    </insert>

</mapper>

