AppraiseOrderStorageMapper.xml 1.6 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.AppraiseOrderStorageMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.AppraiseOrderStorage">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="order_code" property="orderCode" jdbcType="BIGINT" />
      <result column="product_id" property="productId" jdbcType="INTEGER" />
      <result column="size_id" property="sizeId" jdbcType="INTEGER" />
      <result column="size_name" property="sizeName" jdbcType="VARCHAR" />
      <result column="color_id" property="colorId" jdbcType="INTEGER" />
      <result column="color_name" property="colorName" jdbcType="VARCHAR" />
      <result column="storage_id" property="storageId" jdbcType="INTEGER" />
      <result column="num" property="num" jdbcType="INTEGER" />
    </resultMap>

    <sql id="Base_Column_List">
        id, order_code, product_id, size_id, size_name, color_id, color_name, storage_id, num 
    </sql>
    
    <select id="selectByOrderCodes" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from appraise_order_storage where order_code in
        <foreach collection="list" item="orderCode" open="(" close=")" separator=",">
        #{orderCode}
        </foreach>
    </select>
    
    <select id="selectByOrderCode" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from appraise_order_storage where order_code = #{orderCode}
    </select>
    
</mapper>