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

    <resultMap type="com.ylx.massage.domain.TFareSetting" id="TFareSettingMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="baseFare" column="base_fare" jdbcType="NUMERIC"/>
        <result property="baseDistance" column="base_distance" jdbcType="NUMERIC"/>
        <result property="additionalFarePer" column="additional_fare_per" jdbcType="NUMERIC"/>
        <result property="enable" column="enable" jdbcType="INTEGER"/>
        <result property="deptId" column="dept_id" jdbcType="VARCHAR"/>
        <result property="deptName" column="dept_name" 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.t_fare_setting(base_farebase_distanceadditional_fare_perenabledept_iddept_namecreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.baseFare}#{entity.baseDistance}#{entity.additionalFarePer}#{entity.enable}#{entity.deptId}#{entity.deptName}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into
        ry-vue.t_fare_setting(base_farebase_distanceadditional_fare_perenabledept_iddept_namecreate_timeupdate_timeis_delete)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.baseFare}#{entity.baseDistance}#{entity.additionalFarePer}#{entity.enable}#{entity.deptId}#{entity.deptName}#{entity.createTime}#{entity.updateTime}#{entity.isDelete})
        </foreach>
        on duplicate key update
        base_fare = values(base_fare) base_distance = values(base_distance) additional_fare_per =
        values(additional_fare_per) enable = values(enable) dept_id = values(dept_id) dept_name = values(dept_name)
        create_time = values(create_time) update_time = values(update_time) is_delete = values(is_delete)
    </insert>

</mapper>

