BuyerOrderMeta.xml 1.36 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.yoho.order.dal.BuyerOrderMetaMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.BuyerOrderMeta">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="uid" property="uid" jdbcType="INTEGER" />
      <result column="order_code" property="orderCode" jdbcType="BIGINT" />
      <result column="meta_key" property="metaKey" jdbcType="VARCHAR" />
      <result column="meta_value" property="metaValue" jdbcType="VARCHAR" />
    </resultMap>

    <sql id="Base_Column_List">
        id, uid, order_code, meta_key, meta_value
    </sql>

    <select id="selectByOrderCodeAndKey" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from buyer_order_meta where order_code=#{orderCode,jdbcType=BIGINT} and meta_key=#{metaKey} ORDER BY id DESC  limit 1
    </select>
    

    
    <select id="selectByBatchOrderCodeAndKey" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from buyer_order_meta where meta_key=#{metaKey} and order_code in 
        <foreach collection="list" item="orderCode" open="(" separator="," close=")">
           #{orderCode,jdbcType=BIGINT}
        </foreach>
    </select>
    
</mapper>