<?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.oying.modules.sh.mapper.OrderProductSnapshotMapper">
|
<resultMap id="BaseResultMap" type="com.oying.modules.sh.domain.OrderProductSnapshot">
|
<id column="snapshot_id" property="snapshotId"/>
|
<result column="order_num" property="orderNum"/>
|
<result column="store_id" property="storeId"/>
|
<result column="product_id" property="productId"/>
|
<result column="product_code" property="productCode"/>
|
<result column="product_barcode" property="productBarcode"/>
|
<result column="product_name" property="productName"/>
|
<result column="product_title" property="productTitle"/>
|
<result column="product_main_image" property="productMainImage"/>
|
<result column="product_description" property="productDescription"/>
|
<result column="param_data" property="paramData"/>
|
<result column="unit_price" property="unitPrice"/>
|
<result column="detail_count" property="detailCount"/>
|
<result column="original_price" property="originalPrice"/>
|
<result column="paid_price" property="paidPrice"/>
|
<result column="actually_pay_price" property="actuallyPayPrice"/>
|
<result column="pay_state" property="payState"/>
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
snapshot_id, order_num, store_id, product_id, product_code, product_barcode, product_name, product_title, product_main_image, product_description, param_data, unit_price, detail_count, original_price, paid_price, actually_pay_price, pay_state
|
</sql>
|
|
<select id="findAll" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from sh_order_product_snapshot
|
<where>
|
<if test="criteria.orderNum != null">
|
and order_num = #{criteria.orderNum}
|
</if>
|
<if test="criteria.storeId != null">
|
and store_id = #{criteria.storeId}
|
</if>
|
<if test="criteria.productId != null">
|
and product_id = #{criteria.productId}
|
</if>
|
<if test="criteria.productCode != null">
|
and product_code like concat('%',#{criteria.productCode},'%')
|
</if>
|
<if test="criteria.productBarcode != null">
|
and product_barcode like concat('%',#{criteria.productBarcode},'%')
|
</if>
|
<if test="criteria.productName != null">
|
and product_name like concat('%',#{criteria.productName},'%')
|
</if>
|
<if test="criteria.productTitle != null">
|
and product_title like concat('%',#{criteria.productTitle},'%')
|
</if>
|
<if test="criteria.payState != null">
|
and pay_state = #{criteria.payState}
|
</if>
|
</where>
|
order by snapshot_id desc
|
</select>
|
<select id="queryOrderProductSnapshot" resultMap="BaseResultMap">
|
select
|
<include refid="Base_Column_List"/>
|
from sh_order_product_snapshot
|
where order_num = #{orderNum}
|
order by snapshot_id desc
|
</select>
|
</mapper>
|