OrderRecipientMapper.xml 1.5 KB
Newer Older
1 2 3 4 5
<?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="cn.iocoder.mall.order.biz.dao.OrderRecipientMapper">

    <sql id="FIELDS">
sin's avatar
sin committed
6
        id, order_id, `area_no`, `name`, mobile, address, `type`,
7 8 9 10 11 12 13 14 15
        create_time, update_time
    </sql>

    <!--
        插入数据
    -->
    <insert id="insert" parameterType="OrderRecipientDO" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
        INSERT INTO `order_recipient` (
            order_id, `area_no`, `name`, mobile, address,
sin's avatar
sin committed
16
            `type`, create_time, update_time
17 18
        ) VALUES (
            #{orderId}, #{areaNo}, #{name}, #{mobile}, #{address},
19
            #{type}, #{createTime,jdbcType=TIMESTAMP} , #{updateTime}
20 21 22
        )
    </insert>

23 24 25 26 27 28 29 30 31 32
    <!--
        查询 - 根据 orderId
    -->
    <select id="selectByOrderId" resultType="cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO">
        SELECT
        <include refid="FIELDS" />
        FROM `order_recipient`
        WHERE order_id = #{orderId}
    </select>

33 34 35 36 37 38 39 40 41 42 43 44
    <!--
        查询 - 根据 orderIds
    -->
    <select id="selectByOrderIds" resultType="cn.iocoder.mall.order.biz.dataobject.OrderRecipientDO">
        SELECT
        <include refid="FIELDS" />
        FROM `order_recipient`
        WHERE order_id IN
        <foreach collection="orderIds" item="orderId" separator="," open="(" close=")">
            #{orderId}
        </foreach>
    </select>
45

46
</mapper>