<?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.tempdb.RepairOrderLogDao">
    <resultMap id="ResultMap" type="com.zm.order.tool.server.model.RepairOrderLog">
		<id column="id" jdbcType="BIGINT" property="id"/>
		<result column="user_id" jdbcType="BIGINT" property="userId"/>
		<result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
		<result column="author" jdbcType="BIGINT" property="author"/>
		<result column="content" jdbcType="VARCHAR" property="content"/>
		<result column="diff" jdbcType="VARCHAR" property="diff"/>
		<result column="remarks" jdbcType="VARCHAR" property="remarks"/>
		<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
		<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
	</resultMap>

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

    <sql id="cols_all">
        id,
		user_id,
		order_no,
		author,
        content,
        diff,
        remarks,
        created_at,
        updated_at
    </sql>

    <sql id="cols_exclude_id">
        user_id,
		order_no,
		author,
        content,
        diff,
        remarks,
        created_at,
        updated_at
    </sql>

    <sql id="values">
		#{userId},
		#{orderNo},
		#{author},
		#{content},
		#{diff},
		#{remarks},
        now(),
        now()
    </sql>

    <insert id="insert" parameterType="com.zm.order.tool.server.model.RepairOrderLog">
        insert into
        <include refid="tb"/>
        (<include refid="cols_exclude_id"/>)
        values
        (<include refid="values"/>)
    </insert>
</mapper>