SellerOrderMapper.xml 1.88 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.SellerOrderMapper">
    <resultMap id="BaseResultMap" type="com.yoho.order.model.SellerOrder">
      <result column="id" property="id" jdbcType="INTEGER" />
      <result column="uid" property="uid" jdbcType="INTEGER" />
      <result column="order_code" property="orderCode" jdbcType="BIGINT" />
      <result column="skup" property="skup" jdbcType="INTEGER" />
      <result column="client_type" property="clientType" jdbcType="TINYINT" />
      <result column="payment" property="payment" jdbcType="TINYINT" />
      <result column="income" property="income" jdbcType="DECIMAL" />
      <result column="earnest_money" property="earnestMoney" jdbcType="DECIMAL" />
      <result column="status" property="status" jdbcType="TINYINT" />
      <result column="create_time" property="createTime" jdbcType="INTEGER" />
      <result column="update_time" property="updateTime" jdbcType="INTEGER" />
    </resultMap>

    <sql id="Base_Column_List">
        id, uid, order_code, skup, client_type, payment, income, earnest_money,
        status, create_time, update_time
    </sql>

    <select id="selectById" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from seller_order where id = #{id}
    </select>
    
    <select id="selectBySkups" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from seller_order where id in 
        <foreach collection="skupList" item="skup" open="(" close=")" separator=",">
          #{skup}
        </foreach>
    </select>
    
    <select id="selectByOrderCode" resultMap="BaseResultMap">
        select <include refid="Base_Column_List" />
        from seller_order where order_code = #{orderCode}
    </select>
    
</mapper>