<?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.zm.order.tool.server.cy.CyOrderRelationsDao">

    <resultMap id="OrderMap" type="com.zm.order.tool.server.model.CyOrderRelations">
        <id column="id" jdbcType="BIGINT" property="id"/>
        <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
        <result column="order_id" jdbcType="BIGINT" property="orderId"/>
    </resultMap>

    <sql id="tb">
        wm_order_relations
    </sql>

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
        order_no, order_id, created_at, updated_at
    </sql>

    <sql id="values">
        #{id}, #{orderNo}, #{orderId}, now(), now()
    </sql>

    <insert id="insertList" parameterType="list">
        insert into
        <include refid="tb"/>
        (<include refid="cols_all"/>)
        values
        <foreach collection="list" item="item" index="index" separator=",">
            (
            #{item.id}, #{item.orderNo}, #{item.orderId}, now(), now()
            )
        </foreach>
    </insert>

</mapper>