GarOrderCarMapper.xml 2.74 KB
<?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.trash.garbage.mapper.GarOrderCarMapper">

    <resultMap id="BaseResultMap" type="com.trash.garbage.pojo.domain.GarOrderCar">
            <id property="garId" column="gar_id" jdbcType="VARCHAR"/>
            <result property="garOrderId" column="gar_order_id" jdbcType="VARCHAR"/>
            <result property="garOrderCarType" column="gar_order_car_type" jdbcType="VARCHAR"/>
            <result property="garOrderCarUserType" column="gar_order_car_user_type" jdbcType="TINYINT"/>
            <result property="garCreateTime" column="gar_create_time" jdbcType="TIMESTAMP"/>
            <result property="garUpdateTime" column="gar_update_time" jdbcType="TIMESTAMP"/>
            <result property="garCreateBy" column="gar_create_by" jdbcType="VARCHAR"/>
            <result property="garUpdateBy" column="gar_update_by" jdbcType="VARCHAR"/>
            <result property="garRemark" column="gar_remark" jdbcType="VARCHAR"/>
            <result property="carId" column="car_id" jdbcType="VARCHAR"/>
            <result property="containerVolume" column="container_volume" jdbcType="VARCHAR"/>
    </resultMap>

    <sql id="Base_Column_List">
        gar_id,gar_order_id,gar_order_car_type,
        gar_order_car_user_type,gar_create_time,gar_update_time,
        gar_create_by,gar_update_by,gar_remark
    </sql>
    <select id="selectByGarOrderId" parameterType="string" resultMap="BaseResultMap">
        SELECT gar_id,gar_order_id,gar_order_car_type,
               gar_order_car_user_type,gar_create_time,gar_update_time,
               gar_create_by,gar_update_by,gar_remark,car_id,container_volume
        FROM gar_order_car
        WHERE gar_order_id = #{garOrderId}
        LIMIT 1
    </select>

    <insert id="insertSelective" parameterType="com.trash.garbage.pojo.domain.GarOrderCar">
        INSERT INTO gar_order_car
        <trim prefix="(" suffix=")" suffixOverrides=",">
            gar_id,
            gar_order_id,
            gar_order_car_type,
            gar_order_car_user_type,
            gar_create_time,
            gar_update_time,
            gar_create_by,
            gar_update_by,
            gar_remark,
            car_id,
            container_volume
        </trim>
        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
            #{garId},
            #{garOrderId},
            #{garOrderCarType},
            #{garOrderCarUserType},
            #{garCreateTime},
            #{garUpdateTime},
            #{garCreateBy},
            #{garUpdateBy},
            #{garRemark},
            #{carId},
            #{containerVolume}
        </trim>
    </insert>
</mapper>