Authored by LUOXC

添加商品排序

@@ -56,7 +56,7 @@ @@ -56,7 +56,7 @@
56 </select> 56 </select>
57 57
58 <sql id="Base_Column_List_with_table_name"> 58 <sql id="Base_Column_List_with_table_name">
59 - sog.id as id, sog.uid as uid, product_id, product_name,storage_id,depot_no,size_id,size_name, 59 + sog.id as id, sog.uid as uid, product_id, product_name,storage_id,depot_no,sog.size_id,sog.size_name,
60 color_id, color_name, goods_price, sog.status as status, image_url, sog.is_del as is_del, batch_no, 60 color_id, color_name, goods_price, sog.status as status, image_url, sog.is_del as is_del, batch_no,
61 sog.attributes as attributes, sog.region as region 61 sog.attributes as attributes, sog.region as region
62 </sql> 62 </sql>
@@ -143,17 +143,19 @@ @@ -143,17 +143,19 @@
143 </select> 143 </select>
144 144
145 <select id="selectEntryListByUidStatusGBSku" resultMap="BaseResultMap"> 145 <select id="selectEntryListByUidStatusGBSku" resultMap="BaseResultMap">
146 - SELECT <include refid="Base_Column_List_with_table_name" />,COUNT(`size_id`) storage_num  
147 - FROM seller_order_goods sog,seller_order so WHERE sog.id = so.skup  
148 - AND sog.uid = #{condition.uid,jdbcType=INTEGER} 146 + SELECT <include refid="Base_Column_List_with_table_name" />,COUNT(sog.size_id) storage_num
  147 + FROM seller_order_goods sog
  148 + join seller_order so on sog.id = so.skup
  149 + left join product_size ps on sog.size_id = ps.size_id
  150 + WHERE sog.uid = #{condition.uid,jdbcType=INTEGER}
149 <if test="isEntry"> 151 <if test="isEntry">
150 AND so.payment = 11 152 AND so.payment = 11
151 </if> 153 </if>
152 <include refid="sql_where_skupTyps_scope" /> 154 <include refid="sql_where_skupTyps_scope" />
153 AND sog.status = #{condition.status, jdbcType=TINYINT} 155 AND sog.status = #{condition.status, jdbcType=TINYINT}
154 AND product_id = #{condition.productId,jdbcType=INTEGER} 156 AND product_id = #{condition.productId,jdbcType=INTEGER}
155 - GROUP BY sog.attributes,size_id,`goods_price`  
156 - order by size_id,goods_price 157 + GROUP BY sog.attributes,sog.size_id,`goods_price`
  158 + order by ps.order_by,sog.size_id,goods_price
157 limit #{offset, jdbcType=INTEGER}, #{limit, jdbcType=INTEGER} 159 limit #{offset, jdbcType=INTEGER}, #{limit, jdbcType=INTEGER}
158 </select> 160 </select>
159 161